Skip to content

Allow editing commit msg when squash merging a PR - #2896

Closed
cristiand391 wants to merge 9 commits into
cli:trunkfrom
cristiand391:squash-edit-commit-msg
Closed

cristiand391 wants to merge 9 commits into
cli:trunkfrom
cristiand391:squash-edit-commit-msg

Conversation

@cristiand391

Copy link
Copy Markdown
Contributor

Closes #1023

This PR adds support for editing the commit message when squash merging a PR.

Spec: #1023 (comment)

The spec for this is converting the confirmation prompt from a y/N prompt to a select with options:

Submit
Edit Commit Message
Edit Commit Author
Cancel

The GraphQL API fails when trying to merge a PR with authorEmail field set, so I avoided adding it for now, would be great if anyone in the cli team can help reporting this to GitHub.
https://github.community/t/graphql-api-fails-when-trying-to-merge-a-pull-request-with-authoremail-field-set/158421

@cristiand391

Copy link
Copy Markdown
Contributor Author

Tests passed both locally and on my fork: https://github.com/cristiand391/cli/runs/1814289277
Any idea of what's going on?

@samcoe samcoe self-assigned this Feb 4, 2021

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

It looks like the tests were failing due to not being up to date with trunk and some conflicting changes had been merged in. I rebased trunk, resolved the tests, and added a bit of polish. I think this is good to go now 👍

@samcoe
samcoe requested a review from a team February 4, 2021 23:48
Comment thread pkg/cmd/pr/merge/merge_test.go Resolved
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
@cristiand391

Copy link
Copy Markdown
Contributor Author

I've pushed some changes to address suggestions 👍🏾

@cristiand391
cristiand391 requested review from mislav and samcoe February 9, 2021 00:32
Comment thread api/queries_pr.go Outdated

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 query looks good for github.com, but this field is not available in GitHub Enterprise 2.22 or lower, and we support those as well. Adding this field would break all pull request queries on GHE.

We have a mechanism for detecting whether a GraphQL field is supported on the remote. I will take over this PR from here and make the query safe for different hosts. In the meantime I will mark the PR as "changes requested" to block merging.

Thank you for all your contribution so far!

@mislav

mislav commented Feb 16, 2021

Copy link
Copy Markdown
Contributor

@cristiand391 I'm folding your PR into this one that adds auto-merge functionality: #2980

@mislav mislav closed this Feb 16, 2021
@cristiand391
cristiand391 deleted the squash-edit-commit-msg branch March 1, 2021 22:38
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.

Allow editing the commit message when squash-merging a PR

3 participants