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
Issue #227: Incompatible with the configuration cache #228
base: main
Are you sure you want to change the base?
Issue #227: Incompatible with the configuration cache #228
Conversation
Blocked until I've received the go ahead to bump the min Gradle version to one that better supports the configuration cache, as per #227 (comment). |
… compatibility and to avoid bugs with dependency resolution on Gradle 6.6, which is the first version that the config cache is introduced
…m w/ RewriteDryRunTask
Thanks for getting this started! As mentioned in #227 (comment) we might want to wait until we hear if requiring Gradle 4.3 is an option, and what the upsides versus downsides of that are. I'm not sure the upsides have been discussed much in #227 up to now. In general I can say we're in the business of (among other things) migrating legacy applications; as such we would like to support going as far back as possible, until such a time that we no longer expect or wish to support migrating from ancient versions. That does have downsides in particular for us as developers on OpenRewrite, but raising the minimum required version before folks can get started with automated migrations is also not ideal. Let's wait for feedback in the issue; potentially expand a bit on the upsides of versions bump versions, and see from there how to continue. |
@timtebeek Okey dokey! It's not the end of world if we can't go forward in this direction, as there's the option of turning on a flag in each and every task to indicate they're incompatible with the configuration cache, which solves the problem but without any speed gains. |
That being said, this flag may only be available in later Gradle versions, so if we need to stick with a config-cache-unaware minimum version of Gradle for the foreseeable future, then so be it. 😄 |
I have many failing tests that I'm not sure how to fix, so when I next have time, I'll copy changes bit by bit into a new local branch. But even if I fix everything, I've discovered that Note for self: use these resources:
|
Can't a Gradle plugin query the Gradle version at runtime and then conditionally use new features? Then we could use the config cache when available. |
@knutwannheden True. I'm struggling to see how that would help, though, because it looks like WDYT? :) |
@knutwannheden Please let me know if I've misunderstood you! |
My Gradle skills are rather limited, unfortunately. Possibly @shanman190 night have a suggestion. |
So @jbduncan is correct in the assessment that for configuration cache support the Gradle plugin would have to undergo a pretty drastic overhaul due to the strict requirements set forth by the configuration cache feature. (You can see more here: https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements) To illustrate a few of these that would have impact, the Overall, right now, I think that it's in the realm of being achievable, but it would require a bit of familiarity with the inner workings of that class in specific. |
Indeed, so it will take me some time to fix it. I'm hoping |
So, the configuration cache was introduced in Gradle 6.6, but my testing shows that Therefore, I'll update this PR to conditionally use I'll make another PR in the future to see if I can make everything config-cache-compatible (following @shanman190's advice) as far back as Gradle 6.6 and remove the In summary, this PR will make |
Team, I'm ready for a review. Hit me. 🤛 |
plugin/src/main/java/org/openrewrite/gradle/RewriteDryRunTask.java
Outdated
Show resolved
Hide resolved
Sorry for the delay, this PR fell off my radar! I believe I've dealt with @timtebeek's feedback, so I'm ready for another round of reviews. |
What's changed?
This is a draft PR for issue #227, showing my work as I go along.
What's your motivation?
To fix issue #227.
Anything in particular you'd like reviewers to focus on?
I'm trying to figure out how to avoid Gradle-specific things like
Project
,Configuration
,Task
andTask.project
to allow rewrite-gradle-plugin to be configuration-cache-compatible. Any insights would be appreciated.Any additional context
I'll mention in gradle/gradle#13490 that this plugin is configuration-cache-incompatible. Also I'm considering hopping on the Gradle Slack or forums to get some help.
Checklist
./gradlew licenseFormat