Skip to content

Fix CI warnings: update platform version compatibility and resolve Kotlin deprecations - #19

Open
hsluoyz with Copilot wants to merge 3 commits into
masterfrom
copilot/fix-ci-error-in-gradle
Open

Fix CI warnings: update platform version compatibility and resolve Kotlin deprecations#19
hsluoyz with Copilot wants to merge 3 commits into
masterfrom
copilot/fix-ci-error-in-gradle

Conversation

Copilot AI commented Dec 13, 2025

Copy link
Copy Markdown
Contributor

The CI build was failing with 13 compilation warnings related to platform version mismatch, experimental coroutines API usage, deprecated Kotlin methods, and parameter naming. Additionally, a plugin compatibility issue was causing the plugin to fail loading.

Changes

  • gradle.properties: Updated pluginSinceBuild from 213.* to 221 (without wildcard) to properly support IntelliJ Platform 2022.1+ and ensure compatibility with specific builds like IC-221.5080.210
  • Experimental coroutines: Added @OptIn(ExperimentalCoroutinesApi::class) to 4 classes implementing coroutines-based interfaces
  • Deprecated methods: Replaced toLowerCase()lowercase() in 2 files (3 occurrences)
  • Parameter naming: Changed equals(obj: Any?)equals(other: Any?) to match supertype signature

Example of coroutines opt-in fix:

@OptIn(ExperimentalCoroutinesApi::class)
class CasbinDocumentManager(private val project: Project) : CasbinDocumentService() {
    override fun processChange(change: CasbinDocumentRequest) {
        // Implementation using experimental coroutines API
    }
}

The key fix for the plugin loading issue was removing the wildcard from 221.* and using just 221, which properly indicates "build 221 or newer" and is compatible with all 221.x builds.

Original prompt

This section details on the original issue you should resolve

<issue_title>[bug] fix CI error</issue_title>
<issue_description>See: https://github.com/will7200/casbin-idea-plugin/actions/runs/20194389608/job/57977410553?pr=17

