fix(ci): scope UI lint to the files a PR actually changed#34600
Merged
mateo-berri merged 1 commit intoJul 25, 2026
Conversation
`UI Lint / frontend-lint` collected its file list from `"$BASE_SHA"...HEAD`, where `BASE_SHA` is the base branch tip captured when the PR was opened and `HEAD` is the merge of the PR into the *current* base tip that actions/checkout leaves behind. The three-dot merge base of those two is `BASE_SHA` itself, so the diff spans every base-branch commit landed since the PR was opened. Any PR opened before an eslint violation landed on the base branch therefore fails on files it never touched. PR #34192 changes two Python files and no UI file at all, and the job still linted 283 dashboard files and failed on three `no-restricted-imports` antd errors from unrelated commits. Diffing the PR head against its own merge base gives exactly the files the PR changed, whether the checkout leaves HEAD on a merge commit or on the head commit.
Contributor
Greptile SummaryUpdates the UI lint workflow to select files by diffing the pull request head against its merge base with the pull request’s recorded base SHA.
Confidence Score: 5/5The pull request appears safe to merge, with no actionable defects identified in the changed workflow logic. The workflow now derives the comparison from the pull request’s explicit base and head commits rather than the synthetic checkout HEAD, preventing unrelated base-branch changes from entering the lint file list.
|
| Filename | Overview |
|---|---|
| .github/workflows/test-litellm-ui-lint.yml | Corrects changed-file selection so UI lint no longer includes unrelated commits added to the base branch after a pull request opened. |
Reviews (1): Last reviewed commit: "fix(ci): scope UI lint to the files a PR..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ryan-crabbe-berri
approved these changes
Jul 25, 2026
tin-berri
approved these changes
Jul 25, 2026
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.
TLDR
Problem this solves:
UI Lint / frontend-lintfails PRs on other people's filesHow it solves it:
Relevant issues
Blocks #34192
Linear ticket
Pre-Submission checklist
Screenshots / Proof of Fix
There is nothing to curl here; the change is to how a CI job selects files, so the proof is the job's own selection reproduced by hand against the exact commits it ran on.
The failing job is frontend-lint on #34192. That PR changes two Python files and no UI file. Its checkout step reports what the job is actually looking at:
so
HEADis the PR merged into the current base tip, whilegithub.event.pull_request.base.shais still28e93e42e5, the base tip from when the PR was opened.git diff "$BASE_SHA"...HEADtakes the merge base of those two, which is28e93e42e5itself, so the file list becomes every base-branch commit since. Reproduced locally on the same commits:$ git diff --name-only --diff-filter=ACMR 28e93e42e5 7b019cf152 -- ui/litellm-dashboard | wc -l 283283, matching the job log exactly:
All three errors are
no-restricted-importson antd inmodels-and-endpoints/add/page.tsx,models-and-endpoints/llm-credentials/page.tsx, andmodels-and-endpoints/vertexCredentialsUpload.ts, none of which #34192 touches. They are on the base branch today:With this change, the same job on the same commits selects nothing and short-circuits:
has_files=false, so the job logs "No lintable UI files changed in this PR; nothing to check" and passes, which is what it was written to do.Type
🐛 Bug Fix
🚄 Infrastructure
Changes
Collect changed filesusedgit diff "$BASE_SHA"...HEAD. The three-dot form resolves to the merge base of its two endpoints, and for apull_requestevent those endpoints are the base tip from PR-open time and a merge commit that already contains the current base tip. The merge base of those is the older base tip, so the diff is "everything on the base branch since this PR was opened, plus the PR", not "the PR".It now resolves the merge base from the PR's own head sha and diffs from there, which is the PR's changes and nothing else, and does not depend on whether the checkout leaves
HEADon a merge commit or on the head commit.The blast radius of the old behaviour grows with PR age: a PR is red the moment any eslint error lands on the base branch after it was opened, in a file its author never touched, and the only way out was to reopen the PR. Prettier had the same exposure, and the wasted work is real too, since 283 files were being formatted and linted for a PR that changed none of them.
The same
"$BASE_SHA"...HEADidiom appears intest-linting.ymland, asvitest --changed "$BASE_SHA", intest-litellm-ui-unit.yml. Those are over-inclusive in the same way but currently fail open rather than closed (they run extra checks rather than reporting foreign violations as yours), so they are left alone here to keep this PR to the one job that is failing.Final Attestation