ci: detect Cargo.lock drift offline + harden java --locked#7425
Open
wjones127 wants to merge 1 commit into
Open
ci: detect Cargo.lock drift offline + harden java --locked#7425wjones127 wants to merge 1 commit into
wjones127 wants to merge 1 commit into
Conversation
The repo keeps three lockfiles — root, python/, and java/lance-jni/ (the latter two are excluded from the workspace) — so a workspace dependency change can leave the excluded locks stale. python CI runs `--locked`, but java CI did not, so a stale java lock went uncaught. - Add a `cargo-lock-sync` pre-commit hook that verifies all three lockfiles with `cargo metadata --frozen` (= `--locked --offline`): no network, no compile, fails fast with a clear fix message. - Add empty `[workspace]` tables to python/ and java/lance-jni/ manifests so cargo resolves them as their own roots instead of climbing to an enclosing checkout (which broke `--manifest-path` inside nested git worktrees). - Add `--locked` to the java clippy (PR CI) and release build steps. - Document the three-lockfile rule in AGENTS.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
The repo keeps three lockfiles — root
Cargo.lock,python/Cargo.lock, andjava/lance-jni/Cargo.lock(the latter two are excluded from the workspace). Aworkspace.dependencieschange can leave the excluded locks stale. python CI already runs--locked, but java CI did not, so a stale java lock went uncaught until a release build.Changes:
cargo-lock-syncpre-commit hook — verifies all three lockfiles withcargo metadata --frozen(--locked+--offline). No network, no compilation; fails fast with a message naming the stale manifest and the fix.[workspace]tables inpython/andjava/lance-jni/manifests — declares each as its own workspace root so cargo resolves it standalone instead of climbing to an enclosing checkout. Without this,--manifest-path(and the hook) breaks when the checkout is nested inside another cargo project, e.g. a git worktree under the main checkout. The dependency graphs and lockfiles are unchanged.--lockedadded to the java clippy step (java.yml, runs on PRs) and the release build steps (java-publish.yml).Verified: offline check passes in-sync and detects an injected stale lock with exit 1 (no network);
[workspace]additions leave all three lockfiles byte-identical;pre-commit validate-configpasses and the hook ran green on this commit.