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

Display commit status in UI and other improvements #106

Merged
merged 8 commits into from
Dec 29, 2024

Conversation

jvansanten
Copy link
Contributor

Ahoy! First of all, this has been a really useful tool.

After some time neglecting a stable of repositories with automated dependency updates, I had a depressing number of PRs to merge, with mix of failing and passing status checks. I needed a way to bulk merge only those that pass checks, and set about trying to display the commit status in the summary table. This PR is the result of that attempt, which got slightly out of hand. It includes the following changes:

  • Display the check status of the last commit to a PR in the summary table (fixes FEATURE: Display CI status on Pull requests #12). This turns out to be impossible to get from the v3 API (the commit status endpoint is just broken), so I switched to the GraphQL-based v4 API.
  • Interpret repo names without a slash as owners, and search for PRs against repos with that owner (simpler in the GraphQL API, and useful for me)
  • Consolidate PR manipulation for multi/single-repo case
  • Omit commit message when merging (effectively fixes FEATURE: Include Co-Authored-By in commit body #105 by letting GitHub generate the commit body, including co-author fields)
  • Optionally filter PRs by label (fixes FEATURE: Find PRs by tag #79). This added more complexity than I would have liked because of the way that the query is encoded in struct tags, and there may be a cleaner way to do this.
  • Attempt to approve PRs that need reviews before merging them (addresses FEATURE: Approve and merge in one step #96, but without the UX). Note that this only works for repos with classic branch protection rules; the new-style repository rulesets don't seem to appear in the API.

I realize that this is kind of a monster, and am happy to break it down into smaller changes if that's helpful. Comments welcome!

Vastly simpler than reducing the result of check runs, and also
includes statuses set without a run (e.g.  from Renovate)
Let GitHub generate the commit message for the merge type, which
does the right thing ~all of the time.
Rather than after each merge.  This avoids a confusing delay after
the last merge.
@Cian911
Copy link
Owner

Cian911 commented Nov 27, 2024

Wow @jvansanten first and foremost, thanks for the PR!

There's quite a few changes here, so I will take some time this weekend to test & review.

Again, much appreciate your contribution.

@Cian911 Cian911 self-assigned this Nov 27, 2024
@Cian911 Cian911 added enhancement New feature or request dependencies Pull requests that update a dependency file user-request User requested features labels Nov 27, 2024
Copy link
Owner

@Cian911 Cian911 left a comment

Choose a reason for hiding this comment

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

I made a few small tweaks to your PR @jvansanten just to improve the visuals slightly - plus some formatting issues.

Apart from that, this is a great PR! Sorry for the delay in reviewing it. I am happy to say though it is now approved :)

I will create a new release for this shortly

@Cian911 Cian911 merged commit 9074e40 into Cian911:master Dec 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request user-request User requested features
Projects
None yet
2 participants