Skip to content

move configuration handling code to the config package.#2095

Merged
mathieu-plak merged 2 commits into
mainfrom
op/refactor-config
Jul 14, 2026
Merged

move configuration handling code to the config package.#2095
mathieu-plak merged 2 commits into
mainfrom
op/refactor-config

Conversation

@omar-polo

Copy link
Copy Markdown
Contributor

no reason to splatter the code for the configuration handling among different packages, try to regroup everything under config.

@omar-polo
omar-polo force-pushed the op/refactor-config branch from 6109769 to 39ba610 Compare May 4, 2026 13:04
@omar-polo

Copy link
Copy Markdown
Contributor Author

This is extracting and improving the refactoring in #1853; i'll revive that PR after this goes in.

@poolpOrg

poolpOrg commented May 5, 2026

Copy link
Copy Markdown
Collaborator

meant to be part of v1.1.0 ?

@omar-polo

Copy link
Copy Markdown
Contributor Author

@poolpOrg depends on whether you want to have the rest of #1853 in v1.1 or not. I think it'll be nice to have it, but to avoid slowing down the release even more we can postpone.

@omar-polo
omar-polo force-pushed the op/refactor-config branch 2 times, most recently from d6fc04f to f7f7882 Compare June 9, 2026 12:07
@omar-polo
omar-polo requested a review from Copilot June 9, 2026 12:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR centralizes configuration loading/saving and import parsing logic under the config package, removing the previous spread of config-handling helpers across utils and updating call sites accordingly.

Changes:

  • Moved config directory load/save logic from utils into config (config.Load, config.Save).
  • Moved/added config import parsing (YAML/JSON/INI) into config.LoadFile and updated the config subcommand to use it.
  • Updated app context + tests to use the new config package APIs and relocated “old config” migration logic into config.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
utils/config.go Removed previous config handling implementation from utils.
config/load.go New centralized config load/save implementation in config.
config/loadfile.go New centralized YAML/JSON/INI import parser in config.
config/old.go Moved old-config migration loader into config package.
config/load_test.go Updated tests for new config.Load/config.Save and import helpers.
config/old_test.go Updated tests for old-config loader in config package.
subcommands/config/config.go Switched config subcommand persistence/import to config.Save/config.LoadFile.
subcommands/config/config_test.go Updated tests to call config.LoadOldConfigIfExists.
subcommands/sync/sync_test.go Updated sync test to call config.Load/config.Save.
appcontext/appcontext.go Updated reload path to use config.Load.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread config/loadfile.go
Comment thread config/load.go
@omar-polo
omar-polo force-pushed the op/refactor-config branch 2 times, most recently from 55c8597 to 3f5df7a Compare June 16, 2026 08:51
@omar-polo
omar-polo force-pushed the op/refactor-config branch 2 times, most recently from c638fb8 to 41b79d3 Compare July 8, 2026 20:17
omar-polo added 2 commits July 8, 2026 20:18
no reason to splatter the code for the configuration handling among
different packages, try to regroup everything under config.
for string, numbers and boolean it's the same behaviour; now it could
stringify other types that before were yielding only "", but shouldn't
matter much here.  Also, no need to special case strings since it's not
a performance-sensitive part, and the gained readability matters.
@omar-polo
omar-polo force-pushed the op/refactor-config branch from 41b79d3 to 405c2de Compare July 8, 2026 20:20

@poolpOrg poolpOrg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OKI

@mathieu-plak
mathieu-plak merged commit 9541dbc into main Jul 14, 2026
8 checks passed
@mathieu-plak
mathieu-plak deleted the op/refactor-config branch July 14, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants