Fix matching operator for ignored files in size-labeler.sh#1034
Fix matching operator for ignored files in size-labeler.sh#1034mhucka wants to merge 6 commits intoquantumlib:mainfrom
Conversation
The `IGNORED` list contain path globs, but they were getting tested using bash regex syntax, and this would not produce the right results.
There was a problem hiding this comment.
Code Review
This pull request updates the size-labeler.sh script to use Bash glob patterns for file exclusion and increases the GitHub API per_page parameter to 100. While the increase in page size is helpful, feedback was provided noting that the script still fails to handle pagination for pull requests exceeding 100 files, which could result in inaccurate size labels.
This enhances the code to support getting more than 100 files from GitHub. (Written with the help of Gemini CLI.)
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the compute_changes function in dev_tools/ci/size-labeler.sh to implement pagination when querying the GitHub API for pull request files, ensuring accurate size labeling for large changesets. It also improves shell script robustness through better variable quoting and refined pattern matching. Feedback was provided to optimize performance by reducing the number of jq process executions within the file processing loop, suggesting a single-pass approach to extract filenames and change counts.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
The
IGNOREDarray insize-labeler.shcontains glob patterns (e.g.,*_pb2.py,.*.lock). Using the Bash regex match operator=~would fail to match these patterns.The following demonstrates the problem:
This is the same fix applied in the Cirq repo in PR #7986 there.
In addition, this PR adds support for getting more than 100 files back from GitHub, a problem that was flagged by Gemini Code Assist. The solution was implemented with the help of Gemini CLI.