fix(cloud-wrappers): parse bracketed/ANSI execution ids from gcloud execute output - #661
Merged
Conversation
…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.
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.
What
gcloud run jobs executeprintsExecution [NAME] has successfully completed.with literal brackets and ANSI SGR codes around the name. Both cloud wrappers parsed it withgrep -oP 'Execution \K[^ ]+', capturing the bracket (and escapes) — every downstreamexecutions describe/logs readthen 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 0masked the failure → wrapper reported success withsucceeded=0unconditionally, 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
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.cloud-vitest-wrapper.test.sh+cloud-vitest-entrypoint.test.shremain green.