Conversation
There was a problem hiding this comment.
Pull request overview
Adds merge-queue awareness so branches whose PRs are currently in GitHub’s merge queue are treated as temporarily “skipped” (similar to merged) across the CLI/TUI, and excluded from push/sync/submit workflows.
Changes:
- Extend GitHub GraphQL PR models to detect queued state via
mergeQueueEntry, and propagate queued flags into stack state (transient, non-persisted). - Update stack model helpers (
IsQueued/IsSkipped,QueuedBranches,ActiveBranchesfamily) and command behavior to skip queued branches. - Update TUI/CLI rendering to show queued state (icon/label/separators) and add tests for queued handling.
Show a summary per file
| File | Description |
|---|---|
| internal/tui/stackview/styles.go | Add queued icon and queued-specific styles. |
| internal/tui/stackview/model.go | Render queued separators/labels/icons and adjust layout calculations for queued state. |
| internal/tui/stackview/model_test.go | Add TUI tests for queued count and queued label rendering. |
| internal/stack/stack.go | Add queued/skipped helpers and exclude queued branches from “active” calculations. |
| internal/stack/stack_test.go | Add unit tests for queued behavior and non-persistence. |
| internal/github/github.go | Query/derive merge-queue status and expose it via PR models/details. |
| internal/github/github_test.go | Add test for PullRequest.IsQueued(). |
| go.mod | Promote golang.org/x/sys to a direct dependency (used behind build tags). |
| cmd/view.go | Show queued separator/icon in --short output and include queued in JSON output. |
| cmd/view_test.go | Add tests validating queued output and ordering with merged. |
| cmd/utils.go | Populate transient BranchRef.Queued during PR sync. |
| cmd/sync.go | Skip queued branches during rebase/push reporting. |
| cmd/submit.go | Attempt to skip queued branches during submit flow. |
| cmd/push.go | Sync PR state first and skip queued branches during push. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
cmd/sync.go:250
- The “no branches” message in Step 4 still says "(all merged)" even though queued branches are now excluded from
branches := activeBranchNames(s)and you print a queued skip count just above. Update the message to include queued (e.g., merged or queued) so output matches behavior.
if len(branches) == 0 {
cfg.Printf("No active branches to push (all merged)")
} else {
- Files reviewed: 14/14 changed files
- Comments generated: 3
|
Warning This is an internal experiment to assess Copilot's ability to auto-approve PRs. Please 👍 this comment if the assessment below is correct and 👎 if not. Feedback in #f-ccr-auto-approve is appreciated! Copilot thinks this PR is not ready to approve — see review comments for details. |
Detect merge queue status via the GitHub GraphQL API's mergeQueueEntry field and temporarily skip queued branches in push, sync, and submit commands. Unlike merged state (which is persisted permanently), queued state is transient — held in-memory only via a json:"-" tagged field on BranchRef. Each command run re-checks queue status from the API, so if a PR is ejected from the queue it becomes active again on next run. Changes: - Add MergeQueueEntry to PullRequest GraphQL struct and PRDetails - Add IsQueued()/IsSkipped()/QueuedBranches() to stack model - Update ActiveBranches() family to exclude queued branches - Skip queued branches in push, sync (rebase + push), and submit - Add queued icon, style, and QUEUED state label in TUI view - Add comprehensive tests for queued state handling Closes github/pull-requests#24019 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b2b1606 to
dcb5885
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Detect merge queue status via the GitHub GraphQL API's mergeQueueEntry field and temporarily skip queued branches in push, sync, and submit commands. Unlike merged state (which is persisted permanently), queued state is transient because PRs may or may not be merged. Each command run re-checks queue status from the API, so if a PR is ejected from the queue it becomes active again on next run.
Changes:
Closes github/pull-requests#24019