Skip to content

Commit

Permalink
Rename workflows to jobs in the bundle explorer UI (#1591)
Browse files Browse the repository at this point in the history
## Changes

This change renames workflows to jobs in the bundle explorer UI to align
with the terminology used in the Databricks UI.

Note that we still have "run file as workflow" command and
`databricks-workflow` launch config - decided to leave it as is to not
break existing users' workflows (and it's still a correct term in that
context)

## Tests

Manually and existing integ tests
  • Loading branch information
ilia-db authored Mar 10, 2025
1 parent dbbaa00 commit d10702a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion packages/databricks-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
{
"command": "databricks.bundle.deployAndRunJob",
"icon": "$(run)",
"title": "Deploy the bundle and run the workflow",
"title": "Deploy the bundle and run the job",
"enablement": "databricks.context.activated && databricks.context.bundle.isTargetSet && databricks.context.bundle.deploymentState == idle",
"category": "Databricks"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe("Bundle in a sub folder", async function () {
async () => {
const job = await getResourceViewItem(
resourceExplorerView,
"Workflows",
"Jobs",
jobs[folder].name!
);
return job !== undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ describe("Deploy and run job", async function () {

const jobItem = await getResourceViewItem(
resourceExplorerView,
"Workflows",
"Jobs",
jobName
);
assert(jobItem, `Job ${jobName} not found in resource explorer`);

const deployAndRunButton = await jobItem.getActionButton(
"Deploy the bundle and run the workflow"
"Deploy the bundle and run the job"
);
assert(deployAndRunButton, "Deploy and run button not found");
await deployAndRunButton.elem.click();
Expand All @@ -85,7 +85,7 @@ describe("Deploy and run job", async function () {

await waitForRunStatus(
resourceExplorerView,
"Workflows",
"Jobs",
jobName,
"Success"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe("Automatically refresh resource explorer", async function () {
async () => {
const job = await getResourceViewItem(
resourceExplorerView,
"Workflows",
"Jobs",
jobDef.name!
);
return job !== undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {CustomTreeSection} from "wdio-vscode-service";

export async function getResourceViewItem(
resourceExplorer: CustomTreeSection,
resourceType: "Workflows" | "Pipelines",
resourceType: "Jobs" | "Pipelines",
resourceName: string
) {
const jobs = await resourceExplorer.openItem(resourceType);
Expand All @@ -21,7 +21,7 @@ export async function geTaskViewItem(
) {
const tasks = await getResourceSubItems(
resourceExplorerView,
"Workflows",
"Jobs",
resourceName,
"Tasks"
);
Expand All @@ -34,7 +34,7 @@ export async function geTaskViewItem(

export async function getResourceSubItems(
resourceExplorerView: CustomTreeSection,
resourceType: "Workflows" | "Pipelines",
resourceType: "Jobs" | "Pipelines",
resourceName: string,
...subItemNames: string[]
) {
Expand All @@ -56,8 +56,8 @@ export async function getResourceSubItems(

export async function waitForRunStatus(
resourceExplorerView: CustomTreeSection,
resourceType: "Workflows" | "Pipelines",
resorceName: string,
resourceType: "Jobs" | "Pipelines",
resourceName: string,
successLabel: string,
timeout: number = 120_000
) {
Expand All @@ -67,10 +67,10 @@ export async function waitForRunStatus(
const item = await getResourceViewItem(
resourceExplorerView,
resourceType,
resorceName
resourceName
);
if (item === undefined) {
console.log(`Item ${resorceName} not found`);
console.log(`Item ${resourceName} not found`);
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,22 +226,22 @@ export class BundleCommands implements Disposable {
type: "pipelines",
key: `pipelines.${key}`,
}));
const workflows = remoteState?.resources?.jobs ?? {};
const workflowItems = Object.keys(workflows).map((key) => ({
const jobs = remoteState?.resources?.jobs ?? {};
const jobItems = Object.keys(jobs).map((key) => ({
label: key,
description: "Workflow",
description: "Job",
type: "jobs",
}));
if (pipelineItems.length === 0 && workflowItems.length === 0) {
if (pipelineItems.length === 0 && jobItems.length === 0) {
window.showErrorMessage(
"No pipelines or workflows found in the bundle."
"No pipelines or jobs found in the bundle."
);
return;
}
const pick = await window.showQuickPick(
[...pipelineItems, ...workflowItems],
[...pipelineItems, ...jobItems],
{
placeHolder: "Select a pipeline or workflow to run",
placeHolder: "Select a pipeline or a job to run",
}
);
if (!pick) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function humaniseResourceType(type: BundleResourceExplorerTreeNode["type"]) {
case "pipelines":
return "Pipelines";
case "jobs":
return "Workflows";
return "Jobs";
default:
return capitalize(type).replace(/_/g, " ");
}
Expand Down

0 comments on commit d10702a

Please sign in to comment.