fix: M8 review findings (restore ownership, barrier tool, World0 claimRef, CI selection, drill verdicts)
P1: restore-world.sh claims its objects path (mkdir) and the database (a held session with a restore try-lock and the exclusive upgrade lock), and removes only what it created, so a losing restore never drops a winner's schema. P2: barrier Ready-pod selection via shared jsonpath helper with fixtures; barrier pod fsGroup; script-generated pods inspected by the policy check; World0 PV claim references protected; ci-paths.sh uses the event's real base and runs on uncertainty; fault-drill asserts RTO and needs positive quarantine evidence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env bash
|
||||
# Offline regression for tools/ci/ci-paths.sh (review M8 P2) in a disposable Git
|
||||
# repository: multi-commit pushes ending in documentation, missing and unknown bases,
|
||||
# pull requests, manual dispatch, and changes to only a check script. Uncertainty
|
||||
# must run validation. Run by the deploy suite before it decides anything.
|
||||
set -euo pipefail
|
||||
script="$(cd "$(dirname "$0")" && pwd)/ci-paths.sh"
|
||||
repo="$(mktemp -d /tmp/evo-ci-paths.XXXXXXXX)"
|
||||
trap 'rm -rf -- "$repo"' EXIT
|
||||
cd "$repo"
|
||||
git init -q
|
||||
git config user.email ci@example.invalid
|
||||
git config user.name ci
|
||||
mkdir -p src docs tools/ci
|
||||
echo base > src/a.cpp; echo base > docs/a.md; echo base > tools/ci/dr-check.sh
|
||||
git add .; git commit -qm base
|
||||
base="$(git rev-parse HEAD)"
|
||||
echo change >> src/a.cpp; git commit -qam implementation
|
||||
echo change >> docs/a.md; git commit -qam documentation
|
||||
docs_only_base="$(git rev-parse HEAD~1)"
|
||||
failures=0
|
||||
expect() { # expect <label> <0 run|1 skip> <env...> -- <suite>
|
||||
local label="$1" want="$2"; shift 2
|
||||
local envs=()
|
||||
while [ "$1" != -- ]; do envs+=("$1"); shift; done
|
||||
shift
|
||||
local got=0
|
||||
env -u GITHUB_EVENT_BEFORE -u GITHUB_EVENT_NAME -u CI_EVENT -u CI_BEFORE -u CI_PR_BASE \
|
||||
"${envs[@]}" bash "$script" "$1" || got=$?
|
||||
if [ "$got" = "$want" ]; then echo "ok $label"; else echo "FAIL $label: exit $got, wanted $want"; failures=$((failures + 1)); fi
|
||||
}
|
||||
expect "push: code then docs runs checks" 0 CI_EVENT=push "CI_BEFORE=$base" -- checks
|
||||
expect "push: docs-only commit skips checks" 1 CI_EVENT=push "CI_BEFORE=$docs_only_base" -- checks
|
||||
expect "push: no before SHA runs" 0 CI_EVENT=push -- checks
|
||||
expect "push: all-zero before (new branch) runs" 0 CI_EVENT=push CI_BEFORE=0000000000000000000000000000000000000000 -- checks
|
||||
expect "push: unknown, unfetchable base runs" 0 CI_EVENT=push CI_BEFORE=1111111111111111111111111111111111111111 -- checks
|
||||
expect "pull request: base diff runs checks" 0 CI_EVENT=pull_request "CI_PR_BASE=$base" -- checks
|
||||
expect "pull request: no base runs" 0 CI_EVENT=pull_request -- deploy
|
||||
expect "manual dispatch always runs" 0 CI_EVENT=workflow_dispatch "CI_BEFORE=$docs_only_base" -- checks
|
||||
expect "local run (no event) runs" 0 -- postgres
|
||||
echo change >> tools/ci/dr-check.sh; git commit -qam dr-script
|
||||
script_base="$(git rev-parse HEAD~1)"
|
||||
expect "push: only dr-check.sh changed runs postgres" 0 CI_EVENT=push "CI_BEFORE=$script_base" -- postgres
|
||||
expect "push: only dr-check.sh changed skips image" 1 CI_EVENT=push "CI_BEFORE=$script_base" -- image
|
||||
[ "$failures" = 0 ] && echo "ci path selection fixtures passed" || { echo "$failures fixture(s) failed"; exit 1; }
|
||||
Reference in New Issue
Block a user