feat(python-setup): rename result target field to compute (DECO-27794 ext side) - #2066
Draft
rugpanov wants to merge 1 commit into
Draft
feat(python-setup): rename result target field to compute (DECO-27794 ext side)#2066rugpanov wants to merge 1 commit into
target field to compute (DECO-27794 ext side)#2066rugpanov wants to merge 1 commit into
Conversation
*Why:* The `setup-local --output json` result key is being renamed `target` -> `compute` in the CLI (databricks/cli#6100, DECO-27794) so the result vocabulary matches the invocation-side field the extension already adopted (`SetupLocalInvocation.compute`, #2039). The extension parses the CLI result with a bare structural cast, so the TypeScript field name must equal the JSON key the CLI emits. This lands the extension half of that coordinated rename; the CLI half (#6100) merges first so the golden fixtures stay verbatim-from-golden. *What:* - `PythonSetupTargetInfo` -> `PythonSetupComputeInfo`; `PythonSetupResult.target?` -> `compute?` (inner fields `source`/`clusterId`/`serverlessVersion`/`envKey` unchanged -- only the outer key renames, matching #6100's result.go diff). - Drop the placeholder TODO on the field; replace with a doc comment pointing at the CLI wire key. - Fixtures (`setupLocalResults.ts`): 3x `target:` -> `compute:`. - Consumers: `isLocalEnvironmentReady` / `saveState` (orchestrator) and `errorMessages.ts` (`r.compute?.envKey`) + their tests. - `E_NO_TARGET` / `ERROR_NO_TARGET` (error-code names) deliberately NOT renamed -- they mirror the stable wire error-code string, which #6100 keeps. *Verification:* - `yarn build` (compile-coupling of fixtures to the type is the contract proof), `yarn test:lint`, `yarn test:unit` (415 passing) all green. Co-authored-by: Isaac
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. |
Contributor
Author
|
🤖 Integration tests ❌ 1 of 35 test jobs failed for |
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.
What
Extension-side half of the
setup-local --output jsontarget→computerename. Follows the CLI half in databricks/cli#6100.
PythonSetupTargetInfo→PythonSetupComputeInfo;PythonSetupResult.target?→compute?(inner fields unchanged — only the outer key renames, mirroring #6100'sresult.go).setupLocalResults.ts): 3×target:→compute:, kept verbatim from the CLI acceptance goldens.isLocalEnvironmentReady/saveState),errorMessages.ts(r.compute?.envKey), and their tests.Why the extension field name must match the wire key
The extension parses the CLI result with a bare structural cast (no field mapping), so the TypeScript field name must equal the JSON key the CLI emits. The fixtures are compile-coupled to the contract type, so this is proven at build time.
Deliberately NOT renamed
E_NO_TARGET/ERROR_NO_TARGET— mirror the stable wire error-code string, which #6100 keeps.Blocked on
⛔ databricks/cli#6100 (CLI side) must merge first, so the CLI's
--output jsonemitscomputeand the acceptance goldens flip. Until then the fixtures here would diverge from the upstream goldens they mirror. schemaVersion stays 1 (command still hidden, no shipped consumer).Test
yarn build,yarn test:lint,yarn test:unit(415 passing) — all green.This pull request and its description were written by Isaac.