Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ charmbracelet/bubbletea - https://github.com/charmbracelet/bubbletea
Copyright (c) 2020-2025 Charmbracelet, Inc
License - https://github.com/charmbracelet/bubbletea/blob/master/LICENSE

charmbracelet/huh - https://github.com/charmbracelet/huh
Copyright (c) 2023 Charmbracelet, Inc.
License - https://github.com/charmbracelet/huh/blob/main/LICENSE

charmbracelet/lipgloss - https://github.com/charmbracelet/lipgloss
Copyright (c) 2021-2025 Charmbracelet, Inc
License - https://github.com/charmbracelet/lipgloss/blob/master/LICENSE
Expand Down
2 changes: 2 additions & 0 deletions acceptance/apps/deploy/bundle-no-args/app/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Minimal app for testing
print("Hello from app")
8 changes: 8 additions & 0 deletions acceptance/apps/deploy/bundle-no-args/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bundle:
name: test-bundle

resources:
apps:
myapp:
name: myapp
source_code_path: ./app
5 changes: 5 additions & 0 deletions acceptance/apps/deploy/bundle-no-args/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions acceptance/apps/deploy/bundle-no-args/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

>>> [CLI] apps deploy --skip-validation
Deploying bundle...
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
Deploying resources...
Updating deployment state...
Deployment complete!
✓ Getting the status of the app myapp
✓ App is in RUNNING state
✓ App compute is in ACTIVE state
✓ Deployment succeeded
You can access the app at myapp-123.cloud.databricksapps.com
✔ Deployment complete!

>>> [CLI] bundle destroy --auto-approve
The following resources will be deleted:
delete resources.apps.myapp

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default

Deleting files...
Destroy complete!
7 changes: 7 additions & 0 deletions acceptance/apps/deploy/bundle-no-args/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Test: apps deploy in a bundle directory without APP_NAME
# Expected: Bundle deploy flow with validation + deploy + run app
# Using --skip-validation since we're testing the deploy flow, not validation

trace $CLI apps deploy --skip-validation

trace $CLI bundle destroy --auto-approve
37 changes: 37 additions & 0 deletions acceptance/apps/deploy/bundle-no-args/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Local = true
Cloud = false

Ignore = [
'.databricks',
]

[EnvMatrix]
DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"]

[[Server]]
Pattern = "POST /api/2.0/apps/myapp/deployments"
Response.Body = '''
{
"deployment_id": "dep-123",
"source_code_path": "/Workspace/apps/myapp",
"mode": "SNAPSHOT",
"status": {
"state": "SUCCEEDED",
"message": "Deployment succeeded"
}
}
'''

[[Server]]
Pattern = "GET /api/2.0/apps/myapp/deployments/dep-123"
Response.Body = '''
{
"deployment_id": "dep-123",
"source_code_path": "/Workspace/apps/myapp",
"mode": "SNAPSHOT",
"status": {
"state": "SUCCEEDED",
"message": "Deployment succeeded"
}
}
'''
8 changes: 8 additions & 0 deletions acceptance/apps/deploy/bundle-with-appname/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bundle:
name: test-bundle

resources:
apps:
myapp:
name: myapp
source_code_path: .
5 changes: 5 additions & 0 deletions acceptance/apps/deploy/bundle-with-appname/out.requests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"method": "POST",
"path": "/api/2.0/apps/test-app/deployments",
"body": {}
}
5 changes: 5 additions & 0 deletions acceptance/apps/deploy/bundle-with-appname/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions acceptance/apps/deploy/bundle-with-appname/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

>>> [CLI] apps deploy test-app --no-wait
{
"deployment_id":"dep-123",
"mode":"SNAPSHOT",
"source_code_path":"/Workspace/apps/test-app",
"status": {
"message":"Deployment pending",
"state":"PENDING"
}
}
3 changes: 3 additions & 0 deletions acceptance/apps/deploy/bundle-with-appname/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Test: apps deploy with APP_NAME in a bundle directory
# Expected: Falls back to API deploy (ignores bundle, no validation)
trace $CLI apps deploy test-app --no-wait
17 changes: 17 additions & 0 deletions acceptance/apps/deploy/bundle-with-appname/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Local = true
Cloud = false
RecordRequests = true

[[Server]]
Pattern = "POST /api/2.0/apps/test-app/deployments"
Response.Body = '''
{
"deployment_id": "dep-123",
"source_code_path": "/Workspace/apps/test-app",
"mode": "SNAPSHOT",
"status": {
"state": "PENDING",
"message": "Deployment pending"
}
}
'''
5 changes: 5 additions & 0 deletions acceptance/apps/deploy/no-bundle-no-args/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions acceptance/apps/deploy/no-bundle-no-args/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Error: accepts 1 arg(s), received 0

Exit code: 1
3 changes: 3 additions & 0 deletions acceptance/apps/deploy/no-bundle-no-args/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Test: apps deploy without databricks.yml and no APP_NAME
# Expected: Error about missing argument
errcode $CLI apps deploy
2 changes: 2 additions & 0 deletions acceptance/apps/deploy/no-bundle-no-args/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Local = true
Cloud = false
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"method": "POST",
"path": "/api/2.0/apps/test-app/deployments",
"body": {}
}
5 changes: 5 additions & 0 deletions acceptance/apps/deploy/no-bundle-with-appname/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions acceptance/apps/deploy/no-bundle-with-appname/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

>>> [CLI] apps deploy test-app --no-wait
{
"deployment_id":"dep-123",
"mode":"SNAPSHOT",
"source_code_path":"/Workspace/apps/test-app",
"status": {
"message":"Deployment pending",
"state":"PENDING"
}
}
3 changes: 3 additions & 0 deletions acceptance/apps/deploy/no-bundle-with-appname/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Test: apps deploy with APP_NAME but without databricks.yml
# Expected: Normal API deploy using apps deploy API
trace $CLI apps deploy test-app --no-wait
17 changes: 17 additions & 0 deletions acceptance/apps/deploy/no-bundle-with-appname/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Local = true
Cloud = false
RecordRequests = true

[[Server]]
Pattern = "POST /api/2.0/apps/test-app/deployments"
Response.Body = '''
{
"deployment_id": "dep-123",
"source_code_path": "/Workspace/apps/test-app",
"mode": "SNAPSHOT",
"status": {
"state": "PENDING",
"message": "Deployment pending"
}
}
'''
1 change: 1 addition & 0 deletions acceptance/apps/deploy/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Common configuration for apps deploy tests
1 change: 1 addition & 0 deletions acceptance/cmd/workspace/apps/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Global Flags:
-o, --output type output type: text or json (default text)
-p, --profile string ~/.databrickscfg profile
-t, --target string bundle target to use (if applicable)
--var strings set values for variables defined in bundle config. Example: --var="key=value"


Exit code: 1
19 changes: 19 additions & 0 deletions cmd/apps/apps.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package apps

import "github.com/spf13/cobra"

// ManagementGroupID contains auto-generated CLI commands for Apps API,
// that are separate from main CLI commands defined in Commands.
const ManagementGroupID = "management"

// Commands returns the list of custom app commands to be added
// to the auto-generated apps command group.
func Commands() []*cobra.Command {
return []*cobra.Command{
newInitCmd(),
newDevRemoteCmd(),
newLogsCommand(),
newRunLocal(),
newValidateCmd(),
}
}
Loading