Skip to content

Conversation

@scottfrederick
Copy link
Contributor

Fixes #47872

For additional-spring-configuration-metadata.json files, the existing :checkAdditionalSpringConfigurationMetadata Gradle task was enhanced to verify that a non-empty since field exists any time there is a deprecation object for a property.

For annotation-based properties, an architecture rule was added to verify that a @DeprecatedConfigurationProperty annotation always has a non-empty since attribute. That should provide the fastest and most usable feedback, I think. I did not add to the :checkSpringConfigurationMetadata Gradle task to verify generated spring-configuration-metadata.json files because that felt redundant, but I'm happy to add that too if the team thinks that's more complete.

There are a few properties that have been deprecated for a very long time, before Spring Boot 2.0.0 even. Should there be a threshold for how long a property stays in a manual metadata file? If you'd like to clean that up, I can remove some of the oldest ones in another commit on this PR, or as a separate issue.

Add an architecture rule to ensure that all usages of
`@DeprecatedConfigurationProperty` in the Spring Boot codebase include
the `since` attribute.

Add the `since` attribute to the few places where it was not already
included.

Signed-off-by: Scott Frederick <scottyfred@gmail.com>
Add the `since` field to all deprecated properties in all
additional-spring-configuration-metadata.json files in the project.

Add to the CheckAdditionalSpringConfigurationMetadata build task to
ensure that all deprecated properties have a non-empty `since` field.

Signed-off-by: Scott Frederick <scottyfred@gmail.com>
@scottfrederick scottfrederick force-pushed the gh-47872-deprecate-since branch from a122ef1 to 3f58fcb Compare November 7, 2025 00:33
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 7, 2025
@scottfrederick scottfrederick changed the title Gh 47872 deprecate since Use since attribute in configuration properties deprecation consistently Nov 7, 2025
@snicoll snicoll added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 7, 2025
@snicoll snicoll added this to the 3.5.x milestone Nov 7, 2025
@snicoll snicoll self-assigned this Nov 7, 2025
@snicoll
Copy link
Member

snicoll commented Nov 7, 2025

Thanks very much for the PR Scott. Looking at it briefly and thinking how to merge this to main, I've come to realize that manual metadata without generated metadata won't have the global check at all. I've opened #47984 to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: documentation A documentation update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants