Skip to content

fix(server): handle null values in flattened info tags - #5842

Merged
ulischulte merged 5 commits into
codecentric:masterfrom
Aminark:fix/null-info-tags
Oct 30, 2026
Merged

ulischulte merged 5 commits into
codecentric:masterfrom
Aminark:fix/null-info-tags

Conversation

@Aminark

@Aminark Aminark commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

An actuator info response such as {"tags.owner": null, "build.version": "1.2.3"} makes InfoUpdater.updateInfo fail with a NullPointerException. Flattened tags are collected with Map.Entry::getValue, and the map collector rejects the null value before the normal tag conversion can run. The same value already works in nested tags.

Convert flattened tag values with Objects.toString before collecting them, preserving the existing nested-tag behavior and insertion order. A null tag therefore no longer prevents the remaining info, including the build version, from being updated.

Validation on Java 17:

  • Added a regression test comparing flat and nested tags, including null and boolean values.
  • Added a WireMock test exercising the actual info response and repository update.
  • Both new tests fail on the original implementation.
  • mvn -f spring-boot-admin-server/pom.xml test -DdisableSpringSnapshots -Dtest=TagsTest,InfoUpdaterTest,InstanceTest: 17 tests pass, with no failures, errors, or skips.
  • Checkstyle and Spring Java Format validation pass.

@Aminark
Aminark requested a review from a team as a code owner October 28, 2026 05:24

@ulischulte ulischulte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…in/server/domain/values/Tags.java


On a Turkish-locale JVM, "TAGS." lowercases to a string with a dotless ı, so those keys don't match.
@ulischulte
ulischulte enabled auto-merge (squash) October 30, 2026 07:38
…in/server/domain/values/Tags.java

On a Turkish-locale JVM, "TAGS." lowercases to a string with a dotless ı, so those keys don't match.
@ulischulte
ulischulte merged commit c709138 into codecentric:master Oct 30, 2026
1 check passed
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