Add --experimental_repository_cache_urls_as_default_canonical_id to help detect broken repository URLs#14268
Closed
kmicklas wants to merge 2 commits intobazelbuild:masterfrom
Closed
Add --experimental_repository_cache_urls_as_default_canonical_id to help detect broken repository URLs#14268kmicklas wants to merge 2 commits intobazelbuild:masterfrom
kmicklas wants to merge 2 commits intobazelbuild:masterfrom
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.
linzhp
approved these changes
Nov 12, 2021
Contributor
|
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 |
Contributor
Author
|
I'll take a look at adding a test on Monday, thanks! |
Member
|
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.
Contributor
Author
|
I added an integration test for the new flag and the default behavior. |
brentleyjones
pushed a commit
to brentleyjones/bazel
that referenced
this pull request
Mar 7, 2022
…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)
Wyverald
pushed a commit
that referenced
this pull request
Mar 7, 2022
…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 <kmicklas@uber.com>
sluongng
added a commit
to sluongng/bazel
that referenced
this pull request
Sep 18, 2023
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.
sluongng
added a commit
to sluongng/bazel
that referenced
this pull request
Sep 19, 2023
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.
copybara-service bot
pushed a commit
that referenced
this pull request
Sep 21, 2023
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
copybara-service bot
pushed a commit
that referenced
this pull request
Nov 2, 2023
*** 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
bazel-io
pushed a commit
to bazel-io/bazel
that referenced
this pull request
Nov 2, 2023
*** 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
bazel-io
pushed a commit
to bazel-io/bazel
that referenced
this pull request
Nov 2, 2023
*** 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
bazel-io
pushed a commit
to bazel-io/bazel
that referenced
this pull request
Nov 2, 2023
*** 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
meteorcloudy
added a commit
that referenced
this pull request
Nov 2, 2023
*** 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 <pcloudy@google.com>
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 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_idworks as before, overriding this behavior.Closes #14128.