Skip to content

fix(cloud-wrappers): parse bracketed/ANSI execution ids from gcloud execute output - #661

Merged
danshapiro merged 1 commit into
mainfrom
fix/cloud-exec-id-parse
Aug 18, 2026
Merged

fix(cloud-wrappers): parse bracketed/ANSI execution ids from gcloud execute output#661
danshapiro merged 1 commit into
mainfrom
fix/cloud-exec-id-parse

Conversation

@danshapiro

Copy link
Copy Markdown
Owner

What

gcloud run jobs execute prints Execution [NAME] has successfully completed. with literal brackets and ANSI SGR codes around the name. Both cloud wrappers parsed it with grep -oP 'Execution \K[^ ]+', capturing the bracket (and escapes) — every downstream executions describe/logs read then addressed a nonexistent execution.

Impact (observed live 2026-08-18)

  • vitest-cloud.sh: status queries always failed → a fully green 4-shard run exited 1 (executions freshell-vitest-xzrwg, -ftrdv). The 5x retry added in fix(vitest-cloud): retry transient post-execute status/log queries #660 could not help a deterministic wrong address.
  • e2e-cloud.sh: || echo 0 masked the failure → wrapper reported success with succeeded=0 unconditionally, which would have hidden real task failures.

Fix

Strip ANSI escapes and accept the bracketed form: Execution \[?\K[A-Za-z0-9][A-Za-z0-9-]*.

Test plan

  • New scripts/test/cloud-exec-id-parse.test.sh: fake gcloud emitting the real bracketed+ANSI format; asserts both wrappers exit 0, report truthfully, and target the clean id in downstream queries. Verified RED before the fix, GREEN after.
  • Existing cloud-vitest-wrapper.test.sh + cloud-vitest-entrypoint.test.sh remain green.

…xecute output

gcloud prints 'Execution [NAME] has successfully completed.' with literal
brackets and ANSI SGR codes around the name; the wrappers parsed with
grep -oP 'Execution \K[^ ]+', capturing the bracket (and escapes). Every
downstream describe/logs call then addressed a nonexistent execution:
- vitest-cloud.sh: status queries all failed, so a fully green 4-shard run
  exited 1 (observed live 2026-08-18, executions freshell-vitest-xzrwg and
  -ftrdv; the 5x retry from #660 could not help a deterministic miss).
- e2e-cloud.sh: '|| echo 0' masked it into succeeded=0 — the wrapper would
  report success even when the status query never reached the real execution.

Fix: strip ANSI escapes and accept the bracketed form
('Execution \[?\K[A-Za-z0-9][A-Za-z0-9-]*'). Regression-tested in
scripts/test/cloud-exec-id-parse.test.sh for both wrappers (exit code,
truthful succeeded count, clean id in downstream describe calls), verified
RED before the fix and green after; cloud-vitest-wrapper.test.sh and
cloud-vitest-entrypoint.test.sh remain green.
@danshapiro
danshapiro merged commit 3817595 into main Aug 18, 2026
3 of 4 checks passed
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.

1 participant