[10/?] feat(python-setup): setup-state storage key for drift detection - #2055
Merged
Conversation
*Why*
After a successful uv-native setup, the extension needs to remember what
environment was provisioned so a later change of compute target can be detected
as drift and surfaced to the user. This adds the persistence key; the write site
(the orchestrator's saveState) is wired separately when the extension-wiring PR
lands (it currently holds a TODO(DECO-27784) no-op).
*What*
- Add the PythonSetupState type ({envKey, pythonVersion, timestamp}) and a
workspace-scoped StorageConfigurations entry
"databricks.pythonSetup.setupState". Workspace (per-project) location because
drift is per-project. Flows through the existing typed get/set surface.
- Add the first StateStorage unit test (in-memory Memento fake): round-trip,
undefined-before-write, clear-on-undefined, and workspace-not-global placement.
*Verification*
yarn --cwd packages/databricks-vscode build / test:lint / test:unit
(329 passing; 4 new). Build confirms the typed key resolves through get/set.
Co-authored-by: Isaac
Contributor
Author
|
🤖 Integration tests ✅ all 35 test jobs passed for |
misha-db
approved these changes
Jul 28, 2026
rugpanov
enabled auto-merge (squash)
July 28, 2026 09:40
Contributor
Author
|
🤖 Integration tests triggered for |
Contributor
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
rugpanov
added a commit
that referenced
this pull request
Jul 29, 2026
*Why* The extension-wiring PR left saveState as a TODO(DECO-27784) no-op and carried seam-doc comments claiming the visibility/compute seams were still stubbed. Both are now resolved: the storage key landed (#2055) and this PR wires the real implementations. *What* - Implement saveState (DECO-27784 write half): makePythonSetupDeps stamps the orchestrator's {envKey, pythonVersion} with an ISO-8601 timestamp and forwards it through a new injected persistSetupState seam; extension.ts wires that to stateStorage.set("databricks.pythonSetup.setupState", ...). Workspace-scoped, so drift detection is per-project. - Correct the now-stale PythonSetupSetupDeps seam docs on isVisible/resolveCompute -- they described "the extension passes a stub"; the real gate (flag + shouldShowPythonSetup) and compute resolution (cluster / persisted serverlessVersion) are now wired. - Tests: makePythonSetupDeps.saveState stamps+forwards a valid timestamp; adoptInterpreter routes through the seam with the OS-correct venv path. *Verification* yarn --cwd packages/databricks-vscode build / test:lint (clean); test:unit 429 passing (VSCODE_TEST_VERSION=1.130.0; default stable pulls VS Code 1.131.0 which breaks @vscode/test-electron locally -- repo-wide infra skew, unrelated). Co-authored-by: Isaac
Merged
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
After a successful uv-native Python environment setup, the extension needs to remember what environment was provisioned, so a later change of compute target can be detected as drift (the local env no longer matches the selected target) and surfaced to the user. This lands the persistence key.
Scoped deliberately to the storage layer: it builds off
mainwith no dependency on the (still-open) wiring stack. The write site — the orchestrator'ssaveState— is wired separately when the extension-wiring PR (#2054) lands; it currently holds aTODO(DECO-27784)no-op that this key will back.What
PythonSetupStatetype —{envKey, pythonVersion, timestamp}:envKey: the CLI's resolved environment key for the target (e.g.serverless/serverless-v5).pythonVersion: the provisioned interpreter minor version (e.g.3.12).timestamp: ISO-8601 time of the successful setup."databricks.pythonSetup.setupState"StorageConfigurationsentry, workspace-scoped (drift is per-project). Flows through the existing typedget/setsurface — no new accessor code.StateStorageunit test (in-memoryMementofake): round-trip, undefined-before-write, clear-on-undefined, and workspace-not-global placement.Verification
yarn --cwd packages/databricks-vscode build / test:lint / test:unit— 329 passing (4 new). Build confirms the typed key resolves throughget/set.This pull request and its description were written by Isaac.