Skip to content

Commit

Permalink
Reduce calls to github API; add counter to view progress
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Feb 20, 2024
1 parent 285dd12 commit 68fe4eb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions galaxy_release_util/point_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,12 @@ def commits_to_prs(packages: List[Package]):
commits = set.union(*(p.commits for p in packages))
pr_cache = {}
commit_to_pr = {}
for commit in commits:
repo = g.get_repo(REPO)
total_commits = len(commits)
for i, commit in enumerate(commits):
click.echo(f"Processing commit {i} of {total_commits}")
# Get the list of pull requests associated with the commit
commit_obj = g.get_repo(REPO).get_commit(commit)
commit_obj = repo.get_commit(commit)
prs = commit_obj.get_pulls()
if not prs:
raise Exception(f"commit {commit} has no associated PRs")
Expand Down

0 comments on commit 68fe4eb

Please sign in to comment.