Skip to content

Introduce RootComponentIdentifier#33654

Merged
jvandort merged 2 commits intomasterfrom
jvandort/dm/introduce-root-component-identifier
Jun 2, 2025
Merged

Introduce RootComponentIdentifier#33654
jvandort merged 2 commits intomasterfrom
jvandort/dm/introduce-root-component-identifier

Conversation

@jvandort
Copy link
Copy Markdown
Member

@jvandort jvandort commented May 28, 2025

Prior to this change, the root variant produced by a resolvable configuration would always live in the same component used to advertise the variants produced by the consumable configurations of a dependency management instance.

There are three scenarios to consider here

  1. A buildscript, or other use of DependencyManagementServices#newDetachedResolver. These dependency management instances have no variants
  2. A project. These dependency management instances have variants
  3. A detached configuration.

For scenarios 1 and 3, the root variant is now placed in a root component that is identified by a RootComponentIdentifier. Previously, for scenario 1, we identified the component as unspecified:unspecified:unspecified, and for scenario 3, we identified the component as the same identifier as the project.

By putting project detached configurations in a separate component, they are now able to resolve dependencies that target the project they live within.

In the future we also want to do this for scenario 2, where the root variant of resolutions within a project also live within some adhoc root component. In practice, the root variant is not a real variant of the project component, but some virtual variant. As a result, resolvable configurations in projects are not able to resolve other versions of that same project. This is likely a more significant change than for buildscripts and detached configurations, so we will start with this set of changes and see how the ecosystem handles these changes

Fixes #9591
Fixes #30320

Reviewing cheatsheet

Before merging the PR, comments starting with

  • ❌ ❓must be fixed
  • 🤔 💅 should be fixed
  • 💭 may be fixed
  • 🎉 celebrate happy things

@jvandort jvandort added this to the 9.0.0 RC1 milestone May 28, 2025
@jvandort jvandort self-assigned this May 28, 2025
@jvandort
Copy link
Copy Markdown
Member Author

@bot-gradle test this

@jvandort jvandort marked this pull request as ready for review May 28, 2025 22:19
@jvandort jvandort requested review from a team as code owners May 28, 2025 22:19
@jvandort jvandort requested review from a team, 6hundreds, bamboo and big-guy and removed request for a team May 28, 2025 22:19
@bot-gradle

This comment has been minimized.

@bot-gradle
Copy link
Copy Markdown
Collaborator

The following builds have passed:

DomainObjectContext domainObjectContext,
String name,
ConfigurationsProvider configurationsProvider,
boolean isDetached,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Lets inline false for all these role locked configurations

jvandort added 2 commits June 2, 2025 13:03
Prior to this change, the root variant produced by a resolvable configuration would always live in the
same component used to advertise the variants produced by the consumable configurations of a dependency
management instance.

There are three scenarios to consider here
1. A buildscript, or other use of DependencyManagementServices#newDetachedResolver
   These dependency management instances have no variants
2. A project. These dependency management instances have variants
3. A detached configuration.

For scenarios 1 and 3, the root variant is now placed in a root component that is identified by a RootComponentIdentifier.
Previously, for scenario 1, we identified the component as unspecified:unspecified:unspecified, and for scenario 3,
we identified the component as the same identifier as the project.

By putting project detached configurations in a separate component, they are now able to resovle dependencies that target
the project they live witin.

In the future we also want to do this for scenario 2, where the root variant of resolutions within a project also live within
some adhoc root component. In practice, the root variant is not a real variant of the project component, but some virtual variant.
As a result, resolvable configurations in projects are not able to resolve other versions of that same project. This is likely a more
significant change than for buildscripts and detached configurations, so we will start with this set of changes and see how
the ecosystem handles these changes
These will always be detached. Only legacy configurations are created as detached
@jvandort jvandort force-pushed the jvandort/dm/introduce-root-component-identifier branch from 1766dcc to b428314 Compare June 2, 2025 17:05
@jvandort jvandort added this pull request to the merge queue Jun 2, 2025
@bot-gradle
Copy link
Copy Markdown
Collaborator

WARN: Based on labels, this pull request addresses notable issue but no changes to release note found.

Merged via the queue into master with commit 7a9771f Jun 2, 2025
25 checks passed
@jvandort jvandort deleted the jvandort/dm/introduce-root-component-identifier branch June 2, 2025 19:18
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.

Add RootComponentIdentifier for root components Cannot resolve a dependency on the root project in a detached configuration

3 participants