[Verify](https://github.com/will7200/casbin-idea-plugin/actions/runs/20194389608/job/57977410553?pr=17#logs)
failed 34 minutes ago in 4m 5s

Run ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=~/.pluginVerifier
Welcome to Gradle 7.1.1!
Here are the highlights of this release:
 - Faster incremental Java compilation
 - Easier source set configuration in the Kotlin DSL
For more details see https://docs.gradle.org/7.1.1/release-notes.html
> Task :patchPluginXml
[gradle-intellij-plugin :patchPluginXml] Patching plugin.xml: attribute 'since-build=[201]' of 'idea-version' tag will be set to '213.*'
[gradle-intellij-plugin :patchPluginXml] Patching plugin.xml: value of 'change-notes[
<li>Add support for parsing Casbin Files</li>
<li>Add support for parsing Casbin CSV Policy Definitions</li>
<li>Add syntax highlighting for Casbin Files</li>
<li>Add support to evaluate policies given a model and policy definition<li>
<li>Add Tool Window for interactive evaluation of policies</li>
]' tag will be set to '<h3>Added</h3>
<h3>Changed</h3>
<h3>Deprecated</h3>
<h3>Removed</h3>
<h3>Fixed</h3>
<ul><li>Add grammar support for multi line models</li></ul>
<h3>Security</h3>'
> Task :verifyPluginConfiguration
[gradle-intellij-plugin :verifyPluginConfiguration] The following plugin configuration issues were found:
- The 'since-build' property is lower than the target IntelliJ Platform major version: 213.* < 221.
See: https://jb.gg/intellij-platform-versions
> Task :processResources
> Task :setupInstrumentCode
> Task :downloadIdeaProductReleasesXml
> Task :listProductsReleases SKIPPED
> Task :compileKotlin
w: /home/runner/work/casbin-idea-plugin/casbin-idea-plugin/src/kotlin/io/github/will7200/plugins/casbin/executor/CasbinDocumentManager.kt: (24, 18): Base declaration of supertype 'CasbinDocumentService' needs opt-in. The declaration override should be annotated with '@kotlinx.coroutines.ExperimentalCoroutinesApi' or '@OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi::class)'
w: /home/runner/work/casbin-idea-plugin/casbin-idea-plugin/src/kotlin/io/github/will7200/plugins/casbin/executor/CasbinDocumentManager.kt: (27, 87): This declaration needs opt-in. Its usage should be marked with '@kotlinx.coroutines.ExperimentalCoroutinesApi' or '@OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi::class)'
w: /home/runner/work/casbin-idea-plugin/casbin-idea-plugin/src/kotlin/io/github/will7200/plugins/casbin/executor/CasbinEnforcementProducer.kt: (120, 23): This declaration needs opt-in. Its usage should be marked with '@kotlinx.coroutines.ExperimentalCoroutinesApi' or '@OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi::class)'
w: /home/runner/work/casbin-idea-plugin/casbin-idea-plugin/src/kotlin/io/github/will7200/plugins/casbin/executor/CasbinExecutorManager.kt: (74, 19): This declaration needs opt-in. Its usage should be marked with '@kotlinx.coroutines.ExperimentalCoroutinesApi' or '@OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi::class)'
w: /home/runner/work/casbin-idea-plugin/casbin-idea-plugin/src/kotlin/io/github/will7200/plugins/casbin/language/reference/CasbinUsagesProvider.kt: (41, 52): 'toLowerCase(): String' is deprecated. Use lowercase() instead.
w: /home/runner/work/casbin-idea-plugin/casbin-idea-plugin/src/kotlin/io/github/will7200/plugins/casbin/language/structure/CasbinStructureViewElement.kt: (38, 36): 'toLowerCase(): String' is deprecated. Use lowercase() instead.
w: /home/runner/work/casbin-idea-plugin/casbin-idea-plugin/src/kotlin/io/github/will7200/plugins/casbin/language/structure/CasbinStructureViewElement.kt: (39, 30): 'toLowerCase(): String' is deprecated. Use lowercase() instead.
w: /home/runner/work/casbin-idea-plugin/casbin-idea-plugin/src/kotlin/io/github/will7200/plugins/casbin/view/ui/CasbinExecutorToolWindowImp.kt: (30, 14): This declaration needs opt-in. Its usage should be marked with '@kotlinx.coroutines.ExperimentalCoroutinesApi' or '@OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi::class)'
w: /home/runner/work/casbin-idea-plugin/casbin-idea-plugin/src/kotlin/io/github/will7200/plugins/casbin/view/ui/CasbinExecutorToolWindowImp.kt: (101, 47): This declaration needs opt-in. Its usage should be marked with '@kotlinx.coroutines.ExperimentalCoroutinesApi' or '@OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi::class)'
w: /home/runner/work/casbin-idea-plugin/casbin-idea-plugin/src/kotlin/io/github/will7200/plugins/casbin/view/ui/CasbinExecutorToolWindowImp.kt: (110, 47): This declaration needs opt-in. Its usage should be marked with '@kotlinx.coroutines.ExperimentalCoroutinesApi' or '@OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi::class)'
w: /home/runner/work/casbin-idea-plugin/casbin-idea-plugin/src/kotlin/io/github/will7200/plugins/casbin/view/u...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes will7200/casbin-idea-plugin#18

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

@hsluoyz
hsluoyz marked this pull request as ready for review December 13, 2025 17:20
…deprecated methods

Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI error in Gradle plugin verification Fix CI warnings: update platform version compatibility and resolve Kotlin deprecations Dec 13, 2025
Copilot AI requested a review from hsluoyz December 13, 2025 17:29
@hsluoyz

hsluoyz commented Dec 14, 2025

Copy link
Copy Markdown
Collaborator

@copilot fix failed CI check:

Run ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=~/.pluginVerifier
Welcome to Gradle 7.1.1!
Here are the highlights of this release:
 - Faster incremental Java compilation
 - Easier source set configuration in the Kotlin DSL
