ci: skip backend unit tests on ui-only PRs without stranding required checks - #32532
Conversation
… checks Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Greptile SummaryThis PR fixes a branch-protection deadlock introduced by #32422: removing
Confidence Score: 5/5Safe to merge — changes are confined to CI configuration, with no production code or test logic altered. All 12 workflows are updated consistently: 10 via the reusable base and 2 inline. Every error path in the composite action defaults to run, so tests can never be silently skipped due to a classification failure. The fallback logic is also exercised by this PR itself (.github/** is classified as backend, so all jobs run normally). The upload-coverage gating via job outputs is wired correctly in the base workflow. No application code is touched. No files require special attention; the most critical logic lives in .github/actions/detect-backend-changes/action.yml and .github/workflows/_test-unit-base.yml, both of which look correct.
|
| Filename | Overview |
|---|---|
| .github/actions/detect-backend-changes/action.yml | New composite action that classifies PR changes via classify_changes.sh and exposes decision=run |
| .github/workflows/_test-unit-base.yml | Adds detect-backend-changes step after checkout, gates Install dependencies / Generate Prisma / Run tests / Save coverage on decision != skip, and gates upload-coverage job via job outputs |
| .github/workflows/test-unit-documentation.yml | Removes paths-ignore and adds inline detect-backend-changes step with step-level guards on install, prisma, and test steps |
| .github/workflows/test-unit-proxy-legacy.yml | Removes paths-ignore and adds inline detect-backend-changes step with step-level guards; matrix jobs each independently run the detection |
| .github/workflows/test-unit-core-utils.yml | paths-ignore block removed; skipping logic now lives entirely in the reusable _test-unit-base.yml |
| .github/workflows/test-unit-proxy-db.yml | paths-ignore block removed; inherits skip logic from reusable base workflow |
Reviews (1): Last reviewed commit: "ci: skip backend unit tests on ui-only P..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…only PRs Extends the detect-relevant-changes gate from #32532 to the remaining slow PR checks so docs/ui-only PRs finish in seconds while still reporting green required checks. lint, code-quality and mcp use the backend category (skip on ui-only and docs-only); server-root-path uses the client category (skip only on pure-docs since it is a UI-serving e2e). Also guards the last unguarded CircleCI job, using_litellm_on_windows, which was running on every PR. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Relevant issues
Re-does #32422 correctly and supersedes the straight revert in #32530
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
Screenshots / Proof of Fix
This is a CI trigger change, so there is no proxy or LLM surface to curl; the proof is the workflow config plus how the checks behave
The classification is the exact same script CircleCI uses (
.circleci/scripts/classify_changes.sh backend), so the skip set is identical to CircleCI. Verified locally atHEAD:This PR itself only touches
.github/, which classifies asrun, so everytest-unit-*job on this PR executes the full suite; that is the regression proof that backend PRs are unaffected. A UI-only PR like #32502 will now run each job, hitdecision=skip, and report the required check green in seconds instead of leaving it stuck on "Expected; waiting for status to be reported"Type
🚄 Infrastructure
Changes
#32422 added
paths-ignore: [ui/**, **.md, **.mdx]to thepull_requesttrigger of the 12test-unit-*.ymlworkflows so UI-only and docs-only PRs would not pay for the backend suites. The problem is that those job names (core-utils / Run tests,auth-checks / Run tests, and so on) are configured as required status checks in branch protection.paths-ignorestops the whole workflow from ever starting, so on a UI-only PR the required contexts are never reported and the PR sits forever on "Expected; waiting for status to be reported" (see #32502). GitHub only treats a required check as satisfied when the job actually runs and reports a conclusion; a workflow that never triggers is not the same as a skipped jobThis is exactly the difference from CircleCI, where the equivalent filter runs inside the job (
.circleci/scripts/path_filter.shcallscircleci-agent step halt), so the job still completes green. Mirroring that, this PR dropspaths-ignorefrom all 12 workflows and instead short-circuits the expensive steps inside each job:.github/actions/detect-backend-changesdiffs the PR againstgithub.event.pull_request.base.shaand pipes the changed files through the sameclassify_changes.sh backendscript CircleCI uses, exposingdecision=run|skip. It defaults torunfor non pull_request events or whenever the base or diff cannot be resolved, so tests are never skipped when classification is uncertain_test-unit-base.yml(the reusable base behind 10 of the workflows) runs the detect step right after checkout and gatesInstall dependencies,Generate Prisma client,Run testsand coverage ondecision != 'skip'; theupload-coveragejob is gated the same waytest-unit-documentation.ymlandtest-unit-proxy-legacy.ymldo not use the reusable base, so they get the same detect step and step-level guards inlineThe net effect is that the jobs always start and always report a conclusion, so required checks are satisfied on every PR, but on a UI-only or docs-only PR they skip the uv sync, prisma generate and pytest steps and finish in seconds. Backend PRs behave exactly as before
Link to Devin session: https://app.devin.ai/sessions/01543c7d72924959bdd52dc138bb4a20
Requested by: @mateo-berri