mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-23 22:27:10 +00:00
[Infra] CI: add UI drift guard + regenerate _experimental/out
Adds a CI job that rebuilds the admin UI from source and fails if the committed static export at litellm/proxy/_experimental/out/ has drifted from what npm run build produces. This prevents silently shipping stale UI bytes and is a prerequisite for the non_root Dockerfile streamlining work, which will stage the UI from _experimental/out/ directly instead of rebuilding it inside the image. Also regenerates litellm/proxy/_experimental/out/ to match a fresh npm run build (Node 20.20.2) — the committed tree had drifted from source prior to this commit. Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
This commit is contained in:
co-authored by
yuneng-jiang
parent
2f22a1293e
commit
65a60dbe35
@@ -0,0 +1,47 @@
|
||||
name: UI Drift Guard
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- "litellm_**"
|
||||
paths:
|
||||
- "ui/litellm-dashboard/**"
|
||||
- "litellm/proxy/_experimental/out/**"
|
||||
- ".github/workflows/ui-drift-guard.yml"
|
||||
|
||||
jobs:
|
||||
verify-ui-output-fresh:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "20.20.2"
|
||||
cache: "npm"
|
||||
cache-dependency-path: ui/litellm-dashboard/package-lock.json
|
||||
|
||||
- name: Build UI
|
||||
working-directory: ui/litellm-dashboard
|
||||
run: |
|
||||
npm ci --no-audit --no-fund
|
||||
npm run build
|
||||
|
||||
- name: Compare against committed _experimental/out
|
||||
run: |
|
||||
set -euo pipefail
|
||||
( cd ui/litellm-dashboard/out && find . -type f -exec sha256sum {} + ) | sort > /tmp/fresh.txt
|
||||
( cd litellm/proxy/_experimental/out && find . -type f -exec sha256sum {} + ) | sort > /tmp/committed.txt
|
||||
if ! diff -u /tmp/committed.txt /tmp/fresh.txt > /tmp/drift.txt; then
|
||||
echo "::error::UI output is stale. Regenerate litellm/proxy/_experimental/out/ from ui/litellm-dashboard/out/."
|
||||
head -200 /tmp/drift.txt
|
||||
exit 1
|
||||
fi
|
||||
echo "UI output is fresh."
|
||||
Reference in New Issue
Block a user