Repository navigation
Check the lockfile when installing dependencies in CI - #1912
Merged
Merged
Conversation
Both lockfiles still lock nx as the Hex package 0.13.1, while both projects depend on nx by path. With that entry present, mix deps.get does not keep telemetry at its locked version and fetches the newest release, so it moved from 1.4.2 to 1.4.3 once 1.4.3 was published. CI caches deps under the hash of the committed lockfile and skips mix deps.get on a cache hit, so the run after a cache miss fails with a lock mismatch. Without the entry, mix deps.get keeps telemetry at 1.4.2. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
mix deps.get ran only when the deps cache was missing, and could rewrite mix.lock without failing. A lockfile that no longer matched what gets fetched went unnoticed until a later run restored the cache and failed with a lock mismatch. It now runs on every job with --check-locked, so a fetch that would change the lockfile fails on the run that introduces it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
Author
|
a candidate fix to make the current CI messup not happen in the future |
polvalente
reviewed
Nov 27, 2026
Comment on lines
-111
to
+112
| if: ${{ steps.mix-cache.outputs.cache-hit != 'true' && env.should_run == 'true' }} | ||
| run: mix deps.get | ||
| if: ${{ env.should_run == 'true' }} | ||
| run: mix deps.get --check-locked |
Member
There was a problem hiding this comment.
We should keep the cache checks. If the lock changes, the cache is invalidated anyway
The lockfile is part of the cache key, so a changed lock already invalidates the cache. Only the --check-locked flag stays. Co-authored-by: Paulo Valente <polvalente@users.noreply.github.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.
Runs
mix deps.get --check-lockedon every CI job.This branch is built on #1911, which removes the lockfile entry this check would otherwise fail on. Until that is merged, the diff here also shows its two lockfile lines.
Why
The workflow installs dependencies only when the
depscache is missing:mix deps.getmay rewritemix.lockwhen it fetches. If it does, the job still passes and savesdepsto the cache. The next job restores that cache, skipsmix deps.get, and fails at compile time with a lock mismatch, on a commit that changed no dependency.The change
--check-lockedmakesmix deps.getfail when it would change the lockfile.The same edit is made in the Linux and Windows jobs.
What it looks like when it catches something
On main today, without #1911, in
exla/:With #1911 it passes in
nx,exlaandtorchx.🤖 Generated with Claude Code