Skip to content

fix(advance-deploy-env): skip Status update if 'Done' can't be resolved - #13

Merged
saadqbal merged 5 commits into
developfrom
fix/advance-deploy-status-skip-on-missing-option
Apr 29, 2026
Merged

fix(advance-deploy-env): skip Status update if 'Done' can't be resolved#13
saadqbal merged 5 commits into
developfrom
fix/advance-deploy-status-skip-on-missing-option

Conversation

@LukasWodka

@LukasWodkaLukasWodka commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Hardens advance-deploy-env.yml against missing Status field options.

The reusable workflow already validates DEPLOY_OPT before using it, but not STATUS_FIELD or DONE_OPT. When the lookup for "Done" returns nothing (option renamed, removed, or the field's name drifted), the GraphQL mutation receives an empty $o and the workflow crashes with:

gh: Variable $o of type String! was provided invalid value

This masks the fact that the primary Deploy environment update succeeded for every PR in the push. The team sees a red workflow and reasonably assumes the deploy didn't tag the kanban — when it actually did.

What changes

  1. After the field lookups, validate STATUS_FIELD and DONE_OPT (only when env=prod, since that's when Status gets touched). On miss, log a workflow ::warning:: and set SKIP_STATUS=1.
  2. Gate the per-PR Status mutation on ${SKIP_STATUS:-0} != "1".
if [ "$DEPLOY_ENV"="prod" ];thenif [ -z"$STATUS_FIELD" ] || [ "$STATUS_FIELD"="null" ] \
|| [ -z"$DONE_OPT" ] || [ "$DONE_OPT"="null" ];thenecho"::warning::Could not resolve 'Done' option in Status field of project #$PROJECT_NUMBER — skipping Status updates"
SKIP_STATUS=1
fifi

Behavior changes

  • Old: missing "Done" → workflow fails, all subsequent PRs in the push are skipped, Deploy env update visible only by reading mid-run logs.
  • New: missing "Done" → workflow warns, every PR's Deploy env update completes, Status update is skipped per-PR.
  • Non-prod pushes (develop, staging): unchanged — Status was never touched on those.
  • Error message: when something IS misconfigured, the warning identifies the project number and field name instead of a cryptic GraphQL error.

Symmetry note

This matches the existing DEPLOY_OPT validation pattern — same shape, except graceful skip instead of abort because Status is a nice-to-have and Deploy env is the primary purpose of the workflow.

Triggered by

tracebloc/client run #24995200600 on PR #64 hit this exact failure: Deploy env = prod succeeded, then the Status mutation failed with the empty-$o error.

Test plan

  • After merge, re-run the failed tracebloc/client workflow (or wait for the next push to main) — confirm it completes green even if "Done" lookup returns empty.
  • Manually break the lookup (rename "Done" to "DONE_TEMP" in project chore: add auto-add to engineer kanban workflow #2 briefly) and confirm the workflow still completes its Deploy environment updates and only skips Status with the expected warning.

Generated with Claude Code

LukasWodkaand others added 5 commits April 25, 2026 18:17
chore: promote develop → main (advance-deploy-env workflow)
chore: promote issue templates + customer-bump to main
chore: promote set-pr-status reusable workflow to main
chore: promote advance-deploy-env fix to main
The reusable workflow already validates DEPLOY_OPT before using it but
not STATUS_FIELD or DONE_OPT. When the Status field lookup returns
empty (e.g. a project where the "Done" option doesn't exist or has
been renamed), the second mutation receives an empty $o and crashes
with "Variable $o of type String! was provided invalid value" — which
masks the fact that the primary Deploy environment update succeeded.
Two changes:
- After the field lookups, validate STATUS_FIELD and DONE_OPT only
when env=prod (since that's when Status is touched). On miss, log
a workflow ::warning:: and set SKIP_STATUS=1.
- Gate the per-PR Status mutation on SKIP_STATUS != 1.
Behavior changes:
- Failure cases that used to abort the workflow now warn and skip
Status while still completing the Deploy environment updates for
every PR in the push.
- Non-prod pushes are unchanged (no Status mutation at all).
- The error from a missing "Done" option is now actionable
("could not resolve 'Done' option in Status field of project
#<num>") instead of a cryptic GraphQL error.
Triggered by: tracebloc/client run #24995200600 (PR #64), where this
exact failure mode blocked the workflow even though Deploy env = prod
was applied successfully.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@saadqbal
saadqbal merged commit af089ce into developApr 29, 2026
1 check passed
@LukasWodkaLukasWodka added bug Something isn't working work-type:bug Defect or regression labels Jun 8, 2026
@LukasWodka
LukasWodka deleted the fix/advance-deploy-status-skip-on-missing-option branch August 1, 2026 21:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugSomething isn't workingwork-type:bugDefect or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@LukasWodka@saadqbal