mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-11-26 10:07:25 +01:00
pre-push is a 1-second stamp check; the suites moved to the manual stage
Some checks failed
dependency freshness / dependencies on newest stable (push) Has been cancelled
file-length / file length <= 250 lines (push) Has been cancelled
md-naming / markdown naming convention (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Tests / test (push) Has been cancelled
release-apk / release (APK) (push) Has been cancelled
Some checks failed
dependency freshness / dependencies on newest stable (push) Has been cancelled
file-length / file length <= 250 lines (push) Has been cancelled
md-naming / markdown naming convention (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Tests / test (push) Has been cancelled
release-apk / release (APK) (push) Has been cancelled
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d2df4c51eb
commit
05fdabf6c8
@ -137,7 +137,7 @@ repos:
|
|||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
always_run: true
|
always_run: true
|
||||||
require_serial: true
|
require_serial: true
|
||||||
stages: [pre-push]
|
stages: [manual]
|
||||||
|
|
||||||
- repo: https://github.com/codespell-project/codespell
|
- repo: https://github.com/codespell-project/codespell
|
||||||
rev: v2.3.0
|
rev: v2.3.0
|
||||||
@ -232,3 +232,17 @@ repos:
|
|||||||
|Cargo\.(toml|lock)|go\.(mod|sum)
|
|Cargo\.(toml|lock)|go\.(mod|sum)
|
||||||
|\.fvmrc|\.nvmrc|\.python-version
|
|\.fvmrc|\.nvmrc|\.python-version
|
||||||
|\.github/workflows/.*\.ya?ml)$
|
|\.github/workflows/.*\.ya?ml)$
|
||||||
|
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
# The only pre-push hook. Everything that used to run here is now
|
||||||
|
# `stages: [manual]` -- run on demand with `scripts/check_gate_stamp.sh
|
||||||
|
# full`, and by CI on every push. finish_auto.sh stamps HEAD after its
|
||||||
|
# gate; a tree without that receipt cannot leave the machine.
|
||||||
|
- id: gate-stamp
|
||||||
|
name: pushed tree passed the local gate (stamp check)
|
||||||
|
entry: scripts/check_gate_stamp.sh check
|
||||||
|
language: system
|
||||||
|
pass_filenames: false
|
||||||
|
always_run: true
|
||||||
|
stages: [pre-push]
|
||||||
|
|||||||
@ -2,7 +2,7 @@ name: diet_guard_app
|
|||||||
description: "Companion phone app for diet_guard: log meals on the go."
|
description: "Companion phone app for diet_guard: log meals on the go."
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 1.0.89+1
|
version: 1.0.90+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.12.2
|
sdk: ^3.12.2
|
||||||
|
|||||||
30
scripts/check_gate_stamp.sh
Executable file
30
scripts/check_gate_stamp.sh
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# ============================================================================
|
||||||
|
# pre-push gate: is the pushed tree stamped as having passed the local gate?
|
||||||
|
#
|
||||||
|
# Thin delegate to the shared tool in ~/src/utils. The pre-push stage used to
|
||||||
|
# re-run every suite (10+ min under the resource cap); now finish_auto.sh's
|
||||||
|
# gate leaves a receipt (the tree hash) and this only compares against it.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# scripts/check_gate_stamp.sh check # pre-commit's pre-push stage (~1 s)
|
||||||
|
# scripts/check_gate_stamp.sh full # the old pre-push suites, then stamp
|
||||||
|
# ============================================================================
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
readonly SHARED_GATE="${UTILS_ROOT:-$HOME/src/utils}/scripts/gate_stamp.sh"
|
||||||
|
|
||||||
|
main() {
|
||||||
|
if [[ ! -x "$SHARED_GATE" ]]; then
|
||||||
|
echo "Error: shared gate-stamp tool not found at $SHARED_GATE" >&2
|
||||||
|
echo " Clone github.com/kuhyx/utils to ~/src/utils, or set" >&2
|
||||||
|
echo " UTILS_ROOT to where it lives." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec bash "$SHARED_GATE" "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
@ -20,8 +20,9 @@
|
|||||||
# no Dart hooks at all: without this, the app's tests were never run by
|
# no Dart hooks at all: without this, the app's tests were never run by
|
||||||
# anything automatic, and a red app/ could be pushed with a green gate.
|
# anything automatic, and a red app/ could be pushed with a green gate.
|
||||||
#
|
#
|
||||||
# Wired as the pre-push hook, so a red result blocks the push before CI ever
|
# Runs on demand (`scripts/check_gate_stamp.sh full`, pre-commit's manual
|
||||||
# sees it. Escape hatch for genuine emergencies: `git push --no-verify`.
|
# stage) and in CI. It left the pre-push path on 2026-09-20: 10+ minutes
|
||||||
|
# per push under the resource cap, for work finish_auto.sh had just done.
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@ -43,7 +44,7 @@ log() { printf 'ci-mirror: %s\n' "$1" >&2; }
|
|||||||
|
|
||||||
fail() {
|
fail() {
|
||||||
log "FAILED — $1"
|
log "FAILED — $1"
|
||||||
log "CI would be red. Fix the above, or 'git push --no-verify' to override."
|
log "CI would be red. Fix the above before pushing."
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user