Skip to content

feat(config): a settings save writes only the changed keys and keeps the comments and unknown keys of config.yaml #1999

Description

@dan-petty

Problem

save_settings writes the whole settings model back to config.yaml. A save drops the comments and the order of the file, and it writes every default. #1921 added a copy before each write and a change record, so a person can restore a file, but a save still rewrites the whole file.

Proposed fix

  • Use ruamel.yaml round-trip mode, which keeps comments, order and keys that the model does not know, and write only the changed keys.
  • Review each of the eight callers of save_settings, and keep only the ones that must write the file.

Acceptance criteria

  • A test saves one changed key into a file with comments and an unknown key, and the file keeps both.
  • Each remaining caller of save_settings has a test that names the keys it writes.

Activity

  1. added
    type/feature
    scope/config
    on Oct 23, 2026
  2. dan-petty commented on Oct 24, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

    • Priority: P2-Medium. This change improves configuration handling but does not fix a critical issue.
    • Value: Medium. The change enhances user experience by preserving file structure during saves.
    • Effort: High. Requires modifying the save logic and reviewing all callers of save_settings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope/configtype/feature

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions