Fix local YAML recipe scanning to be recursive#7437
Merged
greg-at-moderne merged 2 commits intoopenrewrite:mainfrom Apr 21, 2026
Merged
Fix local YAML recipe scanning to be recursive#7437greg-at-moderne merged 2 commits intoopenrewrite:mainfrom
greg-at-moderne merged 2 commits intoopenrewrite:mainfrom
Conversation
timtebeek
approved these changes
Apr 21, 2026
Member
timtebeek
left a comment
There was a problem hiding this comment.
Thanks for the immediate fix!
greg-at-moderne
approved these changes
Apr 21, 2026
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.
What's changed?
Fixes a bug introduced in #7338 where
ClasspathScanningLoaderfailed to recursively scan subdirectories for YAML recipes when loading from a local path (e.g.,target/classesduringmvn test).Replaced the non-recursive
Files.newDirectoryStreamwithFiles.walkinlistYamlResourcesFromPath, and added handling forUncheckedIOExceptionwhich can be thrown by the stream traversal if it encounters unreadable files/directories.What's your motivation?
We have a large suite of YAML recipes organized into subdirectories (e.g.,
META-INF/rewrite/framework60/). After upgrading to 8.79.6, all of these recipes started failing to load during local Maven test runs with "Recipe(s) not found" errors.Anything in particular you'd like reviewers to focus on?
The exception handling around the
Files.walkstream. We catch bothIOException(for the initial directory open) andUncheckedIOException(for any unreadable subdirectories encountered during traversal) to maintain the previous behavior of gracefully ignoring unreadable files.Anyone you would like to review specifically?
@sam-snyder (since this relates to the changes in #7338)
Have you considered any alternatives or workarounds?
The only workaround for users currently is to flatten their entire
META-INF/rewritedirectory structure, which is not ideal for large recipe collections.Any additional context
A witness test
scanYamlInSubdirectorywas added toClasspathScanningLoaderTestto verify recursive YAML loading works correctly.Checklist