Skip to content

Commit 8f8b671

Browse files
fix(deploy): make cockpit rebuild detection explicit
Summary: - Capture dashboard file changes with git diff --name-only before deciding whether to rebuild cockpit. - Force a cockpit rebuild when the diff cannot be computed instead of silently skipping it. - Log changed dashboard paths during deploy for auditability. Rationale: - The previous deploy skipped cockpit rebuild after a dashboard-only PR, leaving the standalone bundle stale until a manual rebuild. - Explicit change detection gives deploy logs enough evidence to verify the rebuild decision. Validation: - bash -n scripts/deploy.sh - git diff --check - git diff --name-only 7b28072..db14ddc -- dashboard/ lists the expected dashboard files - Cross-model review: no issues after fallback fix Co-authored-by: Codex <codex@openai.com>
1 parent db14ddc commit 8f8b671

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

scripts/deploy.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ asapp git fetch --quiet origin "$DEPLOY_BRANCH"
6464
asapp git reset --hard "origin/$DEPLOY_BRANCH"
6565
new_sha=$(asapp git rev-parse HEAD)
6666
log "old_sha=$old_sha new_sha=$new_sha"
67+
dashboard_changes="fresh checkout"
68+
if [[ "$old_sha" != "none" ]]; then
69+
if ! dashboard_changes=$(asapp git diff --name-only "$old_sha" "$new_sha" -- dashboard/); then
70+
log "cockpit: could not diff $old_sha..$new_sha — forcing rebuild"
71+
dashboard_changes="fresh checkout"
72+
fi
73+
fi
6774

6875
# 4. Rebuild the escript BEFORE stopping anything. The running orchestrator does
6976
# not read _build/prod or bin/symphony at runtime, so a rebuild (or a failure
@@ -96,10 +103,11 @@ log "orchestrator deployed — service active, health 200"
96103
# decision loudly either way so a green deploy never silently ships a stale
97104
# cockpit. Next.js standalone keeps serving the old build until the restart,
98105
# so the only blip is the restart itself.
99-
if [[ "$old_sha" != "none" ]] && asapp git diff --quiet "$old_sha" "$new_sha" -- dashboard/; then
106+
if [[ -z "$dashboard_changes" ]]; then
100107
log "cockpit: dashboard/ unchanged ($old_sha..$new_sha) — skip rebuild"
101108
else
102109
log "cockpit: dashboard/ changed (or fresh checkout) — rebuilding"
110+
printf '%s\n' "$dashboard_changes" | sed 's/^/[deploy] cockpit changed: /'
103111
asapp env HOME="$APP_HOME" PATH="$NODE_BIN_PATH" bash -euo pipefail -c "
104112
cd '$COCKPIT_DIR'
105113
pnpm install --frozen-lockfile

0 commit comments

Comments
 (0)