Skip to content

Fall back to RecipeLoader when ecosystem resolver is missing#6741

Closed
kmccarp wants to merge 1 commit intomainfrom
kmccarp/prepare-recipe-fallback
Closed

Fall back to RecipeLoader when ecosystem resolver is missing#6741
kmccarp wants to merge 1 commit intomainfrom
kmccarp/prepare-recipe-fallback

Conversation

@kmccarp
Copy link
Copy Markdown
Contributor

@kmccarp kmccarp commented Feb 13, 2026

Summary

  • When the PrepareRecipe handler finds a recipe in the marketplace but listing.prepare() throws because no resolver matches the bundle's ecosystem, it now catches the exception and falls through to RecipeLoader
  • This fixes recipe runs on Node.js repositories where JS recipes use preconditions like usesType() or usesMethod() that call back to the Java side to prepare Java recipes — without a Maven resolver wired into the RPC endpoint, these callbacks previously failed with "No available resolver for 'maven' ecosystem"

Test plan

  • Added prepareRecipeFallsBackToRecipeLoaderWhenResolverMissing test that installs a recipe listing with a "maven" ecosystem bundle into a marketplace with only a "runtime" resolver, then verifies prepareRecipe succeeds via the RecipeLoader fallback
  • All existing RewriteRpcTest tests continue to pass

When the PrepareRecipe handler finds a recipe in the marketplace but
listing.prepare() throws because no resolver matches the bundle's
ecosystem (e.g., a "maven"-bundled recipe when only a "runtime" resolver
is available), the handler now catches the exception and falls through
to RecipeLoader. This allows recipes that are already on the classpath
to be loaded by class name instead of failing outright.

This fixes recipe runs on Node.js repositories where JS recipes use
preconditions like usesType() or usesMethod() that call back to the
Java side to prepare Java recipes. Without a Maven resolver wired into
the RPC endpoint, these callbacks previously failed with
"No available resolver for 'maven' ecosystem".
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Feb 13, 2026
@kmccarp kmccarp closed this Feb 13, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant