[PATCH] D126940: github: Fix release automation /branch command with new repo

Tobias Hieta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 8 01:46:54 PDT 2022


thieta added inline comments.


================
Comment at: llvm/utils/git/github-automation.py:322
+            local_repo = Repo(self.llvm_project_dir)
+            local_repo.git.fetch(f'https://github.com/{owner}/llvm-project', f'{branch}:{branch}')
+            local_repo.git.push(self.push_url, f'{branch}:{branch}', force=True)
----------------
tstellar wrote:
> thieta wrote:
> > Maybe there should be some error handling here? this block can be retried if fetch or push fails - network errors happens fairly often.
> Is there a concise way to do retries in python?  I tried implementing this, but I thought it made the script too complicated.  
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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126940/new/

https://reviews.llvm.org/D126940



More information about the llvm-commits mailing list