Skip to content

Fix parent POM dependency resolution in From Source generator#48482

Merged
weidongxu-microsoft merged 1 commit intoAzure:mainfrom
alzimmermsft:FixFromSourceHandlingOfNestedParents
Mar 20, 2026
Merged

Fix parent POM dependency resolution in From Source generator#48482
weidongxu-microsoft merged 1 commit intoAzure:mainfrom
alzimmermsft:FixFromSourceHandlingOfNestedParents

Conversation

@alzimmermsft
Copy link
Member

Description

Fixes handling of parent POM dependencies in generate_from_source_pom.py where resolving dependencies for parent POMs only checked that parent of the current POM. This handling worked in most cases as almost all libraries in the repository use a direct parent of azure-client-sdk-parent, and its parent POM doesn't have any dependencies. This breaks down in cases of Cosmos's Spark libraries where there are multiple layers of parent POMs with the base parent containing dependencies.

The change in this PR is when handling parent POMs, deeply check them by recursing and go up the parent tree until we hit the root parent (or hit a parent that has already been added as a dependency).

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@alzimmermsft alzimmermsft self-assigned this Mar 19, 2026
Copilot AI review requested due to automatic review settings March 19, 2026 22:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the From Source aggregate POM generator to correctly resolve dependencies declared in multi-level parent POM hierarchies (e.g., Cosmos Spark), by recursing up the parent chain instead of only considering the immediate parent’s dependencies.

Changes:

  • Update resolve_project_dependencies to add the parent POM itself and recursively resolve its dependencies and ancestors.
  • Prevent duplicate parent processing by short-circuiting when a parent POM has already been added to the dependency set.

@weidongxu-microsoft weidongxu-microsoft merged commit f1828d5 into Azure:main Mar 20, 2026
23 checks 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.

4 participants