From f79d425d3dee8ecbad9c867c5aec2d6ab52d58b7 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Tue, 17 Nov 2026 22:47:43 +0100 Subject: [PATCH] Add full gate, nightly timer, 8 shards Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WzxdWZB8QEaFVQoa8CjuAw --- .pre-commit-config.yaml | 42 +++++++++++++++++++++--- full-gate.service | 14 ++++++++ full-gate.timer | 14 ++++++++ scripts/check_flutter_coverage.sh | 2 +- scripts/full_gate.sh | 53 +++++++++++++++++++++++++++++++ scripts/nightly_full_gate.sh | 28 ++++++++++++++++ 6 files changed, 147 insertions(+), 6 deletions(-) create mode 100644 full-gate.service create mode 100644 full-gate.timer create mode 100755 scripts/full_gate.sh create mode 100755 scripts/nightly_full_gate.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d37329b..0af325a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -316,7 +316,7 @@ repos: files: '^stronglift_replacement/workout_app/.*\.(dart|yaml)$' pass_filenames: false - id: flutter-test-coverage-shard-0 - name: flutter test bucket 0/4 (workout app, local gate) + name: flutter test bucket 0/8 (workout app, local gate) entry: bash scripts/check_flutter_coverage.sh --gate-shard 0 language: system pass_filenames: false @@ -324,7 +324,7 @@ repos: require_serial: true stages: [manual] - id: flutter-test-coverage-shard-1 - name: flutter test bucket 1/4 (workout app, local gate) + name: flutter test bucket 1/8 (workout app, local gate) entry: bash scripts/check_flutter_coverage.sh --gate-shard 1 language: system pass_filenames: false @@ -332,7 +332,7 @@ repos: require_serial: true stages: [manual] - id: flutter-test-coverage-shard-2 - name: flutter test bucket 2/4 (workout app, local gate) + name: flutter test bucket 2/8 (workout app, local gate) entry: bash scripts/check_flutter_coverage.sh --gate-shard 2 language: system pass_filenames: false @@ -340,17 +340,49 @@ repos: require_serial: true stages: [manual] - id: flutter-test-coverage-shard-3 - name: flutter test bucket 3/4 (workout app, local gate) + name: flutter test bucket 3/8 (workout app, local gate) entry: bash scripts/check_flutter_coverage.sh --gate-shard 3 language: system pass_filenames: false always_run: true require_serial: true stages: [manual] + - id: flutter-test-coverage-shard-4 + name: flutter test bucket 4/8 (workout app, local gate) + entry: bash scripts/check_flutter_coverage.sh --gate-shard 4 + language: system + pass_filenames: false + always_run: true + require_serial: true + stages: [manual] + - id: flutter-test-coverage-shard-5 + name: flutter test bucket 5/8 (workout app, local gate) + entry: bash scripts/check_flutter_coverage.sh --gate-shard 5 + language: system + pass_filenames: false + always_run: true + require_serial: true + stages: [manual] + - id: flutter-test-coverage-shard-6 + name: flutter test bucket 6/8 (workout app, local gate) + entry: bash scripts/check_flutter_coverage.sh --gate-shard 6 + language: system + pass_filenames: false + always_run: true + require_serial: true + stages: [manual] + - id: flutter-test-coverage-shard-7 + name: flutter test bucket 7/8 (workout app, local gate) + entry: bash scripts/check_flutter_coverage.sh --gate-shard 7 + language: system + pass_filenames: false + always_run: true + require_serial: true + stages: [manual] # Fails unless every shard above passed on THIS tree, then applies the # unchanged 100% bar and every-lib-file guard to their union. - id: flutter-test-coverage-merge - name: flutter coverage 100% (union of the 4 buckets) + name: flutter coverage 100% (union of the 8 buckets) entry: bash scripts/check_flutter_coverage.sh --gate-merge language: system pass_filenames: false diff --git a/full-gate.service b/full-gate.service new file mode 100644 index 0000000..bd5b0f6 --- /dev/null +++ b/full-gate.service @@ -0,0 +1,14 @@ +[Unit] +Description=screen-locker full test suite (writes the green/red full stamp that gates pushes) + +[Service] +Type=oneshot +# %h = kuhy's home. nightly_full_gate.sh skips under load and on a dirty tree. +ExecStart=/bin/bash %h/src/screen-locker/scripts/nightly_full_gate.sh +# Each hook step is <60 s on its own; the whole run gets its own generous cap. +TimeoutStartSec=45min +Nice=19 +IOSchedulingClass=idle +CPUQuota=20% +MemoryMax=4G +Environment=FLUTTER_TEST_CONCURRENCY=2 diff --git a/full-gate.timer b/full-gate.timer new file mode 100644 index 0000000..26d65aa --- /dev/null +++ b/full-gate.timer @@ -0,0 +1,14 @@ +[Unit] +Description=Nightly screen-locker full suite at 22:00 +# No After=graphical-session.target: it would close an ordering cycle with +# timers.target and systemd would delete this timer's job (see +# early-bird-workout-check.timer, 2026-08-04). + +[Timer] +OnCalendar=*-*-* 22:00:00 +# Persistent stamps on elapse, not on success; a night skipped by the load +# guard is simply skipped. The PC is off from 23:00, so no catch-up is wanted. +Persistent=false + +[Install] +WantedBy=timers.target diff --git a/scripts/check_flutter_coverage.sh b/scripts/check_flutter_coverage.sh index 4aa9582..7540145 100755 --- a/scripts/check_flutter_coverage.sh +++ b/scripts/check_flutter_coverage.sh @@ -42,7 +42,7 @@ APP_DIR="stronglift_replacement/workout_app" LCOV_INFO="$APP_DIR/coverage/lcov.info" # Number of local-gate buckets; must equal the flutter-test-coverage-shard-* # hooks in .pre-commit-config.yaml (the merge counts them, see below). -GATE_SHARDS=4 +GATE_SHARDS=8 die() { echo "ERROR: $*" >&2 diff --git a/scripts/full_gate.sh b/scripts/full_gate.sh new file mode 100755 index 0000000..0558cbf --- /dev/null +++ b/scripts/full_gate.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# ============================================================================ +# The FULL suite, outside the push path: every manual-stage hook of +# .pre-commit-config.yaml as its own <60 s step (gate_stamp.sh step ), then +# a green or red verdict in $GIT_DIR: +# gate-full-green commit the full suite passed on (push gate's base) +# gate-full-status "green