Files
OrbitTv/tools/verify.sh
T
pauljdandClaude Opus 5.5 9f815a2bb7
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 3m12s
release-gate / verify (push) Successful in 8m58s
pauljd/davidson-ci: Davidson CI / ai-review (push) Failing after 2m41s
0.126.0 (versionCode 323): no server built into the app
The address field starts empty on a new box, and its first server becomes
its original. A box from before reads its original server once from its own
saved sign-in and notes it beside its data; nothing else is moved or changed.
Paul's own decisions by item are kept to his server by a SHA-256 of its
address. The release gate refuses an APK that contains a server address.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 01:11:08 +00:00

34 lines
2.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Orbit's release gate (8 November 2026): the same checks for every change and every provider, before anything reaches a TV.
# Builds the release APK, runs every unit test (the shared provider contract suite included) and lint, and fails on any
# failure, any lint error, or a missing contract suite. Prints the APK's SHA-256 for the install record.
# tools/verify.sh (uses Orbit's offline .tooling cache when it's there)
set -euo pipefail
ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
TOOLING="${ORBIT_TOOLING:-$ROOT/../orbit-tv/.tooling}"
OFFLINE=()
if [ -d "$TOOLING/gradle-cache" ]; then export GRADLE_USER_HOME="$TOOLING/gradle-cache" ANDROID_USER_HOME="$TOOLING/android"; OFFLINE=(--offline); fi
export ANDROID_HOME="${ANDROID_HOME:-/opt/android-sdk}"
python3 "$ROOT/tools/test_compare_snapshots.py" 2>&1 | tail -1 # the install checker is tested too
cd "$ROOT/android"
# A clean build every time (9 November 2026): incremental builds left stale Compose stability checks in the APK.
./gradlew --no-daemon "${OFFLINE[@]}" -q clean
./gradlew --no-daemon "${OFFLINE[@]}" -q :app:assembleRelease :app:testDebugUnitTest --rerun :app:lintRelease
python3 - <<'PY'
import glob, re, sys
tests = fails = 0; contract = False
for p in glob.glob('app/build/test-results/testDebugUnitTest/*.xml'):
s = open(p).read(); m = re.search(r'tests="(\d+)".*?failures="(\d+)".*?errors="(\d+)"', s)
tests += int(m[1]); fails += int(m[2]) + int(m[3])
if 'ContractTest' in p and 'MediaProviderContract' not in p: contract = True
lint = len(re.findall(r'severity="(Error|Fatal)"', open('app/build/reports/lint-results-release.xml').read()))
print(f"tests {tests}, failures {fails}, lint errors {lint}, contract suite {'present' if contract else 'MISSING'}")
sys.exit(0 if fails == 0 and lint == 0 and contract and tests > 0 else 1)
PY
# The playback test hook is only ever in the playtest build (Paul, 9 November 2026): never in the release APK.
if unzip -l app/build/outputs/apk/release/app-release.apk | grep -q playtest-approved || \
unzip -p app/build/outputs/apk/release/app-release.apk 'classes*.dex' | grep -aq PlaytestFileActivity; then echo "Release APK contains the playback test hook."; exit 1; fi
if unzip -p app/build/outputs/apk/release/app-release.apk 'classes*.dex' 'assets/*' | grep -aq appboxmanager; then echo "Release APK contains a built-in server address."; exit 1; fi
sha256sum app/build/outputs/apk/release/app-release.apk | cut -c1-64
echo "Release gate passed."