-
Notifications
You must be signed in to change notification settings - Fork 45
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
Fix a couple of URL SCM issues #552
Merged
Merged
Conversation
This file contains 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
There was a typo in the switching logic when testing for the "recurseSubmodules" property. Use the correct spelling. Effectively, the recurseSubmodules property was not ignored in some cases as it should have been.
Instead of comparing the recipe specs, compare Scm instances. Otherwise any newly introduces properties will always show up in the diff. By comparing parsed Scm instances, the default values of all attributes will be applied and there should be no false negatives because of older checkouts that lacked some attributes.
This attribute has no influence on the result.
This attribute has no influence on the result.
The mirrors are only used for deterministic instances. If they change, the result won't be influenced at all.
If the URL is changed but the hashes are stable, and at least one hash is set, the result cannot change.
If the copy fails half way, we don't want to retain a corrupt file in the workspace. In case of a deterministic SCM the copy won't be done again but the digest check will fail consistently.
The mtime itself is irrelevant for the workspace hash. But if a file is copied from a local mirror we don't want to get the file a newer mtime than the source mirror file. Otherwise the mirror will be updated with the same file again. Likewise, the mirror should get the same file attributes like the fetched file.
If a file is fetched from remote, it's mode has historically been set to 0600. We must retain this behaviour even if the file is fetched from a local mirror instead. Otherwise, if the mirror has not the right file mode, the result will be wrong compared a fetch from the primary URL.
Some SCM properties may have different formats where some are better readable for humans. Give the SCM a hint how the properties should be returned.
Allow to set a mode explicitly, regardless of the source file. Without the mode, remotely fetched files will have a 0600 mode while locally copied files will retain their mode.
Remove some redundant information to make it more readable. Also explain what the asterisk means.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #552 +/- ##
==========================================
+ Coverage 88.73% 88.92% +0.18%
==========================================
Files 46 46
Lines 14724 14774 +50
==========================================
+ Hits 13066 13138 +72
+ Misses 1658 1636 -22 ☔ View full report in Codecov by Sentry. |
Historically the URL SCM applies a file mode of 0600 (user read/write only) to all files that are fetched via HTTP(S) or FTP. For locally copied files (``file://`` URLs or bare file names) though, the file mode of the source file is retained. This is both inconsistent and not predictable for local file because the result will depend on the source file. The defaultFileMode policy will enforce a mode of 0600 to all files, regardless of the origin. This will prevent any accidental checkout inconsistencies in the future.
It's only detected at runtime if the extractor does not support stripComponents.
jkloetzke
force-pushed
the
url-permissions
branch
from
February 10, 2024 22:26
3654c9a
to
47f1bdf
Compare
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.
Most importantly, usage of local mirrors should not result in unpredictable checkout results any more.