litellm/scripts/update-codegen.sh
ryan-crabbe-berri cca1b8f06e ci: commit openapi.json and gate it with a verify-codegen script
Adds the proxy's OpenAPI spec to the repo as openapi.json so diff tooling has a
committed baseline, and replaces the inline drift check with the update/verify
script pair Kubernetes uses so the same command runs locally and in CI.

- scripts/update-codegen.sh is the single writer for generated artifacts
- scripts/verify-codegen.sh runs it and fails on any git status change
- the sync job now runs on every PR instead of a path filter, so routes defined
  outside litellm/proxy (enterprise/**) can no longer land a stale spec
- git status --porcelain replaces git diff, which was blind to untracked files
2026-08-07 15:53:16 -07:00

20 lines
521 B
Bash
Executable file

#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
DASHBOARD_DIR="${REPO_ROOT}/ui/litellm-dashboard"
if [[ -z "${LITELLM_PYTHON:-}" && -x "${REPO_ROOT}/.venv/bin/python" ]]; then
export LITELLM_PYTHON="${REPO_ROOT}/.venv/bin/python"
fi
if [[ ! -x "${DASHBOARD_DIR}/node_modules/.bin/openapi-typescript" ]]; then
echo "Installing dashboard dependencies..." >&2
npm ci --prefix "${DASHBOARD_DIR}"
fi
cd "${DASHBOARD_DIR}"
npm run gen:api