Skip to content

fix(fleet-config): reject dispatch-test threshold = 0 (#6603) - #6692

Merged
dezren39 merged 1 commit into
mainfrom
queue/fallback-6603-threshold-zero
Nov 7, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/fallback-6603-threshold-zero

Conversation

@dezren39

@dezren39 dezren39 commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Fixes #6603.

What

The #6412 zero rule in fleet-config rejects a configured 0 for scalar numeric settings, but the [dispatch-test] threshold landed later (#6580) and was never added — threshold = 0 loaded cleanly, and since eligibility is active < threshold, active < 0 made every execution home permanently ineligible with no hint the threshold itself was the cause. The CLI path had the same hole (--threshold 0 passed parse_threshold).

Tests

  • fleet-config: zero_scalar_numerics_are_a_loud_error gains the [dispatch-test] threshold = 0 case; omitted threshold still resolves to 40 and threshold = 7 loads as 7.
  • fleet-dispatch-test: new threshold_zero_is_a_usage_error pins exit code 2 + message for Some("0"), and that Some("7") / None (default 40) pass unchanged.
  • Laptop: cargo test -p fleet-config -p fleet-dispatch-test — 17 + 14 passed.

Oracle: the #6412 rule's own behavior for the original three fields (same error shape, same load path), plus the documented default (40) for the omitted case.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The #6412 zero rule covered the three scalar numerics that existed then; the [dispatch-test] threshold landed later (#6580) and was never added, so threshold = 0 loaded cleanly and made every execution home permanently ineligible (active < 0 is always false). Config::validate now rejects it naming [dispatch-test] threshold and the default (40), and parse_threshold rejects --threshold 0 as a usage error (exit 2). Tests pin both refusals; omitted still yields 40, positive values unchanged.
@dezren39
dezren39 requested a review from a team as a code owner November 7, 2026 02:30
@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 01a17bf5-84cd-44a1-9769-5bc311ed6f98
Commits

Reviewing files that changed from the base of the PR and between 83a6d10 and d25ba33.

Files selected for processing: 2

  • pkgs/fleet/crates/fleet-config/src/lib.rs
  • pkgs/fleet/crates/fleet-dispatch-test/src/lib.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T02:32:39.663241Z d25ba33 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant