Repository navigation
fix(fleet-config): validate [[proxy.services]] rows at load (#6397) - #8405
Conversation
Duplicate ports silently collapsed last-wins in fleet-proxy port-keyed routing map, duplicate names made the hello map ambiguous, and port 0 / empty-name rows loaded verbatim (issue #6397). Config::validate now rejects all four shapes with a ConfigError::Parse naming the offending row, in the crate loud-at-load idiom; the built-in default table is untouched. Five pinning tests cover each rejected shape plus a valid multi-row table.
|
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 47 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. |
Codex Review Summary: ✅ CompletedThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5663c605e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
Codex P1 on PR #8405 (testing doctrine): the four [[proxy.services]] invariants (nonzero ports, nonblank names, unique ports, unique names) now have generated coverage — 256 proptest cases draw tables from collision-heavy pools and check load acceptance against an independent predicate, including arbitrary row order and whitespace-only names; an empty table is the documented built-in fallback. proptest 1.12 dev-dependency, matching the sibling fleet crates.
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour 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". |
Closes #6397.
Problem
fleet-configloaded[[proxy.services]]rows with no value validation: duplicate ports silently collapsed last-wins when fleet-proxy collected the rows into its port-keyed routing map, duplicate names made the advertised hello map ambiguous, and port 0 / empty-name rows loaded verbatim (verified by the triage probe in task 10813: dup-port load_ok rows=2 map_len=1).Change
Config::validateinpkgs/fleet/crates/fleet-config/src/lib.rsnow checks every declared row, in the crate's loud-at-load idiom, and rejects with aConfigError::Parsenaming the offending row:The built-in default services table is not validated (per the packet scope) and
services()behaviour for valid tables is unchanged — a valid multi-row table loads verbatim.Tests
cargo test -p fleet-config— 43 passed, 0 failed, including five new pinning tests besideservices_come_from_config_when_declared: one per rejected shape (the duplicate-port test is the probe's impostor case) plus the valid-table control. rustfmt clean.Queue task 10815 (repo-health-code-pilot), lane code-l.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.