GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — mcpx: paths.config governs the config chain (two-pass, #1842) by dezren39 · Pull Request #2477 · developing-today/code Conversation
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 55 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
TestNoUndeclaredEnvRead caught chain.go reading MCPX_PATHS_CONFIG by name: it seeds the discovery pass before any Set exists, so it belongs on rawReadAllowed with the reason, alongside MCPX_CONFIG. Verified with -count=1 (the guard reads the tree at runtime, so a cached test result can hide this).
|
Follow-up commit e013229: the full-suite run caught a real failure the package runs missed — |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: bcf9151591
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // A bootstrap flag like --config: it decides which files | ||
| // the settings are read from, so it is captured here, | ||
| // before any settings exist (issue #1842). | ||
| config.SetPathsConfigSeed(splitList(args[1])) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Forward the bootstrap seed to auto-started daemons
When --paths-config adds a configuration file and a command needs to auto-start a daemon, the seed exists only in this process's flagSeed. Connect keys the expected socket from the expanded configuration, but Client.EnsureDaemon (internal/cli/client.go) forwards only --config, not this seed. Without an equivalent MCPX_PATHS_CONFIG environment variable, the child loads the default chain and listens on a different configuration fingerprint, so the client times out waiting for its socket. Propagate the bootstrap seed to the spawned process as well.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed forward in PR #5165 (issue #2507, commit 2a88cd5): config.PathsConfigSeedEnv() serializes the flag seed as MCPX_PATHS_CONFIG, and the daemon autostart path in internal/cli/client.go now sets it as the child daemon's environment, so an auto-started daemon resolves the same chain as the invoking process. Covered by TestPathsConfigSeedEnvForwardsFlagSeed (internal/config).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| for _, loc := range expandAll(info.Seeded, wd) { | ||
| add0(loc) | ||
| } | ||
| for _, loc := range SearchPathFrom(wd) { | ||
| add0(loc) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Preserve the seed list's null splice around default locations
For MCPX_PATHS_CONFIG='[null,"/custom/config.json"]', expandAll discards the splice position and this code places the custom file before every default location, giving it higher rather than lower precedence. A seed without null also retains all default locations instead of replacing them. This contradicts the setting's help in internal/settings/registry.go: “Without a null the list replaces outright.” Build the discovery list using the before/after/null result so the seed does not load unintended configurations or reverse precedence.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed forward in PR #5165 (issue #2507, commit 2a88cd5): pass 1 of ResolveChainFrom now splices the seed around the default walk via expandEntries — entries before the null land nearer, entries after it farther, and a seed with no null replaces the default walk outright, as the registry help states. Covered by TestPathsConfigSeedNullSplicesAroundDefaults and TestPathsConfigSeedWithoutNullReplacesDefaults.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // A bootstrap flag like --config: it decides which files | ||
| // the settings are read from, so it is captured here, | ||
| // before any settings exist (issue #1842). | ||
| config.SetPathsConfigSeed(splitList(args[1])) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Accumulate repeated config-search flags
For mcpx --paths-config /a --paths-config /b config, each call replaces flagSeed, so only /b participates in discovery. The setting is declared Repeatable: true in internal/settings/registry.go, and the existing binding implementation accumulates repeated occurrences. The new bootstrap interception bypasses that behavior and silently drops earlier configuration sources. Collect all occurrences before installing the seed.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| var doc struct { | ||
| Paths struct { | ||
| Config []any `json:"config"` | ||
| } `json:"paths"` | ||
| Flat []any `json:"paths.config"` |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Accept existing string-valued path lists during discovery
An existing configuration such as {"paths":{"config":"./shared"}} now fails discovery with a JSON unmarshal error because these fields require arrays. The normal settings file loader accepts this representation: ApplyFile preserves string values and Set.List parses comma/newline-separated strings as well as JSON arrays. Since chain resolution now runs before command dispatch, a previously accepted configuration prevents commands from running at all. Normalize the discovery value using the same accepted representations as the settings layer.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if inChain0[chainIdentity(loc)] { | ||
| edges[f] = append(edges[f], loc) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Canonicalize cycle-graph endpoints by file identity
When discovered files A and B refer to each other through symlink aliases, the membership test recognizes their identities but the graph stores the original path strings. findCycle consequently treats those aliases as unrelated terminal vertices and accepts the cycle instead of returning the promised cycle error. This is reproducible with A declaring a symlink to B and B declaring a symlink to A. Use canonical identities consistently for graph keys, edge targets, and traversal roots, retaining display paths separately for diagnostics.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| return -1 | ||
| } | ||
| for _, f := range chain0 { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Apply declarations in the resolved chain order
When a nearer file reorders already-discovered configurations, this loop still applies their declarations in the original discovery order. For discovery order A,B,C, let A declare [C,B], B declare [X], and C declare [B], all without null. A moves C before B, but B is processed first and adds X; C then replaces its remainder with B, dropping X even though B remains in the chain. The result is A,C,B rather than A,C,B,X, silently excluding X's servers and settings. Apply declarations in the current load-chain order so a retained file's declaration is not undone by a now-nearer file processed later.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed forward in PR #5165 (issue #2507, commit 2a88cd5): declarations now apply in the resolved chain's order — the build loop rescans the evolving load chain from the nearest end after each application — so a file a nearer list moved up governs before the ones it displaced, and extensions it added are no longer dropped. Covered by TestPathsConfigDeclarationsApplyInChainOrder, which reproduces this finding's A/B/C/X example exactly.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.