Skip to content

ci: run the dashboard API types and Terraform endpoint checks on every change that can alter the spec - #49022

Merged
mateo-berri merged 8 commits into
BerriAI:mainfrom
tavren27:litellm_ui_api_types_check_all_spec_inputs
Oct 29, 2026
Merged

mateo-berri merged 8 commits into
BerriAI:mainfrom
tavren27:litellm_ui_api_types_check_all_spec_inputs

Conversation

@tavren27

@tavren27 tavren27 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

The dashboard API types check only ran when a PR touched litellm/proxy/ or litellm/types/, so a PR that changed a response model anywhere else skipped it and merged with schema.d.ts stale. Every later proxy PR then failed the required lint passed on drift it didn't cause

This runs the check on any change under litellm/ or enterprise/ and on dependency pin changes, since each can change the OpenAPI spec. make check gets the same fix, and the Terraform provider's endpoint audit now runs on enterprise/ route changes

Original

TLDR

Problem this solves:

How it solves it:

  • The CI filter now matches litellm/, enterprise/, pyproject.toml, and uv.lock
  • make check uses the same trigger set, minus the workflow file itself
  • The Terraform provider audit now also runs on enterprise/ changes
  • Tests run the workflow's real detection step and check both trigger lists pick the same files

User Flow

Before: a PR that changes a response model outside litellm/proxy/ or litellm/types/ merges with stale dashboard types

  1. A contributor opens a PR that only changes litellm/tracing/generated/models.py, adding a trace table name
  2. The lint / ui-api-types check prints "nothing to verify" and passes, so the PR merges without a regenerated schema.d.ts
  3. The next PR that touches litellm/proxy/ runs the check against main, and it fails with "Generated API types are out of sync with the proxy OpenAPI spec"
  4. lint passed is red on that PR until someone regenerates the types on main

After: the same PR gets the failure itself before it merges

  1. A contributor opens the same PR
  2. The lint / ui-api-types check regenerates the types and fails with "Generated API types are out of sync with the proxy OpenAPI spec" and the npm run gen:api hint
  3. They run npm run gen:api, commit schema.d.ts, and the check passes
  4. Later PRs that touch litellm/proxy/ stay green

A PR that only adds a management route under enterprise/ now also runs the Terraform provider audit, which it used to skip

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

Screenshots / Proof of Fix

Last updated: ee7e45f. QA ran on 5b50007 (CI legs), 538c01d (make check legs), and 40b70c9 (Terraform legs). Changes after the first two: a main merge, comment and docs edits, tests, and the Terraform paths. Then a test moved files. Proof remains valid because the merge left the workflow, script, generator, and models.py unchanged, and the Terraform paths have their own legs. Verification: the make check tests pass at the tip

This ran the real lint / ui-api-types job on GitHub's runners. On a fork I opened the same one-line PR into a copy of main and into a copy of this branch, adding "llm_traces" to the trace table names in litellm/tracing/generated/models.py. Only the workflow file GitHub runs from the merge commit differs

Leg PR base PR diff Job result
Before main d9c9d84298 models.py passed, check skipped (job)
After this branch 5b50007f9e models.py failed on drift (job)
After, types regenerated this branch 5b50007f9e models.py, schema.d.ts passed (job)
make check before main 3f5e42d032 staged models.py type sync skipped
make check after this branch 538c01dc66 staged models.py failed on stale types
Terraform before main 3f5e42d032 enterprise route audit not started (PR)
Terraform after this branch 40b70c919e enterprise route failed on the new route (job)
Steps to reproduce the CI and make check legs

