fix: harden E2E pipeline — phase detection, log-based health checks, image_tag bypass - #3
Merged
Merged
Conversation
jq 1.7+ exits with code 5 when a top-level expression produces no output (e.g. when // empty is triggered). Under set -euo pipefail this kills the script silently. Replace with // "" so jq always produces output and exits 0, then check for empty string as before.
jq fails when doctl stderr output (2>&1) prefixes the JSON with a warning. Use the grep pattern that worked in earlier runs as the fallback. Also log the first line of doctl output so we can see any non-JSON prefix that was tripping up jq.
doctl apps get returns [{app}] (array), not a plain object. Calling
.pending_deployment.phase directly on an array causes a jq type error
which exits with code 5 under set -euo pipefail, killing the loop
before the first Phase: line is printed. Normalise to object with
(if type == "array" then .[0] else . end) and add || true guards.
doctl outputs 'Notice: App created' to stdout before the JSON. Strip all Notice: lines so jq parses the JSON directly and the grep fallback is no longer needed.
Remove spec dump, doctl exit code log, first-line/last-20-lines output dumps, and all DEBUG: log messages added during testing. Keep only production-relevant log output and error handling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hardens the automated OpenClaw upgrade E2E pipeline. All 7 health checks passed on Run digitalocean-labs#12.
Root causes fixed
unknown flag: --commanddoctl apps consolehas no--commandflag — interactive onlydoctl apps logs --type=runactive_deployment.phase; new apps track in-progress work inpending_deployment// emptyproduces no output;set -euo pipefailkills the script// emptywith// ""+ add `doctl apps create 2>&1prependsNotice: App createdto stdout before the JSON, breaking jqNotice:lines before piping to jq; silent grep fallbackdoctl apps getreturns[{app}](array);.pending_deployment.phaseon an array causes jq type error → exit 5(if type == "array" then .[0] else . end)+ `Changes
tests/e2e/deploy-and-test.shpending_deployment.phaseandactive_deployment.phase, handles array response fromdoctl apps getdoctl apps logs --type=runlog pattern matching instead ofdoctl apps console --commandNotice:prefix, jq with// "", silent grep fallback|| true.github/workflows/openclaw-upgrade-check.ymlimage_tagworkflow_dispatch input — provide an existing GHCR tag to skip Docker build/push and go straight to E2Edocker-testsandpush-e2e-imageskip whenimage_tagis providedopen-prandopen-issueskip in bypass modeTest results (Run digitalocean-labs#12)