Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ask before merging if CI failed or is pending #2623

Closed
camelid opened this issue Dec 15, 2020 · 4 comments
Closed

Ask before merging if CI failed or is pending #2623

camelid opened this issue Dec 15, 2020 · 4 comments
Labels
enhancement a request to improve CLI

Comments

@camelid
Copy link
Contributor

camelid commented Dec 15, 2020

Describe the feature or problem you’d like to solve

In the GitHub.com UI, the 'Merge pull request' button is not filled in if CI failed or is still pending. However, the GitHub CLI does not notify you if the checks failed or if they are still pending when you run gh pr merge. It would be helpful to ask 'Are you sure?' if CI failed or is pending so that one does not need to remember to run gh pr checks before merging.

Proposed solution

Add an 'Are you sure?' prompt at the beginning of the gh pr merge workflow if CI failed or is pending. I'm thinking something like:

$ gh pr merge
? Some checks failed. Are you sure you want to merge? (y/N)
? What merge method would you like to use?  [Use arrows to move, type to filter]
...

and this if checks are pending:

$ gh pr merge
? Some checks are still pending. Are you sure you want to merge? (y/N)
? What merge method would you like to use?  [Use arrows to move, type to filter]
...
@camelid camelid added the enhancement a request to improve CLI label Dec 15, 2020
@mislav
Copy link
Contributor

mislav commented Dec 15, 2020

This is a great idea. Makes sense to ship in tandem with #1198 👍

@ampinsk What do you think?

@vilmibm vilmibm added the needs-design An engineering task needs design to proceed label Dec 15, 2020
@ampinsk
Copy link
Contributor

ampinsk commented Dec 15, 2020

I love this idea! The proposed prompt makes sense to me 👍

@darcyclarke
Copy link

Hey @camelid, it seems like we already support this behavior/throwing if you add required CI status' to your branch protection rules/repo settings.

@darcyclarke darcyclarke removed the needs-design An engineering task needs design to proceed label Mar 23, 2022
@camelid
Copy link
Contributor Author

camelid commented Mar 23, 2022

Ah, I didn't know that. It might still be useful to have a warning even if the user doesn't have enforced branch protection though. The web UI has a visual clue of whether checks have passed based on the color of the merge button, whereas AFAIK there's nothing like that in the CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a request to improve CLI
Projects
None yet
Development

No branches or pull requests

5 participants