Skip to content

ci(repo): route every Flutter setup through setup-flutter - #2952

Merged
renefloor merged 3 commits into
masterfrom
claude/unify-flutter-cache-keys
Sep 10, 2026
Merged

ci(repo): route every Flutter setup through setup-flutter#2952
renefloor merged 3 commits into
masterfrom
claude/unify-flutter-cache-keys

Conversation

@renefloor

@renefloor renefloor commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

🎯 Goal

Reclaim ~1.6GB of the repository's 10GB Actions cache allowance, which currently sits at ~9.05GB and therefore evicts caches other jobs need.

🛠 Implementation details

  • Five call sites configured subosito/flutter-action independently and their cache keys had drifted into two shapes — flutter-:os:-:channel:-:version:-:arch: in setup-flutter, and …-:hash:-${{ hashFiles('**/pubspec.lock') }} everywhere else — so the same SDK is stored twice. Both of these are live right now: flutter-linux-stable-3.47.3-x64 (1640 MiB, master) and flutter-linux-stable-3.47.3-x64-e8113bf…-b09b477… (1640 MiB, PR ref).
  • setup-flutter now takes optional flutter-version and channel inputs and owns the key shape; update_goldens (×2), release_publish, legacy_version_analyze, beta_version_analyze and actions/pana pass only what differs. Composite-in-composite is already used by actions/allure-launch, so actions/pana is not new ground.
  • legacy_version_analyze still pins Flutter 3.44.0 and so still gets its own SDK entry — correct, not duplication.
  • Two deliberate behaviour changes: release_publish used a bare flutter-action with no caching and no version pin, and now matches everything else; beta_version_analyze passes an empty flutter-version so it keeps tracking the newest beta whatever its major, instead of inheriting the 3.x default.

☑️ Verification

Not yet run — this is a draft. All six touched files parse as YAML, and no direct subosito/flutter-action usage remains outside setup-flutter. The keys can only be confirmed by landing this and watching the cache list settle to one SDK entry per os/channel/version/arch; update_goldens, release_publish and beta_version_analyze are dispatch/cron/schedule-triggered, so they will not exercise themselves on this PR.

⚠️ Also worth a look

Unrelated to this change, gradle-Linux-… is 2.92GB — the single largest entry, and a bigger prize than this PR if the cache limit keeps biting.

☑️Contributor Checklist

General

  • Assigned a person / code owner group (required)
  • Thread with the PR link started in a respective Slack channel (#flutter-team) (required)
  • PR is linked to the GitHub issue it resolves

☑️Reviewer Checklist

  • Sample runs & works
  • UI Changes correct (before & after images)
  • Bugs validated (bugfixes)
  • New feature tested and works
  • All code we touched has new or updated Documentation

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Standardized Flutter setup across analysis, release, and golden-update workflows.
    • Added configurable Flutter version, channel, and SDK caching options for automated workflows.
    • Consolidated Flutter and pub-cache handling to provide more consistent build and validation environments.
    • Beta-version analysis can now disable SDK caching while retaining the appropriate Flutter channel configuration.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: b021b7d0-74a1-4c63-b1c5-20167398d17b

📥 Commits

Reviewing files that changed from the base of the PR and between 0e3b364 and 9b1ac12.

📒 Files selected for processing (6)
  • .github/actions/pana/action.yml
  • .github/actions/setup-flutter/action.yml
  • .github/workflows/beta_version_analyze.yml
  • .github/workflows/legacy_version_analyze.yml
  • .github/workflows/release_publish.yml
  • .github/workflows/update_goldens.yml

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The local Flutter setup action now accepts configurable version, channel, and SDK cache inputs. Repository actions and workflows now use this local action instead of configuring subosito/flutter-action@v2 directly.

Changes

Flutter setup centralization

Layer / File(s) Summary
Configurable Flutter setup action
.github/actions/setup-flutter/action.yml
The local action adds flutter-version, channel, and cache-sdk inputs with defaults. It passes these inputs to the Flutter action and enables pub-cache caching.
Workflow migration to local setup
.github/actions/pana/action.yml, .github/workflows/*
The Pana action and analysis, release, and golden workflows now use the local setup action. Beta analysis disables SDK caching and clears the Flutter version input.
Estimated code review effort: 2 (Simple) ~10 minutes

Suggested reviewers: xsahil03x

Merge Risk: ⚪ Minimal · up to 9b1ac

The change centralizes Flutter setup across CI workflows and preserves the beta workflow’s newest-beta behavior. No actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: routing all Flutter setup call sites through the shared setup-flutter action.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/unify-flutter-cache-keys

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.

Five call sites configured subosito/flutter-action independently and their
cache keys had drifted into two shapes:

    setup-flutter:  flutter-:os:-:channel:-:version:-:arch:
    everywhere else: flutter-:os:-:channel:-:version:-:arch:-:hash:-<pubspec.lock hash>

So the same SDK gets stored twice. Both of these are live right now:

    flutter-linux-stable-3.47.3-x64                       1640 MiB
    flutter-linux-stable-3.47.3-x64-e8113bf...-b09b477... 1640 MiB

That is 1.6GB of a 10GB repository allowance that currently sits at
~9.05GB, so it evicts other caches.

setup-flutter now takes optional flutter-version and channel inputs and
owns the key shape; the other call sites pass only what differs.
legacy_version_analyze still pins 3.44.0 and so still gets its own entry,
which is correct rather than duplication.

Two behaviour changes worth noting:
  - release_publish used a bare flutter-action with no cache and no
    version pin. It now caches and resolves 3.x like everything else.
  - beta_version_analyze passes an empty flutter-version so it keeps
    tracking the newest beta whatever its major version, rather than
    inheriting the 3.x default.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@renefloor
renefloor force-pushed the claude/unify-flutter-cache-keys branch from cd51dc5 to 4389599 Compare September 10, 2026 12:51
beta_version_analyze runs once a week and GitHub expires cache entries
after 7 idle days, so an SDK entry is at the expiry boundary by the next
run — and a newly released beta changes the resolved version, and so the
key, making it a certain miss. It stored ~1.6GB nearly every run for
almost no restores.

setup-flutter gains a cache-sdk input for this, and now enables pub
caching explicitly so turning the SDK cache off keeps it. The pub key
carries no channel or version, so beta shares the entry the stable jobs
already populate.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@renefloor
renefloor marked this pull request as ready for review September 10, 2026 12:56
Comment thread .github/workflows/beta_version_analyze.yml
Names the failure mode rather than the mechanism: inheriting the shared
action's 3.x default would keep the weekly beta check on 3.x betas.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@renefloor
renefloor merged commit 07e06fe into master Sep 10, 2026
28 checks passed
@renefloor
renefloor deleted the claude/unify-flutter-cache-keys branch September 10, 2026 13:51
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