Steps, from a clone with a fork remote fork (use origin/main for the before leg and this PR's branch for the after leg as $base):

  1. git push fork $base:refs/heads/litellm_qa_base && git switch --detach $base
  2. sed -i 's/"spend_logs"\]/"spend_logs", "llm_traces"]/' litellm/tracing/generated/models.py && git commit -qam "feat(tracing): add the llm_traces trace table name" && git push fork HEAD:refs/heads/litellm_qa_pr
  3. gh pr create -R <fork> --base litellm_qa_base --head litellm_qa_pr --fill, then open the lint / ui-api-types job
  4. For the last row, cd ui/litellm-dashboard && npm run gen:api, commit src/lib/http/schema.d.ts, and push
Terraform legs: the probe PR, then what each base started

On the same fork I opened a PR into a copy of main and one into a copy of this branch. Each adds one route to enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py:

@router.get("/project/qa_probe")
async def project_qa_probe() -> dict:
    return {}

Before (PR). Seven workflows started and the Terraform Provider workflow is not one of them:

$ gh api "repos/tavren27/litellm/actions/runs?head_sha=d997513878fae2070b7922e3a36a0530e5bf6166&per_page=50" --jq ".workflow_runs[].name" | sort
Conventional PR Title
Cost map guard
GitHub Actions Security Analysis
OSV Scan
lint
smoke
unit

After. The Terraform Provider workflow started, and its endpoint audit fails on the route:

$ gh api "repos/tavren27/litellm/actions/runs?head_sha=77502f8f6c5bf8ce185678429870b88050e91dad&per_page=50" --jq ".workflow_runs[].name" | sort
Conventional PR Title
Cost map guard
GitHub Actions Security Analysis
OSV Scan
Terraform Provider
lint
smoke
unit

$ gh api repos/tavren27/litellm/actions/jobs/123476262556/logs | grep -A3 'provider coverage gaps' | cut -d' ' -f2-
error: provider coverage gaps:
  uncovered management endpoint: GET /project/qa_probe has no provider resource or data source; add coverage or allowlist it with a reason
exit status 1
##[error]Process completed with exit code 1.

After, the headline case. The job now runs, and its stale-types step fails:

$ gh api repos/tavren27/litellm/actions/jobs/123289127205/logs | grep -A6 'Z ##\[error\]Generated API types' | cut -d' ' -f2-
##[error]Generated API types are out of sync with the proxy OpenAPI spec.

A backend route or model changed without regenerating the dashboard types.
To fix, run from ui/litellm-dashboard:
  npm run gen:api
then commit the updated src/lib/http/schema.d.ts.
##[error]Process completed with exit code 1.
After: the drift the same step printed above the error
diff --git a/ui/litellm-dashboard/src/lib/http/schema.d.ts b/ui/litellm-dashboard/src/lib/http/schema.d.ts
index a49f1099..5d3bdc65 100644
--- a/ui/litellm-dashboard/src/lib/http/schema.d.ts
+++ b/ui/litellm-dashboard/src/lib/http/schema.d.ts
@@ -47767,7 +47767,7 @@ export interface components {
              * Table
              * @enum {string}
              */
-            table: "otel_traces" | "agent_traces_by_key" | "spend_logs";
+            table: "otel_traces" | "agent_traces_by_key" | "spend_logs" | "llm_traces";
             /** Truncated */
             truncated: boolean;
         };
@@ -47831,7 +47831,7 @@ export interface components {
              * Table
              * @enum {string}
              */
-            table: "otel_traces" | "agent_traces_by_key" | "spend_logs";
+            table: "otel_traces" | "agent_traces_by_key" | "spend_logs" | "llm_traces";
             /** Truncated */
             truncated: boolean;
         };
@@ -47856,7 +47856,7 @@ export interface components {
              * Table
              * @enum {string}
              */
-            table: "otel_traces" | "agent_traces_by_key" | "spend_logs";
+            table: "otel_traces" | "agent_traces_by_key" | "spend_logs" | "llm_traces";
             /** Type */
             type: string;
         };
@@ -47884,7 +47884,7 @@ export interface components {
              * Name
              * @enum {string}
              */
-            name: "otel_traces" | "agent_traces_by_key" | "spend_logs";
+            name: "otel_traces" | "agent_traces_by_key" | "spend_logs" | "llm_traces";
         };
         /** TraceSQLResponse */
         TraceSQLResponse: {
##[error]Generated API types are out of sync with the proxy OpenAPI spec.

A backend route or model changed without regenerating the dashboard types.
To fix, run from ui/litellm-dashboard:
  npm run gen:api
then commit the updated src/lib/http/schema.d.ts.
##[error]Process completed with exit code 1.
Before: the check is skipped and the job passes
$ gh api repos/tavren27/litellm/actions/jobs/123289114045/logs | grep 'nothing to verify.$' | tail -1 | cut -d' ' -f2-
No proxy, types or generator changes in this pull request, nothing to verify.
$ gh api repos/tavren27/litellm/actions/runs/40826015654/jobs --jq '.jobs[] | select(.name|test("ui-api-types")) | .steps[] | [.name,.conclusion] | @tsv'
Set up job	success
Checkout repository	success
Detect changes that can affect the generated types	success
Set up Python	skipped
Set up uv	skipped
Cache uv dependencies	skipped
Cache the Rust build	skipped
Install backend dependencies	skipped
Cache Prisma binaries	skipped
Generate Prisma client	skipped
Regenerate the lazy OpenAPI snapshot	skipped
Fail if the lazy OpenAPI snapshot is stale	skipped
Set up Node.js	skipped
Install dashboard dependencies	skipped
Regenerate types from the live spec	skipped
Fail if types are stale	skipped
Post Checkout repository	success
Complete job	success
After, types regenerated: the job passes
$ gh api repos/tavren27/litellm/actions/jobs/123292775918/logs | grep 'in sync with the proxy OpenAPI spec.$' | tail -1 | cut -d' ' -f2-
schema.d.ts is in sync with the proxy OpenAPI spec.
make check before, at the merge base: the API-type sync is skipped
$ git log -1 --format='%h %s'
3f5e42d032 fix(proxy): enforce team and key Allowed Vector Stores when no vector store registry is loaded (#48915)
$ sed -i 's/"spend_logs"\]/"spend_logs", "llm_traces"]/' litellm/tracing/generated/models.py && git add litellm/tracing/generated/models.py
$ git diff --cached --stat
 litellm/tracing/generated/models.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
$ make check
gate_slot_lock: all 2 machine-wide slots are busy; queueing (set LITELLM_GATE_SLOTS=0 to disable)
make[1]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
uv sync --inexact --frozen --extra proxy --group proxy-dev --group e2e-dev
Audited 245 packages in 112ms
uv run --no-sync python scripts/prisma_generate_if_needed.py
Prisma client already generated for litellm/proxy/schema.prisma (prisma 0.11.0); skipping prisma generate
cd ui/litellm-dashboard && ../../scripts/with_dashboard_node.sh npm install --no-audit --no-fund

up to date in 3s
bootstrap: .env left untouched
bootstrap: done
./scripts/pre_commit_lint.sh
check: logging full output to /Users/mateo/Development/litellm/.git/worktrees/work-e81cb248-base/pre_commit_lint.log
check: linting Python (make lint)
make[2]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
make[3]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
uv sync --inexact --frozen --group proxy-dev --group e2e-dev
Audited 215 packages in 15ms
uv run --no-sync python scripts/prisma_generate_if_needed.py
Prisma client already generated for litellm/proxy/schema.prisma (prisma 0.11.0); skipping prisma generate
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
No changed litellm Python files to format-check.
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
cd litellm && uv run --no-sync python ../tests/documentation_tests/test_circular_imports.py && cd ..
No LiteLLM type hints found.
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
uv run --no-sync python scripts/check_mcp_operation_boundary.py
MCP operation boundary: passed
cd litellm && uv run --no-sync ruff check . && cd ..
All checks passed!
uv run --no-sync ruff check --config ruff-tests.toml tests
warning: Invalid `# noqa` directive on tests/unit/proxy/common_utils/test_user_api_key_cache.py:49: expected a comma-separated list of codes (e.g., `# noqa: F401, F841`).
All checks passed!
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
uv run --no-sync python scripts/ruff_strict_gate.py --base "origin/main"
OK: no strict rule grew past its merge-base count (base origin/main)
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
[from litellm import *] OK! no issues!
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
uv run --no-sync python scripts/type_discipline_gate.py --base "origin/main"
OK: no LIT rule grew past its merge-base count (base origin/main)
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
uv run --no-sync python scripts/test_quality_gate.py --base "origin/main"
OK: no TQ rule grew past its merge-base count (base origin/main)
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
uv run --no-sync python scripts/openapi_docs_gate.py --base "origin/main"
OK: no OA rule grew past its merge-base count (base origin/main)
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
uv run --no-sync basedpyright tests/e2e tests/e2e_harness
0 errors, 0 warnings, 0 notes
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
uv run --no-sync python scripts/type_check_gate.py --base "origin/main"
provisioning .venv-typecheck (first run installs packages and generates the Prisma client; re-runs are near-instant no-ops)
OK: every basedpyright rule is within its ceiling (105019 errors total, base 3f5e42d0322e)
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
make[3]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
make[2]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
check: ruff format --check (scoped litellm files)
1 file already formatted
check: summary
    ran:     Python lint (make lint)
    skipped: tests/e2e checks (basedpyright + raw HTTP client ban) (no tests/e2e Python files in scope)
    skipped: test-tree lint (ruff-tests.toml + test-quality gate) (no tests/ Python files or test-tree lint inputs in scope)
    skipped: dashboard lint (prettier + eslint + lint budgets) (no dashboard files in scope)
    skipped: dashboard API-type sync (npm run gen:api) (no litellm/proxy, litellm/types, or generator files in scope)
check: PASS
check: full log: /Users/mateo/Development/litellm/.git/worktrees/work-e81cb248-base/pre_commit_lint.log
make[1]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-base'
exit=0
make check after, at this branch: the stale types fail the check
$ git log -1 --format='%h %s'
538c01dc66 chore: shorten the spec_pattern comment to a pointer at the CI filter
$ sed -i 's/"spend_logs"\]/"spend_logs", "llm_traces"]/' litellm/tracing/generated/models.py && git add litellm/tracing/generated/models.py
$ git diff --cached --stat
 litellm/tracing/generated/models.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
$ make check
gate_slot_lock: all 2 machine-wide slots are busy; queueing (set LITELLM_GATE_SLOTS=0 to disable)
make[1]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
uv sync --inexact --frozen --extra proxy --group proxy-dev --group e2e-dev
Audited 245 packages in 213ms
uv run --no-sync python scripts/prisma_generate_if_needed.py
Prisma client already generated for litellm/proxy/schema.prisma (prisma 0.11.0); skipping prisma generate
cd ui/litellm-dashboard && ../../scripts/with_dashboard_node.sh npm install --no-audit --no-fund

up to date in 2s
bootstrap: .env left untouched
bootstrap: done
./scripts/pre_commit_lint.sh
check: logging full output to /Users/mateo/Development/litellm/.git/worktrees/work-e81cb248-head/pre_commit_lint.log
check: linting Python (make lint)
make[2]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
make[3]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
uv sync --inexact --frozen --group proxy-dev --group e2e-dev
Audited 215 packages in 14ms
uv run --no-sync python scripts/prisma_generate_if_needed.py
Prisma client already generated for litellm/proxy/schema.prisma (prisma 0.11.0); skipping prisma generate
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
No changed litellm Python files to format-check.
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
cd litellm && uv run --no-sync python ../tests/documentation_tests/test_circular_imports.py && cd ..
No LiteLLM type hints found.
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
uv run --no-sync python scripts/check_mcp_operation_boundary.py
MCP operation boundary: passed
cd litellm && uv run --no-sync ruff check . && cd ..
All checks passed!
uv run --no-sync ruff check --config ruff-tests.toml tests
All checks passed!
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
uv run --no-sync python scripts/ruff_strict_gate.py --base "origin/main"
OK: no strict rule grew past its merge-base count (base origin/main)
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
[from litellm import *] OK! no issues!
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
uv run --no-sync python scripts/type_discipline_gate.py --base "origin/main"
OK: no LIT rule grew past its merge-base count (base origin/main)
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
uv run --no-sync python scripts/openapi_docs_gate.py --base "origin/main"
OK: no OA rule grew past its merge-base count (base origin/main)
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
uv run --no-sync python scripts/test_quality_gate.py --base "origin/main"
OK: no TQ rule grew past its merge-base count (base origin/main)
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
uv run --no-sync basedpyright tests/e2e tests/e2e_harness
0 errors, 0 warnings, 0 notes
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
make[4]: Entering directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
uv run --no-sync python scripts/type_check_gate.py --base "origin/main"
provisioning .venv-typecheck (first run installs packages and generates the Prisma client; re-runs are near-instant no-ops)
OK: every basedpyright rule is within its ceiling (105019 errors total, base 3f5e42d0322e)
make[4]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
make[3]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
make[2]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
check: ruff format --check (scoped litellm files)
1 file already formatted
check: checking the lazy OpenAPI snapshot and dashboard API types are in sync (npm run gen:api)
Prisma client already generated for litellm/proxy/schema.prisma (prisma 0.11.0); skipping prisma generate
wrote 37 feature fragments to /Users/mateo/Development/litellm-worktrees/work-e81cb248-head/litellm/proxy/_lazy_openapi_snapshot.json

> litellm-dashboard@0.1.0 gen:api
> node scripts/gen-api-types.mjs

✨ openapi-typescript 7.13.0
🚀 /tmp/litellm-openapi-b7rJlF/openapi.json → /Users/mateo/Development/litellm-worktrees/work-e81cb248-head/ui/litellm-dashboard/src/lib/http/schema.d.ts [8.5s]
✗ Dashboard API types are stale; regenerated src/lib/http/schema.d.ts. Stage it and commit; re-run make check only if other checks failed too.
check: summary
    ran:     Python lint (make lint)
    skipped: tests/e2e checks (basedpyright + raw HTTP client ban) (no tests/e2e Python files in scope)
    skipped: test-tree lint (ruff-tests.toml + test-quality gate) (no tests/ Python files or test-tree lint inputs in scope)
    skipped: dashboard lint (prettier + eslint + lint budgets) (no dashboard files in scope)
    ran:     dashboard API-type sync (npm run gen:api)
check: FAIL
check: full log: /Users/mateo/Development/litellm/.git/worktrees/work-e81cb248-head/pre_commit_lint.log
make[1]: *** [Makefile:275: check-inner] Error 1
make[1]: Leaving directory '/Users/mateo/Development/litellm-worktrees/work-e81cb248-head'
make: *** [Makefile:272: check] Error 2
exit=2

Type

🐛 Bug Fix
🚄 Infrastructure

Caveats (if any)

Medium

  • When main's schema.d.ts is stale, every litellm/ or enterprise/ PR fails lint passed, and so does make check
    • main has no up-to-date rule, so two green PRs can still merge into drift
    • Kept on purpose (Decision 8). One regen on main clears it, and main is in sync today

Low

  • The drift error still says a route or model changed when a dependency bump caused it. The fix it names is the same
  • make check runs the type sync for non-Python litellm/ changes, about 3.5 min on a loaded machine
    • Kept, since the spec build reads those files
  • The new trigger tests run git and bash from tests/unit, as the mapped file already did

Decisions

Why this filter and not another one
  1. Kept a path filter instead of running the check on every PR. UI-only, docs-only, and test-only PRs can't change the spec, and skipping them saves a 4 minute job with a full uv sync and npm ci
  2. Matched all of litellm/ instead of listing more subfolders. The spec is built from litellm.proxy.proxy_server, which imports models from litellm/models, litellm/router_strategy, litellm/tracing, litellm/telemetry, and litellm/litellm_core_utils today (78 of 1044 components), and a list would go stale the next time someone adds a module
  3. Added enterprise/ because litellm_enterprise is a workspace package whose models show up in the spec (audit logs, email events)
  4. Added pyproject.toml and uv.lock because about 160 components come from openai, fastapi, and mcp models, so a version bump can change the spec with no repo code change
  5. Left out litellm-rust/ and litellm-proxy-extras/. The spec only reads Python models, and the Rust trace types reach it through generated files under litellm/tracing/generated/, which the filter now covers
  6. Matched non-Python files under litellm/ too, so a cost-map-only PR also runs the check. In CI it runs next to the longer lint jobs, while make check waits on it alone
  7. Fixed make check in the same PR, since it would keep skipping locally what CI now fails on
  8. Kept the check failing on any drift, not only drift the PR adds. Regenerating at the base and at the merge and comparing would double the spec build on every PR, and a stale main would stay stale with no PR asked to fix it, while the point here is keeping main's schema.d.ts current
  9. Added enterprise/** to the Terraform provider audit's PR paths, since /project/info and /project/list, which the provider calls, are enterprise routes. Left out litellm/types/ and dependency files there, because that audit only compares route paths and methods

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR
/live-pr-risk report

Verdict: no breaking path found. The change widens two trigger lists and edits two skip messages. Graph walked at 0aacbab, live legs at 5b50007 (CI) and 538c01d (make check), carried to af3e8a0 because later commits change only comments, docs, and tests. The Terraform paths commit got its own walk and live legs at 40b70c9. Carried to ee7e45f, which only moves that commit's test into the mapped test file.

Breaking

None observed. Every dependent that reads the changed values was driven live on base and head or is covered by a test that runs the real script.

Backward incompatible

  • The CI skip message in the ui-api-types detect step changed text. Nothing parses it (grep over .github, scripts, tests, ~/.claude tooling found only the new test).
  • The make check skip reason for the API-type sync changed text. Only tests/unit/test_pre_commit_lint.py reads summary lines, and it asserts the "ran:"/"skipped:" prefix, not the reason.
  • The trigger set widened in both places. Observable effect: PRs and staged sets touching any litellm/, enterprise/, pyproject.toml or uv.lock file now run gen:api. This is the PR's intent, and it is the Medium merge-skew caveat's cause (a drifted main now fails every litellm/ PR, not only proxy/types PRs). Disposition: kept as an inherent caveat in the PR body, the fix being whichever PR commits the regenerated schema.d.ts.
  • A cost-map-only staged change under litellm/ now runs gen:api in make check (about 77s). Disposition: Low caveat, kept as net-negative to fix.

Regression risk

  • warn_skipped: with the API-type sync skipped, an unstaged file under litellm/, enterprise/, pyproject.toml or uv.lock now prints a second SKIPPED warning. Advisory output only, no exit code change. Not driven live (each make check leg waits over an hour for a machine slot).
  • The "nothing ran" NOTE no longer fires for a staged set of only non-Python litellm/ or enterprise/ files, since the API-type sync now runs for them. That is correct for the new trigger set and is covered for pyproject/uv.lock by the new tests through the real script.

Dependency graph

Dependent Reads State
ui-api-types detect step trigger regex verified-live
ui-api-types gen and diff steps relevant verified-live
lazy snapshot steps relevant verified-live
lint-passed aggregate job result tested (CI)
make check gen:api block spec_files verified-live
make check summary line spec_files tested
"nothing ran" NOTE spec_files tested
warn_skipped spec_pattern untested
dashboard AGENTS.md:7 rule text still accurate
Terraform endpoint-drift job PR paths verified-live
Terraform gofmt/vet/test job PR paths runs more often, not required

test-terraform-provider.yml had its own narrower filter, now widened to enterprise/**. No ruleset requires its checks and no workflow reads its result. No other workflow, hook, or ~/.claude tool duplicates the filter. The legacy suites do not reach it. There is no proxy HTTP surface.

Not verified

  • warn_skipped's extra warning, live on base and head (machine slot queue).
  • litellm-docs was not swept for mentions of the old trigger set (no checkout on this node).
Bugbot summary

[!NOTE]
Medium Risk
More PRs run the ~4 minute ui-api-types job and make check gen:api; if schema.d.ts is stale on main, unrelated litellm/ PRs can fail lint until types are regenerated.

Overview
Widens when CI and make check regenerate dashboard OpenAPI types, so PRs are no longer limited to litellm/proxy/ and litellm/types/. The lint / ui-api-types detect step and pre_commit_lint.sh spec_pattern now treat any change under litellm/ or enterprise/, plus pyproject.toml / uv.lock, and the existing generator paths, as spec-affecting.

Adds enterprise/** to the Terraform Provider workflow PR path filter so endpoint drift audits run when enterprise routes change.

Tests and docs: new unit tests execute the real workflow detect script, assert CI and make check match (minus the workflow file), and verify every APIRouter file is covered by Terraform triggers; AGENTS.md tells contributors to run npm run gen:api after any backend model/route or dependency bump.

Reviewed by Cursor Bugbot for commit ee7e45f. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with no outstanding findings

Summary

Expands the dashboard API-type checks to cover litellm/, enterprise/, and dependency files. The Terraform audit also runs for enterprise/ changes

The latest change moves the Terraform regression into the existing workflow test file without changing what it checks. No new actionable issues were found

Greptile previously withdrew the request to move subprocess checks outside tests/unit/ after mateo-berri explained the existing test layout

  • Backend and dependency edits now trigger the dashboard API-type check.
  • Enterprise route edits now start the Terraform endpoint audit.

Reviews (8) · Last reviewed commit: "test: keep the Terraform trigger test in..." · Reviewed by Greptile

Comment thread scripts/pre_commit_lint.sh Resolved
@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

Comment thread scripts/pre_commit_lint.sh Resolved
@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai


def _tracked_paths_matching(extended_regex: str) -> frozenset[str]:
tracked: Final = _git(WORKFLOW.parents[2], "ls-files")
selected: Final = subprocess.run(["grep", "-E", extended_regex], input=tracked, capture_output=True, text=True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unit tests start external programs

tests/unit/AGENTS.md bans subprocesses. Move these Git/Bash checks outside tests/unit/, including the workflow and staged-file cases, before merging

Context Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files already ran git and bash on main, and no test directory fits script tests, so this PR extends the existing mapped files

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point: test_lint_workflow_diff_gates.py is already the mapped home for these workflow/path-filter checks, and its existing tests invoke git. Moving just the additions would split the coverage without resolving the underlying policy mismatch. I overstated the move-out-of-tests/unit/ suggestion as a merge blocker; I withdraw that request.

The remaining inconsistency is that tests/unit/AGENTS.md explicitly says “In-process. No network or subprocess,” while these tests use subprocesses (and the additions also invoke bash and grep). That may be an intentional exception for workflow-script tests, but it is not documented there. If so, clarifying that exception would prevent future reviews from raising the same concern.

Should I remember this as a review preference: keep workflow/script checks in their existing mapped test files rather than requiring them to move solely because they invoke Git or shell commands?

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@mateo-berri mateo-berri changed the title ci: run the dashboard API types check on every change that can alter the OpenAPI spec ci: run the dashboard API types and Terraform endpoint checks on every change that can alter the spec Oct 29, 2026
@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit ee7e45f. Configure here.

@mateo-berri mateo-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mateo-berri
mateo-berri merged commit e73f06e into BerriAI:main Oct 29, 2026
90 of 92 checks passed
yuneng-berri pushed a commit that referenced this pull request Nov 7, 2026
…y change that can alter the spec (#49022)

* ci: run the dashboard API types check on every change that can alter the OpenAPI spec

* chore: shorten the spec_pattern comment to a pointer at the CI filter

* chore: drop the spec_pattern comment

* docs: name the full ui-api-types trigger set in the make check header and dashboard AGENTS.md

* test: check make check and CI pick the same files for the API-type sync

* ci: run the Terraform provider endpoint audit on enterprise route changes

* test: keep the Terraform trigger test in the mapped workflow test file

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
(cherry picked from commit e73f06e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants