Skip to content

chore(ci): add optimized PR size labeler and batch workflows#27616

Merged
sripasg merged 5 commits into
mainfrom
sripas_pr_labeler
Jun 2, 2026
Merged

chore(ci): add optimized PR size labeler and batch workflows#27616
sripasg merged 5 commits into
mainfrom
sripas_pr_labeler

Conversation

@sripasg

@sripasg sripasg commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Introduces two workflows to automatically categorize Pull Requests by size:

  1. 'PR Size Labeler' (.github/workflows/pr-size-labeler.yml) which runs on
    PR events (opened, synchronized, reopened) and manual triggers.
  2. 'PR Size Labeler (Batch)' (.github/workflows/pr-size-labeler-batch-run.yml)
    which retroactively labels existing PRs via manual triggers.

Details

The system consists of two GitHub Action workflows that operate completely
server-side using the GitHub API via the 'gh' CLI, removing the need to
locally checkout the repository.

  1. PR Size Labeler (.github/workflows/pr-size-labeler.yml)
    • Triggers: Automatically runs when a Pull Request is opened, synchronized
      (new commits pushed), or reopened. It can also be triggered manually via
      workflow_dispatch by providing an optional PR number.
    • Label Synchronization: Inspects current PR changes and determines the
      correct size label based on total modifications (additions + deletions):
      • size/XS: < 10 lines (Green, #7ee081)
      • size/S: 10-49 lines (Yellow-green, #a6d49f)
      • size/M: 50-249 lines (Amber/Yellow, #f7d070)
      • size/L: 250-999 lines (Orange, #f48c06)
      • size/XL: >= 1000 lines (Red, #dc2f02)
    • Execution Flow:
      • Dynamically creates any of the five size labels in the repository if they
        are not already present.
      • Fetches additions, deletions, changed files, and existing labels in a
        single GitHub API query.
      • Compares the calculated size to existing labels and executes a single
        atomic edit call only if a label change is required.
      • Locates any previous size comment left on the PR by the actions bot and
        updates it inline, leaving exactly one clean status comment in the thread.
  2. PR Size Labeler (Batch) (.github/workflows/pr-size-labeler-batch-run.yml)
    • Triggers: Triggered manually via workflow_dispatch to retroactively label
      historical pull requests.
    • Inputs:
      • process_all: Boolean option to specify whether to check all PR states
        (open and closed) or open PRs only.
      • limit: Numerical limit to control the maximum number of PRs to query
        (defaults to 100).
    • Execution Flow:
      • Ensures target labels exist in the repository.
      • Fetches the metadata (additions, deletions, and current labels) for all
        eligible PRs within the specified limit in a single consolidated request.
      • Iterates over the retrieved PR list, evaluates size categories locally
        in-memory, and executes updates only for PRs missing the correct size
        label.

Related Issues

How to Validate

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • [NA] Added/updated tests (if needed)
  • [NA] Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@sripasg sripasg requested a review from a team as a code owner June 1, 2026 17:04
@sripasg sripasg self-assigned this Jun 1, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

Size Change: -4 B (0%)

Total Size: 33.9 MB

Filename Size Change
./bundle/chunk-2ZNZY6FX.js 0 B -661 kB (removed) 🏆
./bundle/chunk-4KIJYQQE.js 0 B -3.43 kB (removed) 🏆
./bundle/chunk-5PYQ7P63.js 0 B -13 kB (removed) 🏆
./bundle/chunk-AEV5UYAB.js 0 B -2.79 MB (removed) 🏆
./bundle/chunk-B7R6XI5G.js 0 B -16.4 MB (removed) 🏆
./bundle/chunk-K72XX2E7.js 0 B -49.2 kB (removed) 🏆
./bundle/chunk-QJRSH2IZ.js 0 B -19.5 kB (removed) 🏆
./bundle/chunk-UNWH6YNJ.js 0 B -3.77 kB (removed) 🏆
./bundle/core-VTGYNJFK.js 0 B -49.5 kB (removed) 🏆
./bundle/devtoolsService-CUIUJEQQ.js 0 B -28 kB (removed) 🏆
./bundle/gemini-NVEATSIL.js 0 B -589 kB (removed) 🏆
./bundle/interactiveCli-ZSZ4C6LE.js 0 B -1.3 MB (removed) 🏆
./bundle/liteRtServerManager-EMK7KKTW.js 0 B -2.08 kB (removed) 🏆
./bundle/oauth2-provider-A7BXI4FA.js 0 B -9.12 kB (removed) 🏆
./bundle/chunk-5CHBRVEF.js 16.4 MB +16.4 MB (new file) 🆕
./bundle/chunk-7XFWZPIG.js 19.5 kB +19.5 kB (new file) 🆕
./bundle/chunk-FMKJADAS.js 2.79 MB +2.79 MB (new file) 🆕
./bundle/chunk-KDKRYS4R.js 3.43 kB +3.43 kB (new file) 🆕
./bundle/chunk-KNIJ5IHS.js 3.77 kB +3.77 kB (new file) 🆕
./bundle/chunk-UWFLD76N.js 661 kB +661 kB (new file) 🆕
./bundle/chunk-V326J6FY.js 13 kB +13 kB (new file) 🆕
./bundle/chunk-WUMGIO3N.js 49.2 kB +49.2 kB (new file) 🆕
./bundle/core-BBK43TNB.js 49.5 kB +49.5 kB (new file) 🆕
./bundle/devtoolsService-AEAZ4CJC.js 28 kB +28 kB (new file) 🆕
./bundle/gemini-DKHJWPLA.js 589 kB +589 kB (new file) 🆕
./bundle/interactiveCli-DGJSEDWW.js 1.3 MB +1.3 MB (new file) 🆕
./bundle/liteRtServerManager-XS5RIGC3.js 2.08 kB +2.08 kB (new file) 🆕
./bundle/oauth2-provider-CVNJSFSD.js 9.12 kB +9.12 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
./bundle/bundled/third_party/index.js 8 MB 0 B
./bundle/chunk-34MYV7JD.js 2.45 kB 0 B
./bundle/chunk-5AUYMPVF.js 858 B 0 B
./bundle/chunk-5PS3AYFU.js 1.18 kB 0 B
./bundle/chunk-6HI7VNOG.js 124 kB 0 B
./bundle/chunk-DAHVX5MI.js 206 kB 0 B
./bundle/chunk-IUUIT4SU.js 56.5 kB 0 B
./bundle/chunk-TUDYL3X4.js 40.3 kB 0 B
./bundle/cleanup-URP3CAQI.js 0 B -902 B (removed) 🏆
./bundle/devtools-V7NE4CQA.js 696 kB 0 B
./bundle/events-XB7DADIJ.js 418 B 0 B
./bundle/examples/hooks/scripts/on-start.js 188 B 0 B
./bundle/examples/mcp-server/example.js 1.43 kB 0 B
./bundle/gemini.js 5.38 kB 0 B
./bundle/getMachineId-bsd-TXG52NKR.js 1.55 kB 0 B
./bundle/getMachineId-darwin-7OE4DDZ6.js 1.55 kB 0 B
./bundle/getMachineId-linux-SHIFKOOX.js 1.34 kB 0 B
./bundle/getMachineId-unsupported-5U5DOEYY.js 1.06 kB 0 B
./bundle/getMachineId-win-6KLLGOI4.js 1.72 kB 0 B
./bundle/https-proxy-agent-AVGR4LHR.js 490 B 0 B
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B
./bundle/src-LG4OHBW7.js 233 kB 0 B
./bundle/src-QVCVGIUX.js 47 kB 0 B
./bundle/start-VZ3UIXLN.js 0 B -622 B (removed) 🏆
./bundle/tree-sitter-7U6MW5PS.js 274 kB 0 B
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB 0 B
./bundle/worker/worker-entry.js 361 kB 0 B
./bundle/cleanup-LSBQDTAF.js 902 B +902 B (new file) 🆕
./bundle/start-5BO5KESU.js 622 B +622 B (new file) 🆕

compressed-size-action

@sripasg sripasg requested review from a team as code owners June 1, 2026 17:13
@github-actions github-actions Bot added the size/l A large sized PR label Jun 1, 2026
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

📊 PR Size: size/L

  • Lines changed: 257
  • Additions: +256
  • Deletions: -1
  • Files changed: 3

@gemini-cli gemini-cli Bot added the priority/p1 Important and should be addressed in the near term. label Jun 1, 2026
@sripasg sripasg added this pull request to the merge queue Jun 2, 2026
Merged via the queue into main with commit 5110bdf Jun 2, 2026
31 of 32 checks passed
@sripasg sripasg deleted the sripas_pr_labeler branch June 2, 2026 02:22
whhe pushed a commit to whhe/gemini-cli that referenced this pull request Jun 4, 2026
hotmanxp pushed a commit to hotmanxp/gemini-cli that referenced this pull request Jun 4, 2026
rfcclub pushed a commit to rfcclub/gemini-cli that referenced this pull request Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority/p1 Important and should be addressed in the near term. size/l A large sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants