fix(#6201): detect merge-queue membership regardless of labels - #6203
Conversation
The merge-queue check in nextwork was gated on the ready-for-merge label in three places: maybe_check_merge_queue(), classify_pr(), and the post-classification reclassify loop in main(). PRs enqueued through other paths (e.g. manual approval of a requires-manual-review PR) were never checked and kept reporting stale statuses like needs_review_decision instead of the terminal waiting_merge_queue. Move the in_merge_queue check to the top of classify_pr() so it fires before any label-specific branch. Remove the ready-for-merge gate from maybe_check_merge_queue() so all PRs are checked. Narrow the reclassify loop to only re-run classification for PRs actually found in the merge queue (in_merge_queue=True) rather than gating on a label. Note: pre-commit could not run (sandbox network block); the post-script runs it authoritatively. Closes #6201
|
🤖 Finished Review · ✅ Success · Started 6:49 PM UTC · Completed 7:02 PM UTC Commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ReviewFindingsMedium
Previous runReviewFindingsHigh
Medium
Low
Labels: PR fixes a bug in the nextwork skill's merge-queue detection logic Next steps:
|
|
/fs-fix the AI review comments |
|
🤖 Finished Fix · ✅ Success · Started 7:54 AM UTC · Completed 8:00 AM UTC Commit: |
- Update SKILL.md Limitations section to reflect that merge-queue membership is now checked for all open PRs (not just ready-for-merge) - Improve docstring precision in maybe_check_merge_queue() Addresses review feedback on #6203
🔧 Fix agent — iteration 1 (human-triggered)Addressed 4 review findings: fixed 2 (stale SKILL.md limitation text, imprecise docstring), disagreed with 2 (protected-path is informational only, ready_to_merge description is still technically accurate). All 184 tests pass. Fixed (2):
Disagreed (2):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 8:01 AM UTC · Completed 8:13 AM UTC Commit: |
Superseded by updated review
|
🤖 Finished Retro · ✅ Success · Started 8:32 AM UTC · Completed 8:45 AM UTC Commit: |
Retro: PR #6203 — detect merge-queue membership regardless of labelsThis workflow went well. The end-to-end pipeline (triage → code → review → fix → re-review → merge) completed cleanly with only one fix iteration, addressing documentation updates the code agent missed. Timeline
What went well
Evidence for existing issues (no new proposals needed)
Agents repo: |
Summary
Merge-queue detection in nextwork was gated on the
ready-for-mergelabel, so PRs enqueued through other paths (e.g. manual approval of arequires-manual-reviewPR) kept reporting stale statuses likeneeds_review_decisioninstead of the terminalwaiting_merge_queue.Changes
in_merge_queuecheck to the top ofclassify_pr()so it fires before any label-specific branch — any PR in the merge queue is now correctly classified aswaiting_merge_queueregardless of labelsready-for-mergelabel gate frommaybe_check_merge_queue()so all PRs are checked against the merge-queue APIin_merge_queue(actual queue membership) instead of label presencerequires-manual-reviewlabel and with no labels at allTestMaybeCheckMergeQueueto verify all PRs are checked regardless of labelsTesting
ruff checkpassesrequires-manual-reviewlabel in the merge queue)Closes #6201
Post-script verification
agent/6201-merge-queue-label-gate)ed0deb850458a4eb2107b51298a569c7503295db..HEAD)