From 345d9561467646acc5eb1070493f3ef6b537e2a7 Mon Sep 17 00:00:00 2001 From: Alejandro Di Stefano Date: Wed, 11 Nov 2026 22:50:39 -0300 Subject: [PATCH] fix(release): tolerate read-after-write lag when verifying the release tag (0.4.1) The release-tag job created v0.4.0 and then failed with "gh: Not Found (HTTP 404)" on the immediate re-read: the git refs API is eventually consistent. Poll the tag with backoff before failing, and treat only HTTP 404 as "tag absent" so other API errors fail loudly instead of falling through to tag creation. Bump to 0.4.1 because v0.4.0 is already tagged on the previous main commit and cannot be moved; 0.4.0 was never published. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/publish.yml | 29 +++++++++++++++++++++++------ CHANGELOG.md | 6 ++++++ README.md | 2 +- STATUS.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 34 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 13390e1..0eaef22 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -163,15 +163,32 @@ jobs: [[ "$main_sha" == "$GITHUB_SHA" ]] || { echo "::error::main advanced during release; refuse stale publication"; exit 1; } - if existing=$(gh api "repos/$GH_REPO/git/ref/tags/$tag" --jq '.object.sha' 2>/dev/null); then - [[ "$existing" == "$GITHUB_SHA" ]] || { - echo "::error::Protected tag exists for another commit"; exit 1; - } - else + # Prints the commit the tag points to, or nothing when the ref does not exist. + # Any error other than 404 (auth, rate limit, outage) fails the job. + tag_sha() { + local out + if out=$(gh api "repos/$GH_REPO/git/ref/tags/$tag" --jq '.object.sha' 2>&1); then + printf '%s' "$out" + elif [[ "$out" != *"HTTP 404"* ]]; then + echo "::error::Reading $ref failed: $out" >&2; return 1 + fi + } + existing=$(tag_sha) + if [[ -z "$existing" ]]; then gh api --method POST "repos/$GH_REPO/git/refs" \ --raw-field ref="$ref" --raw-field sha="$GITHUB_SHA" >/dev/null + elif [[ "$existing" != "$GITHUB_SHA" ]]; then + echo "::error::Protected tag exists for another commit"; exit 1 fi - recorded=$(gh api "repos/$GH_REPO/git/ref/tags/$tag" --jq '.object.sha') + # The git refs API is eventually consistent: a ref created a moment ago + # can still answer 404, so poll with backoff before declaring failure. + recorded="" + for attempt in 1 2 3 4 5 6; do + recorded=$(tag_sha) + [[ -n "$recorded" ]] && break + echo "$ref not visible yet (attempt $attempt); retrying" + sleep $((attempt * 2)) + done [[ "$recorded" == "$GITHUB_SHA" ]] || { echo "::error::Protected tag SHA verification failed"; exit 1; } diff --git a/CHANGELOG.md b/CHANGELOG.md index a76af75..d257c0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog + +## [0.4.1] — 2026-11-11 + +- Fixed the `release-tag` publish job failing with `gh: Not Found (HTTP 404)` right after creating the tag: the git refs API is eventually consistent, so the verification read now retries with backoff before failing. +- The tag existence check now treats only HTTP 404 as "absent"; auth, rate-limit or outage errors fail the job instead of falling through to tag creation. +- 0.4.0 was tagged (`v0.4.0`) but never published to any registry; 0.4.1 is the first published build containing the 0.4.0 changes. ## [0.4.0] — 2026-11-11 (candidate; NOT PUBLISHED) - Added a bilingual, opt-in **Check setup** command and Control Center action, using the existing visual components. Version-only local tool checks and target-policy validation never send load traffic. diff --git a/README.md b/README.md index f618f0d..18a959d 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ --- -> **Published stable version: [0.3.1](https://github.com/Drako01/saturivo/releases/tag/v0.3.1).** This source branch proposes **Saturivo 0.4.0** with correctness, privacy and first-run diagnostics improvements. The 0.4.0 candidate is **not published** until exact-SHA PR CI, squash merge and the protected release pipeline complete. The icon, branding, Control Center layout and visual styling are preserved. No third-party certification is claimed. +> **Published stable version: [0.3.1](https://github.com/Drako01/saturivo/releases/tag/v0.3.1).** Source version **Saturivo 0.4.1** ships the 0.4.0 correctness, privacy and first-run diagnostics improvements plus a release-pipeline fix; 0.4.0 was tagged but never published. It is **not published** until exact-SHA PR CI, squash merge and the protected release pipeline complete. The icon, branding, Control Center layout and visual styling are preserved. No third-party certification is claimed. ## Saturivo 0.4.0 — reliability and onboarding (candidate) diff --git a/STATUS.md b/STATUS.md index e46239d..c5b4f58 100644 --- a/STATUS.md +++ b/STATUS.md @@ -2,7 +2,7 @@ **Versión publicada verificada:** 0.3.1 estable, sin Preview — [GitHub Release v0.3.1](https://github.com/Drako01/saturivo/releases/tag/v0.3.1), publicada el 10/11/2026. [Workflow de publicación](https://github.com/Drako01/saturivo/actions/runs/42871351253): success. -**Versión fuente propuesta:** 0.4.0, rama `feat/saturivo-0.4.0-reliability-onboarding`, basada en `main` `c34b22ffabcfed24d681b5a46457a49c07a2ad10`. **Estado: NO PUBLICADO** hasta que CI de PR, merge y release verifiquen la revisión exacta. +**Versión fuente propuesta:** 0.4.1 (incluye el alcance de 0.4.0, que quedó etiquetada pero nunca publicada, más el fix del job `release-tag`). **Estado: NO PUBLICADO** hasta que CI de PR, merge y release verifiquen la revisión exacta. ## Alcance 0.4.0 diff --git a/package-lock.json b/package-lock.json index 1a9cede..b2f3d91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "saturivo", - "version": "0.4.0", + "version": "0.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "saturivo", - "version": "0.4.0", + "version": "0.4.1", "license": "MIT", "devDependencies": { "@types/node": "^22.15.30", diff --git a/package.json b/package.json index f42169f..b798d66 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "saturivo", "displayName": "Saturivo", "description": "Evidence-based load, concurrency and performance diagnostics for local APIs and Go services.", - "version": "0.4.0", + "version": "0.4.1", "publisher": "armotusitio", "author": { "name": "Alejandro Daniel Di Stefano",