chore(#846): remove unused PR-size labeler (size/S–XL) workflow (#848)

The PR Gate workflow's only job, size-check, labeled every PR with
size/S–size/XL based on lines changed. Those labels aren't used in any
review, triage, or automation flow, so the workflow was pure noise.

- Delete .github/workflows/pr-gate.yml
- Drop size-check from required status checks in both rulesets so PRs
  don't block forever on a check that never reports
- Remove pr-gate.yml from INERT_WORKFLOWS (ci-test-scope.cjs) and the
  knownInert list (ci-test-scope.test.cjs)
- Remove "PR Gate / size-check" from setup-branch-protection.sh

Closes #846

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-06-07 22:03:48 -04:00
committed by GitHub
parent 543e51e71f
commit 606363c416
6 changed files with 1 additions and 77 deletions

View File

@@ -35,7 +35,6 @@
"strict_required_status_checks_policy": true,
"required_status_checks": [
{ "context": "Required tests" },
{ "context": "size-check" },
{ "context": "check-branch" },
{ "context": "changeset-lint" },
{ "context": "docs-lint" },

View File

@@ -32,7 +32,6 @@
"strict_required_status_checks_policy": true,
"required_status_checks": [
{ "context": "Required tests" },
{ "context": "size-check" },
{ "context": "check-branch" },
{ "context": "changeset-lint" },
{ "context": "docs-lint" },

View File

@@ -1,71 +0,0 @@
name: PR Gate
on:
pull_request:
types: [opened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
pull-requests: write
issues: write
jobs:
size-check:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Check PR size
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const files = await github.paginate(github.rest.pulls.listFiles, {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
per_page: 100,
});
const additions = files.reduce((sum, f) => sum + f.additions, 0);
const deletions = files.reduce((sum, f) => sum + f.deletions, 0);
const total = additions + deletions;
let label = '';
if (total <= 50) label = 'size/S';
else if (total <= 200) label = 'size/M';
else if (total <= 500) label = 'size/L';
else label = 'size/XL';
// Remove existing size labels
const existingLabels = context.payload.pull_request.labels || [];
const sizeLabels = existingLabels.filter(l => l.name.startsWith('size/'));
for (const staleLabel of sizeLabels) {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: staleLabel.name
}).catch(() => {}); // ignore if already removed
}
// Add size label
try {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: [label],
});
} catch (e) {
core.warning(`Could not add label: ${e.message}`);
}
if (total > 500) {
core.warning(`Large PR: ${total} lines changed (${additions}+ / ${deletions}-). Consider splitting.`);
}

View File

@@ -20,7 +20,6 @@ const INERT_WORKFLOWS = new Set([
'auto-backmerge.yml',
'close-draft-prs.yml',
'dismiss-unauthorized-pr-approvals.yml',
'pr-gate.yml',
'pr-target-validator.yml',
'pr-template-format.yml',
'require-issue-link.yml',

View File

@@ -61,13 +61,11 @@ REQUIRED_CHECKS_MAIN=(
"security-scan"
"Changeset Required / changeset-lint"
"Docs Required / docs-lint"
"PR Gate / size-check"
"Validate Branch Name / check-branch"
)
REQUIRED_CHECKS_NEXT=(
"test"
"PR Gate / size-check"
"Validate Branch Name / check-branch"
"Changeset Required / changeset-lint"
"Docs Required / docs-lint"

View File

@@ -343,7 +343,7 @@ describe('INERT_WORKFLOWS allowlist integrity guard', () => {
const knownInert = [
'stale.yml', 'branch-cleanup.yml', 'branch-naming.yml', 'auto-label-issues.yml',
'auto-branch.yml', 'auto-backmerge.yml', 'close-draft-prs.yml',
'dismiss-unauthorized-pr-approvals.yml', 'pr-gate.yml', 'pr-target-validator.yml',
'dismiss-unauthorized-pr-approvals.yml', 'pr-target-validator.yml',
'pr-template-format.yml', 'require-issue-link.yml', 'changeset-required.yml',
'docs-required.yml', 'discord-changelog.yml',
];