Skip to content

[VPEX][14] Accept bare serverless version numbers (5, not v5)#5965

Merged
rugpanov merged 2 commits into
mainfrom
dbconnect/15-serverless-bare-version
Jul 21, 2026
Merged

[VPEX][14] Accept bare serverless version numbers (5, not v5)#5965
rugpanov merged 2 commits into
mainfrom
dbconnect/15-serverless-bare-version

Conversation

@rugpanov

Copy link
Copy Markdown
Contributor

Stacked on #5964#5963#5962#5961#5960#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. v4e.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.

@rugpanov rugpanov changed the title [VPEX] Accept bare serverless version numbers (5, not v5) [VPEX][14] Accept bare serverless version numbers (5, not v5) Jul 17, 2026
@eng-dev-ecosystem-bot

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

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 840642f

Run: 29814400025

Env 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 4 4 227 1127 3:01
💚​ aws windows 4 4 229 1125 2:42
💚​ aws-ucws linux 4 4 314 1044 3:48
🔄​ aws-ucws windows 2 4 4 314 1042 3:51
💚​ azure linux 4 4 227 1126 2:56
💚​ azure windows 4 4 229 1124 3:22
💚​ azure-ucws linux 4 4 316 1041 4:11
💚​ azure-ucws windows 4 4 318 1039 3:30
💚​ gcp linux 4 4 226 1128 3:01
💚​ gcp windows 4 4 228 1126 2:32
10 interesting tests: 4 RECOVERED, 4 SKIP, 2 flaky
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
🔄​ TestFilerWorkspaceNotebook ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🔄​ TestFilerWorkspaceNotebook/rJupyterNb.ipynb ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
💚​ 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 1 slowest tests (at least 2 minutes):
duration env testname
2:38 azure windows TestAccept

@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). Requesting changes: this PR breaks CI — two existing unit tests fail at this commit, contradicting the "unit + acceptance green" claim in the description.

  • [blocker] TestResolveBundleServerless and TestResolveJobServerlessEmptyVersionFallsBackToDefault fail. Running go test ./libs/localenv/ at this commit:

    --- FAIL: TestResolveBundleServerless (target_test.go:100)
        expected: "serverless/serverless-5"   actual: "serverless/serverless-v5"
    --- FAIL: TestResolveJobServerlessEmptyVersionFallsBackToDefault (target_test.go:153)
        expected: "serverless/serverless-5"   actual: "serverless/serverless-v5"
    FAIL	github.com/databricks/cli/libs/localenv
    

    Root cause: this PR changes defaultServerlessVersion from "v5" to "5" (libs/localenv/envkey.go:23). Those two assertions (which this PR does not touch) build the expected key as "serverless/serverless-"+defaultServerlessVersion → now serverless/serverless-5, while ResolveTarget still runs the value through NormalizeServerless (which re-adds the v) → serverless/serverless-v5. Both tests pass at the parent commit (#5964), so this PR is what breaks them. Fix: assert the literal "serverless/serverless-v5", or wrap the constant in EnvKeyForServerless(...) on the expected side.

  • [low] Those tests are self-referential. As written they compare the code against the same constant the code uses, so they'd pass for any value of defaultServerlessVersion — they don't actually pin the default to v5. Worth asserting the concrete expected env key (serverless/serverless-v5) so the default is genuinely covered. (Related: there's no acceptance test that serves serverless-v5; see my note on #5962.)

  • [low] NormalizeServerless still does no validation. Now that the bare form is the documented input, malformed values pass straight through: --serverless-version vv5serverless/serverless-vv5, vserverless/serverless-v, " 5"serverless/serverless-v 5 (whitespace not trimmed). ResolveTarget's serverless branch (target.go:106) accepts any non-empty string, so these resolve "successfully" at the resolve phase and only fail two phases later at fetch with a generic E_ENV_UNSUPPORTED 404 that never tells the user their version string was malformed. Per the repo's "reject incompatible inputs early with an actionable error" rule, validating the format at resolve/preflight would be better.

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

@rugpanov
rugpanov force-pushed the dbconnect/14-errcode-reconcile branch from 6ff8a75 to a97a774 Compare July 20, 2026 08:43
rugpanov added a commit that referenced this pull request Jul 20, 2026
… test

Follow-up to #5965 review (anton-107):
- [low] NormalizeServerless did no validation, so malformed values (vv5,
  v, ' 5', 5x, latest) resolved to a bogus serverless-vN env key and only
  404'd two phases later at fetch with a generic E_ENV_UNSUPPORTED. Add
  ValidServerlessVersion (bare number, or v-prefixed) and reject at the
  resolve phase with an actionable E_RESOLVE, per the repo's reject-early
  rule.
- [low] The two default-serverless tests compared the code against the
  same constant it uses, so they'd pass for any value. Assert the concrete
  serverless/serverless-v5 key so the v5 default is genuinely pinned.

Co-authored-by: Isaac
@rugpanov
rugpanov force-pushed the dbconnect/15-serverless-bare-version branch from 67c2589 to e169ea6 Compare July 20, 2026 08:43
@rugpanov

Copy link
Copy Markdown
Contributor Author

Addressed — and thanks for catching the broken build; the root cause was worse than a stale assertion.

[blocker] two tests fail — investigating this surfaced that a cascade-rebase earlier in the session had silently dropped this PR's main commit ("Accept bare serverless version numbers"), leaving only the test-assertion follow-up on the branch — which referenced the bare 5 constant that was no longer there. Restored the dropped commit via cherry-pick; the branch now has both the bare-serverless change and the fix on top. go test ./libs/localenv/ is green.

[low] tests were self-referential — fixed: both now assert the concrete serverless/serverless-v5 literal, so the v5 default is genuinely pinned rather than compared against the constant the code uses.

[low] NormalizeServerless did no validation — fixed: added ValidServerlessVersion (bare number or v-prefixed) and reject malformed input (vv5, v, 5, 5x, latest) at the resolve phase with an actionable E_RESOLVE, instead of a bogus env key that 404s at fetch. Unit tests cover the predicate and the resolve-phase rejection.

Fixes on the branch (e169ea6a0).

@rugpanov
rugpanov force-pushed the dbconnect/14-errcode-reconcile branch from a97a774 to 57eb340 Compare July 20, 2026 16:37
Base automatically changed from dbconnect/14-errcode-reconcile to main July 20, 2026 21:31
rugpanov added 2 commits July 21, 2026 10:23
Per follow-up on the [P0] CLI Changes spec, --serverless-version is
documented to take a bare number (e.g. 5). NormalizeServerless already
accepts a bare number and remains tolerant of a v-prefix (v5/V5); both map
to the serverless-vN env key, so the environment-repo layout is unchanged.

- Flag help now shows 'e.g. 5'; the E_ENV_UNSUPPORTED hint suggests
  '--serverless-version 5'.
- defaultServerlessVersion is stored in the bare form ('5'); it still
  resolves to serverless-v5 via NormalizeServerless.
- Acceptance scripts pass the bare form; env-key goldens are unchanged
  (still serverless-vN). Unit tests cover bare and v-prefixed input plus
  the default constant.

Co-authored-by: Isaac
… test

Follow-up to #5965 review (anton-107):
- [low] NormalizeServerless did no validation, so malformed values (vv5,
  v, ' 5', 5x, latest) resolved to a bogus serverless-vN env key and only
  404'd two phases later at fetch with a generic E_ENV_UNSUPPORTED. Add
  ValidServerlessVersion (bare number, or v-prefixed) and reject at the
  resolve phase with an actionable E_RESOLVE, per the repo's reject-early
  rule.
- [low] The two default-serverless tests compared the code against the
  same constant it uses, so they'd pass for any value. Assert the concrete
  serverless/serverless-v5 key so the v5 default is genuinely pinned.

Co-authored-by: Isaac
@rugpanov
rugpanov force-pushed the dbconnect/15-serverless-bare-version branch from e169ea6 to 840642f Compare July 21, 2026 08:26
@rugpanov
rugpanov requested a review from anton-107 July 21, 2026 09:43
@rugpanov
rugpanov enabled auto-merge July 21, 2026 09:47
@rugpanov
rugpanov dismissed anton-107’s stale review July 21, 2026 09:55

Requested changes have been addressed (fixes on current head 840642f; CI 17/17 green). anton-107 is OOO and misha-db has approved the current head. Dismissing the stale review pinned to old commit 67c2589.

@rugpanov
rugpanov added this pull request to the merge queue Jul 21, 2026
Merged via the queue into main with commit 4999c01 Jul 21, 2026
27 checks passed
@rugpanov
rugpanov deleted the dbconnect/15-serverless-bare-version branch July 21, 2026 10:10
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.

4 participants