Check uv.lock and plugins/uv.lock freshness in just check and CI - #1258
Merged
Merged
Conversation
The root `pyproject.toml` server extra moved to `sqlalchemy[asyncio]>=2.0.51,!=2.1.0` in #1250, but `plugins/uv.lock` kept the old `<2.1` specifier, so `uv lock --check` failed inside `plugins/`. Regenerate the lock and move the resolved `sqlalchemy` from 2.0.51 to 2.1.1, the version the root `uv.lock` already resolves, so plugin tests run against the same SQLAlchemy as the core tests.
Every sync in CI and the `justfile` uses `--frozen`, which installs the lock file without comparing it to `pyproject.toml`. A stale `plugins/uv.lock` therefore passed every PR check and would only have failed in the release workflow. Run `uv lock --check` for both lock files in `just check` and in the CI `lint` job so the drift fails on the PR that causes it.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Adds a
just lock-checkrecipe that runsuv lock --checkfor the root project and forplugins/. It is wired into two places:just check, as the first step, so it fails locally before anyone pushes.lintjob in.github/workflows/ci.yml, as a newjust lock-checkstep.Why
Every dependency install in CI and in the
justfileusesuv sync --frozen.--frozeninstalls exactly what the lock file says and never compares it topyproject.toml. So when a PR changes a dependency range and forgets to regenerate a lock file, nothing on that PR fails.That is what happened in #1250: the root SQLAlchemy range changed,
plugins/uv.lockwas not regenerated, and plugin CI kept testing on SQLAlchemy 2.0.51 while core tested on 2.1.1. #1257 fixes that lock file.The only existing comparison is in
release.yml("Prepare development reset"), which runs after a release has already been published. The stale lock would have failed there, in front of whoever was cutting the release, long after the PR that caused it.Reviewer Notes
This PR is stacked on #1257. Its base is
fix/plugins-lock-sqlalchemy, notdevelop, because the new check fails ondeveloptoday (that failure is the bug #1257 fixes). Review and merge #1257 first; GitHub then retargets this PR todevelop.The change is small. The two things worth a look:
ci.ymldoes not calljust check; thelintjob lists recipes one by one. So adding the recipe tojust checkalone would not have reached CI, which is why there is an explicitjust lock-checkstep. I put it inlintbecause that job already hasuvandjustset up and runs on every non-draft PR.pyproject.tomlfiles setexclude-newer = "3 days", a rolling window. I checked that this does not make the check flaky: the lock files record the window as a duration (exclude-newer-span = "P3D"), not as a date, anduv lock --checkkeeps an existing pin as long as it still satisfiespyproject.toml. A newer release appearing on PyPI does not fail it. The root lock in this branch was last regenerated in Validate SQLAlchemy 2.1 server compatibility #1250 and still passes.lock-checkdoes not need the project environment installed, so it adds a few seconds at most.Reproduction
On this branch the check passes:
To see it catch the original bug, put
develop's stale lock file back and run it again:git show origin/develop:plugins/uv.lock > plugins/uv.lock just lock-checkExpect
error: The lockfile at uv.lock needs to be updated, but --check was provided.and a non-zero exit from theuv lock --project plugins --checkline. Restore the file afterwards:(Once #1257 is on
develop,origin/developno longer has the stale file; use720a52913:plugins/uv.lockinstead.)Local checks run
just checkpasses with the new step.actionlint,yamlfixandjust zizmorreport nothing. The two test files that read the workflow orjustfilepass (108 tests). I did not rerun the fulljust testsuite: no Python code or dependency changes here.No changelog fragment: contributor tooling only.