Skip to content

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

Merged
rugpanov merged 1 commit into
mainfrom
dbconnect/14-errcode-reconcile
Jul 20, 2026
Merged

[VPEX][13] Document the error-code contract as source of truth#5964
rugpanov merged 1 commit into
mainfrom
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.

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

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

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 57eb340

Run: 29760442230

Env💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
💚​aws linux4422711277:05
💚​aws windows4422911254:02
💚​aws-ucws linux4431410444:27
💚​aws-ucws windows4431610424:48
💚​azure linux4422711263:07
💚​azure windows4422911243:58
💚​azure-ucws linux4431610415:20
💚​azure-ucws windows4431810394:50
💚​gcp linux4422611283:06
💚​gcp windows4422811263:51
8 interesting tests: 4 RECOVERED, 4 SKIP
Test Nameaws linuxaws windowsaws-ucws linuxaws-ucws windowsazure linuxazure windowsazure-ucws linuxazure-ucws windowsgcp linuxgcp 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 6 slowest tests (at least 2 minutes):
durationenvtestname
6:04aws linuxTestSecretsPutSecretStringValue
3:03aws windowsTestAccept
3:00azure windowsTestAccept
2:59azure-ucws windowsTestAccept
2:16aws-ucws windowsTestAccept/bundle/deploy/mlops-stacks/DATABRICKS_BUNDLE_ENGINE=terraform
2:01gcp windowsTestAccept

@rugpanov
rugpanovforce-pushed the dbconnect/13-usage-error branch from f20628a to 6b4a2a4CompareJuly 17, 2026 13:27
@rugpanov
rugpanovforce-pushed the dbconnect/14-errcode-reconcile branch 2 times, most recently from 3f6b218 to 6ff8a75CompareJuly 17, 2026 13:44

@anton-107anton-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).

@rugpanov
rugpanovforce-pushed the dbconnect/14-errcode-reconcile branch from 6ff8a75 to a97a774CompareJuly 20, 2026 08:43
@rugpanov
rugpanovforce-pushed the dbconnect/13-usage-error branch 2 times, most recently from c0e7dea to d5c4d6fCompareJuly 20, 2026 15:51
Base automatically changed from dbconnect/13-usage-error to mainJuly 20, 2026 16:34
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
@rugpanov
rugpanovforce-pushed the dbconnect/14-errcode-reconcile branch from a97a774 to 57eb340CompareJuly 20, 2026 16:37
@rugpanov
rugpanov added this pull request to the merge queueJul 20, 2026
Merged via the queue into main with commit 1e02255Jul 20, 2026
23 checks passed
@rugpanov
rugpanov deleted the dbconnect/14-errcode-reconcile branch July 20, 2026 21:31
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 1e02255

Run: 29780527591

