Repository navigation
feat(ci): label pull requests by diff size - #2554
Draft
TheAnimatrix wants to merge 1 commit into
Draft
TheAnimatrix wants to merge 1 commit into
TheAnimatrix wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Reviewers have to inspect each PR to get a sense of its size.
Change
Apply one size label when a PR opens, reopens, receives a push, or is edited. The tiers are XS (0–9), S (10–29), M (30–99), L (100–499), XL (500–999), and XXL (1,000+).
Count additions and deletions from the merge base with Git's whitespace and blank-line filters. Binary files contribute zero lines. Test lines are excluded when non-test lines count. Otherwise, test lines set the size.
The workflow executes code from the trusted base and fetches the PR head only for comparison. Its label writes are limited to the six size tiers. Inspired by the T3 Code workflow.
Verification
node --test scripts/pr-size.test.mjspassed all three tests. A real Git fixture covers divergent branches, whitespace, binary files, renames, and test-only and mixed changes. A local API simulation verifies stale size label removal and preservation ofreadyand other labels.actionlint .github/workflows/pr-size.ymlpassed.No issue