Skip to content

https://arxiv.org/abs/2606.28344. The end of web parsing. The beginning of scalable pixel-native search. link: https://pixelrag.ai/

fix(deploy): measure the change set from the box's HEAD, not github.event.before (#149)

Zhifei Li35bdf1cf896f
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 8d6c1ef..97996e6 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -18,8 +18,6 @@ jobs:
runs-on: [self-hosted, deploy]
steps:
- name: Fast-forward working tree + restart what changed
- env:
- BEFORE: ${{ github.event.before }}
run: |
set -euo pipefail
cd /home/yichuan/visrag
@@ -33,9 +31,19 @@ jobs:
fi
if ! git diff --quiet || ! git diff --cached --quiet; then
echo "::warning::deploy box has uncommitted changes — skipping to avoid clobbering"
+ echo "### Deploy skipped: the box has uncommitted changes" >> "$GITHUB_STEP_SUMMARY"
+ git status --short >> "$GITHUB_STEP_SUMMARY"
exit 0
fi
+ # Measure the change set from where this box actually is, not from
+ # github.event.before. A manual dispatch carries no `before`, and
+ # deploy.sh then falls back to the tip commit alone — so everything
+ # the box was behind by is invisible and the services that changed
+ # are never restarted, while the run still reports success. The
+ # tree's own HEAD is right for both triggers and for a box that has
+ # fallen several commits behind.
+ before=$(git rev-parse HEAD)
git fetch origin main
git merge --ff-only origin/main
- bash deploy/deploy.sh "${BEFORE:-}"
+ bash deploy/deploy.sh "$before"
diff --git a/deploy/deploy.sh b/deploy/deploy.sh
index 9e89470..0894429 100755
--- a/deploy/deploy.sh
+++ b/deploy/deploy.sh
@@ -25,7 +25,10 @@ say "deploy: ${BEFORE:-<none>} -> ${AFTER}"
if [ -n "$BEFORE" ] && git cat-file -e "${BEFORE}^{commit}" 2>/dev/null; then
CHANGED=$(git diff --name-only "$BEFORE" "$AFTER")
else
- # First run / unknown base: treat the tip commit's files as the change set.
+ # Defensive fallback only — the workflow passes the box's pre-merge HEAD, so
+ # this should not be reached. It sees just the tip commit, which understates
+ # the change set whenever the box was more than one commit behind.
+ say "WARN: no usable base commit — falling back to the tip commit's files only"
CHANGED=$(git show --name-only --pretty="" "$AFTER")
fi
say "changed: $(echo "$CHANGED" | tr '\n' ' ')"