Repository navigation
add pr size label workflow - #40717
Conversation
|
/gemini review |
There was a problem hiding this comment.
📋 Review Summary
This PR introduces a GitHub Actions workflow (pr-size-labeler.yml) that automatically calculates PR diff sizes (additions + deletions) and applies appropriate size/* labels. The workflow avoids checking out untrusted code on pull_request_target and passes workflow expressions safely via environment variables.
🔍 General Feedback
- Calling
gh label createfive times on every PR event adds 5 unnecessary GitHub API requests per workflow run, which can contribute toGITHUB_TOKENrate limit exhaustion on a high-traffic repository like Apache Beam. - Label matching uses
grep -Fqwithout whole-line matching (-x), which can cause substring false positives if any prefix/suffix labels exist in the future. - Consider adding a
concurrencygroup per PR so rapid pushes (synchronizeevents) do not race when adding and removing size labels.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
a0e1f97 to
8790e8c
Compare
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
1 similar comment
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
|
assign set of reviewers |
|
Assigning reviewers: R: @damccorm for label build. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
Other Github repos have this feature and when looking through the PRs from the main PR page you can quickly tell what size the PRs are and maybe review those first without clicking on PR to determine how large the changes are. Its a small workflow with little maintenance, but with added benefit. Thanks |
Have you checked if there is an existing Apache projects implementing PR sizes with third party Action? Ideally we can use one other than maintain our own; and we can put it into existing pr bot workflow (to just trigger one workflow per push) |
Found another Apache project - mynewt - that uses a third party action. Updated to that. Thanks. |
I'm fine adding this, particularly now that we've reafactored to use an external action. But the underlying principle I want us to be careful of is adding code that has limited value since code is a liability. |

Uh oh!
There was an error while loading. Please reload this page.