-
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
Implement --target_pattern_file flag for reading patterns from file #10856
Implement --target_pattern_file flag for reading patterns from file #10856
Conversation
@michajlo thanks for your comments in #10796 (review) and your suggestion in #8609 (comment). While would like generic parameter file support in Bazel, I would also appreciate a more immediate solution to #8609. Suggesting we go with this much simpler approach for now till I can spend the time on a generic solution to the open questions in #10796. |
src/main/java/com/google/devtools/build/lib/runtime/commands/BuildCommand.java
Outdated
Show resolved
Hide resolved
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 changes!
src/main/java/com/google/devtools/build/lib/buildtool/BuildRequestOptions.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/runtime/commands/BuildCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/runtime/commands/BuildCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/runtime/commands/BuildCommand.java
Outdated
Show resolved
Hide resolved
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.
If you can figure out how to add a simple java unit test for TargetPatternFileSupport it'd be much appreciated - easier to get more coverage more quickly than the integration tests. Otherwise just minor comments.
src/main/java/com/google/devtools/build/lib/runtime/commands/BuildCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/runtime/commands/TargetPatternFileSupport.java
Outdated
Show resolved
Hide resolved
Reviewers: once approved, please read the internal go/import-bazel-pr document for PR import instructions. |
Processed the comments but did not get to the unit test yet. I looked at making one, but standing up a
I'm not sure how best to approach that, if you have any recommendation please let me know and I'll try to finish the unit test. |
CommandEnvironment should be mockable as of an hour or so ago. |
b57f364
to
904fd51
Compare
Let me know when that last test is ready, otherwise everything else lgtm. |
An alternative to bazelbuild#10796 to fix bazelbuild#8609. As bazelbuild#8609 (comment) points out there's currently a --query_file to read a query pattern from file, but there's no analogous feature available for build/test. Generic parameter file support attempted in bazelbuild#10796 turns out to be a little more complex than expected due to bazel's client/server architecture and likely requires some design document. This PR would fix help bazelbuild#8609 without rushing into any designs, so we can spend time properly designing generic parameter files while also alleviating the immediate problem with a known/simpler pattern.
2096478
to
71bad6b
Compare
@michajlo I squashed the changes and rebased them on master to resolve a merge conflict github was showing. It seems like there was a few changes to use I think all the changes, including unit and integration tests should be there. Please let me know if theres anything else! |
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.
All lgtm, just style/naming things on this round then good to go.
* list of targets based on the supplied command line options. | ||
*/ | ||
public static class TargetPatternFileSupportException extends Exception { | ||
public TargetPatternFileSupportException(String message) { super(message); } |
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.
style thing, mv the super(...) to a new line:
... {
super(message);
}
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.
Fixed. Does Bazel have something like google-java-format
setup? I couldn't find it myself in the contribution guidelines.
src/main/java/com/google/devtools/build/lib/runtime/commands/TargetPatternFileSupport.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/runtime/commands/TargetPatternFileSupport.java
Outdated
Show resolved
Hide resolved
src/test/java/com/google/devtools/build/lib/runtime/commands/TargetPatternFileSupportTest.java
Outdated
Show resolved
Hide resolved
- TargetPatternFileSupport -> TargetPatternsHelper - Add unittest for empty case - Comments/style
All comments should be taken care of. |
src/main/java/com/google/devtools/build/lib/runtime/commands/TargetPatternFileSupport.java
Outdated
Show resolved
Hide resolved
Thanks @michajlo! |
--query_file accepts space separated list of targets. |
An alternative to bazelbuild#10796 to fix bazelbuild#8609. As bazelbuild#8609 (comment) points out there's currently a `--query_file` to read a query pattern from file, but there's no analogous feature available for build/test. Generic parameter file support attempted in bazelbuild#10796 turns out to be a little more complex than expected due to bazel's client/server architecture and likely requires some design document. This PR would fix help bazelbuild#8609 without rushing into any designs, so we can spend time properly designing generic parameter files while also alleviating the immediate problem with a known/simpler pattern. Closes bazelbuild#10856. PiperOrigin-RevId: 298953350
An alternative to #10796 to fix #8609.
As #8609 (comment) points out there's currently a
--query_file
to read a query pattern from file, but there's no analogous feature available for build/test. Generic parameter file support attempted in #10796 turns out to be a little more complex than expected due to bazel's client/server architecture and likely requires some design document.This PR would fix help #8609 without rushing into any designs, so we can spend time properly designing generic parameter files while also alleviating the immediate problem with a known/simpler pattern.