Commit a8030ca
authored
fix(review): repair stale gate-check publication state (#2351)
* fix(review): invalidate stale ai review cache inputs
* fix(review): fingerprint the actual REES endpoint, not just its presence
The AI-review cache fingerprint only recorded Boolean(REES_URL), so
changing the configured analyzer endpoint from one URL to another kept
the same cache key -- a same-head PR could reuse AI-review output
produced against a different analyzer service. Fingerprint the URL
value itself (still one-way-hashed by aiReviewInputFingerprint, so it
never appears in the output), matching the pattern already used for the
other REES_* fields.
* fix(review): restrict backlogged sweeps to priority repairs only
While an active per-PR regate backlog defers ordinary stale maintenance
(the point of the earlier check), a repo with even one priority repair
(a PR missing its current Gate check) escaped that deferral entirely and
picked up a full SWEEP_MAX_PRS batch -- letting unrelated ordinary stale
PRs ride along whenever any priority repair existed, contradicting the
"normal maintenance yields behind repairs" intent. Cap the candidate
limit to exactly the priority count when a backlog is active; a repo
with no backlog still gets a normal, full-size sweep.
Also documents (not fixes -- verified as a false positive) why
`decision.willLabel` in the incomplete-surface audit path is safe even
though `decision` can still be the un-reassigned `prelim` value there:
`willLabel` is a non-optional boolean on every PublicSurfaceDecision
variant, and the path is only reachable when "label" was never in
prelim.actions to begin with.
* test(review): mark the ai-review cache metadata fallback as provably unreachable
runAiReviewForAdvisory is the sole assignment site reaching the cache-write
branch, and every one of its "ok" returns sets metadata explicitly, so the
nullish fallback is a type-level safeguard only.1 parent ef8ae7c commit a8030ca
8 files changed
Lines changed: 1711 additions & 175 deletions
File tree
- src
- db
- queue
- review
- settings
- test/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3334 | 3334 | | |
3335 | 3335 | | |
3336 | 3336 | | |
| 3337 | + | |
3337 | 3338 | | |
3338 | 3339 | | |
3339 | 3340 | | |
| |||
3342 | 3343 | | |
3343 | 3344 | | |
3344 | 3345 | | |
| 3346 | + | |
| 3347 | + | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
3345 | 3351 | | |
3346 | 3352 | | |
3347 | 3353 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
| |||
0 commit comments