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

Migrate to org.jetbrains.intellij.platform v2.0.0 #5657

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

BoD
Copy link
Contributor

@BoD BoD commented Feb 27, 2024

Resolves #5647.

Keeping as draft for now, while this is beta..

Copy link

netlify bot commented Feb 27, 2024

Deploy Preview for apollo-android-docs canceled.

Name Link
🔨 Latest commit 74f4029
🔍 Latest deploy log https://app.netlify.com/sites/apollo-android-docs/deploys/667058f67247c000089a12dd

@BoD BoD force-pushed the intellij-platform-gradle-plugin-v2.0.0 branch 3 times, most recently from a57a3ff to ddad3e6 Compare April 19, 2024 11:06
@BoD BoD force-pushed the intellij-platform-gradle-plugin-v2.0.0 branch from ddad3e6 to 59c9233 Compare May 14, 2024 10:32
@BoD BoD force-pushed the intellij-platform-gradle-plugin-v2.0.0 branch from c2eb372 to 7ca2a30 Compare May 30, 2024 08:47
@BoD BoD force-pushed the intellij-platform-gradle-plugin-v2.0.0 branch 2 times, most recently from 1a97abb to 319c233 Compare June 12, 2024 13:31
Comment on lines 356 to 355
it.inputs.property("allVersions", Callable {
it.inputs.property("allVersions", project.provider {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting... Was the issue that the callable is called eagerly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly! (Credits to @hsz 🙏). However this works locally but just noticed we still got the ConcurrentModificationException on the CI 😭

Copy link
Contributor

@martinbonnin martinbonnin Jun 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC intellij-plugin uses the published version of the Gradle plugin so we won't be able to tell before the next release if the fix actually worked.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intellij-plugin uses the published version of the Gradle plugin

You're right! And my mistake - thought it was working locally but it's only because I ran with --no-configuration-cache :(

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say the concurrent modification happens on the configurations collection because we're iterating all of them but addAllLater (here) may create new configurations while iterating (here)

Proposed fix to iterate a read-only copy of the configurations:

     private fun getDeps(configurations: ConfigurationContainer): List<String> {
-      return configurations.flatMap { configuration ->
+      // see https://github.com/apollographql/apollo-kotlin/pull/5657
+      val currentConfigurations = configurations.toList()
+      return currentConfigurations.flatMap { configuration ->
         configuration.dependencies

Means we won't check the newly created configurations for conflicting Apollo dependencies but it's probably fine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hsz sorry, messages crossed. Regarding SNAPSHOTs, it's about Apollo releases. AKIJP (Apollo Kotlin IntelliJ Plugin) uses AKGP (Apollo Kotlin Gradle Plugin) . We could verify using Apollo snapshots but means we'd need a separate PR to check the plugin-ception 🙃 .

All in all, my vote goes to disabling the check 😄

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I figured too late. Anyway, I'm around if you need me!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martinbonnin unfortunately disabling the task doesn't work - the exception is thrown at configuration time - not 100% sure why, but looks like getDeps ends up being called during org.gradle.configurationcache.ConfigurationCacheIO.writeConfigurationCacheState.

Copy link
Contributor

@martinbonnin martinbonnin Jun 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmmpff... Disable CC (configuration cache) in that CI job? Until we make a release and bump that AKGP dep?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha that should work! And I'll open an PR for your suggested fix above, so it can be in the next release, hopefully fixing the issue.

@BoD BoD force-pushed the intellij-platform-gradle-plugin-v2.0.0 branch from 01de58c to 74f4029 Compare June 17, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[IJ Plugin] Try the new IntelliJ Platform Gradle Plugin 2.0
3 participants