Closed radoslaw-panuszewski closed 8 months ago
@travisboettcher this PR takes a slightly different approach to what you suggested in https://github.com/openrewrite/rewrite-gradle-plugin/issues/252 ; Any thoughts to share here?
@travisboettcher this PR takes a slightly different approach to what you suggested in #252 ; Any thoughts to share here?
I don't think I have any concerns, no - this change makes sense to me. If I understand correctly, we don't need to use the existing execution context when parsing resources, since they aren't likely to reference other sub-modules. In addition, the test added seems to cover my case, so I think we're good!
What's changed?
Fixed the bug with resources in subproject being excluded from processing.
What's your motivation?
I have a multi-module project like this:
And I have a custom recipe to modify some YAML. While the
application-root.yml
is correctly modified, theapplication-subproject.yml
is skipped. It is reproduced in theresources in subproject committed to git are correctly processed
test case.There is already a test case
rewriteRun applies recipe to a multi-project build
which aims to verify this situation, but it doesn't check the case when Git repo is available. There is a different code path inOmniParser
for such case and it's not reached.I believe that I've found a bug in the code of
DefaultProjectParser
. When theOmniParser
is created for the root project, it is configured to exclude contents of its subprojects. But when it's created for the subproject, it's still configured to exclude the root project's subprojects, so also the subproject we want to parse.Anything in particular you'd like reviewers to focus on?
I've added the
Project
parameter to theomniParser()
. Please verify that the updated method usages are correct.Additional changes
There was a typo in
dependencyRepositoriesDeclaredInSettings
test case which caused the test to fail. I fixed it:nevVersion
->newVersion
Checklist