For more details see https://docs.gradle.org/7.1.1/release-notes.html
> Task :patchPluginXml
[gradle-intellij-plugin :patchPluginXml] Patching plugin.xml: attribute 'since-build=[201]' of 'idea-version' tag will be set to '221.*'
[gradle-intellij-plugin :patchPluginXml] Patching plugin.xml: value of 'change-notes[
<li>Add support for parsing Casbin Files</li>
<li>Add support for parsing Casbin CSV Policy Definitions</li>
<li>Add syntax highlighting for Casbin Files</li>
<li>Add support to evaluate policies given a model and policy definition<li>
<li>Add Tool Window for interactive evaluation of policies</li>
]' tag will be set to '<h3>Added</h3>
<h3>Changed</h3>
<h3>Deprecated</h3>
<h3>Removed</h3>
<h3>Fixed</h3>
<ul><li>Add grammar support for multi line models</li></ul>
<h3>Security</h3>'
> Task :verifyPluginConfiguration
> Task :processResources
> Task :setupInstrumentCode
> Task :downloadIdeaProductReleasesXml
> Task :listProductsReleases SKIPPED
> Task :compileKotlin
> Task :compileJava
> Task :classes
> Task :instrumentCode
> Task :postInstrumentCode
> Task :inspectClassesForKotlinIC
> Task :classpathIndexCleanup
> Task :jar
> Task :prepareSandbox
2025-12-14 11:28:52,404 [    114]   WARN - j.u.prefs - Prefs file removed in background /home/runner/.java/.userPrefs/prefs.xml
> Task :buildSearchableOptions
2025-12-14 11:28:52,696 [    406] SEVERE - #c.i.i.p.PluginManager - Problems found loading plugins:
  The Casbin (id=io.github.will7200.plugins.casbin, path=~/work/casbin-idea-plugin/casbin-idea-plugin/sandbox/idea-sandbox/plugins/casbin-idea-plugin, version=0.1.16) plugin Plugin 'Casbin' (version '0.1.16') is not compatible with the current version of the IDE, because it requires build 221.* or newer but the current build is IC-221.5080.210
java.lang.Throwable: Problems found loading plugins:
  The Casbin (id=io.github.will7200.plugins.casbin, path=~/work/casbin-idea-plugin/casbin-idea-plugin/sandbox/idea-sandbox/plugins/casbin-idea-plugin, version=0.1.16) plugin Plugin 'Casbin' (version '0.1.16') is not compatible with the current version of the IDE, because it requires build 221.* or newer but the current build is IC-221.5080.210
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:182)
	at com.intellij.ide.plugins.PluginManagerCore.preparePluginErrors(PluginManagerCore.java:543)
java.lang.NumberFormatException: Not a number: 36.1
	at com.sun.xml.bind.DatatypeConverterImpl._parseInt(DatatypeConverterImpl.java:125)
	at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$18.parse(RuntimeBuiltinLeafInfoImpl.java:742)
	at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$18.parse(RuntimeBuiltinLeafInfoImpl.java:740)
	at com.sun.xml.bind.v2.runtime.unmarshaller.TextLoader.text(TextLoader.java:69)
	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.text(UnmarshallingContext.java:590)
	at com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.processText(SAXConnector.java:213)
	at com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.endElement(SAXConnector.java:176)
	at java.xml/org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:610)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1718)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2883)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
	at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
	at java.xml/org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:258)
	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:229)
	at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:153)
	at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:136)
	at com.android.repository.impl.meta.SchemaModuleUtil.unmarshal(SchemaModuleUtil.java:195)
	at com.android.repository.impl.manager.LocalRepoLoaderImpl.parsePackage(LocalRepoLoaderImpl.java:318)
	at com.android.repository.impl.manager.LocalRepoLoaderImpl.parsePackages(LocalRepoLoaderImpl.java:157)
	at com.android.repository.impl.manager.LocalRepoLoaderImpl.getPackages(LocalRepoLoaderImpl.java:122)
	at com.android.repository.impl.manager.RepoManagerImpl$LoadTask.run(RepoManagerImpl.java:582)
	at com.android.tools.idea.sdk.progress.StudioProgressRunner$1$2.lambda$run$0(StudioProgressRunner.java:69)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:295)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:829)
Searchable options index builder completed
> Task :jarSearchableOptions
[gradle-intellij-plugin :jarSearchableOptions] No searchable options found. If plugin is not supposed to provide custom settings exposed in UI, disable building searchable options to decrease the build time. See: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin-faq.html#how-to-disable-building-searchable-options
> Task :buildPlugin
> Task :verifyPlugin
> Task :runPluginVerifier
[gradle-intellij-plugin :runPluginVerifier] Cannot download 'IC-2023.1' from 'release' channel: https://cache-redirector.jetbrains.com/download.jetbrains.com/idea/ideaIC-2023.1.tar.gz. Run with --debug option to get more log output.

…ompatibility

Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>

Copilot AI commented Dec 14, 2025

Copy link
Copy Markdown
Contributor Author

@copilot fix failed CI check:

...

Fixed the plugin compatibility issue in commit f5941a4. Changed pluginSinceBuild from 221.* to 221 (without wildcard). The wildcard was causing the plugin to be incompatible with IC-221.5080.210. Now it correctly supports all 221.x builds.

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.

2 participants