test(merge-queue): regression tests for dismissed/superseded review filtering (#3068) #3070
Reference in New Issue
Block a user
Delete Branch "fix/3068-merge-queue-review-filter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Regression-test coverage for the review-evaluation contract used by
gitea-merge-queue.pyandreview-check.sh.Why
molecule-core#3066 was blocked by a stale
REQUEST_CHANGESreview that had already been dismissed/superseded by anAPPROVEDreview on the same head. The production code now correctly (a) dedupes to the latest valid review per user and (b) excludesdismissed:true/official:falserows; this PR adds tests so the behavior cannot silently regress.Coverage
REQUEST_CHANGESis ignoredofficial=falserows are rejectedreviewer_setfilteringFixes #3068
Test plan
SOP checklist
SOP checklist
APPROVED on head
35e23d91e2.Independent 5-axis review: this is a test-only PR and the coverage is sound. The tests import the real .gitea/scripts/_approval_validator.py module, not a copy, and exercise the contract used by gitea-merge-queue.py: latest valid review per user wins; dismissed REQUEST_CHANGES is ignored; stale-head and official=false reviews are rejected; reviewer_set filtering is honored; and a later valid REQUEST_CHANGES supersedes an earlier APPROVED and remains an open block.
Correctness/robustness: the regression class from #3068 is pinned directly, including the important validate-before-reduce behavior. Security: no production/runtime surface or credentials touched; this strengthens merge-gate integrity. Performance: negligible, test-only. Readability: clear fixtures and focused assertions.
Status note: several CI contexts were still pending when checked, so merge should still wait for branch protection/all-required.
APPROVED on current head
35e23d91.5-axis review: Correctness looks good for the #3068 regression scope. The new tests exercise classify_reviews taking the latest valid review per user, ignoring dismissed/non-official/stale-head rows, preserving a later current-head REQUEST_CHANGES as blocking, and enforcing reviewer_set filtering. Robustness is appropriate for this pure reducer contract: the tests hit both consumer-facing classify_reviews and the per-verdict predicates, so future drift in dismissed/official/head handling should break CI. Security posture improves by pinning the fail-closed review gate behavior; no secrets/auth surface is changed. Performance impact is nil; this is test-only. Readability is clear and localized.
CI verified green via Gitea statuses, including CI / all-required. I attempted the targeted pytest locally, but this container does not have pytest installed; I relied on the green CI run for execution verification.
/sop-ack 1
/sop-ack 2
/sop-ack 3
/sop-ack 4
/sop-ack 5
/sop-ack 6
/sop-ack 7