Skip to content

Commit

Permalink
Add a interface for specifying bundle variables (#1157)
Browse files Browse the repository at this point in the history
## Changes
<!-- Summary of your changes that are easy to understand -->

## Tests
<!-- How is this tested? -->

---------

Co-authored-by: Ilia Babanov <[email protected]>
  • Loading branch information
kartikgupta-db and ilia-db authored Apr 24, 2024
1 parent 5177b8d commit b279467
Show file tree
Hide file tree
Showing 30 changed files with 2,387 additions and 1,060 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ jobs:
working-directory: packages/databricks-vscode

- name: Upload test logs
if: always()
if: failure()
continue-on-error: true
uses: actions/upload-artifact@v3
with:
Expand Down
54 changes: 49 additions & 5 deletions packages/databricks-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,20 @@
"title": "Run File as Workflow",
"category": "Databricks",
"enablement": "!inDebugMode && databricks.context.activated && databricks.context.loggedIn",
"icon": "$(play)"
"icon": {
"dark": "resources/dark/databricks-run-icon.svg",
"light": "resources/light/databricks-run-icon.svg"
}
},
{
"command": "databricks.run.runEditorContents",
"title": "Upload and Run File",
"category": "Databricks",
"enablement": "!inDebugMode && databricks.context.activated && databricks.context.loggedIn",
"icon": "$(play)"
"icon": {
"dark": "resources/dark/databricks-run-icon.svg",
"light": "resources/light/databricks-run-icon.svg"
}
},
{
"command": "databricks.quickstart.open",
Expand Down Expand Up @@ -256,13 +262,21 @@
"command": "databricks.run.dbconnect.debug",
"title": "Databricks Connect: Debug current file",
"enablement": "databricks.context.activated && databricks.context.loggedIn",
"category": "Databricks"
"category": "Databricks",
"icon": {
"dark": "resources/dark/databricks-run-icon.svg",
"light": "resources/light/databricks-run-icon.svg"
}
},
{
"command": "databricks.run.dbconnect.run",
"title": "Databricks Connect: Run current file",
"enablement": "databricks.context.activated && databricks.context.loggedIn",
"category": "Databricks"
"category": "Databricks",
"icon": {
"dark": "resources/dark/databricks-run-icon.svg",
"light": "resources/light/databricks-run-icon.svg"
}
},
{
"command": "databricks.bundle.showLogs",
Expand All @@ -275,6 +289,20 @@
"title": "Copy",
"enablement": "databricks.context.activated",
"category": "Databricks"
},
{
"command": "databricks.bundle.variable.openFile",
"title": "Override bundle variables",
"enablement": "databricks.context.activated && databricks.context.bundle.isTargetSet",
"category": "Databricks",
"icon": "$(gear)"
},
{
"command": "databricks.bundle.variable.reset",
"title": "Reset to default values",
"enablement": "databricks.context.activated && databricks.context.bundle.isTargetSet",
"category": "Databricks",
"icon": "$(discard)"
}
],
"viewsContainers": {
Expand All @@ -298,6 +326,12 @@
"visibility": "visible",
"when": "databricks.context.bundle.isTargetSet"
},
{
"id": "dabsVariableView",
"name": "Bundle Variables View",
"visibility": "visible",
"when": "databricks.context.bundle.isTargetSet"
},
{
"id": "workspaceFsView",
"name": "Workspace explorer",
Expand Down Expand Up @@ -382,6 +416,16 @@
"command": "databricks.bundle.deploy",
"when": "view == dabsResourceExplorerView && databricks.context.bundle.deploymentState == idle",
"group": "navigation@1"
},
{
"command": "databricks.bundle.variable.openFile",
"when": "view == dabsVariableView && databricks.context.bundle.deploymentState == idle",
"group": "navigation@1"
},
{
"command": "databricks.bundle.variable.reset",
"when": "view == dabsVariableView && databricks.context.bundle.deploymentState == idle",
"group": "navigation@1"
}
],
"databricks.cluster.filter": [
Expand Down Expand Up @@ -504,7 +548,7 @@
"explorer/context": [
{
"submenu": "databricks.run",
"when": "resourceLangId == python"
"when": "resourceLangId == python || resourceExtname == .ipynb"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {expect} from "chai";
import path from "path";
import * as tmp from "tmp-promise";
import * as fs from "fs/promises";
import {BundleSchema} from "./BundleSchema";
import {BundleSchema} from "./types";
import * as yaml from "yaml";

describe(__filename, async function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/databricks-vscode/src/bundle/BundleFileSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as glob from "glob";
import {merge} from "lodash";
import * as yaml from "yaml";
import path from "path";
import {BundleSchema} from "./BundleSchema";
import {BundleSchema} from "./types";
import {readFile, writeFile} from "fs/promises";
import {CachedValue} from "../locking/CachedValue";
import minimatch from "minimatch";
Expand Down
Loading

0 comments on commit b279467

Please sign in to comment.