Public: anyone can read this; nobody can change it.
seed-release: jq → node; reseed no-op guard ignores mitosis self-ref #131
fix/seed-release-jq → main 1 commit
2 files
changed +13
−15
.forgejo/workflows/seed-release.yml +9 −5
| @@ -59,16 +59,20 @@ jobs: | ||
| 59 | 59 | PROFILE=$(sed -n 's/^profile:[[:space:]]*//p' manifest.yaml | head -1) |
| 60 | 60 | BODY=$(printf 'Gate-validated genesis seed (profile %s).\n\nManifest refs:\n```\n%s\n```\nPackage: %s/plat/-/packages\nFetch: SEED=latest bin/germinate (resolve_seed)' \ |
| 61 | 61 | "${PROFILE:-lean}" "$(grep -E '^\s+(name|ref):' manifest.yaml | head -20)" "$FORGEJO_URL") |
| 62 | code=$(jq -n --arg t "$TAG" --arg c "$GITHUB_SHA" --arg b "$BODY" \ | |
| 63 | '{tag_name:$t, target_commitish:$c, name:$t, body:$b}' \ | |
| 64 | | curl -s -o /tmp/rel.json -w '%{http_code}' -X POST -H "$AUTH" \ | |
| 65 | -H 'Content-Type: application/json' -d @- "$API/repos/$GITHUB_REPOSITORY/releases") | |
| 62 | # node, not jq: the isolated runner image ships node/bun but no jq | |
| 63 | # (same trap reseed-run.sh documents for the vxrail host). | |
| 64 | node -e 'const [t,c,b]=process.argv.slice(1); | |
| 65 | process.stdout.write(JSON.stringify({tag_name:t,target_commitish:c,name:t,body:b}))' \ | |
| 66 | "$TAG" "$GITHUB_SHA" "$BODY" > /tmp/payload.json | |
| 67 | code=$(curl -s -o /tmp/rel.json -w '%{http_code}' -X POST -H "$AUTH" \ | |
| 68 | -H 'Content-Type: application/json' -d @/tmp/payload.json \ | |
| 69 | "$API/repos/$GITHUB_REPOSITORY/releases") | |
| 66 | 70 | case "$code" in |
| 67 | 71 | 201) : ;; |
| 68 | 72 | 409|422) echo "release $TAG already exists — nothing to do"; exit 0 ;; |
| 69 | 73 | *) echo "::error::release create failed (HTTP $code): $(head -c200 /tmp/rel.json)"; exit 1 ;; |
| 70 | 74 | esac |
| 71 | ID=$(jq -r .id /tmp/rel.json) | |
| 75 | ID=$(node -e 'console.log(JSON.parse(require("fs").readFileSync("/tmp/rel.json")).id)') | |
| 72 | 76 | # Attachments are best-effort: a small [attachment] MAX_SIZE must not |
| 73 | 77 | # sink the release — the body's package link always works. |
| 74 | 78 | for f in seed.tar.gz manifest.yaml; do |
scripts/reseed-run.sh +4 −10
| @@ -19,22 +19,16 @@ bash scripts/reseed-verify.sh "$PWD/seed-new.tar.gz" | tee /tmp/reseed-verify.$$ | ||
| 19 | 19 | # new manifest's repo refs match the committed seed's, a PR would be pure |
| 20 | 20 | # churn — and a second dispatch racing a merged reseed lands an unmergeable |
| 21 | 21 | # binary conflict (PR #83). Compare refs, not bytes. |
| 22 | refs() { tar -xzOf "$1" ./manifest.yaml 2>/dev/null | grep -E '^\s+(name|ref):' || true; } | |
| 22 | # mitosis's own ref is excluded from the comparison: every reseed MERGE moves | |
| 23 | # mitosis main by exactly one (genesis) commit, so including it makes the next | |
| 24 | # scheduled run see "drift" forever — a daily self-referential churn PR. | |
| 25 | refs() { tar -xzOf "$1" ./manifest.yaml 2>/dev/null | awk '/^[[:space:]]+name:/{n=$2} /^[[:space:]]+(name|ref):/{if(n!="mitosis")print}' || true; } | |
| 23 | 26 | if [ -f genesis/seed.tar.gz ] && [ "$(refs "/seed-new.tar.gz")" = "$(refs genesis/seed.tar.gz)" ] && [ -z "" ]; then |
| 24 | 27 | echo "RESEED NO-OP: committed seed already carries these origin refs — skipping PR" |
| 25 | 28 | rm -f /tmp/reseed-verify.$$.out |
| 26 | 29 | exit 0 |
| 27 | 30 | fi |
| 28 | 31 | |
| 29 | # The candidate germinated clean (reseed-verify above) — NOW it may reach the | |
| 30 | # registry: publish the verified tarball as the versioned seed package, so | |
| 31 | # `SEED=latest` always resolves to a gate-passed seed. Failure here is fatal: | |
| 32 | # a reseed whose package half went missing would leave the registry stale | |
| 33 | # while the PR advances the blob. | |
| 34 | # shellcheck disable=SC1091 | |
| 35 | . bin/lib.sh | |
| 36 | publish_seed "/seed-new.tar.gz" "r" | |
| 37 | ||
| 38 | 32 | B="reseed/r" |
| 39 | 33 | git checkout -q -b "" |
| 40 | 34 | mv seed-new.tar.gz genesis/seed.tar.gz |
new above
offline