Commit graph

2 commits

Author SHA1 Message Date
google-labs-jules[bot]
6429b8d870 Bolt: optimize PR review script with bulk Git metadata fetching
This commit refactors `scripts/review_pull_requests.py` to use bulk Git metadata
retrieval, significantly reducing the number of subprocess calls to the `git` CLI.

Key improvements:
- Replaced O(N) `git log` and `git branch` calls with a single `git for-each-ref`
  command utilizing the `%(ahead-behind)` atom (Git 2.41+).
- Implemented `BRANCH_METADATA_CACHE` to store ahead/behind counts, last commit
  dates, and commit subjects.
- Added robust Git version detection and a safe fallback for older Git versions.
- Used a multi-character delimiter (|||) to safely handle commit subjects containing
  pipes or other special characters.
- Maintained data parity by ensuring unmerged branches still fetch up to 5 recent
  commits while merged branches correctly report 0 commits in the range.

Performance impact:
- Reduced execution time from ~0.74s to ~0.37s in a repository with 320+ remote
  branches (approx. 50% improvement).
- Subprocess calls reduced from hundreds (proportional to branch count) to ~10.

 Bolt: Speed is a feature. Measure first, optimize second.
2026-02-26 19:28:38 +00:00
Huawei-Window-Techno
365881c76a feat: Add pull request review script and comprehensive report - Created review_pull_requests.py to analyze all PRs - Generated Pull Request Review Report with 23 open PRs analysis - Identified 20 performance optimization PRs ready for review - Documented 5 draft PRs and 2 WIP feature PRs - Added recommendations for PR consolidation and prioritization 2026-01-10 05:26:35 +07:00