Skip to content

Commit ca13f5e

Browse files
authored
Bump CLI to 230, use verbose deploy (#1390)
## Changes Bump CLI to 230, use verbose deploy, regenerate the schema Note: new schema generator doesn't produce stable result, hence the huge amount of changed lines ## Tests Existing tests + manually for the CLI auth
1 parent 96aaa71 commit ca13f5e

File tree

7 files changed

+4573
-3255
lines changed

7 files changed

+4573
-3255
lines changed

packages/databricks-vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@
897897
"useYarn": false
898898
},
899899
"cli": {
900-
"version": "0.228.1"
900+
"version": "0.230.0"
901901
},
902902
"scripts": {
903903
"vscode:prepublish": "rm -rf out && yarn run package:compile && yarn run package:wrappers:write && yarn run package:jupyter-init-script:write && yarn run package:copy-webview-toolkit && yarn run generate-telemetry",

packages/databricks-vscode/src/bundle/BundleSchema.ts

Lines changed: 4541 additions & 3248 deletions
Large diffs are not rendered by default.

packages/databricks-vscode/src/bundle/models/BundleValidateModel.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ export class BundleValidateModel extends BaseModelWithStateCache<BundleValidateS
8383
) as BundleTarget;
8484

8585
return {
86-
clusterId: validateOutput?.bundle?.compute_id,
86+
clusterId:
87+
validateOutput?.bundle?.compute_id ??
88+
validateOutput?.bundle?.cluster_id,
8789
remoteRootPath: validateOutput?.workspace?.file_path,
8890
...validateOutput,
8991
};

packages/databricks-vscode/src/cli/CliWrapper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ export class CliWrapper {
602602
"deploy",
603603
"--target",
604604
target,
605+
"--verbose",
605606
...(force ? ["--force-lock"] : []),
606607
],
607608
workspaceFolder,

packages/databricks-vscode/src/test/e2e/run_files.e2e.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ describe("Run files", async function () {
4343

4444
beforeEach(async () => {
4545
await openFile("hello.py");
46+
// We enable the run command when the active editor is changed.
47+
// We wait here to avoid race conditions between the extension logic enabling this command and tests executing it.
48+
await sleep(1000);
4649
});
4750

4851
it("should run a python file on a cluster", async () => {
@@ -54,7 +57,6 @@ describe("Run files", async function () {
5457
.openDebugConsoleView();
5558

5659
while (true) {
57-
await dismissNotifications();
5860
await sleep(2000);
5961
const text = await (await debugOutput.elem).getHTML();
6062
if (text && text.includes("hello world")) {
@@ -66,7 +68,6 @@ describe("Run files", async function () {
6668
it("should run a python file as a workflow", async () => {
6769
const workbench = await driver.getWorkbench();
6870
await workbench.executeQuickPick("Databricks: Run File as Workflow");
69-
await dismissNotifications();
7071
await waitForWorkflowWebview("hello world");
7172
});
7273
});

packages/databricks-vscode/src/test/e2e/run_notebooks.e2e.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import path from "node:path";
22
import * as fs from "fs/promises";
33
import assert from "node:assert";
4+
import {sleep} from "wdio-vscode-service";
45
import {
56
dismissNotifications,
67
openFile,
@@ -73,17 +74,21 @@ describe("Run notebooks", async function () {
7374

7475
it("should run a notebook.py file as a workflow", async () => {
7576
await openFile("notebook.py");
77+
// We enable the run command when the active editor is changed.
78+
// We wait here to avoid race conditions between the extension logic enabling this command and tests executing it.
79+
await sleep(1000);
7680
const workbench = await driver.getWorkbench();
7781
await workbench.executeQuickPick("Databricks: Run File as Workflow");
78-
await dismissNotifications();
7982
await waitForWorkflowWebview("a/b c");
8083
});
8184

8285
it("should run a notebook.ipynb file as a workflow", async () => {
8386
await openFile("notebook.ipynb");
87+
// We enable the run command when the active editor is changed.
88+
// We wait here to avoid race conditions between the extension logic enabling this command and tests executing it.
89+
await sleep(1000);
8490
const workbench = await driver.getWorkbench();
8591
await workbench.executeQuickPick("Databricks: Run File as Workflow");
86-
await dismissNotifications();
8792
await waitForWorkflowWebview("hello world");
8893
});
8994
});

packages/databricks-vscode/src/test/e2e/utils/commonUtils.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,23 @@ export function getUniqueResourceName(name?: string) {
233233

234234
export async function waitForWorkflowWebview(expectedOutput: string) {
235235
const workbench = await browser.getWorkbench();
236-
const webView = await workbench.getWebviewByTitle(/Databricks Job Run/);
236+
const title = /Databricks Job Run/;
237+
await browser.waitUntil(
238+
async () => {
239+
try {
240+
const webView = await workbench.getWebviewByTitle(title);
241+
return webView !== undefined;
242+
} catch (e) {
243+
return false;
244+
}
245+
},
246+
{
247+
timeout: 5_000,
248+
interval: 1_000,
249+
timeoutMsg: "Webview did not open",
250+
}
251+
);
252+
const webView = await workbench.getWebviewByTitle(title);
237253
await webView.open();
238254

239255
await browser.waitUntil(

0 commit comments

Comments
 (0)