Repository navigation
feat(internal/librarian/java): pre-validate java libraries bom version in config - #6613
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the validation of the Java Libraries BOM version by moving it from the post-processing phase to the configuration tidy phase. A new validateBOM function has been introduced in tidy.go to ensure the BOM version is set upfront, allowing direct access to LibrariesBOMVersion during post-processing and simplifying the code. Test cases, sample configurations, and test data have been updated to reflect this change. No review comments were provided, so there is no additional feedback.
sofisl
marked this pull request as ready for review
July 1, 2026 20:12
Signed-off-by: sofisl <[email protected]>
zhumin8
reviewed
Jul 1, 2026
Following code review feedback, the validation for LibrariesBOMVersion has been shifted from to the package. This separates the language-specific logic cleanly.
zhumin8
reviewed
Jul 6, 2026
zhumin8
reviewed
Jul 6, 2026
zhumin8
reviewed
Jul 6, 2026
zhumin8
reviewed
Jul 6, 2026
zhumin8
approved these changes
Jul 6, 2026
sofisl
enabled auto-merge (squash)
July 6, 2026 22:46
sofisl
pushed a commit
to sofisl/librarian
that referenced
this pull request
Jul 7, 2026
…m version in config" (googleapis#6666) Reverts googleapis#6613
noahdietz
pushed a commit
to noahdietz/librarian
that referenced
this pull request
Jul 7, 2026
🤖 I have created a release *beep* *boop* --- ## [0.25.0](googleapis/librarian@v0.24.0...v0.25.0) (2026-07-07) ### Features * **internal/config:** add declarative postprocessing config schema ([googleapis#6651](googleapis#6651)) ([12ecef3](googleapis@12ecef3)), closes [googleapis#6516](googleapis#6516) * **internal/filesystem:** add MoveAndMergeWithKeep and MoveAndMerge deprecation TODO ([googleapis#6644](googleapis#6644)) ([fe91dda](googleapis@fe91dda)), closes [googleapis#6516](googleapis#6516) * **internal/librarian/java:** add comment to fully generated POM templates ([googleapis#6648](googleapis#6648)) ([54f881b](googleapis@54f881b)) * **internal/librarian/java:** add Java README rendering without snippets ([googleapis#6636](googleapis#6636)) ([96e890a](googleapis@96e890a)), closes [googleapis#6515](googleapis#6515) * **internal/librarian/java:** add logging-logback to legacy BOMs ([googleapis#6669](googleapis#6669)) ([258d1de](googleapis@258d1de)) * **internal/librarian/java:** add README metadata parsing helpers ([googleapis#6595](googleapis#6595)) ([c402d4a](googleapis@c402d4a)), closes [googleapis#6515](googleapis#6515) * **internal/librarian/java:** add README partials loader ([googleapis#6596](googleapis#6596)) ([4babb38](googleapis@4babb38)), closes [googleapis#6515](googleapis#6515) * **internal/librarian/java:** pre-validate java libraries bom version in config ([googleapis#6613](googleapis#6613)) ([6fe1ee3](googleapis@6fe1ee3)) * **internal/librarian/java:** source google-cloud-pom-parent in pom.xml templates ([googleapis#6607](googleapis#6607)) ([3c46b73](googleapis@3c46b73)) * **internal/librarian/php:** add skeleton code for PHP client library generation ([googleapis#6641](googleapis#6641)) ([dba27ec](googleapis@dba27ec)) * **internal/librarian:** add `protoc` installation support ([googleapis#6583](googleapis#6583)) ([6037497](googleapis@6037497)), closes [googleapis#6558](googleapis#6558) * **internal/librarian:** track Go snippet metadata in release-please ([googleapis#6525](googleapis#6525)) ([22c3b33](googleapis@22c3b33)) * **nodejs:** read nodejs tools from librarian.yaml config ([googleapis#6649](googleapis#6649)) ([0bebff2](googleapis@0bebff2)) ### Bug Fixes * **internal/postprocessing:** add input validation and error handling in Replace and ReplaceRegex ([googleapis#6661](googleapis#6661)) ([1a32aab](googleapis@1a32aab)), closes [googleapis#6516](googleapis#6516) * **rust:** do not add empty rust config ([googleapis#6609](googleapis#6609)) ([c563304](googleapis@c563304)) * **rust:** tidy empty rust blocks ([googleapis#6618](googleapis#6618)) ([dfa0f2d](googleapis@dfa0f2d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
sofisl
pushed a commit
to sofisl/librarian
that referenced
this pull request
Jul 8, 2026
🤖 I have created a release *beep* *boop* --- ## [0.25.0](googleapis/librarian@v0.24.0...v0.25.0) (2026-07-07) ### Features * **internal/config:** add declarative postprocessing config schema ([googleapis#6651](googleapis#6651)) ([12ecef3](googleapis@12ecef3)), closes [googleapis#6516](googleapis#6516) * **internal/filesystem:** add MoveAndMergeWithKeep and MoveAndMerge deprecation TODO ([googleapis#6644](googleapis#6644)) ([fe91dda](googleapis@fe91dda)), closes [googleapis#6516](googleapis#6516) * **internal/librarian/java:** add comment to fully generated POM templates ([googleapis#6648](googleapis#6648)) ([54f881b](googleapis@54f881b)) * **internal/librarian/java:** add Java README rendering without snippets ([googleapis#6636](googleapis#6636)) ([96e890a](googleapis@96e890a)), closes [googleapis#6515](googleapis#6515) * **internal/librarian/java:** add logging-logback to legacy BOMs ([googleapis#6669](googleapis#6669)) ([258d1de](googleapis@258d1de)) * **internal/librarian/java:** add README metadata parsing helpers ([googleapis#6595](googleapis#6595)) ([c402d4a](googleapis@c402d4a)), closes [googleapis#6515](googleapis#6515) * **internal/librarian/java:** add README partials loader ([googleapis#6596](googleapis#6596)) ([4babb38](googleapis@4babb38)), closes [googleapis#6515](googleapis#6515) * **internal/librarian/java:** pre-validate java libraries bom version in config ([googleapis#6613](googleapis#6613)) ([6fe1ee3](googleapis@6fe1ee3)) * **internal/librarian/java:** source google-cloud-pom-parent in pom.xml templates ([googleapis#6607](googleapis#6607)) ([3c46b73](googleapis@3c46b73)) * **internal/librarian/php:** add skeleton code for PHP client library generation ([googleapis#6641](googleapis#6641)) ([dba27ec](googleapis@dba27ec)) * **internal/librarian:** add `protoc` installation support ([googleapis#6583](googleapis#6583)) ([6037497](googleapis@6037497)), closes [googleapis#6558](googleapis#6558) * **internal/librarian:** track Go snippet metadata in release-please ([googleapis#6525](googleapis#6525)) ([22c3b33](googleapis@22c3b33)) * **nodejs:** read nodejs tools from librarian.yaml config ([googleapis#6649](googleapis#6649)) ([0bebff2](googleapis@0bebff2)) ### Bug Fixes * **internal/postprocessing:** add input validation and error handling in Replace and ReplaceRegex ([googleapis#6661](googleapis#6661)) ([1a32aab](googleapis@1a32aab)), closes [googleapis#6516](googleapis#6516) * **rust:** do not add empty rust config ([googleapis#6609](googleapis#6609)) ([c563304](googleapis@c563304)) * **rust:** tidy empty rust blocks ([googleapis#6618](googleapis#6618)) ([dfa0f2d](googleapis@dfa0f2d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
sofisl
added a commit
that referenced
this pull request
Jul 14, 2026
…n in config (#6674) A BOM version is now required and validated upfront in the config, and findBOMVersion is removed. This reapplies the changes from pull request [6613](#6613) (exactly the same) and adds a fix for the undefined findBOMVersion error in internal/librarian/java/readme.go by accessing the config value directly (removing the call to `findBOMVersion`, which we deleted). Fixes #5152 --------- Signed-off-by: sofisl <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change modifies librarian to pre-validate that the LibrariesBOMVersion is present for Java libraries during the configuration parsing and tidying phase (
librarian tidy). Previously, this check was performed deep in thegeneration phase, which could result in a later, less predictable failure.
Fixes #5152