Skip to content

PR merge improvements: auto-merge, edit commit body#2980

Merged
mislav merged 11 commits intotrunkfrom
auto-merge
Feb 17, 2021
Merged

PR merge improvements: auto-merge, edit commit body#2980
mislav merged 11 commits intotrunkfrom
auto-merge

Conversation

@mislav
Copy link
Contributor

@mislav mislav commented Feb 16, 2021

$ gh pr merge --auto --squash 40
✓ Pull request #40 will automatically get merged via squash when all requirements are met

$ gh pr merge --disable-auto 40
✓ Auto-merge disabled for pull request #40

Questions:

  • The confirmation checkmark for merge --auto is green. Should it be purple?
  • The confirmation checkmark for merge --disable-auto is green. Should it be red?

Fixes #2619
Fixes #1023
Reverts #1627, reasoning #2954 (comment), ref. #1621

TODO:

  • tests for --auto
  • tests for --disable-auto
  • GHE compatibility for viewerMergeBodyText GraphQL field

cristiand391 and others added 6 commits February 16, 2021 15:59
For single-commit PRs, the commit subject will be the subject of the
head commit and the PR number. For multi-commit PRs, the commit subject
will be the PR title and PR number. Instead of trying to replicate this
logic client-side, omit the `commitHeadline` param and let the server
apply defaults appropriately.

Reverts #1627
Copy link

@ampinsk ampinsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me!

The confirmation checkmark for merge --auto is green. Should it be purple?
The confirmation checkmark for merge --disable-auto is green. Should it be red?

I actually think it makes sense for these to be green, since neither of these result in something merging or closing right then and there. 👍

@@ -0,0 +1,100 @@
package merge
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the extraction of the API code into this new file.

mislav and others added 5 commits February 17, 2021 12:30
Co-authored-by: Amanda Pinsker <ampinsk@github.com>
GHE versions 2.22 and older will not have this GraphQL field. Avoid the
resulting error and have the command proceeed with empty text as the
default.
@mislav mislav marked this pull request as ready for review February 17, 2021 14:25
Copy link
Contributor

@samcoe samcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, nice work!

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.

Support pr auto-merge from gh Allow editing the commit message when squash-merging a PR

4 participants