chore(bigtable): correct sparse-bootstrap dep discovery and install ordering#13523
Merged
Merged
Conversation
…rdering The previous script missed cross-project SNAPSHOT deps and could fail on clean-m2 runs. Fixes: - Walk regular <dependency> edges (not just parent + BOM imports) so monorepo SNAPSHOTs like api-common-java are discovered. - Version-aware edge following: skip edges whose declared version doesn't match the local pom, so pinned released BOM imports (e.g. google-cloud-pubsub-bom:1.140.0 from google-cloud-jar-parent) aren't mistakenly followed to the local SNAPSHOT, which created cycles and phantom projects in the install list. - Verify the local pom's coord+version matches <parent> before accepting the <relativePath> shortcut; the Maven default '../pom.xml' otherwise resolves to the unrelated repo-root pom. - Enqueue each project's aggregator <project>/pom.xml when any pom under it is visited, since 'cd <project> && mvn' forces Maven to load the aggregator regardless of -pl. - Flush the install batch on every top-level project change so interleaved topo orders (A1, A2, B1, A3 when A3 depends on B1) install in dep order instead of being collapsed per project. - Match pom filenames by exact basename so test resources like src/test/resources/gax-example-pom.xml aren't picked up as modules.
Contributor
There was a problem hiding this comment.
Code Review
This pull request enhances the sparse-bootstrap.py script to resolve and traverse regular <dependency> edges within the monorepo, and updates the install command generation to preserve topological order by grouping consecutive POMs of the same project. The review feedback highlights three key improvements: resolving a namespace issue in get_version that prevents inheriting versions from parent POMs, adding the -N flag to mvn install when no sub-modules are present to prevent recursive builds in sparse checkouts, and caching parsed XML roots to avoid redundant parsing during dependency resolution.
mutianf
approved these changes
Jun 22, 2026
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.
The previous script missed cross-project SNAPSHOT deps and could fail on clean-m2 runs. Fixes: