chore(ci): enforce uv.lock is in sync (#3679)

Add a uv lock --check guard in two places so a stale uv.lock cannot be
committed unnoticed (as happened with the groundroute extra):

- pre-commit: a local uv-lock-check hook, scoped to the backend
  pyproject.toml files and uv.lock.
- CI: a "Check uv.lock is in sync" step in the lint-backend job, run
  before uv sync so the install step cannot mask a stale lock by
  regenerating it.
This commit is contained in:
Zheng Feng 2026-06-21 19:10:12 +08:00 committed by GitHub
parent 25e33b1927
commit 5b61214f7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View file

@ -23,6 +23,10 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Check uv.lock is in sync
working-directory: backend
run: uv lock --check
- name: Install dependencies
working-directory: backend
run: |

View file

@ -14,6 +14,12 @@ repos:
language: system
types_or: [python]
files: ^backend/
- id: uv-lock-check
name: uv lock check
entry: bash -c 'cd backend && uv lock --check'
language: system
pass_filenames: false
files: ^backend/(pyproject\.toml|uv\.lock|packages/harness/pyproject\.toml)$
# Frontend: eslint + prettier (must run from frontend/ for node_modules resolution)
- repo: local