Split dependency and plugin resolver caches - #1578
Open
Ivan Chirkov (chrkv) wants to merge 3 commits into
Open
Conversation
Ivan Chirkov (chrkv)
requested review from
Flórián Garaba (fgaraba) and
Robert Novotny (novotnyr)
August 11, 2026 10:19
Robert Novotny (novotnyr)
approved these changes
Aug 11, 2026
Robert Novotny (novotnyr)
requested changes
Aug 13, 2026
| } | ||
|
|
||
| @Test | ||
| fun `dependency closure and plugin classpath resolvers use different cache entries`() { |
Collaborator
There was a problem hiding this comment.
I'd rename to transitive dependency resolver and plugin classpath resolver use different cache entries.
| val ide = MockIde(ideVersion, ideRoot, bundledPlugins = listOf(betaPlugin)) | ||
| val betaAction = "com/example/beta/BetaAction" | ||
|
|
||
| val dependencyClosureFirst = CachingPluginDependencyResolverProvider(ide) |
Collaborator
There was a problem hiding this comment.
val transitiveDependenciesFirst?
| } | ||
|
|
||
| @Test | ||
| fun `dependency closure cache distinguishes plugin versions`() { |
Collaborator
There was a problem hiding this comment.
ditto, do not introduce "dependency closure", as it is not used anywhere, terminology-wise
| } | ||
|
|
||
| @Test | ||
| fun `dependency closure cache distinguishes artifacts with same id and version`() { |
Collaborator
There was a problem hiding this comment.
ditto "dependency closure"
| return this as? NamedResolver ?: CompositeResolver.create(listOf(this), fallbackName) | ||
| } | ||
|
|
||
| private fun IdePlugin.artifactKey(): PluginArtifactKey = |
Collaborator
There was a problem hiding this comment.
Consider intern()in this?
| private fun IdePlugin.artifactKey(): PluginArtifactKey = | ||
| PluginArtifactKey(id ?: UNNAMED_RESOLVER, pluginVersion, originalFile) | ||
|
|
||
| private fun IdePlugin.resolverCacheKey(resolverName: String = newResolverName()): PluginResolverKey = |
Collaborator
There was a problem hiding this comment.
Ditto interning?
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.
Description
CachingPluginDependencyResolverProvidercurrently stores dependency-closure resolvers and plugin classpath resolvers in the same cache. These resolvers have different semantics: a dependency resolver contains the plugin's dependencies, while a plugin resolver contains the plugin's own classes.Using the same cache entry for both can make resolution depend on which resolver was created first.
This change separates the two caches and makes their keys identify the actual plugin artifact by ID, version, and original path.
DefaultClassResolverProvidernow explicitly requests the cached plugin resolver instead of reusing the dependency resolver cache.Added regression tests for separate dependency/plugin resolver entries, different plugin versions, and different artifacts with the same ID and version.