Skip to content

fix: prompt for required resources in apps init --features on a terminal - #6912

Open
MarioCadenas wants to merge 2 commits into
mainfrom
fix/apps-init-features-tty-required-resources
Open

MarioCadenas wants to merge 2 commits into
mainfrom
fix/apps-init-features-tty-required-resources

Conversation

@MarioCadenas

Copy link
Copy Markdown
Contributor

Changes

When databricks apps init runs in a terminal with --features and without --name, it skipped both the resource prompts and the required-resource check. The scaffold then declared required variables (for example postgres_branch, sql_warehouse_id) with no value, and bundle validate / deploy failed with no value assigned to required variable ....

  • In that path, apps init now prompts for each required resource that --set did not provide, using the existing pickers (promptForResource, so the Postgres project/branch/database picker, the warehouse picker, and so on). Optional resources are not prompted.
  • The existing resolve-and-validate step now also runs in that path, before any project files are written, so an unresolved required resource fails with the existing missing required resource ... (use --set ...) error.
  • The deploy/run prompt in that path now comes after the resource prompts, matching the fully interactive flow.

Unchanged: flags mode (--name), the fully interactive flow (no --features), pre-rendered templates, and agentic mode (DATABRICKS_APPS_AGENTIC_MODE, which still skips prompts and validation).

Why

This is pre-existing: the resource prompts have been skipped for --features since #4469, and the validation only covered flags/non-interactive mode. The released v1.17.0 CLI reproduces it. It is independent of the execution-identity work (#6886, #6903).

Tests

  • Unit: hasResourceValue, and promptForMissingResources does not prompt for resources that already have values (from --set).
  • go test ./cmd/apps/... ./libs/apps/... and the apps / quickstart acceptance tests pass; existing outputs are unchanged.
  • Manually, in a pseudo-terminal driven by expect against the AppKit template and a real workspace:
    • --features analytics: the warehouse picker appears; sql_warehouse_id is set; bundle validate passes.
    • --features lakebase: the Postgres project, branch, and database pickers appear; postgres_branch / postgres_database are set; bundle validate passes.
    • --features analytics --set analytics.sql-warehouse.id=...: no picker; the --set value is used.
    • Agentic mode with --features lakebase: no prompts, same output as before.
  • The terminal prompts are not covered by automated tests (no TTY in the test harness).

This pull request and its description were written by Isaac.

With --features (and no --name) on a terminal, apps init skipped both the
resource prompts and the required-resource check, so it scaffolded a project
whose databricks.yml declared required variables with no value and deploy
failed. Prompt for required resources that --set did not provide, then run the
existing resolve and validation step before any project files are written.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
@MarioCadenas
MarioCadenas requested review from a team as code owners October 2, 2026 09:33
@MarioCadenas
MarioCadenas requested a review from anton-107 October 2, 2026 09:33
Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 89d0c96

Run: 36990523870

Env ✅​pass 🙈​skip Time
✅​ aws linux 276 15 5:38
✅​ aws windows 278 13 5:34
✅​ azure linux 275 15 5:31
✅​ azure windows 277 13 6:25
✅​ gcp linux 276 15 5:32
✅​ gcp windows 278 13 4:52
Top 6 slowest tests (at least 2 minutes):
duration env testname
6:22 azure windows TestAccept
5:31 aws windows TestAccept
4:49 gcp windows TestAccept
2:59 azure linux TestAccept
2:58 gcp linux TestAccept
2:57 aws linux TestAccept

This branch has not been deployed

No deployments
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.

2 participants