Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unwanted dependencies via rewrite-static-analysis #648

Open
BoykoAlex opened this issue Dec 11, 2024 · 1 comment
Open

Unwanted dependencies via rewrite-static-analysis #648

BoykoAlex opened this issue Dec 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@BoykoAlex
Copy link
Contributor

BoykoAlex commented Dec 11, 2024

The size of the Spring Boot Language Server JAR has increased quite a bit in the past 6 months. Looks like major contributor to the size of the Boot LS JAR are the OpenRewrite libs.
There are libs such as rewrite-csharp, rewrite-kotlin, rewrite-github-actions, rewrite-jenkins. For example rewrite-csharp is unrelated to Spring at all yet it is still pulled in via the rewrite-static-analysis dependency.

Excluding these dependencies leads to Class Def Not Found Exceptions in rewrite-static-analysis from KotlinFileChecker and similar as well as from rewrite-migrate-java org.openrewrite.java.migrate.UpgradeJavaVersion where a class from rewrite-jenkins is used explicitly.

I'd propose to have runtime dependencies rather than compile for:

rewrite-spring -> rewrite-static-analysis. Only needs org.openrewrite.staticanalysis.RemoveUnneededBlock recipe for rewrite-static-analysis. I'd move this recipe in rewrite-java.

rewrite-migrate-java -> rewrite-static-analysis. Attempt to move recipes used from rewrite-static-analysis to rewrite-java as well. Some may move in rewrite-migrate-java such as ReplaceDeprecatedRuntimeExecMethods

rewrite-migrate-java -> rewrite-jenkins. Not sure how to convert this into the runtime dependency but would be nice as well.

The benefit of a runtime dependency would be that composite yaml recipe would miss a recipe rather than fail to load the entire composite recipe. Perhaps there is something else can be done with optional dependencies on Kotlin and C# libs such that recipes in rewrite-static-analysis won't throw exceptions. Please feel free to propose alternative ideas.

@BoykoAlex BoykoAlex added the bug Something isn't working label Dec 11, 2024
@timtebeek
Copy link
Contributor

hi @BoykoAlex ! Thanks for the initial work into figuring out how we can trim these dependencies down a bit; would indeed be nice to have these be a little more opt in as opposed to ever growing, but we'd also need to re-architect things a bit. For now: know that you've kicked off an internal discussion as well, as we reevaluate and make changes to make this optional.

@timtebeek timtebeek moved this to Backlog in OpenRewrite Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants