Skip to content

Commit b279467

Browse files
Add a interface for specifying bundle variables (#1157)
## Changes <!-- Summary of your changes that are easy to understand --> ## Tests <!-- How is this tested? --> --------- Co-authored-by: Ilia Babanov <[email protected]>
1 parent 5177b8d commit b279467

30 files changed

+2387
-1060
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ jobs:
163163
working-directory: packages/databricks-vscode
164164

165165
- name: Upload test logs
166-
if: always()
166+
if: failure()
167167
continue-on-error: true
168168
uses: actions/upload-artifact@v3
169169
with:

packages/databricks-vscode/package.json

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,20 @@
136136
"title": "Run File as Workflow",
137137
"category": "Databricks",
138138
"enablement": "!inDebugMode && databricks.context.activated && databricks.context.loggedIn",
139-
"icon": "$(play)"
139+
"icon": {
140+
"dark": "resources/dark/databricks-run-icon.svg",
141+
"light": "resources/light/databricks-run-icon.svg"
142+
}
140143
},
141144
{
142145
"command": "databricks.run.runEditorContents",
143146
"title": "Upload and Run File",
144147
"category": "Databricks",
145148
"enablement": "!inDebugMode && databricks.context.activated && databricks.context.loggedIn",
146-
"icon": "$(play)"
149+
"icon": {
150+
"dark": "resources/dark/databricks-run-icon.svg",
151+
"light": "resources/light/databricks-run-icon.svg"
152+
}
147153
},
148154
{
149155
"command": "databricks.quickstart.open",
@@ -256,13 +262,21 @@
256262
"command": "databricks.run.dbconnect.debug",
257263
"title": "Databricks Connect: Debug current file",
258264
"enablement": "databricks.context.activated && databricks.context.loggedIn",
259-
"category": "Databricks"
265+
"category": "Databricks",
266+
"icon": {
267+
"dark": "resources/dark/databricks-run-icon.svg",
268+
"light": "resources/light/databricks-run-icon.svg"
269+
}
260270
},
261271
{
262272
"command": "databricks.run.dbconnect.run",
263273
"title": "Databricks Connect: Run current file",
264274
"enablement": "databricks.context.activated && databricks.context.loggedIn",
265-
"category": "Databricks"
275+
"category": "Databricks",
276+
"icon": {
277+
"dark": "resources/dark/databricks-run-icon.svg",
278+
"light": "resources/light/databricks-run-icon.svg"
279+
}
266280
},
267281
{
268282
"command": "databricks.bundle.showLogs",
@@ -275,6 +289,20 @@
275289
"title": "Copy",
276290
"enablement": "databricks.context.activated",
277291
"category": "Databricks"
292+
},
293+
{
294+
"command": "databricks.bundle.variable.openFile",
295+
"title": "Override bundle variables",
296+
"enablement": "databricks.context.activated && databricks.context.bundle.isTargetSet",
297+
"category": "Databricks",
298+
"icon": "$(gear)"
299+
},
300+
{
301+
"command": "databricks.bundle.variable.reset",
302+
"title": "Reset to default values",
303+
"enablement": "databricks.context.activated && databricks.context.bundle.isTargetSet",
304+
"category": "Databricks",
305+
"icon": "$(discard)"
278306
}
279307
],
280308
"viewsContainers": {
@@ -298,6 +326,12 @@
298326
"visibility": "visible",
299327
"when": "databricks.context.bundle.isTargetSet"
300328
},
329+
{
330+
"id": "dabsVariableView",
331+
"name": "Bundle Variables View",
332+
"visibility": "visible",
333+
"when": "databricks.context.bundle.isTargetSet"
334+
},
301335
{
302336
"id": "workspaceFsView",
303337
"name": "Workspace explorer",
@@ -382,6 +416,16 @@
382416
"command": "databricks.bundle.deploy",
383417
"when": "view == dabsResourceExplorerView && databricks.context.bundle.deploymentState == idle",
384418
"group": "navigation@1"
419+
},
420+
{
421+
"command": "databricks.bundle.variable.openFile",
422+
"when": "view == dabsVariableView && databricks.context.bundle.deploymentState == idle",
423+
"group": "navigation@1"
424+
},
425+
{
426+
"command": "databricks.bundle.variable.reset",
427+
"when": "view == dabsVariableView && databricks.context.bundle.deploymentState == idle",
428+
"group": "navigation@1"
385429
}
386430
],
387431
"databricks.cluster.filter": [
@@ -504,7 +548,7 @@
504548
"explorer/context": [
505549
{
506550
"submenu": "databricks.run",
507-
"when": "resourceLangId == python"
551+
"when": "resourceLangId == python || resourceExtname == .ipynb"
508552
}
509553
]
510554
},

packages/databricks-vscode/src/bundle/BundleFileSet.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {expect} from "chai";
44
import path from "path";
55
import * as tmp from "tmp-promise";
66
import * as fs from "fs/promises";
7-
import {BundleSchema} from "./BundleSchema";
7+
import {BundleSchema} from "./types";
88
import * as yaml from "yaml";
99

1010
describe(__filename, async function () {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as glob from "glob";
33
import {merge} from "lodash";
44
import * as yaml from "yaml";
55
import path from "path";
6-
import {BundleSchema} from "./BundleSchema";
6+
import {BundleSchema} from "./types";
77
import {readFile, writeFile} from "fs/promises";
88
import {CachedValue} from "../locking/CachedValue";
99
import minimatch from "minimatch";

0 commit comments

Comments
 (0)