Skip to content

Improve Spring AI version consistency validation - #138

Open
codingkiddo wants to merge 1 commit into
spring-projects:mainfrom
codingkiddo:fix/version-consistency-validation
Open

Improve Spring AI version consistency validation#138
codingkiddo wants to merge 1 commit into
spring-projects:mainfrom
codingkiddo:fix/version-consistency-validation

Conversation

@codingkiddo

Copy link
Copy Markdown

Summary

Improve scripts/check-spring-ai-version.sh so that Spring AI version validation is more portable and accurate.

The previous implementation used a Bash associative array through declare -A, which is unsupported by the default Bash version available on macOS.

The checker also considered Spring AI version declarations contained inside XML comments, which could cause false version inconsistencies.

Changes

  • Remove the Bash 4-only associative array usage.
  • Support execution with the default macOS Bash.
  • Detect Spring AI versions declared through <spring-ai.version>.
  • Detect versions declared directly on the spring-ai-bom dependency.
  • Ignore Spring AI declarations contained inside XML comments.
  • Report an error when no active Spring AI version declarations are found.
  • Return a non-zero exit code when multiple active versions are found.
  • Add a regression test covering an active version alongside a commented-out version.

Example

The following commented declaration is now ignored:

<!-- <spring-ai.version>1.1.3-SNAPSHOT</spring-ai.version> -->
<spring-ai.version>2.0.0-SNAPSHOT</spring-ai.version>

Previously, both versions could be reported, resulting in a false inconsistency.

Testing

bash -n scripts/check-spring-ai-version.sh
bash -n scripts/tests/check-spring-ai-version-tests.sh

./scripts/tests/check-spring-ai-version-tests.sh
./scripts/check-spring-ai-version.sh

Repository result:

2.0.0-SNAPSHOT: 77 files
All detected declarations use Spring AI version 2.0.0-SNAPSHOT

Signed-off-by: Vinod Kumar <codingkiddo@gmail.com>
@codingkiddo
codingkiddo force-pushed the fix/version-consistency-validation branch from 5a3dbe1 to 9586761 Compare July 21, 2026 04:52
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.

1 participant