Skip to content

Commit e94df75

Browse files
authored
Merge pull request #2678 from SatoshiPortal/develop
v6.13.0
2 parents 33a1ff1 + f747d1e commit e94df75

1,319 files changed

Lines changed: 102310 additions & 37004 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,42 @@ app-*.aab
2020
.tmp_apk_diff/
2121
reproducibility/bullbitcoin_*_verification/
2222
reproducibility/reproducibility_test_*/
23+
24+
# Secrets — must never enter a build image layer, even one that's later
25+
# deleted (secrets baked into an intermediate layer persist in the image
26+
# cache/registry history). .gitignore already excludes these from commits;
27+
# .dockerignore does not inherit .gitignore, so they need their own entries.
28+
# NOTE: dockerignore patterns follow Go filepath.Match, NOT gitignore: a bare
29+
# `*.keystore` matches only at the context root, so nested paths need `**/`.
30+
# Two keystores are re-included below (the `!` lines): debug.keystore for
31+
# debug/local builds, and beta-upload.keystore so build.gradle can sign the beta
32+
# channel inside the image — the CI runner is already the secret boundary there.
33+
# android/key-beta.properties is not matched by any exclude here, so it too
34+
# stays available for beta signing. Everything else keeps secrets out of layers.
35+
**/.env
36+
android/key.properties
37+
**/*.keystore
38+
**/*.jks
39+
!android/app/debug.keystore
40+
!android/app/beta-upload.keystore
41+
42+
# Stale host-generated code. Most of these are gitignored and regenerated inside
43+
# the image by `make build-runner` / `make translations`; .dockerignore doesn't
44+
# inherit .gitignore, so without these entries a locally generated (and possibly
45+
# stale) file gets COPYed in ahead of the in-image regeneration. (`**/*.g.dart`
46+
# also matches one tracked file, packages/bull_ui_catalogue/lib/main.directories.g.dart,
47+
# but that's a widgetbook-catalogue artifact the app APK build never uses, so
48+
# excluding it from the build context is harmless.)
49+
lib/generated/
50+
**/*.freezed.dart
51+
**/*.g.dart
52+
untranslated-messages.txt
53+
integration_test/all_test.dart
54+
55+
# Editor/scratch/log artifacts irrelevant to the build
56+
**/*.swp
57+
bull_logs.tsv
58+
59+
# Host-extracted build artifacts that don't match the BULL-*.apk/aab globs
60+
# above (e.g. verification-workflow output named without an extension)
61+
BULL-release-*

.fvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"flutter": "3.44.2"
2+
"flutter": "3.44.9"
33
}

.git-blame-ignore-revs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Revisions listed here are skipped by `git blame`.
2+
# Configure once locally: git config blame.ignoreRevsFile .git-blame-ignore-revs
3+
# GitHub honors this file automatically in its blame UI.
4+
5+
# style: apply Dart tall-style formatter across the codebase (Dart 3.7+ tall style)
6+
9c1106069896c703b6a99816218c35bad36e2eac

.git_hooks/pre-commit

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ if echo "$staged" | grep -q '\.dart$'; then
3434
# Run analyze and dart fix in parallel; they are independent read-only checks.
3535
analyzeOut="$(mktemp)"
3636
fixOut="$(mktemp)"
37-
trap 'rm -f "$analyzeOut" "$fixOut"' EXIT
37+
fmtOut="$(mktemp)"
38+
trap 'rm -f "$analyzeOut" "$fixOut" "$fmtOut"' EXIT
3839

3940
start=$SECONDS
4041

@@ -44,10 +45,26 @@ if echo "$staged" | grep -q '\.dart$'; then
4445
$DART fix --dry-run >"$fixOut" 2>&1 &
4546
fixPid=$!
4647

48+
# Format check on staged Dart source only (check-only, like analyze/fix
49+
# above — never rewrites the working tree). Generated files are excluded so
50+
# regenerated output can't fail the commit: by suffix and by /generated/
51+
# path segment (drift schema snapshots). `dart format` ignores the analyzer's
52+
# `exclude:`, so the filter lives here — keep the regex in sync with the
53+
# format-check target in the makefile (which CI invokes). xargs -r no-ops when
54+
# the staged set is all-generated. Exits non-zero if any staged file is
55+
# unformatted.
56+
# $DART is intentionally unquoted: the fallback sets DART="fvm dart" (two
57+
# words), and quoting it makes xargs exec a literal binary named "fvm dart"
58+
# (exit 127). Word splitting here matches the `$DART fix` call above.
59+
echo "$staged" | grep '\.dart$' | grep -vE '\.(g|freezed|gr|config|mocks|steps)\.dart$|/generated/' \
60+
| xargs -r $DART format --output=none --set-exit-if-changed >"$fmtOut" 2>&1 &
61+
fmtPid=$!
62+
4763
wait $analyzePid; analyzeExit=$?
4864
wait $fixPid; fixExit=$?
65+
wait $fmtPid; fmtExit=$?
4966

50-
echo "analyze + dart fix took $((SECONDS - start))s (parallel)"
67+
echo "analyze + dart fix + format took $((SECONDS - start))s (parallel)"
5168

5269
if [ $analyzeExit -ne 0 ]; then
5370
cat "$analyzeOut"
@@ -60,8 +77,14 @@ if echo "$staged" | grep -q '\.dart$'; then
6077
echo "dart fix has suggestions, run \`dart fix --apply\` and commit the result."
6178
exit 1
6279
fi
80+
81+
if [ $fmtExit -ne 0 ]; then
82+
cat "$fmtOut"
83+
echo "dart format found unformatted staged files, run \`dart format .\` and commit the result."
84+
exit 1
85+
fi
6386
else
64-
echo "No Dart/pub files staged — skipping analyze + dart fix."
87+
echo "No Dart/pub files staged — skipping analyze + dart fix + format."
6588
fi
6689

6790
# bull_ui import boundary: feature UI built on the design system must import
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Shared Flutter toolchain setup for the analyze_and_test jobs. Both jobs pay
2+
# this prefix (checks needs generated code for analyze/tests; integration needs
3+
# it to build the app), so it lives here to keep the two copies from drifting.
4+
#
5+
# Cache notes: keys derive from lockfiles, so they self-invalidate when deps
6+
# change. When both parallel jobs miss the same key (lockfile just changed),
7+
# both build and both try to save — the first save wins, the second logs a
8+
# benign "cache already exists" warning. No restore-keys on the pub cache on
9+
# purpose: it holds the bull_sdk git clone, and a fuzzy fallback can restore a
10+
# checkout from an OLDER lock whose pinned commit differs; pub then resolves
11+
# against that stale clone and `pub get --enforce-lockfile` fails wanting to
12+
# drop deps. The exact key already pins the commit via pubspec.lock.
13+
name: Flutter setup
14+
description: FVM + pub caches, FVM install, deps, build_runner, translations
15+
16+
inputs:
17+
cargo-cache:
18+
description: Also restore the Cargo cache (only the integration job compiles the FRB native crates)
19+
required: false
20+
default: 'false'
21+
22+
runs:
23+
using: composite
24+
steps:
25+
# runner.arch is in the FVM key because the SDK is native binaries — an
26+
# x64 SDK restored on an arm64 runner is broken. pub/cargo caches hold
27+
# sources only (arch-independent), so they keep os-only keys and stay
28+
# shared across arches.
29+
- name: Cache Flutter SDK (FVM)
30+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
31+
with:
32+
path: ~/fvm/versions
33+
key: fvm-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.fvmrc') }}
34+
35+
- name: Cache pub (hosted + git deps)
36+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
37+
with:
38+
path: ~/.pub-cache
39+
key: pub-${{ runner.os }}-${{ hashFiles('pubspec.lock') }}
40+
41+
- name: Cache Cargo (FRB native crates)
42+
if: ${{ inputs.cargo-cache == 'true' }}
43+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
44+
with:
45+
path: |
46+
~/.cargo/registry
47+
~/.cargo/git
48+
key: cargo-${{ runner.os }}-${{ hashFiles('pubspec.lock') }}
49+
restore-keys: cargo-${{ runner.os }}-
50+
51+
- name: Install FVM
52+
shell: bash
53+
run: |
54+
case "$(uname -m)" in
55+
x86_64) fvm_arch=x64 ;;
56+
aarch64|arm64) fvm_arch=arm64 ;;
57+
*) echo "Unsupported FVM architecture: $(uname -m)" >&2; exit 1 ;;
58+
esac
59+
archive="$RUNNER_TEMP/fvm-4.1.2-linux-${fvm_arch}.tar.gz"
60+
curl --retry 5 --retry-all-errors -fL \
61+
"https://github.com/conceptadev/fvm/releases/download/4.1.2/fvm-4.1.2-linux-${fvm_arch}.tar.gz" \
62+
-o "$archive"
63+
mkdir -p "$HOME/fvm/bin"
64+
# Extract the whole tree, not just `fvm/fvm`: the two release archives
65+
# have different layouts. x64 ships a self-contained binary, arm64 a
66+
# launcher script that execs `src/dart` relative to its own directory —
67+
# unpacking the launcher alone yields `exec: .../src/dart: not found`
68+
# on every fvm invocation.
69+
tar -xzf "$archive" -C "$HOME/fvm/bin" --strip-components=1
70+
chmod +x "$HOME/fvm/bin/fvm"
71+
if [ -f "$HOME/fvm/bin/src/dart" ]; then
72+
chmod +x "$HOME/fvm/bin/src/dart"
73+
fi
74+
# Prove the launcher actually runs before anything depends on it.
75+
"$HOME/fvm/bin/fvm" --version
76+
echo "$HOME/fvm/bin" >> $GITHUB_PATH
77+
78+
- name: Check Flutter version
79+
shell: bash
80+
run: make fvm-check
81+
82+
- name: Get dependencies
83+
shell: bash
84+
run: make deps
85+
86+
# build_runner's incremental cache — RESTORE ONLY. PR jobs never save (a sha-keyed save per push would blow the 10GB repo cache quota and evict the FVM/pub/cargo caches); only the cache-warmer workflow saves, on develop pushes, so all PRs restore develop's latest warm snapshot.
87+
# ALL gitignored generated source files are cached alongside .dart_tool/build so the restored state is self-consistent (outputs present + asset graph present); build_runner hashes inputs itself and regenerates what changed.
88+
# The suffix list MUST cover every gitignored to-source output: build_runner trusts .dart_tool/build and will NOT regenerate an output whose file is missing from disk (it reports "N skipped"), so a suffix left out here is silently absent after restore and breaks the build — that is how the missing assets.gen.dart (flutter_gen, *.gen.dart ≠ *.g.dart) incident happened.
89+
# *.gr.dart / *.config.dart match nothing today but are pre-listed to mirror the format-filter regex (makefile format-check), so adding auto_route/injectable later cannot reproduce the incident; *.steps.dart is deliberately NOT cached — drift schema snapshots are git-tracked, and restoring a tracked file would overwrite the checkout (same reason main.directories.g.dart is excluded below).
90+
# Arch is in the key defensively: the build cache holds kernel/asset hashes we don't want shared across arches.
91+
# The key embeds hashFiles of this action and the warmer workflow, so any edit to either file self-busts the cache instead of restoring a stale pre-edit snapshot — no manual version token to bump (this replaced the short-lived -v2- token).
92+
# Keep path + key in sync with the save step in cache-warmer.yml.
93+
- name: Restore build_runner cache
94+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
95+
with:
96+
path: |
97+
.dart_tool/build
98+
**/*.g.dart
99+
**/*.freezed.dart
100+
**/*.mocks.dart
101+
**/*.gen.dart
102+
**/*.gr.dart
103+
**/*.config.dart
104+
!packages/bull_ui_catalogue/lib/main.directories.g.dart
105+
key: buildrunner-${{ hashFiles('.github/actions/flutter-setup/action.yml', '.github/workflows/cache-warmer.yml') }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pubspec.lock') }}-${{ github.sha }}
106+
restore-keys: buildrunner-${{ hashFiles('.github/actions/flutter-setup/action.yml', '.github/workflows/cache-warmer.yml') }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pubspec.lock') }}-
107+
108+
- name: Generate code (build_runner)
109+
shell: bash
110+
run: make build-runner
111+
112+
- name: Generate translations
113+
shell: bash
114+
run: make translations
115+
116+
- name: Disk telemetry (for trimming free-disk later)
117+
shell: bash
118+
run: df -h /

0 commit comments

Comments
 (0)