feat(track): clarify master-guard failure output (IN-3714) - #394
Conversation
|
Your development orb has been published. It will expire in 30 days. |
There was a problem hiding this comment.
Pull request overview
This PR improves the readability and debuggability of the promote_production flow by redirecting verbose set -x traces into a stored artifact and by printing clearer, actionable failure output when the “master guard” blocks promotion.
Changes:
- Redirects bash xtrace output to
/tmp/promote-production-logsand publishes it via astore_artifactsstep. - Enhances
check_wait_master.shmessaging with an explicit “promotion blocked” banner, master workflow status, and a direct CircleCI URL. - Adds an
ERRtrap inpromote_production.shto print a clear failure banner with the failing phase and artifact path.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/scripts/utils/check_wait_master.sh |
Adds artifact-backed xtrace logging and clearer master-guard failure diagnostics (banner, URL, “no master pipeline found” case). |
src/scripts/track/promote_production.sh |
Adds artifact-backed xtrace logging plus an ERR trap to produce clearer failures with phase context. |
src/commands/track/promote_production.yaml |
Stores /tmp/promote-production-logs as a CircleCI artifact (always). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| exec {trace_fd}>"${LOG_DIR}/check-wait-master.trace.log" | ||
| export BASH_XTRACEFD="$trace_fd" | ||
| set -x |
| @@ -55,33 +60,108 @@ get_workflow() { | |||
| | jq -r '.items | map(select(.name != "setup")) | first' | |||
|
Your orb has been published to the CircleCI Orb Registry. |

What
Rewrites the
promote_productioncommand's two scripts and adds astore_artifactsstep so the step's output is readable and its master-guard failure is self-explanatory. Fullset -xtrace + raw CircleCI API JSON now go to apromote-production-logsartifact (viaBASH_XTRACEFD) instead of flooding the console. On a non-green master, the guard prints a clear banner — this block is expected, don't re-run it, look at master — with the master workflow's status and a directapp.circleci.comlink. Adds anERR-trap failure message to the tag-images script and a distinct message for the "no master pipeline found" case.Why
On the production branch,
check_wait_master.shcorrectly blocks promotion when the master workflow for the same commit isn't green. Butset -xproduced ~640 lines of raw JSON and the only message wasmaster workflow not successful. exiting..., so developers read a correct guard as a bug in the production job and re-ran it — instead of fixing the master workflow where the real failure is.How to test
PRODUCTION PROMOTION BLOCKEDbanner + clickable master URL; thepromote-production-logsartifact holds the full trace.shellcheck src/scripts/utils/check_wait_master.sh src/scripts/track/promote_production.sh(clean),./validate.sh(orb valid), and the stub harnesses in the plan reproduce the banner/URL/exit codes.Out of scope
The guard's exit-code/control flow (unchanged — the
exit 1is what blocks the bad deploy); consuming-repo workflow/branch filters; other scripts.