Skip to content

[VPEX][13] Document the error-code contract as source of truth#5964

Open
rugpanov wants to merge 1 commit into
dbconnect/13-usage-errorfrom
dbconnect/14-errcode-reconcile
Open

[VPEX][13] Document the error-code contract as source of truth#5964
rugpanov wants to merge 1 commit into
dbconnect/13-usage-errorfrom
dbconnect/14-errcode-reconcile

Conversation

@rugpanov

Copy link
Copy Markdown
Contributor

Stacked on #5963 (E_USAGE) → #5962#5961#5960#5959.

What

Reconciles the error codes with the [P0] CLI Changes spec table (spec item #10). No behavior change — the code already emits the correct set. The spec's table was stale:

  • omitted E_NOT_WRITABLE (preflight) and E_PYTHON_INSTALL (provision), and
  • wrongly listed E_UV_MISSING as "reserved / not emitted" when the CLI does emit it at preflight.

Changes

  • Annotate each ErrorCode constant with the phase that emits it, and document the two spec codes the CLI deliberately never emits: E_PYTHON_POLICY (no signal source yet) and E_AUTH (handled earlier by MustWorkspaceClient). This makes the constant block the authoritative reference the spec mirrors.
  • Fix a TargetInfo doc comment that still said "four precedence sources" — with --cluster-name there are now five flag sources (the JSON source value is still one of cluster/serverless/job/bundle).

Note

The spec doc's error-code table itself (in the VPEX ERD, a Google Doc) has been updated separately to match — that's outside this repo.

Testing

go build ./..., lint (0 issues), deadcode clean, unit + acceptance green (comment-only code change).

This pull request and its description were written by Isaac.

@rugpanov rugpanov changed the title [VPEX] Document the error-code contract as source of truth [VPEX][13] Document the error-code contract as source of truth Jul 17, 2026
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 6ff8a75

Run: 29585189743

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 4 4 227 1123 4:46
💚​ aws windows 4 4 229 1121 9:14
💚​ aws-ucws linux 4 4 316 1039 6:16
💚​ aws-ucws windows 4 4 318 1037 9:58
💚​ azure linux 4 4 227 1122 4:54
💚​ azure windows 4 4 229 1120 6:41
💚​ azure-ucws linux 4 4 318 1036 7:00
💚​ azure-ucws windows 4 4 320 1034 8:07
💚​ gcp linux 4 4 226 1124 5:00
💚​ gcp windows 4 4 228 1122 8:49
8 interesting tests: 4 RECOVERED, 4 SKIP
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 10 slowest tests (at least 2 minutes):
duration env testname
8:45 aws windows TestAccept
8:29 aws-ucws windows TestAccept
8:24 gcp windows TestAccept
6:30 azure-ucws windows TestAccept
6:17 azure windows TestAccept
2:58 gcp linux TestAccept
2:57 aws linux TestAccept
2:56 azure-ucws linux TestAccept
2:56 azure linux TestAccept
2:50 aws-ucws linux TestAccept

@rugpanov
rugpanov force-pushed the dbconnect/13-usage-error branch from f20628a to 6b4a2a4 Compare July 17, 2026 13:27
@rugpanov
rugpanov force-pushed the dbconnect/14-errcode-reconcile branch from 47c9f11 to 3f6b218 Compare July 17, 2026 13:27
Reconcile the error codes with the spec table (spec item #10). The code
already emits the correct set; the spec's table was stale (it omitted
E_NOT_WRITABLE and E_PYTHON_INSTALL and wrongly listed E_UV_MISSING as
reserved). Rather than change behavior, annotate each ErrorCode constant
with the phase that emits it and document the two codes the CLI
deliberately never emits (E_PYTHON_POLICY, E_AUTH), making this block the
authoritative reference the spec mirrors.

Also fix a TargetInfo doc comment that still said 'four precedence
sources' — with --cluster-name there are now five flag sources, though
the JSON 'source' value is still one of cluster/serverless/job/bundle.

Co-authored-by: Isaac

@anton-107 anton-107 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed as part of the full stack (#5960#5965). The annotated error-code block reads well and makes the constant set a genuine source of truth; documenting why E_PYTHON_POLICY/E_AUTH are deliberately never emitted is a nice touch. Approving.

Since this is the comment-accuracy PR, two adjacent comment fixes it could sweep in while it's here:

  • [low] Stale v4 fallback comments. After #5962 bumped the default to v5, cmd/environments/compute.go:78 and :116 still describe the serverless empty-version fallback as v4. This PR touched only result.go, so these were missed.

  • [nit] ResolveTarget precedence comment still lists four sources. This PR updated the TargetInfo doc to acknowledge --cluster-name ("now five flag sources"), but the sibling precedence comment at libs/localenv/target.go:64 still reads --cluster-id → --serverless-version → --job-id → bundle, omitting --cluster-name. Same class of inaccuracy this PR set out to fix.

Reviewed with AI assistance (build + unit tests + adversarial verification against the checked-out top of stack).

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.

3 participants