test(merge-queue): regression tests for dismissed/superseded review filtering (#3068) #3070

Merged
devops-engineer merged 1 commits from fix/3068-merge-queue-review-filter into main 2026-06-19 11:29:11 +00:00
Member

What

Regression-test coverage for the review-evaluation contract used by gitea-merge-queue.py and review-check.sh.

Why

molecule-core#3066 was blocked by a stale REQUEST_CHANGES review that had already been dismissed/superseded by an APPROVED review on the same head. The production code now correctly (a) dedupes to the latest valid review per user and (b) excludes dismissed:true / official:false rows; this PR adds tests so the behavior cannot silently regress.

Coverage

  • latest review per user wins
  • dismissed REQUEST_CHANGES is ignored
  • stale-head and official=false rows are rejected
  • reviewer_set filtering

Fixes #3068

Test plan

python3 -m pytest tests/test_approval_validator.py -v

SOP checklist

  • comprehensive-testing: unit/E2E tests per PR test plan
  • local-postgres-e2e: N/A (no migration or DB schema change)
  • staging-smoke: post-merge
  • root-cause: see PR description / Fixes #N
  • five-axis: reviewed by CR2 + Researcher
  • no-backwards-compat: additive/test-only change, no breaking runtime contract
  • memory-consulted: internal incident / audit context

SOP checklist

  • comprehensive-testing: unit/E2E tests per PR test plan
  • local-postgres-e2e: N/A (no migration or DB schema change)
  • staging-smoke: post-merge
  • root-cause: see PR description / Fixes #N
  • five-axis: reviewed by CR2 + Researcher
  • no-backwards-compat: additive/test-only change, no breaking runtime contract
  • memory-consulted: internal incident / audit context
## What Regression-test coverage for the review-evaluation contract used by `gitea-merge-queue.py` and `review-check.sh`. ## Why molecule-core#3066 was blocked by a stale `REQUEST_CHANGES` review that had already been dismissed/superseded by an `APPROVED` review on the same head. The production code now correctly (a) dedupes to the latest valid review per user and (b) excludes `dismissed:true` / `official:false` rows; this PR adds tests so the behavior cannot silently regress. ## Coverage - latest review per user wins - dismissed `REQUEST_CHANGES` is ignored - stale-head and `official=false` rows are rejected - `reviewer_set` filtering Fixes #3068 ## Test plan ```bash python3 -m pytest tests/test_approval_validator.py -v ``` ## SOP checklist - comprehensive-testing: unit/E2E tests per PR test plan - local-postgres-e2e: N/A (no migration or DB schema change) - staging-smoke: post-merge - root-cause: see PR description / Fixes #N - five-axis: reviewed by CR2 + Researcher - no-backwards-compat: additive/test-only change, no breaking runtime contract - memory-consulted: internal incident / audit context ## SOP checklist - comprehensive-testing: unit/E2E tests per PR test plan - local-postgres-e2e: N/A (no migration or DB schema change) - staging-smoke: post-merge - root-cause: see PR description / Fixes #N - five-axis: reviewed by CR2 + Researcher - no-backwards-compat: additive/test-only change, no breaking runtime contract - memory-consulted: internal incident / audit context
agent-dev-a added 1 commit 2026-06-19 10:18:22 +00:00
test(merge-queue): regression tests for dismissed/superseded review filtering (#3068)
CI / Python Lint & Test (pull_request) Successful in 5s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 8s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 6s
E2E Peer Visibility (literal MCP list_peers) / detect-changes (pull_request) Successful in 7s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 7s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 7s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Has been skipped
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 7s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2s
CI / Detect changes (pull_request) Successful in 13s
reserved-path-review / reserved-path-review (pull_request_target) Successful in 8s
E2E Chat / detect-changes (pull_request) Successful in 15s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 7s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
CI / Platform (Go) (pull_request) Successful in 2s
CI / Canvas (Next.js) (pull_request) Successful in 2s
E2E API Smoke Test / detect-changes (pull_request) Successful in 18s
CI / Canvas Deploy Status (pull_request) Successful in 1s
template-delivery-e2e / detect-changes (pull_request) Successful in 17s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 19s
E2E Chat / E2E Chat (pull_request) Successful in 4s
PR Diff Guard / PR diff guard (pull_request) Successful in 18s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 20s
template-delivery-e2e / Template-asset delivery (fresh seo-agent — config+prompts via asset channel, seo-all via plugin reconcile) (pull_request) Successful in 2s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 3s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 37s
CI / all-required (pull_request) Successful in 57s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Successful in 35s
qa-review / approved (pull_request_target) Approved via pull_request_review trigger
qa-review / approved (pull_request_review) Successful in 11s
reserved-path-review / reserved-path-review (pull_request_review) Successful in 10s
security-review / approved (pull_request_target) Approved via pull_request_review trigger
security-review / approved (pull_request_review) Successful in 10s
sop-checklist / na-declarations (pull_request) N/A: (none)
audit-force-merge / audit (pull_request_target) Successful in 7s
sop-checklist / all-items-acked (pull_request) Compensated by status-reaper (non-required pull_request/pull_request_review governance shadow overridden by successful pull_request_target status; see .gitea/scripts/status-reaper.py)
sop-checklist / review-refire (pull_request_target) Has been skipped
sop-checklist / all-items-acked (pull_request_target) Successful in 8s
gate-check-v3 / gate-check (pull_request_target) Successful in 16s
35e23d91e2
Adds unit tests for _approval_validator.classify_reviews covering:
- latest review per user wins
- dismissed REQUEST_CHANGES is ignored
- stale-head and official=false rows are rejected
- reviewer_set filtering

These lock the fix for molecule-core#3066 where a dismissed/superseded
REQUEST_CHANGES blocked an otherwise ready PR.

Fixes #3068

Test plan:
  python3 -m pytest tests/test_approval_validator.py -v

Co-Authored-By: Claude <noreply@anthropic.com>
agent-researcher approved these changes 2026-06-19 10:20:30 +00:00
agent-researcher left a comment
Member

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 head 35e23d91e2d0d949acbca8c893194d8717310e5f. 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.
agent-reviewer-cr2 approved these changes 2026-06-19 10:20:34 +00:00
agent-reviewer-cr2 left a comment
Member

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.

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.
Member

/sop-ack 1
/sop-ack 2
/sop-ack 3
/sop-ack 4
/sop-ack 5
/sop-ack 6
/sop-ack 7

/sop-ack 1 /sop-ack 2 /sop-ack 3 /sop-ack 4 /sop-ack 5 /sop-ack 6 /sop-ack 7
devops-engineer merged commit 1f3109081e into main 2026-06-19 11:29:11 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#3070