fix(test): repoint the cadence-signal seed helper from review_targets to pull_requests - #9097
Merged
Merged
Conversation
… to pull_requests #9041 repointed getSubmitterCadence's query from review_targets (frozen since the 2026-06-22 self-host cutover) to the live pull_requests ledger, but the local seedReviewTarget helper inside "submission-cadence signal (#4514)" still inserted into review_targets -- so its own test seeded a table the code no longer reads, making "FLAG-ON: true for a machine-paced submitter" fail on main for everyone (cadence always resolves to 0 samples against the real query). Renamed to seedCadencePullRequest and repointed at pull_requests (repo_full_name/author_login, matching the real query shape) so the test again exercises the code path it names. The module-level seedReviewTarget (used elsewhere in this file for the separate quality/burst signal, which #9041 did not change) is untouched.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9097 +/- ##
==========================================
+ Coverage 90.56% 92.66% +2.10%
==========================================
Files 96 810 +714
Lines 22490 80600 +58110
Branches 3884 24454 +20570
==========================================
+ Hits 20367 74686 +54319
- Misses 1945 4840 +2895
- Partials 178 1074 +896
Flags with carried forward coverage won't be shown. Click here to find out more. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
mainis currently broken for every subsequent PR:test/unit/reputation-wiring.test.ts > shouldSkipAiForReputation (helper) > submission-cadence signal (#4514) > FLAG-ON: true for a machine-paced submitter even though every submission itself looks fine (quality-neutral)fails withexpected false to be true.Root cause
#9041 (merged as
c25fa1ef7) correctly repointedgetSubmitterCadence's query fromreview_targets(frozen since the 2026-06-22 self-host cutover — it stopped receiving writes, so the machine-paced signal was silently inert in production) to the livepull_requestsledger.That PR updated its own new test (
test/unit/submitter-reputation.test.ts) to assert the query shape, but missed a sibling:test/unit/reputation-wiring.test.ts's localseedReviewTargethelper (scoped inside the"submission-cadence signal (#4514)"describe block) still inserts rows intoreview_targets. Since the code now readspull_requests, that seed produces zero matching rows regardless of what's inserted —getSubmitterCadencealways resolves{count: 0, medianGapMs: null}, soisMachinePacedCadencecan never returntrue. The sibling "false for a human pace" test passed vacuously (right answer for the wrong reason); the "true for machine-paced" test assertstrueand correctly fails.Fix
Renamed the local helper to
seedCadencePullRequestand repointed it atpull_requests(repo_full_name+author_login, matching the real query). The module-levelseedReviewTarget(line 20, used elsewhere in this same file for the quality/burst signal — a separate code path #9041 did not touch) is untouched.Validation
npx vitest run test/unit/reputation-wiring.test.ts— 36/36 passed (was 1 failed / 35 passed).tsc --noEmit --incremental falseclean.