-
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
Allow ~/home in downloaderConfig of RepositoryOptions #24618
Conversation
8a707e7
to
7070f16
Compare
UrlRewriter rewriter = | ||
UrlRewriter.getDownloaderUrlRewriter( | ||
env.getWorkspace(), repoOptions.downloaderConfig, env.getReporter()); | ||
env.getWorkspace(), configPath, env.getReporter()); |
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.
Nit: Could you change the signature of this method to accept a PathFragment
instead of a String
?
7070f16
to
f816a57
Compare
@@ -86,11 +87,11 @@ public class UrlRewriter { | |||
* @param reporter Used for logging when URLs are rewritten. | |||
*/ | |||
public static UrlRewriter getDownloaderUrlRewriter( | |||
Path workspaceRoot, String configPath, Reporter reporter) throws UrlRewriterParseException { | |||
Path workspaceRoot, PathFragment configPath, Reporter reporter) throws UrlRewriterParseException { |
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.
Path workspaceRoot, PathFragment configPath, Reporter reporter) throws UrlRewriterParseException { | |
Path workspaceRoot, @Nullable PathFragment configPath, Reporter reporter) throws UrlRewriterParseException { |
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 for the improvement! Can we add a test for this?
Similar to `--distdir` it makes sense to provide a `--experimental_downloader_config` from `~/.bazelrc` where it is more convenient to address a file in ones home directory by using `~/...` syntax instead of an absolute path.
f816a57
to
07becea
Compare
Can you please link to an existing test which can be extended? I could not find any test for |
@meteorcloudy That's a unit test though and this PR relies on changes to |
I don't see there a fitting example. In this test file it creates a rewriter by calling the c'tor But in this PR we only change the outside observable behaviour where an user can call |
Oh I see, then the converter itself should have been well tested: |
@bazel-io fork 8.1.0 |
Similar to `--distdir` it makes sense to provide a `--experimental_downloader_config` from `~/.bazelrc` where it is more convenient to address a file in ones home directory by using `~/...` syntax instead of on absolute path. Closes bazelbuild#24618. PiperOrigin-RevId: 708007102 Change-Id: Ia8d0ebc1cb79c95ea58888c08746adc917d3fb63
Similar to `--distdir` it makes sense to provide a `--experimental_downloader_config` from `~/.bazelrc` where it is more convenient to address a file in ones home directory by using `~/...` syntax instead of on absolute path. Closes #24618. PiperOrigin-RevId: 708007102 Change-Id: Ia8d0ebc1cb79c95ea58888c08746adc917d3fb63 Commit 0ce2d7d Co-authored-by: Kiron <[email protected]>
Similar to `--distdir` it makes sense to provide a `--experimental_downloader_config` from `~/.bazelrc` where it is more convenient to address a file in ones home directory by using `~/...` syntax instead of on absolute path. Closes bazelbuild#24618. PiperOrigin-RevId: 708007102 Change-Id: Ia8d0ebc1cb79c95ea58888c08746adc917d3fb63
Similar to
--distdir
it makes sense to provide a--experimental_downloader_config
from~/.bazelrc
where it is more convenient to address a file in ones home directory by using~/...
syntax instead of on absolute path.