fix(ci): use whitespace-insensitive PR size diff#1500
fix(ci): use whitespace-insensitive PR size diff#1500juliusmarminge merged 3 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
.github/workflows/pr-size.yml
Outdated
| "--numstat", | ||
| "--ignore-all-space", | ||
| "--ignore-blank-lines", | ||
| "--no-renames", |
There was a problem hiding this comment.
This will break any PR's that explicitly rename a file. We'll get an overcalculated number of additions/deletions (counting each and every line of the renamed file). However, I believe Codex added this to make parsing the numstat easier. If desired, we can remove this flag and add additional parsing for renames. Or just leave this as is and keep rename calculations being off as an acceptable risk.
There was a problem hiding this comment.
should be good now
There was a problem hiding this comment.
Well, that certainly is one way to do it. Now we're not parsing the filename from numstat at all. I think that should be good, yeah.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

What Changed
Use a whitespace-insensitive diff for PR size labels.
Why
GitHub's raw diff counts can overcount whitespace-only changes.
Checklist
Warning
this might be a hallucination from codex
Note
Medium Risk
Changes PR size labeling logic in CI to compute diff stats locally with
git diff, which could shift size labels and depends on correct ref fetching inpull_request_targetruns.Overview
Updates the
PR SizeGitHub Action to compute effective changed lines using a localgit diff --numstatthat ignores whitespace and blank-line-only changes, instead of relying on the GitHubpulls.listFilesAPI.The workflow now checks out and fetches base/head refs for the PR (avoiding the 3,000-file API truncation risk), excludes test files via git pathspec excludes, and logs a warning if the fetched head SHA differs from the PR’s reported head SHA.
Written by Cursor Bugbot for commit 0dbdc0e. This will update automatically on new commits. Configure here.
Note
Fix PR size labeling to use whitespace-insensitive
git diff --numstatgit diff --numstat --ignore-all-space --ignore-blank-linesto compute line change counts in pr-size.yml.refs/pull/<number>/head) so the diff runs locally.:(glob,exclude)patterns passed directly to the diff command.Macroscope summarized 0dbdc0e.