Repository navigation
id(scripts): resolve prod-lines rows in the post-crate-split layout (#10603) - #10604
Conversation
…10603) The grandfather and test-only tables were keyed on pre-split paths (src/cli.rs, src/directory.rs, src/web/*.rs, src/encryption/tests.rs, src/world_session/tests.rs). After the crate split the scan produces crates/<crate>/src/... paths, so no row could match: the guard reported module-gated test modules and an explicitly grandfathered file as over-limit, and the ratchet guarded nothing. Lookups now try the real path first and then a normalized key with the leading crates/<crate>/ stripped, so a row keeps working across a crate move. The directory row moves to its crate path, the three obsolete pre-split rows are dropped (their successors are under the plain limit), and the missing src/cli/tests.rs test-only row is added. prod-lines-check-test.sh gains crate-layout fixtures: module-gated test modules under crates/x/src/..., an over-limit crate file, and a grandfathered crate file that passes at its allowance and fails one line later. On the real tree the guard now fails only on the three files tracked by #8590, #8592 and #8593, and reports directory.rs as grandfathered at 2,536 <= 2,610.
Codex Review Summary: ❌ FailedThis 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. |
|
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 45 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Problem
pkgs/id/scripts/prod-lines-check.shkeys its grandfather allowances and module-gated test-only exemptions on pre-crate-split paths (src/cli.rs,src/directory.rs,src/web/routes.rs,src/web/markdown.rs,src/encryption/tests.rs,src/world_session/tests.rs). After the crate split the scan yieldscrates/<crate>/src/..., so no row could match:crates/id-directory/src/directory.rs(2,536 lines, allowance 2,610) was reported as a plain 2,500 violation instead of grandfathered.crates/id-groups/src/encryption/tests.rs,crates/id-worlds/src/world_session/tests.rsandcrates/id-cli/src/cli/tests.rs(the last had no row at all) were reported despite#[cfg(test)] mod tests;in their parent modules.$tmp/src/...fixtures, which is why the regression went unnoticed.Solution
crates/<crate>/stripped. A row therefore survives the split and a later move between crates; reporting still uses the real path.src/directory.rsmoves tocrates/id-directory/src/directory.rs(same 2,610 allowance — grows still fail).src/cli.rs,src/web/routes.rsandsrc/web/markdown.rsrows are dropped with a recorded reason (successors are under the plain limit: routes 2,096, markdown 1,196 production lines).src/cli/tests.rsmodule-gated test-only row.Verification
cd pkgs/id && bash scripts/prod-lines-check-test.sh→prod-lines-check tests passed(new crate-layout fixtures: module-gated tests, over-limit crate file, grandfathered crate file at allowance and +1 failing).cd pkgs/id && bash scripts/prod-lines-check.shon this branch reports exactly:i.e. only the three genuinely over-limit production files, each already tracked by a held split issue (#8590, #8592, #8593). The basic tier goes green when those land; this PR is what makes that possible instead of being blocked on four false positives forever.
Fixes #10603
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.