-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Upgrade to SpringBoot 2.6.1, updating unit test and code accordingly #284
Conversation
https://travis-ci.com/github/common-workflow-language/cwlviewer/builds/198507618#L1273 |
@kinow I assigned you this PR, but feel free to make a new branch |
59d8d70
to
9a28792
Compare
Rebased. |
<groupId>org.hibernate.validator</groupId> | ||
<artifactId>hibernate-validator</artifactId> | ||
<version>6.0.13.Final</version> | ||
</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.
Looks like javax.validation
implementation is not included, so had to import the Hibernate validator (this is not ORM, just the validation part, which is a reference implementation of JSR-303)
(checklist moved to first comment, so it is visible on the issues page) |
Thanks @kinow ! I moved your checklist to the first comment so that it shows up on the issues browser. Let me know if you don't have the permissions to edit it further. |
Huh, funny, |
Manual tests passed with |
bc9ca67
to
187aa81
Compare
All right. The MongoDB test passed locally, because the tests were run sequentially. On GitHub Actions they were running in parallel, so there was a conflict with ports. Setting the port number to |
@mr-c this PR should upgrade SpringBoot to I don't know enough about the production environment to say it will work flawlessly when merged & deployed. So, if possible, a backup when upgrading would be recommended IMO. Let me know if you know what would be the next steps here, or if I need to talk with someone else to see it merged & deployed 🎉 -Bruno |
@kinow this is fantastic! Deployment is manual, so no worries about merging this PR. Do you want me to squash this down to one commit, or do you want to cleanup these commits and then I'll rebase onto the primary branch? |
187aa81
to
0b9f326
Compare
Forgot about squashing commits. Done now 🙂 Thanks! |
Oh, I can always easily squash down to one commit myself in the web interface. I wondered if you preferred one big commit or a series of fewer commits with cleaned up descriptions. |
0b9f326
to
b0ebf68
Compare
@kinow I force pushed with correct attribution. You wrote a lot of nice commit messages, and some of them should be saved. But since I didn't have a local checkout prior to your squash I can't regroup your original commits. Would you mind doing so? (next week is fine!) I did make a local backup of view.commonwl.org via the instructions at https://github.com/common-workflow-language/cwlviewer#dumprestore and I did a partial restore until I got bored. Seems fine! |
1b8a573
to
a75d12c
Compare
Update springboot to 2.2.2.RELEASE and inject specific dependency for spring-data-commons. An older data-commons dependency without touching WorkflowService.
Had to add a new dependency for the embedded MongoDB server used for tests. The version of MongoDB used for tests (embedded) also needs to be defined now. And MongoDB/SpringData integration appears to be more strict. A query like { obj.property: ?0 } failed, and took me a long time to recognize that it was missing quotes, so { 'obj.property': ?0 } fixed it. Finally, there was also an issue with serialization. For some reason now the Mongo repository was failing to serialize a response for Workflow. The object contained a final String that was used for the base URL of permanent links, and Mongo/Spring/etc wanted a way to set that value in the constructor. Tried the @PersistenceConstructor annotation but that didn't work. In the end it was easy to fix it by making the final String now a constant
a75d12c
to
23574bf
Compare
Did I replace an author somewhere, or forgot a commit? I thought perhaps you meant the co-author bit that appears after I rebase; but I don't know how to remove it. Hopefully I didn't mess it up now...
Thanks! I remember adding some links in the commits to explain where settings/changes were coming from. But there are two commits fixing unit tests which could be combined perhaps. The commit message could be merged into a single message with links & notes. Feel free to re-organize the commits if you'd like @mr-c. I used
Hooray! 🎉 Thanks! |
No, the issue was your commit didn't list you as an author! :-)
I did a local check and all is good; thanks! I'll do some light commit combining with |
23574bf
to
7bfe840
Compare
🤣 ops! Thanks @mr-c ! |
(redo of #280 )
The reported issue is related to the following case:
https://stackoverflow.com/questions/49316751/spring-data-jpa-findone-change-to-optional-how-to-use-this
Solution:
[Editing Pom.xml]
update Spring Boot:
org.springframework.boot spring-boot-starter-parent 2.2.2.RELEASEadd the following dependency for ensuring that we use the appropriate spring-data-commons version.
org.springframework.data spring-data-commons 2.0.1.RELEASE[WorkflowService.java]
Replace any occurrence of the findOne with findById(id).orElse(null) here:
org.commonwl.view.workflow.WorkflowRepository
org.commonwl.view.workflow.QueuedWorkflowRepository
With these changes we should expect to build successfully.
2.6.1
(latest)spring-data-commons
to2.6.0