Skip to content

feat(internal/librarian/java): source google-cloud-pom-parent in pom.xml templates#6432

Open
zhumin8 wants to merge 2 commits into
googleapis:mainfrom
zhumin8:fix-java-parent-pom
Open

feat(internal/librarian/java): source google-cloud-pom-parent in pom.xml templates#6432
zhumin8 wants to merge 2 commits into
googleapis:mainfrom
zhumin8:fix-java-parent-pom

Conversation

@zhumin8

@zhumin8 zhumin8 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Update logic to parse google-cloud-pom-parent version separately from librarian.yaml, and update pom.xml templates to use dedicated marker comment for "google-cloud-pom-parent" to match versions.txt (googleapis/google-cloud-java#13483).
Note: This logic is added in parallel to existing "monorepoVersion" logic. Will do a followup to validate both config in Validate step and simplify logic when accessing these.

For #6411

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces support for retrieving and using a separate parent POM version (google-cloud-pom-parent) instead of relying solely on the monorepo version (google-cloud-java). It adds a helper function findParentPOMVersion to extract this version from the configuration, updates the syncPOMs and collectModules signatures to accept and propagate the parent version, and updates the relevant POM templates and test files accordingly. I have no feedback to provide as there are no review comments.

// TODO(https://github.com/googleapis/librarian/issues/5529): remove returning version entries.
func syncPOMs(library *config.Library, libraryDir, monorepoVersion string, metadata *repoMetadata, transports map[string]serviceconfig.Transport) error {
modules, err := collectModules(library, libraryDir, monorepoVersion, metadata, transports)
func syncPOMs(library *config.Library, libraryDir, monorepoVersion, parentVersion string, metadata *repoMetadata, transports map[string]serviceconfig.Transport) error {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

inputs are becoming too long to read. Filed #6439 to fix separately

@zhumin8 zhumin8 force-pushed the fix-java-parent-pom branch from f654e20 to f086e7d Compare June 16, 2026 01:27
@zhumin8 zhumin8 marked this pull request as ready for review June 16, 2026 01:32
@zhumin8 zhumin8 requested a review from a team as a code owner June 16, 2026 01:32
@zhumin8 zhumin8 requested review from JoeWang1127 and sofisl June 16, 2026 01:32
return lib.Version, nil
}
}
return "", errParentVersion

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.

Could you add a test to verify the error case?

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