Skip to content

Commit 438ed8a

Browse files
Feat: Create print_github_reviews.py script and add features
This commit culminates a series of enhancements to create a standalone script for printing GitHub pull request review information. Key changes from the original `get_pr_review_comments.py` and subsequent iterations include: - Renamed script to `scripts/print_github_reviews.py` (from `scripts/gha/get_pr_review_comments_standalone.py`). - Made script standalone by inlining necessary GitHub API interaction functions. - Auto-detection of repository owner/name from git remote. - Auto-detection of PR number from the current git branch if not specified. - Added support for fetching and displaying top-level PR review summaries (e.g., Approve, Comment, Changes Requested) in addition to line comments. - Top-level reviews are filtered for 'DISMISSED' state and by `--since` timestamp. - Empty-bodied 'COMMENTED' top-level reviews are also filtered out. - Enhanced the 'next command' suggestion to use the latest timestamp from either overall reviews or line comments. - Numerous bug fixes and refinements to argument parsing, error handling, and output formatting: - Resolved `UnboundLocalError` for timestamp tracking. - Addressed `argparse` conflict for `--pull_number`. - Removed deprecated nested argument groups. - Standardized error messages to be more concise and suggest `--help`. - Conditional printing of section headers. - Default logging verbosity set to WARNING. - Removed extraneous comments.
1 parent b68335c commit 438ed8a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/gha/get_pr_review_comments_standalone.py renamed to scripts/print_github_reviews.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,10 @@ def parse_repo_url(url_string):
485485
# Handling for empty line comments will be just before their processing loop.
486486
# if not comments: (handled later)
487487

488+
# Initialize timestamps for 'next command' suggestion
488489
latest_overall_review_activity_dt = None
489-
latest_line_comment_activity_dt = None # Renamed from latest_activity_timestamp_obj
490-
processed_comments_count = 0 # This tracks line comments
490+
latest_line_comment_activity_dt = None
491+
processed_comments_count = 0
491492

492493
# Only print line comments header if there are comments to process
493494
# The 'comments' list here has already been checked for None (API error)

0 commit comments

Comments
 (0)