You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Limit merge methods to merge button settings #1190
Describe the feature or problem you’d like to solve
The settings for a project allow the merge methods associated with the Merge button to be limited to a subset of the three options
Allow merge commits
Allow squash merging
Allow rebase merging
When merging through gh pr merge, you are presented with a list of all three options regardless.
Proposed solution
It would be nice if the options were limited to only the ones supported by the project. To take it one step further, if only one of the options is supported, the question should be skipped entirely.
Is it possible for a repo to have none of the 3 options enabled? The test for interactive merge fails because the "blueberries" repo we create to test on has none of the options enabled. Just wondering if this can also be a real world case so I can modify the tests accordingly.
EDIT: I have created the draft PR and mentioned my problem with the tests. Please take a look and advise on how to fix the test.
Activity
vilmibm commentedon Oct 7, 2020
Switching to bug since we ought to be respecting that setting.
mislav commentedon Oct 16, 2020
I'm guessing we should be querying something like this:
{ repository(owner:"cli",name:"cli") { mergeCommitAllowed squashMergeAllowed rebaseMergeAllowed } }and adjusting the available options accordingly in
cli/pkg/cmd/pr/merge/merge.go
Lines 226 to 234 in 02f4946
divbhasin commentedon Oct 17, 2020
New contributor here 👋 Willing to give this a shot :)
divbhasin commentedon Oct 17, 2020
Is it possible for a repo to have none of the 3 options enabled? The test for interactive merge fails because the "blueberries" repo we create to test on has none of the options enabled. Just wondering if this can also be a real world case so I can modify the tests accordingly.
EDIT: I have created the draft PR and mentioned my problem with the tests. Please take a look and advise on how to fix the test.
Merge pull request #2224 from divbhasin/1190-limit-merge-methods
adonisj910 commentedon Feb 2, 2021