Skip to content

Clean up DependencyState#34927

Merged
jvandort merged 1 commit into
masterfrom
jvandort/dm/hacks/dependency-state-hacking
Sep 24, 2025
Merged

Clean up DependencyState#34927
jvandort merged 1 commit into
masterfrom
jvandort/dm/hacks/dependency-state-hacking

Conversation

@jvandort

@jvandort jvandort commented Sep 8, 2025

Copy link
Copy Markdown
Member

The previous caching dependency substitution applicator failed to include the requested artifacts as part of the cache key. The requested artifacts were passed to the dependency substitution details, making the cache unreliable. We combine the default and caching substitution applicators to increase locality, making it more difficult to make this cache unreliable in the future.

We also remove the substitution cache from DependencyState. Instead, we only construct DependencyState instances directly from DependencyMetadata instances, after substitution. This saves us from having a map for every DependencyState instance, and saves us from instantiating one extra DependencyState for every substituted edge.

Reviewing cheatsheet

Before merging the PR, comments starting with

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

@jvandort jvandort self-assigned this Sep 8, 2025
@jvandort jvandort added this to the 9.2.0 RC1 milestone Sep 8, 2025
@jvandort jvandort force-pushed the jvandort/dm/hacks/dependency-state-hacking branch 2 times, most recently from e3bd2dd to 5d9503a Compare September 9, 2025 15:34
@jvandort

This comment has been minimized.

@bot-gradle

This comment has been minimized.

@bot-gradle

This comment has been minimized.

@jvandort

This comment has been minimized.

@jvandort jvandort marked this pull request as ready for review September 9, 2025 18:57
@jvandort jvandort requested review from a team as code owners September 9, 2025 18:57
@jvandort jvandort requested review from abstratt, bamboo and ghale and removed request for a team September 9, 2025 18:57
@bot-gradle

This comment has been minimized.

@jvandort jvandort requested review from ljacomet and removed request for ghale September 9, 2025 18:57
@bot-gradle

Copy link
Copy Markdown
Collaborator

The following builds have passed:

@jvandort jvandort force-pushed the jvandort/dm/prepare-to-deprecate-module-version-selector branch from 5b09b84 to df66daa Compare September 23, 2025 00:15
@jvandort jvandort requested review from a team as code owners September 23, 2025 00:15
@jvandort jvandort requested a review from a team September 23, 2025 00:15
@jvandort jvandort requested a review from a team as a code owner September 23, 2025 00:15
@jvandort jvandort requested a review from donat September 23, 2025 00:15
@jvandort jvandort force-pushed the jvandort/dm/hacks/dependency-state-hacking branch 2 times, most recently from 837bbd7 to 36468e3 Compare September 23, 2025 00:52
@jvandort jvandort modified the milestones: 9.2.0 RC1, 9.3.0 RC1 Sep 23, 2025
Base automatically changed from jvandort/dm/prepare-to-deprecate-module-version-selector to master September 23, 2025 02:39
@jvandort jvandort removed request for a team, abstratt, bamboo, donat and ljacomet September 23, 2025 15:05
The previous caching dependency substitution applicator failed to include the requested artifacts as part of the cache key.
The requested artifacts were passed to the dependency subtitution details, making the cache unreliable.
We combine the default and caching substitution applicators to increase locality, making it more difficult to make this cache unreliable in the future.

We also remove the substitution cache from DependencyState. Instead, we only construct DependencyState instances directly from DependencyMetadata instances, after substitution.
This saves us from having a map for every DependencyState instance, and saves us from instantiating one extra DependencyState for every substituted edge.
@jvandort jvandort force-pushed the jvandort/dm/hacks/dependency-state-hacking branch from 36468e3 to eacae5d Compare September 24, 2025 17:47
@jvandort jvandort requested a review from big-guy September 24, 2025 17:48
@jvandort jvandort marked this pull request as ready for review September 24, 2025 17:48
@jvandort

Copy link
Copy Markdown
Member Author

@bot-gradle test prf apt

@bot-gradle

This comment has been minimized.

@bot-gradle

Copy link
Copy Markdown
Collaborator

The following builds have passed:

@bot-gradle

Copy link
Copy Markdown
Collaborator

The following builds have passed:

@jvandort jvandort added this pull request to the merge queue Sep 24, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 24, 2025
@jvandort jvandort added this pull request to the merge queue Sep 24, 2025
Merged via the queue into master with commit 72aab5c Sep 24, 2025
38 checks passed
@jvandort jvandort deleted the jvandort/dm/hacks/dependency-state-hacking branch September 24, 2025 20:44
jvandort added a commit that referenced this pull request Dec 6, 2025
jvandort added a commit that referenced this pull request Dec 24, 2025
jvandort added a commit that referenced this pull request Jan 26, 2026
This was originally introduced in #34927 , but
there was no test to verify this behavior. Now, we add a test to verify that exclusions
are applied to dependencies before and after substitution
jvandort added a commit that referenced this pull request Jan 26, 2026
This was originally introduced in #34927 , but
there was no test to verify this behavior. Now, we add a test to verify that exclusions
are applied to dependencies before and after substitution
@cobexer cobexer mentioned this pull request Mar 18, 2026
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