Completes d8a4a3d, which was a half fix that looked complete.
What d8a4a3d missed
The merge-queue deployment guard went into execute_job, which only sees jobs that actually reach execution. execute_claimed parks an approval-gated job and moves on before calling it:
if job.approval_required && job.approved_at.is_none() {
self.database.set_job_status(job.id, "waiting", None, None)?;
progressed = true;
continue; // <- execute_job, and its guard, never run
}
self.execute_job(run_id, job.id, &workspace, cancellation)?;
So the fix covered exactly one of the two symptoms it was written for:
| Repo | deploy job | Result under d8a4a3d |
|---|---|---|
| AkurAI-Build | approval: false | correctly skipped on refs/merge-queue/N |
| AkurAI-Framework | approval: true | still waiting — queue still blocked |
Run 2011 reproduced it against the deployed fix: verify succeeded, package succeeded, deploy waiting on refs/merge-queue/7. I confirmed the deployed binary did contain d8a4a3d (service restarted 12:34:46, nine seconds after the merge, and the new skip string is present in it), so this was a coverage gap and not a stale deploy.
Why the first regression test did not catch it: make_job_spec defaults approval to false, and the test only set environment. It therefore exercised only the non-approval path and passed against an incomplete fix — the failure mode I should have anticipated, since the approval-gated case is precisely the one that was stalling the queue.
The fix
Decide before the approval gate, and share the merge-queue predicate between the two call sites via Runner::queue_targets_default rather than deriving it twice.
Verification
approval_gated_deployment_is_skipped_not_parked_on_merge_queue_refs drives the whole claimed-run path instead of execute_job in isolation, and asserts both that the job is skipped with a reason naming the merge queue and that the run does not end in waiting. I verified it fails without the new guard (left: "waiting", right: "skipped").
cargo fmt --all -- --check: cleancargo clippy --all-targets --all-features --locked -- -D warnings: cleancargo test --lib: 337 passed, 0 failed, 4 ignored
Unlike the previous PR, this one's own queue run will already skip its deployment job — d8a4a3d is deployed, and this job has no approval gate.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FRtUmfFA7yWCFpX9dCaXvz