We started using the llvm/llvm-project-release-prs repo for
backport pull requests, but since this repo is not a fork of
llvm/llvm-project it will reject pull requests from other repos. In
order to fix this, when ever someone uses the /branch command to request
a branch be merged into the release branch, we first copy the branch to
the llvm-project-release-prs repo and then create the pull request.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This looks good - only a comment about error handling, but I think we can also address that later if we see it's a large problem.
llvm/utils/git/github-automation.py | ||
---|---|---|
233 | Maybe there should be some error handling here? this block can be retried if fetch or push fails - network errors happens fairly often. |
llvm/utils/git/github-automation.py | ||
---|---|---|
234 | Should we include owner in the branch name, to avoid clashing when multiple repos use the same branch name? |
llvm/utils/git/github-automation.py | ||
---|---|---|
233 | Is there a concise way to do retries in python? I tried implementing this, but I thought it made the script too complicated. |
llvm/utils/git/github-automation.py | ||
---|---|---|
233 | maybe: for i in range(5): try: local_repo.git.fetch(...) local_repo.git.push(...) except: continue Or use https://pypi.org/project/retrying/ which is very nice and looks much neater in the code. |
llvm/utils/git/github-automation.py | ||
---|---|---|
233 | That module looks nice, but I didn't want to add another dependency, so I just implemented the retry manually. |
LGTM with the caveat that I think we should print the error.
llvm/utils/git/github-automation.py | ||
---|---|---|
243 | I think maybe we should log the exception here - otherwise we will swallow the error completely and it will be hard to troubleshoot |
Maybe there should be some error handling here? this block can be retried if fetch or push fails - network errors happens fairly often.