Pin serverless databricks-connect by major (~=17.0, not ~=17.3.0) - #15
Conversation
A serverless environment version tracks a whole major runtime line, not a single point release, but dbconnect_pin() took the first two version segments (17.3.1 -> ~=17.3.0), locking the dev-group databricks-connect to one minor line (>=17.3.0, <17.4.0) and only picking up patches. Pin by bare major instead — ~=MAJOR.0 (17.3.1 -> databricks-connect~=17.0, resolving >=17.0, <18.0) — so it tracks the latest release within the major. Regenerate the committed serverless pyprojects to match; the DBR path is unaffected (it passes an explicit MAJOR.MINOR pin per point-release page). Co-authored-by: Isaac
|
Reviewed at f303e33. I'd like to hold this one — I think the loosened pin breaks a cross-repo contract the CLI depends on, and I'm also not convinced the premise is right. Details below; happy to be argued out of the second part. 1. It corrupts the version the CLI reports to usersThe CLI reads the pin string verbatim out of the published
With
The pipeline won't fail, at least: validate only asserts the major matches ( 2. It reshapes every future sync, not just the six files
3. I don't think the premise holdsThe PR argues a serverless environment version "tracks a whole major runtime line." That's true of the runtime, but it's not what these artifacts are for. Per this repo's own README, the goal is reproducing one runtime snapshot — "matching the exact Python version, Concretely: Also: What I'd suggestMostly I want to understand the motivating problem, since that changes the answer:
Either way, this coupling deserves a test on at least one side — the fact that a one-line change to Reviewed with Claude Code; all claims above were verified by running the branch's |
… setup-local --dry-run (databricks#6218) ## Summary Found in code review of the unveil PR (databricks#5835). P1, not P0: it only affects `--dry-run`; real runs are correct. `versionFromPin` in `libs/localenv/pipeline.go` derives the reported `dbconnectVersion` by taking everything from the first digit of the published pin string. A pin string is not a version: - A point pin like `~=17.3.0` happens to return `17.3.0` (correct). - A major-only pin like `~=17.0` returns `"17.0"` — a `major.minor` floor that nothing installs. Serverless has pinned by major (`~=17.0`, not `~=17.3.0`) since databricks/environments#15 (merged 2026-08-11), so this is live now for serverless targets. On a real run `validate` overwrites `dbconnectVersion` with the actually-installed version, so the reported value is correct. Under `--dry-run`, `validate` is stubbed, so the fabricated value is what gets reported — dry-run and real runs disagree, and the `--output json` contract the VS Code extension consumes carries the wrong value in dry-run. No wrong install happens; the provisioned venv is still correct. ## Fix Gate the reported version behind a new `dbcVersionFromPin`, which emits a version only when the pin carries a full `major.minor.patch` (e.g. `~=17.3.0` → `17.3.0`) and returns `""` (omitted from JSON) for a range-only pin such as `~=17.0`. The key constraint: `versionFromPin` has two callers. Hardening it directly would break `dbcMajorFromPin`'s major extraction for `~=17.0` and regress *real* runs (validate would fail to determine the major) — worse than the dry-run bug. So the gate is applied only to the reporting path; `versionFromPin` is left untouched. ## Tests The ticket noted nothing tested this cross-repo coupling. Added: - `TestPipelineDryRunOmitsFabricatedDBConnectVersion` — end-to-end dry-run with a `~=17.0` pin (written red-first; reported `17.0` before the fix). - `TestDBCVersionFromPin` — table-driven, including the `~=17.0` bare-major case. - `TestDBCMajorFromPinHandlesMajorOnlyPin` — guards that the real-run major path still works for `~=17.0`. `go test ./libs/localenv` (170 pass) and related acceptance tests (9 pass) are green; the existing JSON goldens use a full `17.2.0` pin, so their output is unchanged. `go vet`, `golangci-lint`, and `gofmt` are clean. No changelog fragment: `setup-local` is still hidden pending the unveil (databricks#5835), matching the prior decision to drop a premature fragment for it. This pull request and its description were written by Isaac.
Problem
For serverless, the dev-group
databricks-connectpin resolved too narrowly.dbconnect_pin()took the first two segments of the listed version (17.3.1→~=17.3.0), producing a compatible-release pin of>=17.3.0, <17.4.0. That locks databricks-connect to a single minor line and only picks up patch bumps — but a serverless environment version tracks a whole major runtime line, so it should follow the latest release within that major.Fix
Pin by bare major:
~=MAJOR.0(e.g.17.3.1→databricks-connect~=17.0, resolving>=17.0, <18.0). One-line change inenvgen.py; the committed serverless pyprojects are regenerated to match.~=14.3.0~=14.0~=15.4.0~=15.0~=16.4.0~=16.0~=17.3.0~=17.0~=18.0.0~=18.0~=18.0.0~=18.0The DBR path is unaffected — it passes an explicit
MAJOR.MINORpin derived per point-release page, which is intended there.Verification
Regenerated serverless output matches the committed files byte-for-byte (no drift), so a future
sync.pyrun won't revert it.This pull request and its description were written by Isaac.