Skip to content

Show GitHub merge queue state in the PR popover and sidebar#352

Merged
sbertix merged 2 commits into
mainfrom
sbertix/296-merge-queue
May 22, 2026
Merged

Show GitHub merge queue state in the PR popover and sidebar#352
sbertix merged 2 commits into
mainfrom
sbertix/296-merge-queue

Conversation

@sbertix
Copy link
Copy Markdown
Collaborator

@sbertix sbertix commented May 22, 2026

Adds support for GitHub's merge queue across the pull request surfaces.

What

  • Fetches mergeQueueEntry (position, estimated time to merge, state) in the batch pull request GraphQL query and decodes it onto GithubPullRequest.
  • The PR popover gains a row showing "In merge queue" with the position and estimated time remaining.
  • Queued open PRs get a dedicated brown git-merge-queue sidebar icon, and the toolbar status button and worktree accessory badge tint brown to match, so the queued state reads consistently everywhere a PR surfaces.

Details

  • A PR counts as queued only when it is open, non-draft, and carries a live entry, so a stale entry on a merged or draft PR never surfaces as queued (the sidebar icon, popover, and toolbar badge all route through one check).
  • On a server that rejects the field (GitHub Enterprise Server before 3.8), the chunk fetch retries once without it so all PR state still loads, minus the merge-queue detail that server cannot provide.
  • Position renders 1-based; the estimate renders "<1 min left" below a minute; an unmergeable entry reads "Cannot merge from queue".

The queue position appears only in the popover; the sidebar conveys the state through the icon alone, keeping the existing #NN PR number unchanged.

Close #296

sbertix added 2 commits May 22, 2026 23:08
Add `mergeQueueEntry` (position, estimated time to merge, state) to the batch
pull request GraphQL query and decode it onto `GithubPullRequest` via the new
`GithubMergeQueueEntry`. `PullRequestMergeQueueStatus` summarizes queue
membership for the UI: a PR counts as queued only when it is open, non-draft,
and carries a live entry, so a stale entry on a merged or draft PR is ignored.

When a server rejects the field (GitHub Enterprise Server before 3.8), the
chunk fetch retries once without it so all PR state still loads, minus the
merge-queue detail that server cannot provide. Position renders 1-based; the
estimated time renders "<1 min left" below a minute, and an unmergeable entry
reads "Cannot merge from queue".
The pull request popover gains a row showing "In merge queue" with the position
and estimated time remaining. Queued open PRs get a dedicated brown
git-merge-queue sidebar icon, and the toolbar status button and worktree
accessory badge tint brown to match, so the queued state reads consistently
everywhere a PR surfaces.
@sbertix sbertix enabled auto-merge (squash) May 22, 2026 21:14
@tuist
Copy link
Copy Markdown

tuist Bot commented May 22, 2026

🛠️ Tuist Run Report 🛠️

Builds 🔨

Scheme Status Duration Commit
supacode 2m 32s c1e5c6ddb

@sbertix sbertix merged commit 3073482 into main May 22, 2026
2 checks passed
@sbertix sbertix deleted the sbertix/296-merge-queue branch May 22, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for GitHub merge queue in Pull Request popover

1 participant