Files
OrbitTv/tools/verify.sh
T
pauljdandClaude Opus 5.5 11af81c859
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 3m38s
release-gate / verify (push) Successful in 11m53s
pauljd/davidson-ci: Davidson CI / ai-review (push) Failing after 2m50s
Household and Play editions, one version-code counter (build 40: 400 household, 402 Play)
Both editions are tv.orbit.classic. The Play edition has no room updater, no
PackageInstaller, no REQUEST_INSTALL_PACKAGES, no adb install check and no
adb test hooks; Google Play updates it. The household edition keeps all of
them. Release builds and the Play bundle are unsigned until signing is
approved. The release gate builds both editions and the bundle, tests both,
and checks what was built: ids, codes above every earlier one (the reserved
390 included), Play isolation, household intact, nothing signed.

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

41 lines
2.9 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 both editions (household APK, Play APK and Play bundle, all unsigned), runs every unit test for both (the shared
# provider contract suite included) and lint, and fails on any failure, any lint error, a missing contract suite, or an
# editions check that fails (tools/check_editions.py). Prints the SHA-256s 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:assembleHouseholdRelease :app:assemblePlayRelease :app:bundlePlayRelease \
:app:testHouseholdDebugUnitTest :app:testPlayDebugUnitTest --rerun :app:lintHouseholdRelease :app:lintPlayRelease
python3 - <<'PY'
import glob, re, sys
ok = True
for edition in ("Household", "Play"):
tests = fails = 0; contract = False
for p in glob.glob(f'app/build/test-results/test{edition}DebugUnitTest/*.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(f'app/build/reports/lint-results-{edition.lower()}Release.xml').read()))
print(f"{edition.lower()}: tests {tests}, failures {fails}, lint errors {lint}, contract suite {'present' if contract else 'MISSING'}")
ok = ok and fails == 0 and lint == 0 and contract and tests > 0
sys.exit(0 if ok else 1)
PY
HOUSEHOLD=app/build/outputs/apk/household/release/app-household-release-unsigned.apk
PLAY=app/build/outputs/apk/play/release/app-play-release-unsigned.apk
BUNDLE=app/build/outputs/bundle/playRelease/app-play-release.aab
# Both editions as built (Paul, 10 November 2026): ids, version codes, Play isolation, household intact, nothing signed.
# The playback test hook and any server address are refused in every edition there too.
python3 "$ROOT/tools/check_editions.py" "$HOUSEHOLD" "$PLAY" "$BUNDLE" "$(ls -d "$ANDROID_HOME"/build-tools/* | sort -V | tail -1)/aapt2"
sha256sum "$HOUSEHOLD" "$PLAY" "$BUNDLE" | sed "s#app/build/outputs/##"
echo "Release gate passed."