Skip to content

Fix off-by-one in merge queue position display - #752

Merged
sbertix merged 1 commit into
mainfrom
sbertix/merge-queue-position
Aug 1, 2026
Merged

Fix off-by-one in merge queue position display#752
sbertix merged 1 commit into
mainfrom
sbertix/merge-queue-position

Conversation

@sbertix

@sbertix sbertix commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

GitHub's GraphQL MergeQueueEntry.position is 1-based: the first entry in the
queue reports position 1. The code assumed it was 0-based and added 1, so a PR
that is actually first surfaced as "Position 2" across the sidebar, popover, and
notification. This renders the position exactly as GitHub reports it.

Type of change

  • Bug fix (the linked issue is a bug report)
  • Feature (the linked issue is a feature request marked ready)
  • Documentation
  • Other (please describe)

How was this tested?

Retargeted the merge-queue tests to real 1-based fixtures, keeping a genuine
second-place case (position: 2 -> "Position 2") that fails if the +1 is ever
reintroduced. The batch-decode test now asserts the raw position == 1 with no
display arithmetic.

  • make check passes (format + lint)
  • make test passes
  • I built and ran the app to confirm the change works

Checklist

  • This pull request is linked to an issue with Closes # above.
  • For a feature, the linked issue is labeled ready.
  • I am the author of this work and accountable for it; no commit is authored or co-authored by an AI agent.
  • I have read the Contributing guide and the Code of Conduct.

GitHub's GraphQL `MergeQueueEntry.position` is 1-based: the first entry
in the queue reports position 1. The code assumed it was 0-based and
added 1, so a PR that is actually first surfaced as "Position 2". Render
the position as GitHub reports it.
@sbertix
sbertix enabled auto-merge (squash) August 1, 2026 00:08
@sbertix
sbertix merged commit ce863b4 into main Aug 1, 2026
3 checks passed
@sbertix
sbertix deleted the sbertix/merge-queue-position branch August 1, 2026 00:18
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.

1 participant