Skip to content

Add support for coroutines version verification in CheckVersionCompatibility task#1015

Merged
egorikftp merged 1 commit into
mainfrom
task/idea/coroutines-verify
Jun 4, 2026
Merged

Add support for coroutines version verification in CheckVersionCompatibility task#1015
egorikftp merged 1 commit into
mainfrom
task/idea/coroutines-verify

Conversation

@egorikftp

Copy link
Copy Markdown
Member

📝 Changelog

If this PR introduces user-facing changes, please update the relevant Unreleased section in changelogs:

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 34bf3d75-a2be-4080-9a7e-57bb0794d0a1

📥 Commits

Reviewing files that changed from the base of the PR and between ae1872b and 04d03bb.

📒 Files selected for processing (3)
  • build-logic/src/main/kotlin/io/github/composegears/valkyrie/task/CheckVersionCompatibility.kt
  • gradle/libs.versions.toml
  • tools/idea-plugin/build.gradle.kts
🚧 Files skipped from review as they are similar to previous changes (3)
  • gradle/libs.versions.toml
  • tools/idea-plugin/build.gradle.kts
  • build-logic/src/main/kotlin/io/github/composegears/valkyrie/task/CheckVersionCompatibility.kt

Walkthrough

This pull request extends the CheckVersionCompatibility Gradle task to enforce coroutines version constraints. The version catalog now defines a centralized coroutines version (1.10.2). The task's input contract changes from accepting a flat list of resolved components to a map keyed by component coordinates and valued by their dependent coordinates. The task implementation adds logic to parse the new maxCoroutinesVersion input and fails when coroutines artifacts exceed that maximum. The task also formats violation messages to include which components require each offending dependency. Build configuration is updated to wire the coroutines constraint and adapt the resolved components collection to build the new map structure.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding coroutines version verification support to the CheckVersionCompatibility task, which aligns with the core modifications across all changed files.
Description check ✅ Passed The PR description includes the changelog reminder template with all required checkbox items for IntelliJ Plugin, CLI, and Gradle Plugin changelogs, matching the repository template structure.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task/idea/coroutines-verify

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tools/idea-plugin/build.gradle.kts (1)

184-194: ⚡ Quick win

Stabilize resolvedComponents ordering to avoid nondeterministic task inputs/output.

Line 193 converts sets to unsorted lists, and insertion order depends on resolution traversal. Sorting keys/dependents keeps diagnostics and task snapshots deterministic.

♻️ Proposed fix
-    resolvedComponents = checkConfig.map { config ->
-        val result = mutableMapOf<String, MutableSet<String>>()
+    resolvedComponents = checkConfig.map { config ->
+        val result = sortedMapOf<String, MutableSet<String>>()
         for (component in config.incoming.resolutionResult.allComponents) {
             val mv = component.moduleVersion ?: continue
             val coordinate = "${mv.group}:${mv.name}:${mv.version}"
             val dependents = result.getOrPut(coordinate) { mutableSetOf() }
             component.dependents.forEach { dep ->
                 dep.from.moduleVersion?.let { dependents.add("${it.group}:${it.name}:${it.version}") }
             }
         }
-        result.mapValues { (_, deps) -> deps.toList() }
+        result.mapValues { (_, deps) -> deps.sorted() }
     }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/idea-plugin/build.gradle.kts` around lines 184 - 194, The current
aggregation builds result: MutableMap<String, MutableSet<String>> and returns
result.mapValues { (_, deps) -> deps.toList() }, which yields nondeterministic
ordering; change the return to produce a deterministically ordered map and lists
by sorting keys and dependents: for each entry in result sort the dependents set
into a List (e.g. deps.sorted()) and return a sorted map (e.g.
result.toSortedMap().mapValues { (_, deps) -> deps.sorted() }) so both keys and
dependency lists are stable; update references to result, coordinate and
dependents accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tools/idea-plugin/build.gradle.kts`:
- Around line 184-194: The current aggregation builds result: MutableMap<String,
MutableSet<String>> and returns result.mapValues { (_, deps) -> deps.toList() },
which yields nondeterministic ordering; change the return to produce a
deterministically ordered map and lists by sorting keys and dependents: for each
entry in result sort the dependents set into a List (e.g. deps.sorted()) and
return a sorted map (e.g. result.toSortedMap().mapValues { (_, deps) ->
deps.sorted() }) so both keys and dependency lists are stable; update references
to result, coordinate and dependents accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f1f3307f-7b30-4142-a1bc-4b58334799af

📥 Commits

Reviewing files that changed from the base of the PR and between f6e3283 and ae1872b.

📒 Files selected for processing (3)
  • build-logic/src/main/kotlin/io/github/composegears/valkyrie/task/CheckVersionCompatibility.kt
  • gradle/libs.versions.toml
  • tools/idea-plugin/build.gradle.kts

@egorikftp egorikftp force-pushed the task/idea/coroutines-verify branch from ae1872b to 04d03bb Compare June 4, 2026 08:17
@egorikftp egorikftp merged commit 4ffa681 into main Jun 4, 2026
3 checks passed
@egorikftp egorikftp deleted the task/idea/coroutines-verify branch June 4, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant