-
Notifications
You must be signed in to change notification settings - Fork 59
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 --includTargetType
and --targetType
options
#194
Conversation
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 doing this!
@@ -38,6 +38,13 @@ class GetImpactedTargetsCommand : Callable<Int> { | |||
) | |||
lateinit var finalHashesJSONPath: File | |||
|
|||
@CommandLine.Option( |
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.
I believe this should be an array? You could desire to filter out for multiple types of target. Maybe this could also be backed by an enumeration to display the allowed values
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.
Yeah, I have changed it to a Set
to support multiple values. However, I was hesitant to change it to enum because in case of new types are added in the future, I expect the current code still work without need to add new values to the enum.
Thanks! |
Thanks @tinder-maxwellelliott ! Do you mind releasing a new version so that we can use it directly from this repo? |
Done |
Thank you sooooo much! |
I'm aware that it's recommended to consume the generated impacted target list with
bazel query
, as suggested in #173 and #151. However, our use case is that we do want to avoid the extra 30-60s spent onbazel query
(we have a huge workspace).This PR adds a
--includeTargetType
option togenerate-hashes
command, which will add "target type" to the generated JSON like this:Later, an extra
--targetType=Rule
can be used inget-impacted-targets
command to filter out the targets with specific type.This may be not what you like, but it does help us a lot so I'm contributing this from our fork.
The tests are updated accordingly.