Bump org.springframework.boot:spring-boot-starter-parent from 3.1.4 to 4.1.0-RC1#751
Conversation
|
Oh, a major release. 👀 |
13fff85 to
07fdaa7
Compare
kinow
left a comment
There was a problem hiding this comment.
Started working on updating it. Got a really broken Java workspace in IntelliJ, but I think it should pass the build in a couple of days, I hope :)
Bumps [org.springframework.boot:spring-boot-starter-parent](https://github.com/spring-projects/spring-boot) from 3.1.4 to 4.0.0. - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](spring-projects/spring-boot@v3.1.4...v4.0.0) --- updated-dependencies: - dependency-name: org.springframework.boot:spring-boot-starter-parent dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
e6ddcf2 to
4a173ca
Compare
Only pending to sort out the tests now, I think. |
…d cleanup the code to use newer JVM 25 features (we had some JVM 5 patterns)
|
CodeQL identified a regex that could be used to create some sort of DDOS attack, I think. A good catch. Tried to fix it. It's the last part of the build process that's still failing. Nearly there! |
…deQL security and performance warnings)
|
The build is finally green! After being read since Nov 2025 😆 Now time to perform some tests, maybe using the workflow from CERN with a comma in the name too 🤓 |
…imum so everything works, less to worry for the next upgrade)
|
One test should fail now. CodeQL build didn't pass due to the regexes used. I removed them and parsed the URL instead. I just need to understand how the generic git URL works now (@mr-c gave me a hint with his comment #782 (comment)). Once that's fixed, I think the work in this branch should be done. Commits can be squashed or reorganized if we would like to keep any for rolling back. Most of our changes in CWL Viewer are rather simple to test. But as with every Spring Boot update, I had to adjust the database layer. We ditched the library that did the translation between Hibernate and Postgres data (we added that during the migration from Mongo to Postgres). Hibernate and Spring Data are able to work directly with JSON and convert to objects. But in order for that to work, I had to update We had a lot of warnings due to deprecation, old Java style, code smells, static analysis errors. So it was hard to see what was new and old in the IDE. The same happened with the Mongo -> Postgres migration, and then Spring Boot 2 -> 3. So this time I bit the bullet and fixed most of these warnings. Some would be good to fix, like ignoring risks when converting Object to custom types like Strings, lists. But these require more testing, and are riskier to implement, so I left them out. |
| with: | ||
| distribution: 'adopt' | ||
| java-version: '17' | ||
| java-version: '25' |
There was a problem hiding this comment.
Spring Boot 4 requires 17, but it wasn't compiling for me. I moved to 25, new LTS version of Java. That brings getFirst(), Java records, and hopefully a bit of performance improvement? I can try again with JVM 17 if it's a blocker.
| /** Represents the input/output of a workflow/tool */ | ||
| @JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
| public class CWLElement { | ||
| public class CWLElement implements Serializable { |
There was a problem hiding this comment.
hypersistence-utils-hibernate library was handling the transformation from CWLElement and others like CWLStep into JSON. Now Jackson + Hibernate can handle this, but we need to make it Serializable or write a converter.
| CWLElement inputOutput = new CWLElement(); | ||
| List<String> sources = extractSource(inOutNode); | ||
| if (sources.size() > 0) { | ||
| if (!sources.isEmpty()) { |
There was a problem hiding this comment.
isEmpty is new in... Java 21 I think.
| typeDetails.append("[], "); | ||
| } else { | ||
| typeDetails.append(type.toString() + ", "); | ||
| typeDetails.append(type).append(", "); |
There was a problem hiding this comment.
Faster than concatenating strings.
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ |
| invocation -> { | ||
| Object[] args = invocation.getArguments(); | ||
| return permalink + "?format=" + args[0]; | ||
| }); |
There was a problem hiding this comment.
Lambdas, no need to use new objects (I guess micro-optimization too, but easier to read/write)
| * | ||
| * @since 1.4.6 | ||
| */ | ||
| @ExtendWith(MockitoExtension.class) |
There was a problem hiding this comment.
We had JUnit 4 mixed, and also old-style Mockito. Had to spend some time rewriting everything to JUnit 5+ and new Spring Test + Mockito.
|
|
||
| @Test | ||
| public void testBundleTemporaryDirectoryDoesNotExist() throws IOException { | ||
| void testBundleTemporaryDirectoryDoesNotExist() throws IOException { |
There was a problem hiding this comment.
New syntax in JUnit 5 always skips the method visibility (more to make it easier for future Java devs to read this code 🤷 , functionally there's no difference)... more Javonic ? 😆
| @@ -1,4 +1,4 @@ | |||
| spring.jpa.hibernate.ddl-auto=create | |||
| spring.jpa.hibernate.ddl-auto=create-drop | |||
There was a problem hiding this comment.
The tests were not running with just create 🤷 This doesn't involve production, only tests, so I didn't spend too long investigating why.
| <groupId>com.fasterxml.jackson.module</groupId> | ||
| <artifactId>jackson-module-jakarta-xmlbind-annotations</artifactId> | ||
| <version>2.21.3</version> | ||
| </dependency> |
There was a problem hiding this comment.
These were causing conflicts with new dependencies in Spring Boot & Spring Data.
04479d2 to
f33f603
Compare
| WHERE q.temp_representation -> 'retrievedFrom' = :retrievedFrom | ||
| """, | ||
| nativeQuery = true) | ||
| void deleteByRetrievedFrom(@Param("retrievedFrom") GitDetails retrievedFrom); |
There was a problem hiding this comment.
In Spring Boot 2 -> 3, we had to do some fiddling with the queries and JSON objects. After a long time (it took really long), we found a stable recipe where we did the mapping with the help of an extra library that mapped JSON & Hibernate objects, but we had to re-write the repository queries to use native SQL, but calling internal objects of Spring Boot & Hibernate/JPA to fetch the data.
With Spring Boot 4 and new Hibernate/JPA, it magically does the serialization correctly! So we can move the queries back here, using JSON (before it wasn't necessary when we had Mongo), and delete the "custom" and "impl" repository classes. ! 🎉 Less code to maintain.
| // No part requested, let's show some alternate permalinks, | ||
| // in addition to the raw redirect | ||
| throw new MultipleWorkflowsException(matches); | ||
| } |
There was a problem hiding this comment.
Here we know part.isPresent is try. Because we tested part.isEmpty before. We didn't have to test null as that's an optional that will be provided (although its content may not be there... because it's optional 😅 )
| // delete saved queued workflow by workflow git details | ||
| repository.deleteByTempRepresentation_RetrievedFrom( | ||
| queuedWorkflow.getTempRepresentation().getRetrievedFrom()); | ||
| repository.deleteByRetrievedFrom(queuedWorkflow.getTempRepresentation().getRetrievedFrom()); |
There was a problem hiding this comment.
It looks like I moved the line, and removed spaces, but looking at the Java file everything looks ok. GitHub UI bug/glitch, I guess.
…nd more string concatenation removal
|
Ok. Build is green. Code now has a lot less warnings, so the next upgrade to Spring Boot 5 or so should be a lot simpler 🙏 Also managed to ditch the extra library to do serialization, so I'm hoping Spring 5 might be a one-day job. @mr-c , @GlassOfWhiskey ready for review. Sorry for the amount of changes. I left comments explaining the changes. There are also a few commits so I might be able to revert some changes without much effort, if needed. It needs JVM 25 now. And would be good to do a test before replacing the current viewer as this is changing the Spring Boot version. I tested with If you want to test with Docker, create That last part is to build the code inside a new container, instead of using cwlviewer:latest. That may take some seconds/minutes depending on your memory/cpu.
Cheers |
| PREFIX DockerRequirement: <https://w3id.org/cwl/cwl#DockerRequirement/> | ||
| PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
| PREFIX s: <http://schema.org/>"""; | ||
|
|
There was a problem hiding this comment.
Nothing to see here, just making the code easier to change for the issues related to SPARQL, and for the #782 (I toyed with this code, trying to get the workflow to render, and it's harder with the concatenated strings).

Bumps org.springframework.boot:spring-boot-starter-parent from 3.1.4 to 4.0.0.
Release notes
Sourced from org.springframework.boot:spring-boot-starter-parent's releases.
... (truncated)
Commits
1c0e08bRelease v4.0.03487928Merge branch '3.5.x'29b8e96Switch make-default in preparation for Spring Boot 4.0.088da0ddMerge branch '3.5.x'56feeaaNext development version (v3.5.9-SNAPSHOT)3becdc7Move server.error properties to spring.web.error2b30632Merge branch '3.5.x'4f03b44Merge branch '3.4.x' into 3.5.x3d15c13Next development version (v3.4.13-SNAPSHOT)dc140dfUpgrade to Spring Framework 7.0.1Most Recent Ignore Conditions Applied to This Pull Request
You can trigger a rebase of this PR by commenting
@dependabot rebase.Note: Dependabot was ignoring updates to this dependency, but since you've updated it yourself we've started tracking it for you again. 🤖
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)