Skip to content

Read the merge queue's reason when it rejects a pull request - #1373

Merged
mergify[bot] merged 1 commit into
mainfrom
stack/EdbertChan/land-stack-queue-feedback/read-merge-queue-s-reason-rejects-pull-req--c6864473
Oct 13, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
stack/EdbertChan/land-stack-queue-feedback/read-merge-queue-s-reason-rejects-pull-req--c6864473

Conversation

@EdbertChan

@EdbertChan EdbertChan commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

After a pull request enters the merge queue, the landing guard could only say queued or not. When the queue rejected one, it said nothing about why.

This teaches the guard to read the queue's own message. It reports the kind of rejection, the reason, and the next step.

It was checked against real rejected pull requests. It also ignores a rejection that is older than the pull request's latest commit.

Review Claim

Approve a read-only check that reports why the merge queue rejected a pull request and what to do next.

Review Lane

behavior

Review Unit

product-skill

Safety Invariant

It only reads Mergify comments and GitHub pull request data; it writes nothing. The token comes from the GitHub login and is never printed or saved.

Slice Rationale

The reader, its test data and the skill text that tells people to use it are one claim. The queue time limit change is a different kind of file and ships separately.

Non-goals

  • No automatic requeue or rebase; it reports and names the next step.
  • No change to the queue rules; that ships separately.

Measured

Command: python3 -m unittest product/skills/land-stack/tests/test_queue_feedback.py

  • base: Ran 9 tests in 0.046s then FAILED (failures=1, errors=8) (the reader did not exist yet)
  • head: Ran 13 tests in 0.045s then OK

Test Plan

Test Plan
  • python3 -m unittest discover -s product/skills/land-stack/tests printed Ran 38 tests in 0.425s then OK (the 13 new tests are in the separate run above)
  • Live run against real pull requests, 2026-10-12:
in-queue   #1354 (rule admin-bypass, ETA 2026-10-12T21:23:00+00:00)
rejected   #1309 conflict: GitHub refused to merge the pull request. Pull Request has merge conflicts. ...
             next: GitHub refused the merge. Rebase onto the trunk and push; Mergify requeues on the update.
rejected   #15193 checks-failed: The merge conditions cannot be satisfied due to failing checks
             failing checks: PR Body
  • check_skill_test_coverage.py, check_skills_three_harnesses.py, check_ecosystem_boundaries.py, check_skill_file_refs.py, check_no_dated_provenance.py, check_skill_trigger_policy.py and check_skill_trigger_mechanism.py each exited 0
  • python3 engine/skills/make-pr/scripts/preflight.py --base origin/main --dry-run printed unit product-skill: 4 file(s) and ok preflight passed

Revert Plan

Revert Plan
  • Safe to revert? Yes
  • Revert command: git revert <sha>
  • Post-revert steps: None
  • Data migration? No

🤖 Generated with Claude Code


Note

Low Risk
Changes are limited to the land-stack skill script, docs, and tests; no runtime product or security-sensitive paths.

Overview
Adds --queue-feedback to verify_stack.py so the land-stack workflow can read Mergify’s Merge Queue Status comment (not just the merge-queue check run) after a queue write. The script parses the embedded Mergify payload and reason text, classifies outcomes as merged / in-queue / waiting / rejected, and for rejections reports a kind (timeout, conflict, checks-failed, ahead-failed, other), failing or still-running checks, and a next-step hint. It can call gh api for bot comments or replay via --feedback-json; exit 0 when nothing is rejected, 1 on rejection, 2 when feedback cannot be read. Stale dequeue comments are treated as waiting when the head commit is newer than the status comment.

SKILL.md documents when to use this after --queue-state and how to act on each rejection kind. Tests and a fixture of real Mergify comments cover timeouts, conflicts, check failures, requeues, and CLI exit codes.

Reviewed by Cursor Bugbot for commit d1c6b24. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor

cursor Bot commented Oct 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 8e68dc3b-e16a-4d41-8c77-14541adca1e7)

@EdbertChan

EdbertChan commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner Author

Revision history

# Type Changes Reason Date
1 initial 1c0f031 2026-10-13 04:09 UTC
2 content 1c0f031 → b6152dd 2026-10-13 04:09 UTC
3 content b6152dd → d1c6b24 2026-10-13 04:14 UTC

@EdbertChan
EdbertChan force-pushed the stack/EdbertChan/land-stack-queue-feedback/read-merge-queue-s-reason-rejects-pull-req--c6864473 branch from 1c0f031 to b6152dd Compare October 13, 2026 04:09
@cursor

cursor Bot commented Oct 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 5fc41608-bd01-4ebe-8b74-8aee55d441da)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Change-Id: Ic68644735337fb896acc5f3a44eb1815c5d57b60
@EdbertChan
EdbertChan force-pushed the stack/EdbertChan/land-stack-queue-feedback/read-merge-queue-s-reason-rejects-pull-req--c6864473 branch from b6152dd to d1c6b24 Compare October 13, 2026 04:14
@cursor

cursor Bot commented Oct 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 8f48dec4-1e45-41dc-80b7-c9a1cfcb67e6)

@EdbertChan

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@mergify

mergify Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

queue

🛑 The pull request has been removed from the queue admin-bypass

Details

The pull request #1373 has been manually updated.

You can take a look at Mergify Merge Queue check runs for more details about the failure.

@mergify

mergify Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@EdbertChan

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@mergify

mergify Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 2 hours 44 minutes 35 seconds in the queue, including 1 hour 33 minutes 22 seconds running CI.

Required conditions to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant