Repository navigation
fix(aggregator): reject unknown arguments in backfill-usage-snapshots (#6973) - #6974
Conversation
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. |
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
Fixes #6973
What
backfill-usage-snapshots.tsprobed argv with a singleindexOf("--dir")(the #3330 value guard) and never examined any other token: a typo'd--dirr <dir>, an unknown flag, a positional, the joined--dir=<path>form, and a duplicate--dirwere all silently ignored — the run seeded the rebuilt history into the default store and exited 0.This replaces the probe with a strict parse (
parseStoreDirArg), mirroringrejectUnknownArgsin append-usage-snapshots (#6961) / compact-usage-snapshots (#6967) and the collect-fleet-feed contract (#3352/#3509): the only accepted forms are no arguments or one separated--dir <storeDir>; anything else is a usage error (exit 2, naming the offending argument) raised at module top, before any input is read or any store is created. The #3330 trailing/flag-like value rejection and its exact message are preserved.Verification (laptop, worktree on main 0290574)
test/backfill-usage-snapshots-argv-6973.test.ts:--bogus,--dirr <dir>, positional,--dir=<path>, duplicate--dirall exit 2 naming the argument, and no store directory (default or operator-named) is created. Fails pre-fix (verified by stashing the script change: 0 pass / 1 fail), passes post-fix.test/backfill-usage-snapshots-dir-3330.test.tsstill green (3/3 across both files).--dirr <intended>→ exit 2unknown argument '--dirr', no default store created; control--dir <custom>→ exit 0 appending to<custom>.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit
--dir <directory>format.