From ba8d9b112d2f66cbfc6bd3b5558273f5eb1c948d Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 25 May 2026 20:05:15 -0400 Subject: [PATCH] =?UTF-8?q?fix(ext-ci):=20add=20diagnostic=20tracing=20to?= =?UTF-8?q?=20commit=20step=20to=20surface=20why=20run=20#309=20reported?= =?UTF-8?q?=20success=20without=20producing=20the=20XPI=20side-commit=20?= =?UTF-8?q?=E2=80=94=20Co-Authored-By:=20Claude=20Opus=204.7=20(1M=20conte?= =?UTF-8?q?xt)=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .forgejo/workflows/extension.yml | 40 +++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/.forgejo/workflows/extension.yml b/.forgejo/workflows/extension.yml index ce35f37..ef007c3 100644 --- a/.forgejo/workflows/extension.yml +++ b/.forgejo/workflows/extension.yml @@ -45,34 +45,52 @@ jobs: WEB_EXT_API_SECRET: ${{ secrets.MOZILLA_AMO_JWT_SECRET }} - name: Commit signed XPI to frontend/public/extension/ run: | - set -e + set -ex # AMO renames signed XPIs using its internal addon-id-safe-string - # (e.g. 997017ca3e104e30a75a-1.0.1.xpi), NOT our gecko ID. The - # original 'fabledcurator-*' glob never matched and the step - # exited 1 even on a successful sign (operator-flagged - # 2026-05-25). Match any *.xpi in the artifacts dir — fresh - # CI runner means there's exactly one — and rename it on copy - # so the FC server's whitelist (backend/app/frontend.py expects - # 'fabledcurator-*.xpi') keeps working. + # (e.g. 997017ca3e104e30a75a-1.0.1.xpi), NOT our gecko ID. Match + # any *.xpi in the artifacts dir — fresh CI runner means there's + # exactly one — and rename it on copy so the FC server's + # whitelist (backend/app/frontend.py expects 'fabledcurator-*.xpi') + # keeps working. + # Diagnostic instrumentation 2026-05-25: a prior run (id 1731) + # reported success without producing an `ext: publish signed XPI` + # commit on main. Tracing the cwd, artifacts dir, version + # extraction, staging state, and push response so the next run's + # log explains the gap. + echo "=== cwd ===" + pwd + echo "=== ref / branch ===" + echo "ref: ${GITHUB_REF:-unset} sha: ${GITHUB_SHA:-unset}" + git log --oneline -3 || true + echo "=== artifacts dir ===" + ls -la extension/web-ext-artifacts/ 2>&1 || echo "(dir missing)" XPI=$(ls extension/web-ext-artifacts/*.xpi 2>/dev/null | head -1) + echo "XPI=$XPI" if [ -z "$XPI" ]; then echo "No XPI produced by web-ext sign — exiting" - ls -la extension/web-ext-artifacts/ || true exit 1 fi VERSION=$(grep -E '"version"' extension/package.json | head -1 | sed -E 's/.*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/') + echo "VERSION=$VERSION" DEST="frontend/public/extension/fabledcurator-${VERSION}.xpi" + echo "DEST=$DEST" mkdir -p frontend/public/extension # Wipe any prior versions so the directory doesn't grow each release. rm -f frontend/public/extension/fabledcurator-*.xpi cp "$XPI" "$DEST" cp "$XPI" "frontend/public/extension/fabledcurator-latest.xpi" + echo "=== frontend/public/extension/ after copy ===" + ls -la frontend/public/extension/ git config user.name "FC extension CI" git config user.email "noreply@fabledsword.com" git add frontend/public/extension/ + echo "=== git status after add ===" + git status --short + echo "=== diff --cached --stat ===" + git diff --cached --stat || true if git diff --cached --quiet; then - echo "No changes to commit" + echo "No changes to commit (frontend/public/extension/ matches HEAD)" else git commit -m "ext: publish signed XPI fabledcurator-${VERSION}.xpi" - git push origin HEAD:main + git push -v origin HEAD:main fi