Repository navigation
cli: read the camelCase -o json spin#1605 writes, and its failure kinds - #64
Merged
Merged
Conversation
spin-stack/spin#1828 makes -o json one contract: every key camelCase, the error envelope's included, the ssh status file at version 2, and a failure's exit status naming its kind (spin help exit-codes) where it was 1. It adds nine codes to the envelope, which failureKinds in cmd/cli/cmd/exitcodes.go pairs with their actions now that errorActions is gone. The contract types, their callers, the fake spin and the tests read the new keys and statuses. unavailable and timed_out offer Retry; the other new codes show the CLI's message with Show Details and Copy Diagnostics. hack/errcodes reads failureKinds from spin's whole cmd/cli/cmd package, which task contract:spin now checks out sparsely, rather than one file. Closes #60 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf
marked this pull request as ready for review
December 1, 2026 19:24
#65 gave every showEnvelope case an again; the nine codes this branch adds arrived without one, and refused, the code the unknown-code case used, is now the contract's. unavailable and timed_out retry, so they answer true; the rest go through internal and answer false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Bump spin workflow checks main's contract before it proposes, and main's contract is the old one, so no bump past spin#1828 could pass (run 46724498387: no errorActions). The pin moves with the contract that reads it, and package.json to the next patch so the merge releases it, as spin:propose would. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
spin-stack/spin#1828 (closing spin#1605) makes
-o jsonone contract on every command. The extension reads the CLI's old output, so the first spin release that carries #1828 breaks it onceversions.yamlmoves to it (#60). Against aspinbuilt from spin main (252c2020c),test/cli/real-spin.test.tsfails 4 of 4 onmainand passes 4 of 4 on this branch.What spin changed that the extension reads
signedIn,verificationUrl/userCode/expiresIn,workspaceId/folderUri/notGiven,preparing.vscodeVersion/vscodeCommit,confirmingKey, and the envelope'sworkspaceId. Checked against spin main's struct tags andcode.go, not only the issue.sshPid,startedAt,updatedAt). A version 1 file left by an older spin is skipped.spin help exit-codes: 64, 65, 66, 69, 75, 77), not 1. The extension never branched on the status, so onlyCliError.exitCodeand the tests change.usage,invalid,not_found,already_exists,permission_denied,not_confirmed,refused,unavailable,timed_out, plus the actionshelpandconfirm. Without a case,showCliErrorwould have shown nothing for them.unavailableandtimed_outoffer Retry. The others show the CLI's message with Show Details and Copy Diagnostics, asno_vscode_serverdoes.errorActionsis gone: spin pairs codes infailureKinds(exitcodes.go).hack/errcodesnow reads spin's wholecmd/cli/cmdpackage, test files excluded, andtask contract:spinchecks it out sparsely.The pin moves here
spin v20261201.01 is the first release that carries #1828. The Bump spin workflow checks main's contract before it proposes, so its run for that release failed (
no errorActions, run 46724498387), and no bump could pass until this lands. This PR movesversions.yamlto v20261201.01 andpackage.jsonto 0.0.14, asspin:proposewould, so the merge releases the extension with that CLI.Rebased on #65, which gave every
showEnvelopecase anagain. The nine new codes answer it too:unavailableandtimed_outretry (true), the rest go throughinternal(false). The unknown-code case now usesquota_exceeded, sincerefusedis a real code.Local after the rebase:
task contract:spinagainst v20261201.01 saysthe contract's codes are spin's.task cipasses (348 tests).Checks
Run in a
node:22container (pnpm 11.27.1 via corepack, install throughsfw):pnpm typecheck,pnpm lint,pnpm build: clean.pnpm test: 284 passed (248 onmain, plus the new codes' cases).pnpm test:cliwithbuild/spin/linux-x64/spinbuilt from spin main: 4/4. Onmain: 0/4.go test ./hack/...: passes.hack/errcodesagainst spin main:the contract's codes are spin's. Againstmain's contract it lists the nine missing codes.task gate: OK.test:integration(real VS Code under xvfb) and thespin-remote/remote-sshlanes.spin-stack/open-remote-ssh#30 is the same change for Spinbox Remote (
ssh-session'shostKey/workspaceId,code'snotGiven/workspaceId).🤖 Generated with Claude Code