fix(ext-ci): add diagnostic tracing to commit step to surface why run #309 reported success without producing the XPI side-commit — Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

This commit is contained in:
2026-05-25 20:05:15 -04:00
parent c451061ca5
commit ba8d9b112d
+29 -11
View File
@@ -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