mirror of
https://github.com/storytold/gridcraft.git
synced 2026-12-02 02:33:55 -06:00
99 lines
4.4 KiB
YAML
99 lines
4.4 KiB
YAML
name: windows validate reproduction with diagnostics (throwaway)
|
|
# Throwaway: reproduces the signer's release/validate refusal on windows-latest with the diagnostics
|
|
# message from craft-common-actions 644556de patched over the reviewed pin (so the pin check still
|
|
# passes), and dumps the path and handle identity of every JSON validate can read.
|
|
# Not part of any release path; binds no environment and uses no secrets.
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
producer_run_id:
|
|
required: false
|
|
default: "45749038918"
|
|
type: string
|
|
producer_run_attempt:
|
|
required: false
|
|
default: "1"
|
|
type: string
|
|
push:
|
|
branches: [diag/**]
|
|
permissions:
|
|
contents: read
|
|
actions: read
|
|
jobs:
|
|
probe:
|
|
runs-on: windows-latest
|
|
timeout-minutes: 25
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: ${{ github.ref }}
|
|
path: .release-source
|
|
persist-credentials: false
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
repository: storytold/craft-common-actions
|
|
ref: be00e5ccd18b68e950c8a08532f2230e7c3d0cba
|
|
path: .nightly-tools
|
|
persist-credentials: false
|
|
- name: Put the diagnostics version of nightly_feed.py in the reviewed checkout
|
|
shell: bash
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
set -euo pipefail
|
|
gh api "repos/storytold/craft-common-actions/contents/scripts/nightly_feed.py?ref=644556debe518ff6963c8d08b92a69aa6cabb534" --jq .content | base64 -d > .nightly-tools/scripts/nightly_feed.py
|
|
git -C .nightly-tools diff --stat
|
|
python -I -B -c "import sys; sys.path.insert(0, '.nightly-tools/scripts'); import nightly_feed as n; print('diagnostics present:', hasattr(n, 'differences'))"
|
|
- name: Download the same three artifacts the signer read
|
|
shell: bash
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
set -euo pipefail
|
|
for spec in windows-x86_64:15085631383 macos-aarch64:15085880628 linux-x86_64:15084264488; do
|
|
platform="${spec%%:*}"; id="${spec##*:}"
|
|
mkdir -p ".unsigned/$platform"
|
|
gh api "repos/storytold/gridcraft/actions/artifacts/$id/zip" > "/tmp/$platform.zip"
|
|
unzip -q "/tmp/$platform.zip" -d ".unsigned/$platform"
|
|
done
|
|
ls -la .unsigned/*/ | head -20
|
|
- name: Admission, exactly as the signer runs it
|
|
shell: bash
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
PRODUCER_RUN_ID: ${{ inputs.producer_run_id || 45749038918 }}
|
|
PRODUCER_RUN_ATTEMPT: ${{ inputs.producer_run_attempt || 1 }}
|
|
run: |
|
|
if [ -n "${PRODUCER_RUN_ID:-}" ]; then
|
|
python -I -B .nightly-tools/scripts/nightly_release_entry.py admit --source .release-source --producer-run-id "$PRODUCER_RUN_ID" --producer-run-attempt "$PRODUCER_RUN_ATTEMPT" --output .admission
|
|
else
|
|
echo "no producer inputs (push run): skipping admit"
|
|
fi
|
|
- name: Dump path and handle identity for every JSON validate reads
|
|
if: always()
|
|
shell: bash
|
|
run: |
|
|
python -I -B - <<'EOF'
|
|
import os, pathlib
|
|
fields = ("st_dev", "st_ino", "st_size", "st_mtime_ns", "st_ctime_ns")
|
|
for root in (".admission", ".unsigned", ".release-source/.github"):
|
|
for path in sorted(pathlib.Path(root).rglob("*.json")):
|
|
try:
|
|
with open(path, "rb") as stream:
|
|
first = os.fstat(stream.fileno())
|
|
entry = os.lstat(path)
|
|
except Exception as error:
|
|
print(path, "could not read:", error); continue
|
|
rows = [f"{k}: lstat {getattr(entry, k)} handle {getattr(first, k)}" for k in fields if getattr(entry, k) != getattr(first, k)]
|
|
print(path, "AGREE" if not rows else "DIFFERS -> " + "; ".join(rows))
|
|
EOF
|
|
- name: Validate with the diagnostics message
|
|
if: always()
|
|
shell: bash
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
set +e
|
|
python -I -B .nightly-tools/scripts/nightly_release_entry.py validate --source .release-source --state .admission --directory .unsigned --output .validated 2>&1 | tee validate.out
|
|
echo "exit: ${PIPESTATUS[0]}"
|