Repository navigation
perf(ci): carry Android Gradle caches on a Blacksmith sticky disk - #109605
Conversation
The android lane's setup-java gradle cache almost never restores under the repo's churned GitHub cache quota, so every run re-resolves the full dependency graph (~501s observed for android-build-play). Mount a task-scoped Blacksmith sticky disk at /var/tmp/openclaw-gradle and point GRADLE_USER_HOME at it for same-repo non-fork non-dispatch runs, mirroring the extension-boundary sticky pattern (per-PR-or-protected key, commit: if-missing, identical trust gate). Fork PRs and manual dispatches keep the existing GitHub cache path and non-Blacksmith runners.
Autoreview P2: if-missing froze the snapshot at first hydration, so later build-cache entries never persisted. on-change commits when the filesystem changed; content-addressed entries and task-scoped keys keep it race-safe.
b4e0708 to
16ce687
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 16ce687056
ℹ️ 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".
| mkdir -p /var/tmp/openclaw-gradle/gradle-user-home | ||
| echo "GRADLE_USER_HOME=/var/tmp/openclaw-gradle/gradle-user-home" >> "$GITHUB_ENV" |
There was a problem hiding this comment.
Keep setup-java cache paths populated on cold sticky runs
For same-repo Blacksmith Android runs where setup-java's Gradle cache misses, this redirects Gradle to populate only /var/tmp/openclaw-gradle/gradle-user-home after the setup action has registered its post-cache save. The pinned actions/setup-java@ad2b... Gradle cache still saves fixed ${HOME}/.gradle/caches and ${HOME}/.gradle/wrapper paths, and its post action rethrows when those paths do not exist, so a cold run can finish the Gradle tasks and then fail during the Java cache post step. Disable the setup-java Gradle cache for sticky runs, or make the homedir cache paths exist/populate consistently.
Useful? React with 👍 / 👎.
…enclaw#109605) * perf(ci): carry Android Gradle caches on a Blacksmith sticky disk The android lane's setup-java gradle cache almost never restores under the repo's churned GitHub cache quota, so every run re-resolves the full dependency graph (~501s observed for android-build-play). Mount a task-scoped Blacksmith sticky disk at /var/tmp/openclaw-gradle and point GRADLE_USER_HOME at it for same-repo non-fork non-dispatch runs, mirroring the extension-boundary sticky pattern (per-PR-or-protected key, commit: if-missing, identical trust gate). Fork PRs and manual dispatches keep the existing GitHub cache path and non-Blacksmith runners. * fix(ci): let the Gradle sticky snapshot keep learning Autoreview P2: if-missing froze the snapshot at first hydration, so later build-cache entries never persisted. on-change commits when the filesystem changed; content-addressed entries and task-scoped keys keep it race-safe.
…enclaw#109605) * perf(ci): carry Android Gradle caches on a Blacksmith sticky disk The android lane's setup-java gradle cache almost never restores under the repo's churned GitHub cache quota, so every run re-resolves the full dependency graph (~501s observed for android-build-play). Mount a task-scoped Blacksmith sticky disk at /var/tmp/openclaw-gradle and point GRADLE_USER_HOME at it for same-repo non-fork non-dispatch runs, mirroring the extension-boundary sticky pattern (per-PR-or-protected key, commit: if-missing, identical trust gate). Fork PRs and manual dispatches keep the existing GitHub cache path and non-Blacksmith runners. * fix(ci): let the Gradle sticky snapshot keep learning Autoreview P2: if-missing froze the snapshot at first hydration, so later build-cache entries never persisted. on-change commits when the filesystem changed; content-addressed entries and task-scoped keys keep it race-safe.
What Problem This Solves
The android CI lane runs ~501s of build (observed on job
android-build-play) largely re-resolving Gradle's dependency graph every run: its only cache today issetup-java's gradle cache on the GitHub actions-cache backend, which the repo's churned quota evicts so quickly that restores rarely hit — the same failure mode that motivated moving the boundary artifacts and Vitest transform caches to Blacksmith sticky disks.Why This Change Was Made
Same-repo android jobs now mount a Blacksmith sticky disk and point
GRADLE_USER_HOMEat it, carrying Gradle's dependency cache, wrapper distributions, and build cache across runs:gradle-v1-${{ matrix.task }}-…): each matrix task (ktlint/test/build) resolves a different dependency set, and a sharedif-missingkey would let a light task win the cold-key race and permanently pin a thin snapshot the heavy lanes can never repair — the exact first-hydration race caught on the boundary-sticky review. One semantic writer per snapshot.commit: if-missing, and the same-repo/non-fork/non-dispatch gate all mirror the repo's established sticky uses. Fork PRs and dispatches keep the GitHub cache path and run on non-Blacksmith runners anyway.User Impact
None at runtime — CI-only. Android-touching PRs stop paying full dependency re-resolution on every push after the first per task.
Evidence
actionlintclean; step order verified (toolchain → mount → env export → gradle run).node scripts/run-vitest.mjs test/scripts/ci-workflow-guards.test.ts— 74 passed, no expectation changes needed.