Skip to content

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

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

mislav merged 11 commits into
trunkfrom
auto-merge

Conversation

@mislav

@mislav mislav commented Feb 16, 2021 •

Copy link
Copy Markdown
Contributor
$ 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

@ampinsk ampinsk left a comment

Copy link
Copy Markdown

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. 👍

Comment thread pkg/cmd/pr/merge/merge.go Resolved
Comment thread pkg/cmd/pr/merge/http.go
@@ -0,0 +1,100 @@
package merge

Copy link
Copy Markdown
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.

Comment thread pkg/cmd/pr/merge/merge.go Resolved
Comment thread pkg/cmd/pr/merge/merge.go Resolved
Comment thread pkg/cmd/pr/merge/merge.go Resolved
@mislav
mislav marked this pull request as ready for review February 17, 2021 14:25

@samcoe samcoe left a comment

Copy link
Copy Markdown
Contributor

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