Skip to content

Conversation

@fjakobs
Copy link
Contributor

@fjakobs fjakobs commented Jan 15, 2026

Summary

Add databricks apps import command.

Import an app created in the workspace with a single command

This command combines:

  1. bundle init
  2. bundle generate app
  3. bundle deployment bind
  4. bundle deploy
  5. bundle run app

The generated databricks.yml is minimal and optimized for single app bundles.

Screen.Recording.2026-01-16.at.11.19.37.mov

@fjakobs fjakobs requested a review from a team as a code owner January 15, 2026 17:17
@fjakobs fjakobs temporarily deployed to test-trigger-is January 15, 2026 17:17 — with GitHub Actions Inactive
@fjakobs fjakobs changed the title Add unit tests for apps import command Add apps import command Jan 15, 2026
@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Jan 15, 2026

Commit: 88717dc

Run: 21252530142

Env 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 3 1 5 6 410 696 18:21
🟨​ aws-ucws linux 3 1 8 5 582 570 37:31
🟨​ aws-ucws windows 3 1 8 5 584 568 35:48
💚​ azure linux 2 8 411 695 24:02
🔄​ azure windows 1 2 8 412 693 23:27
💚​ azure-ucws linux 5 7 579 569 32:19
💚​ gcp linux 2 8 400 701 21:00
💚​ gcp windows 2 8 402 699 21:23
19 interesting tests: 8 RECOVERED, 5 SKIP, 3 KNOWN, 3 flaky
Test Name aws linux aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux gcp linux gcp windows
🟨​ TestAccept 🟨​K 🟨​K 🟨​K 💚​R 💚​R 💚​R 💚​R 💚​R
🔄​ TestAccept/bundle/deploy/mlops-stacks 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p
🙈​ TestAccept/bundle/deployment/bind/alert 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/generate/alert 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/alerts/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/alerts/with_file 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 🟨​K 🟨​K 🟨​K 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 🟨​K
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 💚​R 💚​R 🙈​S 🙈​S 💚​R 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R
💚​ TestAccept/ssh/connection 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🔄​ TestSyncEnsureRemotePathIsUsableIfRepoExists ✅​p 🔄​f 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p
🔄​ TestFetchRepositoryInfoAPI_FromRepo ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p
Top 36 slowest tests (at least 2 minutes):
duration env testname
9:36 aws-ucws windows TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform
9:01 aws-ucws windows TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct
7:01 aws-ucws linux TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct
6:56 aws-ucws linux TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform
5:33 gcp linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:32 gcp windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:25 gcp windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:25 aws-ucws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:21 gcp linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:20 azure windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:09 aws-ucws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
4:31 azure-ucws linux TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct
4:05 azure-ucws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
4:02 azure-ucws linux TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform
3:43 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:43 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:42 azure windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
3:42 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:40 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:25 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:16 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:12 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:12 azure-ucws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
2:52 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:42 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:41 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:39 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:35 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:27 aws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
2:25 aws-ucws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
2:24 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:24 aws-ucws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
2:23 aws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
2:20 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:13 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:08 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct

@lennartkats-db lennartkats-db self-requested a review January 21, 2026 13:53
Adds comprehensive unit tests for the apps import command focusing on edge cases:
- YAML formatting (addBlankLinesBetweenTopLevelKeys)
- App config inlining (inlineAppConfigFile)
- Path detection for .bundle folders
- Email parsing and comparison logic
- Error handling for file operations and invalid YAML

Refactored code to use existing convert.FromTyped instead of custom conversion logic.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Use platform-specific methods to deny file read access in test:
- Windows: Use icacls to deny read permissions via ACLs
- Unix: Use chmod to remove read permissions

This fixes the TestInlineAppConfigFileErrors/unreadable_app.yml test
that was failing on Windows because Unix-style file permissions don't
work the same way on Windows systems.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Verify that the file is actually unreadable after running icacls.
If the file is still readable, skip the test with a clear message.

This handles cases where the icacls command runs successfully but
doesn't actually deny read access (e.g., due to admin privileges or
UAC settings).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@fjakobs fjakobs temporarily deployed to test-trigger-is January 22, 2026 14:09 — with GitHub Actions Inactive
},
}

cmd.Flags().StringVar(&appName, "app-name", "", "Name of the app to import (if not specified, lists all apps)")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cmd.Flags().StringVar(&appName, "app-name", "", "Name of the app to import (if not specified, lists all apps)")
cmd.Flags().StringVar(&appName, "name", "", "Name of the app to import (if not specified, lists all apps)")

I would change this to --name so its consistent with the rest of the commands

@fjakobs fjakobs temporarily deployed to test-trigger-is January 22, 2026 14:31 — with GitHub Actions Inactive
@fjakobs fjakobs temporarily deployed to test-trigger-is January 22, 2026 14:40 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants