Skip to content

feat(pull-requests): list rows say auto-merge, and arming never merges outright - #227

Merged
badcuban merged 3 commits into
mainfrom
threadlines/evaluate-github-auto-merge
Sep 5, 2026
Merged

feat(pull-requests): list rows say auto-merge, and arming never merges outright#227
badcuban merged 3 commits into
mainfrom
threadlines/evaluate-github-auto-merge

Conversation

@badcuban

@badcuban badcuban commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Problem

Only the detail page said whether a pull request was armed to merge on its own. The list gave no hint which branches would land without anyone coming back for them.

Worse, "Enable auto-merge" ran gh pr merge --auto. On a pull request that is already ready, that command merges it on the spot instead of arming it, with no confirmation. And on a repository with auto-merge switched off, the menu item still appeared and GitHub's raw GraphQL error came back.

Fix

  • List rows carry the auto-merge flag from every host that reports one (GitHub, including the authored search; GitLab; Azure DevOps). The page shows it as a mono "auto-merge" word on the meta line of an open, non-draft row, with a tooltip and a word in the row's accessible name.
  • The GitHub provider reads mergeStateStatus before arming and refuses a ready pull request with "This pull request can merge right now. Use Merge instead." Nothing reaches the host in that case.
  • The repository read picks up allow_auto_merge. The service drops enable-auto-merge from the detail's capabilities where it is off, so the menu item never appears on a repository that would refuse it.

The optional list field is in packages/contracts; the provider-side autoMergeEnabled moved onto the shared list row type so the detail inherits it.

Verification

  • vp run typecheck, scoped vp fmt and vp lint: clean.
  • @threadlines/server#test pullRequest/: 107 passed, including new tests for the list decoder, the authored search, the ready check (both branches), the repository decode, and the capability narrowing.
  • @threadlines/web#test:browser PullRequestsView: 10 passed, with a new assertion for the marker.

Not in this PR

GitLab's glab mr merge --auto-merge=true likely merges outright too when no pipeline is running. Left for a follow-up.

…s outright

Only the detail page said whether a pull request was armed to merge on its own,
so the list gave no hint which branches would land without anyone coming back.
Worse, "Enable auto-merge" ran `gh pr merge --auto`, which merges a ready pull
request on the spot instead of arming it, with no confirmation.

List rows now carry the auto-merge flag from every host that reports one
(GitHub, including the authored search; GitLab; Azure DevOps) and the page shows
it as a mono "auto-merge" word on the meta line of an open, non-draft row.

The GitHub provider reads the pull request's merge readiness before arming and
refuses a ready one with "This pull request can merge right now. Use Merge
instead." The repository read also picks up `allow_auto_merge`, and the service
drops the enable action from the detail's capabilities where it is off, so the
menu item never appears on a repository that would refuse it.
@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Sep 5, 2026 8:04am UTC

Request Review

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Sep 5, 2026
@badcuban
badcuban enabled auto-merge September 5, 2026 06:24
@badcuban
badcuban disabled auto-merge September 5, 2026 07:57
@badcuban
badcuban enabled auto-merge (squash) September 5, 2026 07:57
@badcuban
badcuban merged commit 6c78d77 into main Sep 5, 2026
16 checks passed
@badcuban
badcuban deleted the threadlines/evaluate-github-auto-merge branch September 5, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant