Repository navigation
Require flake.lock to be up-to-date if it exists - #96
Merged
Merged
Conversation
colemickens
previously approved these changes
Nov 6, 2023
cole-h
marked this pull request as draft
November 6, 2023 21:38
We allow flakes without a flake.lock checked in (similar to how, in the Rust ecosystem, sometimes library authors don't commit their Cargo.lock), but we require flakes that do have a flake.lock to be up-to-date.
cole-h
force-pushed
the
no-update-lock-file
branch
from
November 6, 2023 21:51
55ab445 to
8b56f4d
Compare
cole-h
marked this pull request as ready for review
November 6, 2023 21:51
Member
Author
|
Tested with:
(Looks similar to below) |
cole-h
commented
Nov 6, 2023
| .arg("flake") | ||
| .arg("metadata") | ||
| .arg("--json") | ||
| .arg("--no-update-lock-file") |
Member
Author
There was a problem hiding this comment.
This is the special sauce right here: if nix flake metadata --json would have updated the flake.lock, this causes Nix (and thus the entire upload) to fail (which we want).
colemickens
approved these changes
Nov 6, 2023
colemickens
left a comment
Member
There was a problem hiding this comment.
super nit: constuct vec of args, use (Command).args() to add it to the command, then you can re-use the args for the error message instead of repeating it. (Just in case we change the command again later, so we don't to change error strings too). But this is mostly just golfing.
but LGTM
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.
This will prevent uploading of flakes that need to be re-locked.