Skip to content

Increase PR size thresholds to accommodate AI-assisted development#2136

Merged
aknysh merged 3 commits intomainfrom
osterman/pr-size-recommendations
Mar 4, 2026
Merged

Increase PR size thresholds to accommodate AI-assisted development#2136
aknysh merged 3 commits intomainfrom
osterman/pr-size-recommendations

Conversation

@osterman
Copy link
Member

@osterman osterman commented Mar 3, 2026

what

Updated PR size tier thresholds to better reflect modern AI-assisted development:

  • Medium: 500 → 1,000 lines
  • Large: 1,000 → 5,000 lines
  • Extra Large: new tier (5,001–10,000 lines)
  • Extra Extra Large: new tier (>10,000 lines, triggers warning)

why

Previously, any PR >1,000 lines triggered a Mergify warning. With Claude-assisted development, PRs naturally grow while remaining focused on single, logical changes. The new thresholds reflect this reality: PRs under a few thousand lines are ideal, only those exceeding 10,000 are flagged as too large and should be split into smaller PRs.

changes

  • Added xl_max_size and xxl_label inputs to PR size action
  • Updated workflow to use new threshold values (1,000/5,000/10,000)
  • Migrated Mergify warning from size/xl to size/xxl (>10,000 lines)
  • Documented guidelines in CLAUDE.md for Claude agents

Summary by CodeRabbit

  • New Features

    • Added XXL size label category for pull requests exceeding 10,000 lines of changes.
    • Introduced optional CI/CD failure when XXL-sized PRs are detected.
  • Chores

    • Updated Medium and Large PR size thresholds (Medium: 500→1,000 lines; Large: 1,000→5,000 lines).
    • Adjusted automated review warning message to reflect higher recommended PR size limit.

Updated size tier breakpoints:
- Medium: 500 → 1,000 lines
- Large: 1,000 → 5,000 lines
- Extra Large: new tier at 5,001–10,000 lines
- Extra Extra Large: new tier at >10,000 lines (triggers warning)

Previously, any PR >1,000 lines triggered a Mergify warning. With AI assistance, PRs naturally grow larger while remaining focused. The new thresholds reflect this: PRs under a few thousand lines are ideal, only those exceeding 10,000 are flagged.

Changes:
- .github/actions/pr-sizer/action.yml: Add xl_max_size, xxl_label, fail_if_xxl inputs and logic
- .github/workflows/pr-size-labeler.yml: Update thresholds and pass new inputs
- .github/mergify.yml: Retarget warning from size/xl to size/xxl
- CLAUDE.md: Document PR size guidelines for Claude agents

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@osterman osterman requested review from a team as code owners March 3, 2026 23:16
The GitHub Action and Mergify rules already enforce these limits.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the size/s Small size PR label Mar 3, 2026
@mergify
Copy link

mergify bot commented Mar 3, 2026

Important

Cloud Posse Engineering Team Review Required

This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.

To expedite this process, reach out to us on Slack in the #pr-reviews channel.

@mergify mergify bot added triage Needs triage needs-cloudposse Needs Cloud Posse assistance labels Mar 3, 2026
@github-actions
Copy link

github-actions bot commented Mar 3, 2026

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 3, 2026

📝 Walkthrough

Walkthrough

Extends the PR size-labeling system to support XXL category by increasing size thresholds, adding XXL-specific configuration options to the pr-sizer action, and updating Mergify rules to comment on XXL-labeled PRs with adjusted sizing guidance.

Changes

Cohort / File(s) Summary
PR Sizer Action
.github/actions/pr-sizer/action.yml
Adds XXL sizing support with new inputs (xl_max_size, xxl_label, fail_if_xxl), extends label-determination logic to handle XXL category, includes xxl_label in label aggregation, and optionally fails when XXL threshold is exceeded.
PR Size Labeler Workflow
.github/workflows/pr-size-labeler.yml
Increases thresholds: m_max_size (500→1000), l_max_size (1000→5000); adds xl_max_size: 10000, xxl_label, and fail_if_xxl inputs; adds go.sum to ignored files.
Mergify Automation
.github/mergify.yml
Shifts PR comment trigger from size/xl to size/xxl label and updates warning message threshold from 1,000 to 10,000 lines.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

no-release

Suggested reviewers

  • aknysh
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: increasing PR size thresholds to support AI-assisted development workflows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch osterman/pr-size-recommendations

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/actions/pr-sizer/action.yml (1)

206-214: Minor observation: identical error messages.

Both XL and XXL failures use the same message. Consider differentiating them (e.g., mentioning the threshold exceeded) for easier debugging. Not blocking.

💡 Optional: differentiate error messages
          // Fail if XL and configured to do so
          if (newLabel === xl_label && fail_if_xl) {
-           core.setFailed(`PR is too large (${totalChanges} changes). Please consider breaking it up into smaller PRs.`);
+           core.setFailed(`PR exceeds XL threshold (${totalChanges} changes, limit ${xl_max_size}). Please consider breaking it up into smaller PRs.`);
          }

          // Fail if XXL and configured to do so
          if (newLabel === xxl_label && fail_if_xxl) {
-           core.setFailed(`PR is too large (${totalChanges} changes). Please consider breaking it up into smaller PRs.`);
+           core.setFailed(`PR exceeds XXL threshold (${totalChanges} changes, limit ${xl_max_size}). Please consider breaking it up into smaller PRs.`);
          }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/actions/pr-sizer/action.yml around lines 206 - 214, The two
core.setFailed calls for XL and XXL use identical messages; update them to
include the label/threshold so failures are distinguishable: when newLabel ===
xl_label && fail_if_xl, call core.setFailed with a message that mentions
xl_label and the XL threshold (e.g., "PR is too large (XL threshold: X changes,
actual: ${totalChanges})."), and when newLabel === xxl_label && fail_if_xxl,
call core.setFailed with a message that mentions xxl_label and the XXL threshold
similarly; use the existing variables (newLabel, xl_label, xxl_label,
fail_if_xl, fail_if_xxl, totalChanges) to build the distinct messages.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/actions/pr-sizer/action.yml:
- Around line 206-214: The two core.setFailed calls for XL and XXL use identical
messages; update them to include the label/threshold so failures are
distinguishable: when newLabel === xl_label && fail_if_xl, call core.setFailed
with a message that mentions xl_label and the XL threshold (e.g., "PR is too
large (XL threshold: X changes, actual: ${totalChanges})."), and when newLabel
=== xxl_label && fail_if_xxl, call core.setFailed with a message that mentions
xxl_label and the XXL threshold similarly; use the existing variables (newLabel,
xl_label, xxl_label, fail_if_xl, fail_if_xxl, totalChanges) to build the
distinct messages.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4f0f243 and 98135a0.

📒 Files selected for processing (3)
  • .github/actions/pr-sizer/action.yml
  • .github/mergify.yml
  • .github/workflows/pr-size-labeler.yml

@mergify mergify bot removed the triage Needs triage label Mar 3, 2026
@osterman osterman added the patch A minor, backward compatible change label Mar 3, 2026
@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.58%. Comparing base (8cd0056) to head (405d94e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2136   +/-   ##
=======================================
  Coverage   76.57%   76.58%           
=======================================
  Files         832      832           
  Lines       79500    79500           
=======================================
+ Hits        60879    60885    +6     
+ Misses      14822    14817    -5     
+ Partials     3799     3798    -1     
Flag Coverage Δ
unittests 76.58% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@osterman osterman added no-release Do not create a new release (wait for additional code changes) and removed patch A minor, backward compatible change labels Mar 4, 2026
@aknysh aknysh merged commit 9e15b0c into main Mar 4, 2026
127 of 129 checks passed
@aknysh aknysh deleted the osterman/pr-size-recommendations branch March 4, 2026 05:45
@mergify mergify bot removed the needs-cloudposse Needs Cloud Posse assistance label Mar 4, 2026
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

These changes were released in v1.208.1-test.0.

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

Labels

no-release Do not create a new release (wait for additional code changes) size/s Small size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants