-
Notifications
You must be signed in to change notification settings - Fork 681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail if a remote source content doesn't match lockfile #1103
Conversation
27b6b32
to
07ef97f
Compare
07ef97f
to
a0aee4a
Compare
If a URL based source does not match the shasum recorded in the lockfile, it likely means a new version has been pushed to the remote source. In this case, we fail to help ensure that when using a lockfile we always run the same code as when the lockfile was created. Signed-off-by: Steven Danna <[email protected]>
a0aee4a
to
1364711
Compare
@archive_path ||= download_archive(path) | ||
end | ||
|
||
def shasum |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe simply sha256
?
archive_shasum.to_s | ||
end | ||
|
||
def archive_shasum |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe just sha256
?
end | ||
|
||
def resolved_source | ||
{ url: @target } | ||
@resolved_source ||= { url: @target, shasum256: shasum } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shasum256
What do you think about sha256
?
|
||
remote = open(@target, http_opts) | ||
def remote_archive_content |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe just content
?
1364711
to
7b0347f
Compare
Suggested renames pushed |
@@ -16,7 +16,7 @@ def resolve(target) | |||
end | |||
end | |||
|
|||
NON_FETCHER_KEYS = [:name, :version_constraint, :cwd, :backend, :cache].freeze | |||
NON_FETCHER_KEYS = [:name, :version_constraint, :cwd, :backend, :cache, :shasum256].freeze |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be sha256
?
Signed-off-by: Steven Danna <[email protected]>
7b0347f
to
8d63db9
Compare
fixes #1066 |
Thanks @stevendanna |
If a URL based source does not match the shasum recorded in the
lockfile, it likely means a new version has been pushed to the remote
source. In this case, we fail to help ensure that when using a lockfile
we always run the same code as when the lockfile was created.
Signed-off-by: Steven Danna [email protected]