refactor(config): separate source loading from resolution#830
Merged
natalie-o-perret merged 10 commits intomasterfrom May 6, 2026
Merged
refactor(config): separate source loading from resolution#830natalie-o-perret merged 10 commits intomasterfrom
natalie-o-perret merged 10 commits intomasterfrom
Conversation
00da573 to
62dede7
Compare
When exo runs inside a PTY spawned by testscript, the testscript wrapper binary (mainExo) is the PTY session leader. On Ctrl+C: 1. SIGINT goes to the whole foreground process group: wrapper + exo. 2. The wrapper has no signal.Notify, so Go's default SIGINT handler kills it immediately. 3. On session-leader exit, the kernel sends SIGHUP to the remaining process group members — including exo. With no SIGHUP handler, exo is killed before it can print "Error: Operation Cancelled". Fix: add syscall.SIGHUP to the signal.Notify in Execute() so SIGHUP cancels the context instead of killing the process. Also overhaul readPasswordInterruptible to cover all SIGINT timing paths: sigCh fires first, unix.Read returns EINTR first, or ctx.Done fires first (when cobra's goroutine cancels the context before signal.Notify runs).
Contributor
Author
|
[SC-178713] |
pierre-emmanuelJ
approved these changes
May 6, 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.
Description
Follow-up to #817.
Splits config source loading from resolution into a small, testable layer. Each source (env vars, config file profile, built-in defaults) is loaded independently, then merged by
resolve()with explicit precedence:CLI flags > env vars > config file profile > built-in defaults
What changed
cmd/config_resolution.gowithenvSources,fileSources, andresolve(). Replaces the oldenvAccountOverrides/useEnvOnlyAccount/finalizeCurrentAccounttangle.--configvsEXOSCALE_CONFIGprecedence: the env-to-flag mapping was missing aChangedguard, soEXOSCALE_CONFIGsilently won. CLI flags now always win.EXOSCALE_ZONE: it now overrides the default zone from the active config profile as documented.resolve(), 2 new e2e scenarios for the fixed behaviors.Examples
2 config files used in the demos:
flag-config.toml:env-config.toml:zone-config.toml:Bug 1:
--configflag ignored whenEXOSCALE_CONFIGis setBefore (master):
EXOSCALE_CONFIGsilently overrides the flag:After (this PR):
--configflag wins as expected:Bug 2:
EXOSCALE_ZONEhas no effect when a config file is presentEXOSCALE_ZONE=ch-gva-2 EXOSCALE_CONFIG=zone-config.toml exo config show # zone-config.toml has defaultZone = "de-fra-1"Before (master): env var ignored, config zone used:
After (this PR):
EXOSCALE_ZONEoverrides as expected:Testing
Note
GitHub Copilot leveraged to: