feat(lock): add --trust-local to skip remote lock verification#657
Open
yeazelm wants to merge 1 commit into
Open
feat(lock): add --trust-local to skip remote lock verification#657yeazelm wants to merge 1 commit into
yeazelm wants to merge 1 commit into
Conversation
Contributor
|
Hey Matt, long time no see :P. So this is good but i think we can actually do this implicitly, I'm not sure if we even need to gate this behind an argument. Here is what i'm thinking might be a better approach for this:
Let me know if you'd like to do these updates or I can make the changes myself as well. |
During lock resolution (outside of `twoliter update`) each artifact's stored digest is compared to the digest in Twoliter.lock. If all match the remote registry check is skipped entirely; if any mismatch or file is missing a full remote re-resolution runs and the digest files are refreshed. Signed-off-by: Matthew Yeazel <matthew.yeazel@gmail.com>
Contributor
Author
|
Sounds good, I can shift towards that pattern! |
34cd411 to
2e73204
Compare
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.
Description of changes:
When
--trust-localis passed (orTWOLITER_TRUST_LOCAL=trueis set), twoliter computes a SHA-256 hash of Twoliter.toml and Twoliter.lock before each build. If the hash matches the cached value stored inbuild/external-kits/.lock-inputs-hashfrom the last successful verification, remote registry manifest fetches are skipped entirely and the local lockfile is trusted as-is.When --trust-local is not set (the default), behavior is unchanged: remote verification always runs. The hash is still written after each successful remote verification so the cache is warm for the next --trust-local run.
This is especially useful when developing on a machine outside of EC2 which may have longer round-trip and authentication paths than from within it. For local development, this really speeds up builds since it doesn't do the same costly check over the network when nothing else has changed between builds.
Testing done:
Built the same variant with and without the
TWOLITER_TRUST_LOCAL=falseset.Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.