Skip to content

feat(track): clarify master-guard failure output (IN-3714) - #394

Merged
theProf merged 4 commits into
masterfrom
gogrady/promote-prod-output-clarity/IN-3714
Jul 22, 2026
Merged

feat(track): clarify master-guard failure output (IN-3714)#394
theProf merged 4 commits into
masterfrom
gogrady/promote-prod-output-clarity/IN-3714

Conversation

@theProf

@theProf theProf commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What
Rewrites the promote_production command's two scripts and adds a store_artifacts step so the step's output is readable and its master-guard failure is self-explanatory. Full set -x trace + raw CircleCI API JSON now go to a promote-production-logs artifact (via BASH_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 direct app.circleci.com link. Adds an ERR-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.sh correctly blocks promotion when the master workflow for the same commit isn't green. But set -x produced ~640 lines of raw JSON and the only message was master 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 for a commit whose master workflow is failing → step fails with the PRODUCTION PROMOTION BLOCKED banner + clickable master URL; the promote-production-logs artifact holds the full trace.
  • Locally: 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 1 is what blocks the bad deploy); consuming-repo workflow/branch filters; other scripts.

@linear-code

linear-code Bot commented Jul 21, 2026

Copy link
Copy Markdown

IN-3714

theProf commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vf-service-account

Copy link
Copy Markdown
Contributor

Your development orb has been published. It will expire in 30 days.
You can preview what this will look like on the CircleCI Orb Registry at the following link:
https://circleci.com/developer/orbs/orb/voiceflow/common?version=dev:e6092126b86845de179f80f76ad68e89fd967f86

@theProf
theProf marked this pull request as ready for review July 21, 2026 23:39
Copilot AI review requested due to automatic review settings July 21, 2026 23:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-logs and publishes it via a store_artifacts step.
  • Enhances check_wait_master.sh messaging with an explicit “promotion blocked” banner, master workflow status, and a direct CircleCI URL.
  • Adds an ERR trap in promote_production.sh to 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.

Comment on lines +18 to +20
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'

theProf commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Jul 22, 1:19 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 22, 1:19 PM UTC: @theProf merged this pull request with Graphite.

@theProf
theProf merged commit 32ae8af into master Jul 22, 2026
6 checks passed
@theProf
theProf deleted the gogrady/promote-prod-output-clarity/IN-3714 branch July 22, 2026 13:19
@vf-service-account

Copy link
Copy Markdown
Contributor

Your orb has been published to the CircleCI Orb Registry.
You can view your published orb on the CircleCI Orb Registry at the following link:
https://circleci.com/developer/orbs/orb/voiceflow/common?version=0.115.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants