-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix io-gcp requiring hamcrest dependency #30619
Conversation
d0b9684
to
2ec11a1
Compare
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
The failed PostCommit tests are either due to #30560 or quota error (failed to bring 1 worker) |
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control |
Can we trigger BQ early rollout tests here?
|
Also would it make sense to combine TestBigQueryOptions and BigtableChangeStreamTestOptions in a new |
@Override | ||
public Iterable<Class<? extends PipelineOptions>> getPipelineOptions() { | ||
return ImmutableList.<Class<? extends PipelineOptions>>builder() | ||
.add(TestBigQueryOptions.class) |
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.
These are options for TestBigQuery
which is intended for users. Anything intended for users should be under src/main
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.
TestBigQueryOptions is still in main. The problem here is there is an AutoService to register TestBigQueryOptions, then whenever a PipelineOptionFactory.fromArgs is called, the PipelineOptionFactory tries to do some reflection access to TestBigQueryOptions which causes NoClassDefFoundError: org/hamcrest/Matcher
. This is because TestPipelineOptions has a method return a Matcher.
This makes org.hamcrest effectively a required dependency (instead of optional one) for Beam io-gcp.
If do not register TestBigQueryOptions, users can still use it. They just need to register the option before they call PipelineOptionFactory.withValidation().
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.
An alternative fix will just be make it a implementation dependency here:
provided library.java.hamcrest |
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.
Yes, making it an implementation dependency seems correct. It is, after all, an implementation dependency :-)
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.
hamcrest is a tiny tiny library that is super stable and has no transitive deps and not going to have security concerns - there is no reason to avoid it
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, opened #30635 and close this PR
I know it could seem like anything "for testing" goes under |
Fix #30617
Please add a meaningful description for your change here
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123
), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.