Update MongoDB driver to mongodb-driver-legacy:5.4.0
Upgrade MongoDB Driver to latest available release.
Note that as of 4.0 the mongo-java-driver uber jar is no longer published, so using mongodb-driver-legacy (which will pull in transitive dependencies) in its place.
I'll also note that I wasn't able to build the project locally without errors so I'm using the PR to check whether everything still works.
https://github.com/apache/beam/issues/32088
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] Mention the appropriate issue in your description (for example:
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. - [ ] Update
CHANGES.mdwith noteworthy changes. - [ ] If this contribution is large, please file an Apache Individual Contributor License Agreement.
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.
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers
assign set of reviewers
Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:
R: @robertwb for label java. R: @Abacn for label build. R: @johnjcasey for label io.
Available commands:
-
stop reviewer notifications- opt out of the automated review tooling -
remind me after tests pass- tag the comment author after tests pass -
waiting on author- shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
The PR bot will only process comments in the main thread (not review comments).
Apologies for not being able to get all the checks to pass. Would appreciate some assistance.
The failed test is
org.junit.ComparisonFailure: expected:<{"$match": {"[_id": {"$gt": {"$oid": "52cc8f6254c5317943000005"}}]}}> but was:<{"$match": {"[$and": [{"_id": {"$gt": {"$oid": "52cc8f6254c5317943000005"}}}]]}}>
at org.junit.Assert.assertEquals(Assert.java:117)
From failed test, go to "Summary", One can see "For more details on these failures, see this check" with a link, then the stack trace for failed test is there.
Also, there is "JUnit Test Results" uploaded in Artifact Section and one can download
Reminder, please take a look at this pr: @robertwb @Abacn @johnjcasey
The 5.4.0 driver was recently released, and I updated the dependency to reflect that. Note that 5.4.0, for the first time, includes a BOM. I'm unsure how to reference the BOM in this project, but perhaps maintainers can advise.
Also unclear why this error is happening:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':sdks:java:extensions:sql:analyzeClassesDependencies'.
> Dependency analysis found issues.
usedUndeclaredArtifacts
- org.mongodb:bson:5.4.0@jar
- org.mongodb:mongodb-driver-core:5.4.0@jar
unusedDeclaredArtifacts
- org.mongodb:mongodb-driver-legacy:5.4.0@jar
Can anyone advise?
Also unclear why this error is happening:
FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':sdks:java:extensions:sql:analyzeClassesDependencies'. > Dependency analysis found issues. usedUndeclaredArtifacts - org.mongodb:bson:5.4.0@jar - org.mongodb:mongodb-driver-core:5.4.0@jar unusedDeclaredArtifacts - org.mongodb:mongodb-driver-legacy:5.4.0@jarCan anyone advise?
This is a gradle-dependency-analyze check. It suggests in ":sdks:java:extensions:sql" it is still mongodb-driver-core instead of mongodb-driver-legacy are actually used one
@Abacn I tried various combinations of dependencies, but have not been able to find the right combination that works. I would appreciate if someone with more knowledge of the build system could give it a shot, but I understand if this PR is not top of mind for the maintainers.
Reminder, please take a look at this pr: @robertwb @Abacn @johnjcasey
Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:
R: @kennknowles for label java. R: @damccorm for label build. R: @johnjcasey for label io.
Available commands:
-
stop reviewer notifications- opt out of the automated review tooling -
remind me after tests pass- tag the comment author after tests pass -
waiting on author- shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
R: @Abacn (keeping sticky since Yi has started to review)
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.
@jyemin could you address the error and resolve the conflict so that the review can continue ?
Please let us know if you need additional help.
waiting on author
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.
This pull request has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.