Repository navigation
test(api): retire the stale hosts-key assertion in the parked migrations test (#16261) - #17379
Conversation
…ons test (#16261) Line 19640 of api_endpoint_migrations_test.py asserted that inspect.getsource(frontend_config.get_frontend_config) contains "hosts". host-list disclosure, #15745), so the check goes stale once it merges. The whole file is skip-marked (#5359/#15173), so nothing caught it. Delete the one assertion; the method's other nine checks (fallback structure, config sections) still exercise real, currently-true behavior. Editing the file put it in no-local-schemas' (#6056) scan, which flagged four pre-existing test-fixture BaseModel subclasses that predate the hook. Exempt *_test.py/test_*.py from that endpoint-schema-placement hook -- a model a test defines inline is a fixture, not a production schema -- the same exemption made independently on #16298. Lower both file-size ratchet ceilings (scripts/python_file_size_known_large.py, repo_tests/python_file_size_ratchet_baseline.py) to the file's new actual line count, 31039, so the deleted line cannot be re-spent elsewhere. Not done here, per the issue's own scope: other getsource substring checks in this parked file may also be stale (e.g. "default_config" is not currently present in get_frontend_config's source either) -- that drift belongs to #15173, not this fix.
|
Warning Review limit reachedNext included review available in 50 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: mrveiss/AutoBot-AI/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (1)
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 |
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
Correcting my own claim: "main's hook version is a superset" — now verified, previously notReview flagged that I justified discarding the branch's It is in my reflog. The 46 are what the branch had and main does not. Checked each:
Only So main's version is a functional superset and taking it was right — but that is established now by diffing the discarded blob, not by counting tests. Verified, where before it was asserted. Two stale counts in the same file, one of which this PR makes stalerAlso raised in review, and both hold: Three numbers, none matching. Pre-existing. The second is mine to answer for: the skip reason also says "710 of those asserts substring Not fixing it here, deliberately. The figures were already wrong in three places before this change, so correcting one leaves two; correcting all three means auditing a 31k-line parked file, which is a different piece of work from deleting one stale assertion. Pushing that to this PR also discards an in-flight suite for prose in a file that never executes. Filed separately instead. It is worth naming what the file is: a docstring about silent assertion-rot, whose own counts have rotted. Prose citing a measurement goes stale at the next change — drop the figure or accept the drift. AC4's destination is closedAC4 says "if the rest of this parked file is also drifting… record that on #15173 rather than fixing it piecemeal." #15173 is CLOSED, and the condition is close to unfalsifiable as written: 2142 |
Thinking Path
#16261 describes a one-line fix that could not be made, blocked by two gates. The branch carrying it had been left behind unpushed, so the first question was not "how do I fix this" but "is the fix still the right one" — the branch was written against a tree that has since moved.
Two of its three parts turned out to be obsolete:
The hook exemption is already in
main. The branch carried ano-local-schemaschange to exempt test files, which is what originally blocked the edit. #16298 landed that as an owner ruling on 2026-09-11, with the same rationale and naming this very file:Main's hook test file has 32 tests where the branch's older copy had 19, including
test_test_files_in_api_are_not_scanned. So the branch's version of both hook files was dropped in favour of main's rather than merged — re-applying it would have deleted 13 tests. A rebase can succeed onto an older copy of a file main has grown, and only counting both sides shows it.The ceiling numbers were stale. The branch proposed 31039, computed when the file was 31040 lines. Main has since shrunk it to 31025, with both ceilings at exactly 31025 — zero headroom. Re-measured rather than carried.
What remains is the actual defect.
What Changed
Deletes the stale assertion:
inspect.getsource(frontend_config.get_frontend_config)no longer containshosts: #16240 removedNetworkConstants.get_host_configs()from that endpoint's anonymous payload, because it published every VM's address and port to unauthenticated callers. The assertion has been false ever since, and nothing noticed because the whole file ispytest.mark.skipped at collection (#15173) — none of its 31k lines run.Lowers both recorded ceilings by the one line removed, together, as the ratchet requires.
Three files, not five.
Verification
Measured on the rebased tree, not taken from the branch:
scripts/python_file_size_known_large.pyrepo_tests/python_file_size_ratchet_baseline.pyAcceptance criteria:
no-local-schemastreats test files. Already decided and landed (feat(auth): one permission vocabulary, key scopes as bundles, /me permissions, and API-key scope enforcement (#16270, #16040) #16298, owner ruling);*_test.py/test_*.pyexempt, fixtures not moved intoschemas_*.py. Verified against merged code withgit show origin/main:tools/lint/check_no_local_schemas.py, not against this branch.assertIn("hosts", source). Done; the file no longer contains that call.This does not un-park the file. It stays skipped at collection under #15173 — the assertion is removed so the recorded defect is gone, not so the file starts running.
Closes #16261
Model Used
Claude Opus 5 (1M context).