Title: disable automerge when adding existing PRs to stack by skarim · Pull Request #120 · github/gh-stack · GitHub
Open Graph Title: disable automerge when adding existing PRs to stack by skarim · Pull Request #120 · github/gh-stack
X Title: disable automerge when adding existing PRs to stack by skarim · Pull Request #120 · github/gh-stack
Description: Disable auto-merge on existing PRs during submit When gh stack submit discovers an existing PR for a branch, that PR may have auto-merge enabled. Auto-merge is incompatible with stacked PRs because the PR would merge independently, breaking the stack's base chain. Previously, users could work around the link command's auto-merge guard by running init on a branch with an auto-merge-enabled PR, then submit to add it to a stack. The submit command had no auto-merge check, so the PR was adopted without any validation. This change adds auto-merge detection to submit's ensurePR function. When an existing PR with auto-merge enabled is found, the CLI automatically disables auto-merge via the disablePullRequestAutoMerge GraphQL mutation and warns the user. If the disable call fails, submit continues with a warning (non-fatal). Changes internal/github/github.go: add DisableAutoMerge() method using the disablePullRequestAutoMerge GraphQL mutation internal/github/client_interface.go: add DisableAutoMerge to ClientOps interface internal/github/mock_client.go: add DisableAutoMergeFn field and mock implementation cmd/submit.go: in ensurePR, detect auto-merge-enabled PRs and disable auto-merge before adding to the stack cmd/submit_test.go: 3 new tests — auto-merge disabled successfully, disable failure continues with warning, and no-op when auto-merge is not enabled Stack created with GitHub Stacks CLI • Give Feedback 💬
Open Graph Description: Disable auto-merge on existing PRs during submit When gh stack submit discovers an existing PR for a branch, that PR may have auto-merge enabled. Auto-merge is incompatible with stacked PRs because...
X Description: Disable auto-merge on existing PRs during submit When gh stack submit discovers an existing PR for a branch, that PR may have auto-merge enabled. Auto-merge is incompatible with stacked PRs because...
Opengraph URL: https://github.com/github/gh-stack/pull/120
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:d6f87fa5-a60f-860c-0d77-2f340ef6dd8c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D05E:2086C7:7489157:A3EF21E:6A50136D |
| html-safe-nonce | 246b88cde265f4976071a3de8e8f7d1d635a9f13e5dd5fbfa91b5792239a443c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDVFOjIwODZDNzo3NDg5MTU3OkEzRUYyMUU6NkE1MDEzNkQiLCJ2aXNpdG9yX2lkIjoiODU1NDQ0MDUxNTg5ODA1MzQ4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7ca9c5352e0fcc4dd943308cdc5f226a9fdc6ee30bb41ed01d894a6f2d9373df |
| hovercard-subject-tag | pull_request:3852645616 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/github/gh-stack/pull/120/files |
| twitter:image | https://avatars.githubusercontent.com/u/1701557?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1701557?s=400&v=4 |
| og:image:alt | Disable auto-merge on existing PRs during submit When gh stack submit discovers an existing PR for a branch, that PR may have auto-merge enabled. Auto-merge is incompatible with stacked PRs because... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | fe4f38b24922a1ce81c1708c3793b47c185599b9144ab94f6ca846b00698058d |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/github/gh-stack git https://github.com/github/gh-stack.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 1151630728 |
| octolytics-dimension-repository_nwo | github/gh-stack |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1151630728 |
| octolytics-dimension-repository_network_root_nwo | github/gh-stack |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 42b6390c91978a16f9196c38c7a00e9bf21f37e7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width