litellm/ci_cd
Yuneng Jiang b39f210a6c
[Infra] Add freshness and destructive guards to migration workflow
Generating a migration from a stale branch could silently emit DROP
COLUMN for columns the stale branch did not know about, and the
script would write that SQL to a new migration file with no warning.

Adds two guards to ci_cd/run_migration.py:

- Branch freshness check: fetches origin/<base-branch> and exits 3 if
  HEAD is behind. Default base is litellm_internal_staging. New
  flags: --base-branch, --skip-freshness-check.
- Destructive guard: refuses (exit 2) if the generated diff contains
  DROP COLUMN / DROP TABLE / DROP INDEX, unless --allow-destructive
  is passed.

Refusal banners include guidance and an explicit callout instructing
AI agents not to auto-bypass the flags. Also treats Prisma's
"-- This is an empty migration." output as a no-op rather than
writing an empty file.

Updates litellm-proxy-extras/migration_runbook.md with the new
workflow, flag documentation, and agent warnings.
2026-04-21 12:00:23 -07:00
..
baseline_db.py Connect UI to "LiteLLM_DailyUserSpend" spend table - enables usage tab to work at 1m+ spend logs (#9603) 2025-03-27 23:29:15 -07:00
check_file_length.py (clean up) move docker files from root to docker folder (#6109) 2024-10-08 08:23:52 +05:30
check_files_match.py (fix) pre commit hook to sync backup context_window mapping 2024-02-05 15:03:04 -08:00
run_migration.py [Infra] Add freshness and destructive guards to migration workflow 2026-04-21 12:00:23 -07:00
security_scans_readme.md [Security] Ensure LiteLLM Images have 0 Critical, High, Medium vulnerabilities with CVSS ≥ 4.0 (#14357) 2025-09-08 16:49:52 -07:00
TEST_KEY_PATTERNS.md Fix CI: Revert security scan changes and add GitGuardian ignore rules (#18358) 2025-12-22 17:03:53 -08:00