Skip to content

Commit 378d5f3

Browse files
committed
Refactor apps-mcp to use CLI-based approach
This refactors the apps-mcp server to use CLI commands instead of direct API providers, significantly simplifying the architecture and leveraging existing bundle command functionality. Major changes: **New CLI-based provider:** - Add experimental/apps-mcp/lib/providers/clitools package - Implement workspace exploration via CLI commands - Add invoke_databricks_cli helper for executing CLI commands - Update prompts to support apps exploration workflow **Removed providers and templates:** - Remove databricks provider (replaced by CLI invocation) - Remove IO provider (scaffolding/validation, now handled by bundle commands) - Remove deployment provider (superseded by bundle deploy commands) - Remove entire templates system including trpc template **Clean up old development features:** - Remove cmd/workspace/apps/dev.go and vite bridge - Remove vite development server integration - Drop experimental development workflow in favor of bundle-based approach This change reduces code complexity by ~21k lines while providing a more maintainable architecture that reuses existing CLI commands rather than duplicating API logic.
1 parent bc1902c commit 378d5f3

File tree

122 files changed

+778
-20894
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+778
-20894
lines changed

acceptance/bundle/resource_deps/job_tasks/out.telemetry.direct.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

acceptance/bundle/resource_deps/job_tasks/out.telemetry.terraform.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

acceptance/bundle/resource_deps/job_tasks/out.test.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

acceptance/bundle/resource_deps/job_tasks/output.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,13 @@ Updating deployment state...
77
Deployment complete!
88

99
>>> print_telemetry_bool_values
10+
experimental.use_legacy_run_as false
11+
has_classic_interactive_compute false
12+
has_classic_job_compute false
13+
has_serverless_compute true
14+
presets_name_prefix_is_set false
15+
python_wheel_wrapper_is_set false
16+
resref_jobs.tags.* true
17+
resreferr_jobs.task true
18+
run_as_set false
19+
skip_artifact_cleanup false
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
if [ "$DATABRICKS_BUNDLE_ENGINE" == "direct" ]; then
2-
# terraform has its own schema, direct uses bundle schema; here we replace TF syntax with bundle syntax:
3-
update_file.py databricks.yml 'task[0].python_wheel_task[0].' 'tasks[0].python_wheel_task.'
4-
fi
5-
61
touch hello.whl
72
trace $CLI bundle deploy
8-
trace print_telemetry_bool_values > out.telemetry.$DATABRICKS_BUNDLE_ENGINE.txt
3+
trace print_telemetry_bool_values
94
rm out.requests.txt hello.whl
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
RecordRequests = true
2+
3+
# direct fails with Error: schema mismatch for ${resources.jobs.test_job.task[0].python_wheel_task[0].entry_point}: task: field "task" not found in resources.Job
4+
EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform"] # uses TF-specific syntax task[0].python_wheel_task[0]
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"plan": {
3+
"resources.schemas.my": {
4+
"action": "skip",
5+
"remote_state": {
6+
"browse_only": false,
7+
"catalog_name": "main",
8+
"catalog_type": "MANAGED_CATALOG",
9+
"created_at": [UNIX_TIME_MILLIS][0],
10+
"created_by": "[USERNAME]",
11+
"full_name": "main.myschema-[UNIQUE_NAME]",
12+
"name": "myschema-[UNIQUE_NAME]",
13+
"owner": "[USERNAME]",
14+
"updated_at": [UNIX_TIME_MILLIS][0],
15+
"updated_by": "[USERNAME]"
16+
}
17+
},
18+
"resources.volumes.bar": {
19+
"depends_on": [
20+
{
21+
"node": "resources.schemas.my",
22+
"label": "${resources.schemas.my.name}"
23+
}
24+
],
25+
"action": "skip",
26+
"remote_state": {
27+
"catalog_name": "main",
28+
"created_at": [UNIX_TIME_MILLIS][1],
29+
"created_by": "[USERNAME]",
30+
"full_name": "main.myschema-[UNIQUE_NAME].volumebar-[UNIQUE_NAME]",
31+
"name": "volumebar-[UNIQUE_NAME]",
32+
"owner": "[USERNAME]",
33+
"schema_name": "myschema-[UNIQUE_NAME]",
34+
"storage_location": "s3://deco-uc-prod-isolated-aws-us-east-1/metastore/[UUID]/volumes/[UUID]",
35+
"updated_at": [UNIX_TIME_MILLIS][1],
36+
"volume_type": "MANAGED"
37+
},
38+
"changes": {
39+
"remote": {
40+
"storage_location": {
41+
"action": "skip",
42+
"reason": "server_side_default"
43+
}
44+
}
45+
}
46+
},
47+
"resources.volumes.foo": {
48+
"depends_on": [
49+
{
50+
"node": "resources.schemas.my",
51+
"label": "${resources.schemas.my.name}"
52+
},
53+
{
54+
"node": "resources.volumes.bar",
55+
"label": "${resources.volumes.bar.storage_location}"
56+
}
57+
],
58+
"action": "skip",
59+
"remote_state": {
60+
"catalog_name": "main",
61+
"comment": "s3://deco-uc-prod-isolated-aws-us-east-1/metastore/[UUID]/volumes/[UUID]",
62+
"created_at": [UNIX_TIME_MILLIS][2],
63+
"created_by": "[USERNAME]",
64+
"full_name": "main.myschema-[UNIQUE_NAME].volumefoo-[UNIQUE_NAME]",
65+
"name": "volumefoo-[UNIQUE_NAME]",
66+
"owner": "[USERNAME]",
67+
"schema_name": "myschema-[UNIQUE_NAME]",
68+
"storage_location": "s3://deco-uc-prod-isolated-aws-us-east-1/metastore/[UUID]/volumes/[UUID]",
69+
"updated_at": [UNIX_TIME_MILLIS][2],
70+
"volume_type": "MANAGED"
71+
},
72+
"changes": {
73+
"remote": {
74+
"storage_location": {
75+
"action": "skip",
76+
"reason": "server_side_default"
77+
}
78+
}
79+
}
80+
}
81+
}
82+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"plan": {
3+
"resources.schemas.my": {
4+
"action": "skip"
5+
},
6+
"resources.volumes.bar": {
7+
"action": "skip"
8+
},
9+
"resources.volumes.foo": {
10+
"action": "create"
11+
}
12+
}
13+
}

acceptance/bundle/resource_deps/remote_field_storage_location/script

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ trap cleanup EXIT
1111
trace errcode $CLI bundle deploy &> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt
1212
print_requests.py --get //unity &> out.deploy.requests.$DATABRICKS_BUNDLE_ENGINE.json
1313

14-
# Terraform could not deploy, so it still shows up here; direct shows no drift:
14+
# Should show empty plan for direct, but shows update in volumes.foo (permanent drift)
1515
$CLI bundle plan &> out.plan_after_deploy.$DATABRICKS_BUNDLE_ENGINE.txt
16+
$CLI bundle plan -o json &> out.plan_after_deploy.$DATABRICKS_BUNDLE_ENGINE.json

acceptance/bundle/resource_deps/remote_field_storage_location/test.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Badness = "Terraform cannot deploy; permanent drift in direct"
2+
13
Local = true
24
Cloud = true
35
RequiresUnityCatalog = true

0 commit comments

Comments
 (0)