Skip to content

fix(ci): Fallback to AGP release notes for Gradle version lookup#1128

Open
romtsn wants to merge 8 commits intomainfrom
rz/fix/agp-gradle-compat-fallback
Open

fix(ci): Fallback to AGP release notes for Gradle version lookup#1128
romtsn wants to merge 8 commits intomainfrom
rz/fix/agp-gradle-compat-fallback

Conversation

@romtsn
Copy link
Copy Markdown
Member

@romtsn romtsn commented Mar 27, 2026

#skip-changelog

Summary

  • When an AGP version (e.g. 9.2.0) is not yet listed in the compatibility table, the CI test matrix script now falls back to fetching the minimum Gradle version from the AGP release notes page
  • This fixes CI failures when new AGP versions are published to Maven but not yet added to the compat table

Test plan

  • Verify the test matrix workflow generates correct Gradle versions for AGP 9.2.0

🤖 Generated with Claude Code

When an AGP version (e.g. 9.2.0) is not yet listed in the compatibility
table at about-agp, fetch the minimum Gradle version from the AGP
release notes page instead of falling back to the latest table entry.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

AGP 9.2.0-alpha06 depends on Kotlin 2.3.10, so Gradle 9.5+ needs to
use that version instead of 2.1.0 to avoid dependency resolution
conflicts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
romtsn and others added 3 commits March 27, 2026 12:53
9.5.0-milestone-5 < 9.5.0 in semver (pre-releases have lower
precedence), so use 9.5.0-0 as the map key to ensure milestone
versions match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Kotlin 2.3+ dropped support for language version 1.8. Use 2.0 when
building with Kotlin 2.3+, otherwise keep 1.8.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@romtsn romtsn force-pushed the rz/fix/agp-gradle-compat-fallback branch from 8d06b04 to 2a5d322 Compare March 27, 2026 12:41
…e notes

Fixed-issues tables can have cells like "Android Gradle Plugin" that
match the "Gradle" check but aren't version strings. Continue the loop
instead of returning null so the actual compatibility table is found.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
romtsn and others added 2 commits March 27, 2026 14:10
…ase notes

Skip tables without "version" in headers (e.g. fixed-issues tables)
and match cells[0] exactly as "Gradle" instead of contains-check to
avoid false matches like "Android Gradle Plugin".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

val compilerParts = KotlinCompilerVersion.VERSION.split(".")
val compilerFlat = compilerParts[0].toInt() * 10 + compilerParts[1].toInt()
val oldestFlat = maxOf(compilerFlat - 3, 18) // 18 = Kotlin 1.8
val kotlinLangVersion = KotlinVersion.valueOf("KOTLIN_${oldestFlat / 10}_${oldestFlat % 10}")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Flat version encoding breaks for minor versions ≥ 10

Low Severity

The flat encoding major * 10 + minor and subsequent decode via oldestFlat / 10 and oldestFlat % 10 is ambiguous when minor version reaches 10 or above. For example, if the computed oldestFlat is 30, it decodes to KOTLIN_3_0 instead of the intended KOTLIN_2_10. This would cause KotlinVersion.valueOf to throw an IllegalArgumentException at configuration time. The earliest this manifests is if Kotlin reaches 2.13 (where oldest = 2.10, flat = 30 → incorrectly decoded as 3.0).

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

don't think kotlin ever reaches 10, they usually bump the major version then

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.

1 participant