Repository navigation
ci: automatically label each PR with a code-size bucket - #3941
Merged
Merged
Conversation
eablack
reviewed
Sep 22, 2026
eablack
left a comment
Contributor
There was a problem hiding this comment.
Automated review findings for the new pr-size-label.yml workflow, posted inline below (most severe first). The line 39 runner-pool exposure is the one worth gating the merge on.
- Serialize with cancel-in-progress: false so an in-flight label/comment reconcile always completes rather than being cancelled mid-update. - Capture the changed-files read up front and degrade to a clean skip on API failure, so a failed read can never be misread as churn=0 (size/XS). - Create only the size label actually applied (via ensure_label) instead of all six on every event, routed through try() for a visible warning. - Add --paginate + a guard to the labels read (a >30-label PR would drop a stale size/* and leave two size labels; a failed read would abort). - Guard the XL-nudge comments read so a transient failure can't abort the step under set -e.
michaelmalave
had a problem deploying
to
AcceptanceTests
September 22, 2026 22:35 — with
GitHub Actions
Failure
Switch the trigger from pull_request to a hardened pull_request_target job, per review feedback. The job runs on the org's IP-allow-listed runner pool; under pull_request_target the workflow definition comes from the base branch, so a fork contributor can no longer edit this file to inject run: steps onto that runner network. Safe because the job never checks out PR head code and references only trusted, non-text context (repository slug, PR number). Update the try() comment: under pull_request_target the GITHUB_TOKEN is read-write even for fork PRs, so try() now guards transient failures rather than a read-only fork token.
eablack
approved these changes
Sep 23, 2026
This branch was successfully deployed
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.
Summary
This adds a small GitHub Actions workflow that automatically tags every pull request with a size label (
size/XSthroughsize/XL) so reviewers can see how big a PR is before they open it. The size is based only on lines of code changed — documentation, the lockfile, and generated files don't count — so a big docs update or a lockfile bump won't make a small code change look large. The label is purely informational: it never blocks a PR from merging.What it does, step by step:
docs/,*.md,package-lock.json,autocomplete-scripts/, anddist/when counting, so the size reflects code a person actually has to review.docslabel when documentation changed, tracked independently of size.Comments on the PR
The workflow posts a comment only when a PR is XL (1000+ lines of code churn) — no other size gets a comment. It's posted once, and it's automatically deleted if the PR is later updated and drops below XL. The comment is a suggestion, not a gate; the check still passes either way. The exact text is:
The workflow is plain bash using the built-in
ghCLI (the same zero-dependency style aspr-title-check.yml); it pulls in no third-party actions.Type of Change
Breaking Changes (major semver update)
!after your change type to denote a change that breaks current behaviorFeature Additions (minor semver update)
Patch Updates (patch semver update)
Testing
Steps:
size/*label to be applied automatically. Since this change touches nodocs/or*.mdfiles, nodocslabel should appear. (This PR is size/M, so no comment is posted.)docs/*.mdfile — expect thedocslabel to show up while the size label stays driven by code changes only.Screenshots (if applicable)
Related Issues
GitHub issue: none
GUS work item: none