move configuration handling code to the config package.#2095
Merged
Conversation
omar-polo
force-pushed
the
op/refactor-config
branch
from
May 4, 2026 13:04
6109769 to
39ba610
Compare
Contributor
Author
|
This is extracting and improving the refactoring in #1853; i'll revive that PR after this goes in. |
Collaborator
|
meant to be part of v1.1.0 ? |
Contributor
Author
omar-polo
force-pushed
the
op/refactor-config
branch
2 times, most recently
from
June 9, 2026 12:07
d6fc04f to
f7f7882
Compare
There was a problem hiding this comment.
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
utilsintoconfig(config.Load,config.Save). - Moved/added config import parsing (YAML/JSON/INI) into
config.LoadFileand updated theconfigsubcommand to use it. - Updated app context + tests to use the new
configpackage APIs and relocated “old config” migration logic intoconfig.
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.
omar-polo
force-pushed
the
op/refactor-config
branch
2 times, most recently
from
June 16, 2026 08:51
55c8597 to
3f5df7a
Compare
omar-polo
force-pushed
the
op/refactor-config
branch
2 times, most recently
from
July 8, 2026 20:17
c638fb8 to
41b79d3
Compare
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
force-pushed
the
op/refactor-config
branch
from
July 8, 2026 20:20
41b79d3 to
405c2de
Compare
mathieu-plak
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
no reason to splatter the code for the configuration handling among different packages, try to regroup everything under config.