feat: quarantine upstream update candidates

This commit is contained in:
Rasyidan Akbar F. 2026-07-14 20:36:58 +07:00
commit 5b0336a493
15 changed files with 660 additions and 230 deletions

26
tests/update-common.sh Executable file
View file

@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -euo pipefail
repo_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
# shellcheck source=scripts/update-common.sh
source "$repo_root/scripts/update-common.sh"
log=$(mktemp)
trap 'rm -f "$log"' EXIT
printf 'error: hash mismatch\n got: sha256-AbCd0123+/=\n' >"$log"
[[ "$(extract_sri_hash "$log")" == "sha256-AbCd0123+/=" ]]
printf 'specified: sha256-old\n got: sha256-newValue=\n' >"$log"
[[ "$(extract_sri_hash "$log")" == "sha256-newValue=" ]]
printf 'an unrelated dependency failure\n' >"$log"
[[ -z "$(extract_sri_hash "$log")" ]]
status=$(run_validation "$log" bash -c 'echo dependency-broke; exit 42')
[[ "$status" == "failed" ]]
grep -q dependency-broke "$log"
status=$(run_validation "$log" bash -c 'echo all-good')
[[ "$status" == "passed" ]]
grep -q all-good "$log"