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

chore: Add Dynamic Loading Bar Functionality to release-notes.py #4857

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions scripts/release-notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ def categorize_pull_request(label):
return category
return UNCATTEGORIZED # Default category if no matching prefix is found

def updateProgress(iteration, total_iterations):
progress = (iteration + 1) / total_iterations
percentage = progress * 100
sys.stdout.write('\r[' + '='*int(progress*50) + ' '*(50-int(progress*50)) + f'] {percentage:.2f}%')
sys.stdout.flush()
if iteration >= total_iterations - 1:
print()
return iteration + 1

def main(token, repo, num_commits, exclude_dependabot):
accept_header = "application/vnd.github.groot-preview+json"
Expand Down Expand Up @@ -88,11 +96,10 @@ def main(token, repo, num_commits, exclude_dependabot):
other_results = []
commits_with_multiple_labels = []

progress = 0
progress_iterator = 0
for commit in commits:
if not (progress % 10):
print(f"Processing commit {progress + 1}")
progress = progress + 1
# Update the progress bar
progress_iterator = updateProgress(progress_iterator, num_commits)

sha = commit['sha']
author = commit['author']['login']
Expand Down
Loading