Env❌​FAIL🟨​KNOWN🔄​flaky💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
❌​aws linux6134520105636:07
🔄​aws windows444479106947:59
💚​aws-ucws linux6298786772:17
💚​aws-ucws windows6292988592:56
💚​azure linux44520105735:56
💚​azure windows44477107045:28
💚​azure-ucws linux6288490176:26
💚​azure-ucws windows6282691984:34
💚​gcp linux44511106240:35
💚​gcp windows44468107548:14
14 interesting tests: 6 FAIL, 5 RECOVERED, 2 SKIP, 1 KNOWN
Test Nameaws linuxaws windowsaws-ucws linuxaws-ucws windowsazure linuxazure windowsazure-ucws linuxazure-ucws windowsgcp linuxgcp windows
🟨​TestAccept🟨​K💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
💚​TestAccept/bundle/invariant/no_drift🙈​S🙈​S💚​R💚​R🙈​S🙈​S💚​R💚​R🙈​S🙈​S
❌​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions❌​F✅​p✅​p✅​p🙈​s🙈​s🙈​s🙈​s🙈​s🙈​s
❌​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct❌​F🔄​f✅​p✅​p
❌​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform❌​F🔄​f✅​p✅​p
❌​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions❌​F✅​p✅​p✅​p🙈​s🙈​s🙈​s🙈​s🙈​s🙈​s
❌​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct❌​F🔄​f✅​p✅​p
❌​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform❌​F🔄​f✅​p✅​p
💚​TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name🙈​S🙈​S💚​R💚​R🙈​S🙈​S💚​R💚​R🙈​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 50 slowest tests (at least 2 minutes):
durationenvtestname
16:40azure-ucws linuxTestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=terraform
12:01gcp linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
10:58gcp windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
9:47gcp linuxTestSecretsPutSecretStringValue
9:29azure-ucws windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
9:17azure windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:28aws-ucws linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:11azure windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:09aws linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
8:08azure-ucws linuxTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
7:53azure-ucws linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:44gcp windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:41aws-ucws windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:38gcp linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:37aws windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:27aws windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:26gcp linuxTestAccept/bundle/resources/clusters/deploy/local_ssd_count/DATABRICKS_BUNDLE_ENGINE=direct
7:26gcp windowsTestAccept/bundle/resources/clusters/deploy/local_ssd_count/DATABRICKS_BUNDLE_ENGINE=direct
7:25azure linuxTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:23azure-ucws windowsTestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:22azure-ucws linuxTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=direct
7:14aws-ucws linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
7:12aws-ucws linuxTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
7:10aws-ucws windowsTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:36aws linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:27azure windowsTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
6:23azure linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
6:14azure linuxTestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:47aws-ucws linuxTestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=direct
5:38azure-ucws linuxTestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct
5:37gcp linuxTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
5:32azure-ucws windowsTestAccept/bundle/resources/clusters/resize-terminated-fallback/DATABRICKS_BUNDLE_ENGINE=direct
5:24gcp windowsTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=direct
5:23gcp windowsTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
5:11gcp windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
5:02gcp linuxTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=direct
4:50gcp windowsTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
4:47gcp linuxTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
4:46gcp linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:42aws-ucws linuxTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=terraform
4:40aws-ucws linuxTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=direct
4:38gcp windowsTestAccept/bundle/resources/apps/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
4:29gcp linuxTestAccept/bundle/resources/apps/lifecycle-started-omitted/DATABRICKS_BUNDLE_ENGINE=direct
4:25azure-ucws linuxTestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=direct
4:18gcp windowsTestAccept/bundle/resources/apps/lifecycle-started-omitted/DATABRICKS_BUNDLE_ENGINE=direct
4:15gcp linuxTestAccept/bundle/resources/apps/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
4:12azure-ucws windowsTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
4:09aws-ucws windowsTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct
4:06azure-ucws windowsTestAccept/bundle/deploy/spark-jar-task/DATABRICKS_BUNDLE_ENGINE=direct
4:05aws windowsTestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct

yansonggao-db pushed a commit to yansonggao-db/cli that referenced this pull request Jul 21, 2026
…icks#5965)
Stacked on databricks#5964databricks#5963databricks#5962databricks#5961databricks#5960databricks#5959.
## What
`--serverless-version` is now documented to take a **bare number** (e.g.
`5`) rather than `v5`.
- Input `5` is the documented form; `v5`/`V5` are still accepted
(tolerant).
- Both map to the same env key `serverless/serverless-vN`, so the
**environments-repo layout is unchanged** (still
`serverless/serverless-v5/…`).
## Changes
- Flag help: `e.g. v4` → `e.g. 5`; the `E_ENV_UNSUPPORTED` hint suggests
`--serverless-version 5`.
- `defaultServerlessVersion` stored in bare form (`"5"`); still resolves
to `serverless-v5` via `NormalizeServerless`.
- Acceptance scripts pass the bare form; env-key goldens unchanged
(`serverless-vN`).
- Unit tests cover bare + v-prefixed input and the default constant.
## Testing
`go build ./...`, lint (0 issues), deadcode clean, unit + acceptance
green.
This pull request and its description were written by Isaac.
Sign up for freeto 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

@rugpanov@eng-dev-ecosystem-bot@anton-107