-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add --experimental_repository_cache_urls_as_default_canonical_id to help detect broken repository URLs #14268
Conversation
…elp detect broken repository URLs This new flag can be used to force redownloading when repository URLs are changed. Otherwise, it's possible broken URLs can be masked by the presence of a repository cache entry with the same hash. Specifying a `canonical_id` works as before, overriding this behavior. Closes bazelbuild#14128.
I tested this PR and it works as expected, see my comment in the corresponding issue. Code looks sane. Would it be feasible to add a test? $ cd src/test/java && git grep -i CanonicalId
com/google/devtools/build/lib/bazel/repository/cache/RepositoryCacheTest.java: public void testCanonicalId() throws Exception {
com/google/devtools/build/lib/bazel/repository/downloader/HttpDownloaderTest.java: "testCanonicalId",
com/google/devtools/build/lib/bazel/repository/downloader/HttpDownloaderTest.java: "testCanonicalId",
com/google/devtools/build/lib/bazel/repository/downloader/HttpDownloaderTest.java: "testCanonicalId",
com/google/devtools/build/lib/bazel/repository/downloader/HttpDownloaderTest.java: "testCanonicalId",
com/google/devtools/build/lib/bazel/repository/downloader/HttpDownloaderTest.java: "testCanonicalId",
com/google/devtools/build/lib/bazel/repository/downloader/HttpDownloaderTest.java: "testCanonicalId",
com/google/devtools/build/lib/remote/downloader/GrpcRemoteDownloaderTest.java: final String canonicalId = "";
com/google/devtools/build/lib/remote/downloader/GrpcRemoteDownloaderTest.java: canonicalId, I see a number of occurrences of |
I'll take a look at adding a test on Monday, thanks! |
Thanks! |
…s_as_default_canonical_id We test the current default behavior, which is that broken URLs are not detected, and that this is detected when using the new flag.
I added an integration test for the new flag and the default behavior. |
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.
Thanks!
…elp detect broken repository URLs This new flag can be used to force redownloading when repository URLs are changed. Otherwise, it's possible broken URLs can be masked by the presence of a repository cache entry with the same hash. Specifying a `canonical_id` works as before, overriding this behavior. Closes bazelbuild#14128. Closes bazelbuild#14268. PiperOrigin-RevId: 420976730 (cherry picked from commit f9882e4)
…elp detect broken repository URLs (#14989) This new flag can be used to force redownloading when repository URLs are changed. Otherwise, it's possible broken URLs can be masked by the presence of a repository cache entry with the same hash. Specifying a `canonical_id` works as before, overriding this behavior. Closes #14128. Closes #14268. PiperOrigin-RevId: 420976730 (cherry picked from commit f9882e4) Co-authored-by: Ken Micklas <[email protected]>
Introduced in bazelbuild#14268, this flag is very useful for bigger enterprise context where folks often version bumping dependencies without remembering to update the SHA256 of the downloaded file, leading to Bazel picking up older download entries from the repository cache. As we get more questions about this flag in Slack, marking it as stable and flip the default seems to be the right move.
Introduced in bazelbuild#14268, this flag is very useful for bigger enterprise context where folks often version bumping dependencies without remembering to update the SHA256 of the downloaded file, leading to Bazel picking up older download entries from the repository cache. As we get more questions about this flag in Slack, marking it as stable and flip the default seems to be the right move.
Introduced in #14268, this flag is very useful for bigger enterprise context where folks often version bumping dependencies without remembering to update the SHA256 of the downloaded file, leading to Bazel picking up older download entries from the repository cache. As we get more questions about this flag in Slack, marking it as stable and flip the default seems to be the right move. Closes #19549. PiperOrigin-RevId: 567356017 Change-Id: I6402e33f569789545e3ce17ebb42c51a8d56126f
*** Reason for rollback *** Due to #19749 *** Original change description *** Stablize and flip repository_cache_urls_as_default_canonical_id Introduced in #14268, this flag is very useful for bigger enterprise context where folks often version bumping dependencies without remembering to update the SHA256 of the downloaded file, leading to Bazel picking up older download entries from the repository cache. As we get more questions about this flag in Slack, marking it as stable and flip the default seems to be the r... *** RELNOTES: None PiperOrigin-RevId: 578840189 Change-Id: I390910b5dd838a4a1384c5d24cedde0b7c1b2b98
*** Reason for rollback *** Due to bazelbuild#19749 *** Original change description *** Stablize and flip repository_cache_urls_as_default_canonical_id Introduced in bazelbuild#14268, this flag is very useful for bigger enterprise context where folks often version bumping dependencies without remembering to update the SHA256 of the downloaded file, leading to Bazel picking up older download entries from the repository cache. As we get more questions about this flag in Slack, marking it as stable and flip the default seems to be the r... *** RELNOTES: None PiperOrigin-RevId: 578840189 Change-Id: I390910b5dd838a4a1384c5d24cedde0b7c1b2b98
*** Reason for rollback *** Due to bazelbuild#19749 *** Original change description *** Stablize and flip repository_cache_urls_as_default_canonical_id Introduced in bazelbuild#14268, this flag is very useful for bigger enterprise context where folks often version bumping dependencies without remembering to update the SHA256 of the downloaded file, leading to Bazel picking up older download entries from the repository cache. As we get more questions about this flag in Slack, marking it as stable and flip the default seems to be the r... *** RELNOTES: None PiperOrigin-RevId: 578840189 Change-Id: I390910b5dd838a4a1384c5d24cedde0b7c1b2b98
*** Reason for rollback *** Due to bazelbuild#19749 *** Original change description *** Stablize and flip repository_cache_urls_as_default_canonical_id Introduced in bazelbuild#14268, this flag is very useful for bigger enterprise context where folks often version bumping dependencies without remembering to update the SHA256 of the downloaded file, leading to Bazel picking up older download entries from the repository cache. As we get more questions about this flag in Slack, marking it as stable and flip the default seems to be the r... *** RELNOTES: None PiperOrigin-RevId: 578840189 Change-Id: I390910b5dd838a4a1384c5d24cedde0b7c1b2b98
*** Reason for rollback *** Due to #19749 *** Original change description *** Stablize and flip repository_cache_urls_as_default_canonical_id Introduced in #14268, this flag is very useful for bigger enterprise context where folks often version bumping dependencies without remembering to update the SHA256 of the downloaded file, leading to Bazel picking up older download entries from the repository cache. As we get more questions about this flag in Slack, marking it as stable and flip the default seems to be the r... *** RELNOTES: None Commit 0a1dce2 PiperOrigin-RevId: 578840189 Change-Id: I390910b5dd838a4a1384c5d24cedde0b7c1b2b98 Co-authored-by: Googler <[email protected]>
This new flag can be used to force redownloading when repository URLs are changed. Otherwise, it's possible broken URLs can be masked by the presence of a repository cache entry with the same hash. Specifying a
canonical_id
works as before, overriding this behavior.Closes #14128.