salvage 2026-11-06: uncommitted work from scratch/darkwing-scratch/r137/wt (disk cleanup #824)
This commit is contained in:
1 parent
7a2987cf51
commit
ace2cb9e20
27 files changed
+1229
-255
No files matched your search
+17
-35
@@ -164,22 +164,14 @@ pdiff "$TARGET" "$MB" "$C" > "$SCRATCH/reviewed.patch"
|
||||
[ -s "$SCRATCH/reviewed.patch" ] || refuse base-conflict "the reviewed diff $MB..$C is empty"
|
||||
REVIEWED_ID="$(git -C "$TARGET" patch-id --stable < "$SCRATCH/reviewed.patch" | cut -d' ' -f1)"
|
||||
|
||||
# Invariant 1: nothing new at the root. A top-level file, a top-level
|
||||
# directory the base doesn't have, and the legacy src/ and archived v1/
|
||||
# trees all count as the root.
|
||||
mapfile -d '' -t ADDED < <(git -C "$TARGET" diff -z --no-renames --name-only --diff-filter=A "$MB" "$C")
|
||||
mapfile -d '' -t TOP < <(git -C "$TARGET" ls-tree -z --name-only "$OLD")
|
||||
ROOT_HITS=""
|
||||
for f in "${ADDED[@]}"; do
|
||||
case "$f" in
|
||||
*/*) top="${f%%/*}" ;;
|
||||
*) ROOT_HITS="$ROOT_HITS $f"; continue ;;
|
||||
esac
|
||||
known="no"
|
||||
for t in "${TOP[@]}"; do [ "$t" = "$top" ] && known="yes" && break; done
|
||||
if [ "$known" = "no" ] || [ "$top" = "src" ] || [ "$top" = "v1" ]; then ROOT_HITS="$ROOT_HITS $f"; fi
|
||||
done
|
||||
[ -z "$ROOT_HITS" ] || refuse root-file "the reviewed diff adds$ROOT_HITS"
|
||||
# Invariant 1: nothing new at the root. The rule is rootHits in
|
||||
# packages/seat/src/landing.mjs, which the bus host's landings share.
|
||||
git -C "$TARGET" diff -z --no-renames --name-only --diff-filter=A "$MB" "$C" > "$SCRATCH/added"
|
||||
git -C "$TARGET" ls-tree -z --name-only "$OLD" > "$SCRATCH/top"
|
||||
ROOT_RC=0
|
||||
node "$REPO/packages/seat/src/landing.mjs" root-file "$SCRATCH/top" "$SCRATCH/added" > "$SCRATCH/root-hits" || ROOT_RC=$?
|
||||
[ "$ROOT_RC" -ne 2 ] || refuse root-file "the reviewed diff adds $(tr '\n' ' ' < "$SCRATCH/root-hits" | sed 's/ $//')"
|
||||
[ "$ROOT_RC" -eq 0 ] || fail "the root-file check could not run (exit $ROOT_RC)"
|
||||
|
||||
mapfile -d '' -t PATHS < <(git -C "$TARGET" diff -z --no-renames --name-only "$MB" "$C")
|
||||
# Paths go to git as they are, never as globs or pathspec magic.
|
||||
@@ -214,25 +206,15 @@ echo "land-work: gate logs in $LOGS" >&2
|
||||
# to shorten or skip it.
|
||||
[ -d "$TARGET/node_modules" ] || fail "no node_modules in $TARGET for the gate" 4
|
||||
ln -s "$TARGET/node_modules" "$WT/node_modules"
|
||||
gate_step() { # name dir command
|
||||
local rc=0
|
||||
(cd "$WT/$2" && bash -c "set -o pipefail; $3") > "$LOGS/$1.log" 2>&1 || rc=$?
|
||||
echo "$1 rc=$rc $(grep -E '^ℹ (pass|fail) [0-9]+' "$LOGS/$1.log" | tr '\n' ' ')" | tee -a "$LOGS/gate.log" >&2
|
||||
[ "$rc" -eq 0 ] || refuse gate-failed "$1, see $LOGS/$1.log"
|
||||
}
|
||||
# No pkg-queue step: scripts/test-queue.sh runs packages/queue/tests/ itself.
|
||||
for d in "$WT"/packages/*/; do
|
||||
p="$(basename "$d")"
|
||||
[ -d "$d/tests" ] || continue
|
||||
[ "$p" = queue ] && continue
|
||||
gate_step "pkg-$p" "packages/$p" 'node --test tests/*.test.mjs'
|
||||
done
|
||||
for s in "$WT"/scripts/test-*.sh; do
|
||||
[ -f "$s" ] || continue
|
||||
n="$(basename "$s" .sh)"
|
||||
gate_step "script-${n#test-}" . "bash scripts/$n.sh"
|
||||
done
|
||||
echo "GATE_PASSED" | tee -a "$LOGS/gate.log" >&2
|
||||
# The steps, their logs and the summary lines are runGate's in
|
||||
# packages/seat/src/landing.mjs, which the bus host's landings share.
|
||||
GATE_RC=0
|
||||
node "$REPO/packages/seat/src/landing.mjs" gate "$WT" "$LOGS" > "$SCRATCH/gate.out" || GATE_RC=$?
|
||||
if [ "$GATE_RC" -eq 2 ] && [ -s "$SCRATCH/gate.out" ]; then
|
||||
line="$(head -n1 "$SCRATCH/gate.out")"
|
||||
refuse gate-failed "${line%% *}, see ${line#* }"
|
||||
fi
|
||||
[ "$GATE_RC" -eq 0 ] || fail "the gate could not run (exit $GATE_RC)"
|
||||
|
||||
# ---- the commit ----
|
||||
SHORT_ID="${REVIEWED_ID:0:12}"
|
||||
|
||||
Reference in new issue
Block a user