Skip to content

feat(ci): label pull requests by diff size - #2554

Draft
TheAnimatrix wants to merge 1 commit into
masterfrom
pr-size-labels
Draft

TheAnimatrix wants to merge 1 commit into
masterfrom
pr-size-labels

Conversation

@TheAnimatrix

Copy link
Copy Markdown
Collaborator

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

  • Tier 3. node --test scripts/pr-size.test.mjs passed 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 of ready and other labels.
  • actionlint .github/workflows/pr-size.yml passed.
  • Live GitHub label writes and external app behavior can be verified after rollout.

No issue

@coderabbitai

coderabbitai Bot commented Dec 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 1

  • ready

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 025b7e0a-8f13-4759-9583-4377f4e76562

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant