Skip to content

ci: give the toolchain versions one source of truth - #363

Merged
TheZupZup merged 3 commits into
mainfrom
claude/linthra-version-management-pfhiwv
Aug 13, 2026
Merged

ci: give the toolchain versions one source of truth#363
TheZupZup merged 3 commits into
mainfrom
claude/linthra-version-management-pfhiwv

Conversation

@TheZupZup

Copy link
Copy Markdown
Owner

First step for #362: clean up where the toolchain versions live, before any update bot exists to bump them.

Right now the Flutter version is written out in seven workflows, the docs promise JDK 21 while CI installs 17, two Android workflow comments still advertise AGP 8.2.1 / Gradle 8.7 / Kotlin 1.9.24, and actions/checkout is split between v4 and v5.

What changed:

  • workflows install Flutter through a new .github/actions/setup-flutter, which reads .flutter-version — no workflow names the version anymore
  • new .java-version owns the JDK, and every setup-java step reads it via java-version-file
  • dropped the stale AGP/Gradle/Kotlin numbers from the workflow comments; those versions live in android/settings.gradle and gradle-wrapper.properties
  • actions/checkout is v5 everywhere (v5 is v4 on node24 — same inputs and defaults)
  • .java-version is protected from the CI fixer like .flutter-version is, and doctor.sh reports both pins
  • docs: development.md now has one table of every pin and the file that owns it, and the JDK references are corrected to 17

The guardrails live in test/tooling/toolchain_pins_test.dart and fail if:

  • a workflow hardcodes the Flutter or JDK version, or runs Flutter without the shared action
  • an action ends up pinned to two different refs
  • a doc, comment or script names a Flutter / Gradle / AGP / Kotlin / JDK version that disagrees with the file that owns it

That last one is what caught the JDK 21 drift. Mentions that are deliberately historical (the arm64 reproducibility note, the license audit) are listed one by one in the test instead of whole files being skipped, so the current-toolchain sentences in those same files stay checked.

Verified locally on the pinned 3.44.7: flutter pub get --enforce-lockfile, dart format --set-exit-if-changed ., flutter analyze, flutter test (3190 passing, including the F-Droid release guardrails) and scripts/check_secrets.sh. I also mutated each pin one at a time to confirm the new test actually fails on drift.

No app code, pubspec.lock, metadata or version changes, so the F-Droid build inputs are untouched.

No Dependabot or update workflow in here — that's the next PR.

Part of #362


Generated by Claude Code

claude added 3 commits August 13, 2026 14:27
The Flutter version was copied into seven workflows, so a bump meant
touching all of them. Workflows now install Flutter through the shared
.github/actions/setup-flutter action, which reads .flutter-version.

The JDK gets the same treatment: .java-version is the one place it lives,
and setup-java reads it with java-version-file. The stale AGP/Gradle/Kotlin
versions in the two Android workflow comments are gone — those numbers live
in settings.gradle and gradle-wrapper.properties, not in a comment.

Also puts actions/checkout on v5 everywhere (it was split v4/v5), protects
.java-version from the CI fixer, and reports both pins in doctor.sh.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W8K9hCeP3CNwTNLwerxxRo
Fails if a workflow hardcodes a Flutter or JDK version again, if a workflow
runs Flutter without the shared action, if an action ends up pinned to two
different refs, or if a doc, comment or script names a Flutter/Gradle/AGP/
Kotlin/JDK version that disagrees with the file that owns it. Deliberately
historical mentions (the arm64 reproducibility note, the license audit) are
listed explicitly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W8K9hCeP3CNwTNLwerxxRo
The docs promised JDK 21 in four places while CI has been installing 17.
development.md now has one table of every pin and the file that owns it,
and the F-Droid docs point at those files instead of listing workflows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W8K9hCeP3CNwTNLwerxxRo
@TheZupZup
TheZupZup marked this pull request as ready for review August 13, 2026 15:52
@TheZupZup TheZupZup self-assigned this Aug 13, 2026
@TheZupZup
TheZupZup merged commit 4fb0d37 into main Aug 13, 2026
10 checks passed
@TheZupZup
TheZupZup deleted the claude/linthra-version-management-pfhiwv branch August 13, 2026 15:52

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 660b5ee446

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

_historicalVersions[f.path] ?? const <String>{};
for (final RegExpMatch m in pattern.allMatches(_plain(f.text))) {
final String found = m.group(1)!;
if (historical.contains(found)) continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Scope historical exemptions to individual mentions

When a current-toolchain sentence in any file listed in _historicalVersions accidentally reuses one of that file's historical version numbers, this condition skips it solely on the (file, version) pair. For example, changing the current Flutter requirement in docs/fdroid-readiness.md to 3.27.4 would still pass, contradicting the intended guarantee that current statements in files containing historical notes remain checked. Identify the specific historical occurrence (such as by line or surrounding text) rather than exempting every occurrence of that version in the file.

Useful? React with 👍 / 👎.

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