Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .claude/skills/dep-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ If the verdict is **APPROVE WITH CHANGES**:
```bash
git fetch origin <headRefName>
git worktree add -b <headRefName> ../dep-review-<number> origin/<headRefName>
# A new worktree has no local.properties, and Gradle then fails to configure
# :apps:flipcash:app (FileNotFoundException). Copy it from the main checkout, which
# `git worktree list` prints first. Copy, not symlink: a worktree may set its own
# overrides there, such as protoLocalRoot.
main=$(git worktree list --porcelain | sed -n '1s/^worktree //p')
cp "$main/local.properties" ../dep-review-<number>/local.properties
```
2. Make the code changes using Edit, and show each one as a before/after diff
3. Run the Recommended Test Plan; done when it passes
Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/flipcash2-cold-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Flipcash2 tests (cold cache)

# Runs the test tasks of Flipcash2 Build and Deploy's `test` job on PRs that change how Gradle
# resolves dependencies, with nothing restored into ~/.gradle or ~/.m2.
#
# Flipcash2 runs only on workflow_dispatch, and its `cache: gradle` key misses whenever
# libs.versions.toml or a build script changes, so that job downloads every dependency from
# scratch. The CI workflow restores code/cash's Gradle home, so a PR that breaks a download
# still passes there. #2040 and #2051 both passed CI, merged, and then failed Flipcash2 on a
# Maven Central 429: an android-all jar after #2040, the Node.js pom after #2051.
#
# Lint is left out. Flipcash2's fastlane lane ends with :apps:flipcash:app:lintDebug, which
# lints every module, and from an empty cache that does not fit this runner: the first run
# here, with the project's 6 GB daemon heaps, lost its runner 62 minutes in; the second, with
# the heap caps below, finished the tests in 28 minutes and was still linting 90 minutes later
# when it timed out. So this check does not resolve lint's own classpath, or the androidTest
# classpaths that only the lint tasks resolve.
#
# Not a required check: a path-skipped required check never reports and blocks the merge.
on:
pull_request:
paths:
- 'build-logic/**'
- 'buildSrc/**'
- 'build.gradle.kts'
- 'settings.gradle.kts'
- 'gradle.properties'
- 'gradle/**'
- 'kotlin-js-store/**'
- '.github/actions/provision-config/**'
- '.github/workflows/flipcash2-cold-cache.yml'
workflow_dispatch:

concurrency:
group: flipcash2-cold-cache-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
test:
name: Flipcash2 tests, cold Gradle cache
runs-on: ubuntu-24.04 # Flipcash2's test job runs on the same image
# The test tasks took 28 minutes from an empty cache on this PR.
timeout-minutes: 50
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4

# No `cache: gradle` here, and no setup-gradle or actions/cache step for Gradle.
- name: Setup Java env
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'corretto'

# Dependabot PRs get no repository secrets; the action falls back to placeholders that
# still compile.
- name: Provision config
uses: ./.github/actions/provision-config
with:
google-services: ${{ secrets.FLIPCASH2_GOOGLE_SERVICES }}
bugsnag-api-key: ${{ secrets.FLIPCASH_BUGSNAG_API_KEY }}
google-cloud-project-number: ${{ secrets.GOOGLE_CLOUD_PROJECT_NUMBER }}
mixpanel-api-key: ${{ secrets.FLIPCASH_MIXPANEL_API_KEY }}
coinbase-onramp-api-key: ${{ secrets.COINBASE_ONRAMP_API_KEY }}

# settings.gradle.kts lists mavenLocal(), so ~/.m2 counts as a cache too. Fails if a
# later edit restores either one.
- name: Check the dependency caches are empty
run: |
set -euo pipefail
for dir in "$HOME/.gradle/caches/modules-2" "$HOME/.m2/repository"; do
if [ -e "$dir" ]; then
echo "::error::$dir exists before the build; this check must start from an empty cache"
exit 1
fi
done

# ci.yml's unit-test command, heap caps included (see the comment there), with
# skipCoverage=true as Flipcash2's job passes it. These are the `flipcash_tests` lane's
# tasks minus lint; keep them in step with fastlane/Fastfile.
- name: Run tests
run: >-
./gradlew
-Dorg.gradle.jvmargs="-Xmx4g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=1024m -Dkotlin.daemon.jvm.options=-XX:MaxMetaspaceSize=1g -Dlint.nullness.ignore-deprecated=true"
"-Pkotlin.daemon.jvmargs=-Xmx3g -XX:MaxMetaspaceSize=1g"
-PskipCoverage=true
generateEmojiList kotlinStorePackageLock jsNodeTest flipcashTestDebug
2 changes: 2 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ Tests for gestures and pointer input replay the sequence a finger makes on the d

After editing a build script, run one of its tasks with the configuration cache on before any `--no-configuration-cache` run. A run with the cache off says nothing about whether the script is cache-compatible.

Before writing a fix for a failed dependency download, get the failing request's HTTP status and URL from the log (Gradle prints them as `Could not GET '<url>'. Received status code <n>`). #2040 moved Robolectric's jar downloads into Gradle without knowing why they failed; the cause was a Maven Central 429, and the same download failed again from Gradle. A build change that adds or moves downloads is not done until the workflows that run the affected tasks pass from an empty cache. The `Flipcash2 tests (cold cache)` check does that for the test tasks of Flipcash2's `test` job, not its lint, on PRs that touch build scripts or version files.

A timeout bounds the whole operation its budget covers (a receiver's `goAsync` window, a locked sheet), and its tests make each await in it never answer, the last one included. A notification reply's first bound covered its sign-in wait but not the send after it, so an offline reply still spun past the receiver's window.

## Namespaces
Expand Down
1 change: 1 addition & 0 deletions docs/architecture/15-ci-and-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ So CI == the `flipcash_tests` Fastlane lane == unit tests. Keep PRs green by run
| [`prep-dev.yml`](../../.github/workflows/prep-dev.yml) | Cron, 1st of each month (+ manual) | Increments Flipcash versioning for the new month. |
| [`bump-patch.yml`](../../.github/workflows/bump-patch.yml) | Manual (`workflow_dispatch`, choose a track) | Updates the release manifest and bumps the patch version. |
| [`build-fcash2-upload-android.yml`](../../.github/workflows/build-fcash2-upload-android.yml) | Manual | Builds and deploys Flipcash to the Play Store. |
| [`flipcash2-cold-cache.yml`](../../.github/workflows/flipcash2-cold-cache.yml) | PRs that touch `build-logic/`, `buildSrc/`, root build scripts, `gradle/`, `gradle.properties` or `kotlin-js-store/` (+ manual) | Runs the test tasks of Flipcash2's `test` job (the `flipcash_tests` lane minus lint) with an empty Gradle cache, so a dependency download that fails there fails on the PR. Before fixing a failed download, get the request's HTTP status and URL from the log. |
| [`labeler.yml`](../../.github/workflows/labeler.yml) | PR opened/synchronized | Applies area labels to PRs. |

`versionCode` comes from `Packaging.Flipcash.versionCode` or `gitVersionCode()`
Expand Down
Loading