Skip to content

[Utils] Add new merge-release-pr.py script. #101630

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

Merged
merged 3 commits into from
Aug 10, 2024
Merged

[Utils] Add new merge-release-pr.py script. #101630

merged 3 commits into from
Aug 10, 2024

Conversation

tru
Copy link
Collaborator

@tru tru commented Aug 2, 2024

This script helps the release managers merge backport PR's.

It does the following things:

  • Validate the PR, checks approval, target branch and many other things.
  • Rebases the PR
  • Checkout the PR locally
  • Pushes the PR to the release branch
  • Deletes the local branch

I have found the script very helpful to merge the PR's.

@tru tru added the infrastructure Bugs about LLVM infrastructure label Aug 2, 2024
@tru tru requested review from tstellar and boomanaiden154 August 2, 2024 08:04
Copy link

github-actions bot commented Aug 2, 2024

✅ With the latest revision this PR passed the Python code formatter.

Copy link
Contributor

@boomanaiden154 boomanaiden154 left a comment

Choose a reason for hiding this comment

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

Main comment is about using docstrings over just comments about the function (https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings). We don't have an official Python style guide (maybe we should start one), but I think it's a reasonable enough format and standardized enough, at least in the code that I read (which is a bit biased towards one style).

We could also use the Github API here to grab the PR info/do stuff, but using the gh tool seems good enough, and if that's what the release managers have setup, then that's what we should go with because they're the ones ultimately using it.

Writing tests looks like it would mostly be integration tests while mocking the Github API/CLI tool, which would be a massive pain for not much benefit.

Copy link
Collaborator

@tstellar tstellar left a comment

Choose a reason for hiding this comment

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

I think this looks good. In theory, we might be able to add a workflow in the future to run this script automatically when a release manager approves a PR.

tru added 2 commits August 10, 2024 12:39
This script helps the release managers merge backport PR's.

It does the following things:

* Validate the PR, checks approval, target branch and many other things.
* Rebases the PR
* Checkout the PR locally
* Pushes the PR to the release branch
* Deletes the local branch

I have found the script very helpful to merge the PR's.
@tru tru requested a review from boomanaiden154 August 10, 2024 10:46
Copy link
Contributor

@boomanaiden154 boomanaiden154 left a comment

Choose a reason for hiding this comment

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

LGTM.

@tru tru merged commit f3e950a into llvm:main Aug 10, 2024
8 checks passed
@tru tru deleted the pr_merger branch August 10, 2024 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Bugs about LLVM infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants