Skip to content
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

chore: update spring boot to version 3.3.1 #784

Conversation

ds-pweick
Copy link
Contributor

Description

This PR addresses #380.

  • The CustomUriTagProvider class has been renamed to CustomKeyValueProvider. This is due to the fact that Spring 3.2 dropped some classes and the code now uses their replacement. This replacement class no longer uses the Tag class, but the KeyValue and KeyValues classes.

  • Starting with Spring Framework 6.1 (Spring Boot 3.3.1 brings version 6.1.10), Spring's LocalVariableTableParameterNameDiscoverer can no longer be used to discover parameter names, see https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x#parameter-name-retention. This required some changes in the code:

    • Methods in the rest controller classes now explicitly include parameter names in the @PathVariable and @RequestParameter annotations, otherwise the parameters are not recognized. In the methods that were changed, the (apparently generally superfluous) validation of passed UUIDs using @Size has been removed since it caused errors. The OpenAPI spec has been adapted accordingly. An integration test has been added in BatchControllerTest to verify that this removal does not allow requests with malformed UUIDs.

    • When using the @Cacheable annotation (e.g. in SemanticsHubFacade), it is no longer possible to use a SpEl expression like "#urn" to specify the caching key. Instead, the code now needs a SpEl-Expression like "#p0", see https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/cache/annotation/Cacheable.html#key().

Pre-review checks

Please ensure to do as many of the following checks as possible, before asking for committer review:

- Renamed CustomUriTagProvider to CustomKeyValueProvider since the Tag class is no longer used by the new DefaultClientRequestObservationConvention class
- Accordingly, CustomKeyValueProvider does not have a method that returns a list of Tag, but KeyValues
- Temporary workaround: due to the changes mentioned at https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x?secureweb=Teams#parameter-name-retention, old Java code now needs to be compiled using the -parameters flag to work
- The DefaultAcceptedPoliciesConfig.AcceptedPolicy class now has a NoArgsConstructor because otherwise it currently won't bind values in application.yaml
- Validation of UUID arguments size in IrsController and BatchController has been removed since it's superfluous and causing crashes
- Starting with Spring Framework 6.1 (Spring Boot 3.3 brings version 6.1.8), Spring's LocalVariableTableParameterNameDiscoverer can no longer be used to discover parameter names, see https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x#parameter-name-retention. This required some changes in the code:

  - Methods in the rest controller classes now explicitly include parameter names in the @PathVariable and @RequestParameter annotations, otherwise the parameters are not recognized.

  - When using the @Cacheable annotation (e.g. in SemanticsHubFacade), it is no longer possible to use a SpEl expression like "#urn" to specify the caching key. Instead, the code now needs a SpEl-Expression like "#p0", see https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/cache/annotation/Cacheable.html#key().
…troller changes made due to spring boot update
@ds-pweick
Copy link
Contributor Author

Dependencies to vet: maven/mavencentral/org.apache.logging.log4j/log4j-slf4j2-impl/2.23.1 and maven/mavencentral/org.springframework.security/spring-security-test/6.3.1

@ds-jhartmann ds-jhartmann changed the base branch from main to chore/springboot-update July 10, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants