fix(ci): Fallback to AGP release notes for Gradle version lookup#1128
fix(ci): Fallback to AGP release notes for Gradle version lookup#1128
Conversation
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>
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. 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>
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>
8d06b04 to
2a5d322
Compare
…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>
…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>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
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}") |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
don't think kotlin ever reaches 10, they usually bump the major version then


#skip-changelog
Summary
Test plan
🤖 Generated with Claude Code