fix: prompt for required resources in apps init --features on a terminal - #6912
Open
MarioCadenas wants to merge 2 commits into
Open
MarioCadenas wants to merge 2 commits into
MarioCadenas wants to merge 2 commits into
Conversation
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>
Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Collaborator
Integration test reportCommit: 89d0c96
Top 6 slowest tests (at least 2 minutes):
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
When
databricks apps initruns in a terminal with--featuresand without--name, it skipped both the resource prompts and the required-resource check. The scaffold then declared required variables (for examplepostgres_branch,sql_warehouse_id) with no value, andbundle validate/ deploy failed withno value assigned to required variable ....apps initnow prompts for each required resource that--setdid 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.missing required resource ... (use --set ...)error.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
--featuressince #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
hasResourceValue, andpromptForMissingResourcesdoes not prompt for resources that already have values (from--set).go test ./cmd/apps/... ./libs/apps/...and theapps/quickstartacceptance tests pass; existing outputs are unchanged.expectagainst the AppKit template and a real workspace:--features analytics: the warehouse picker appears;sql_warehouse_idis set;bundle validatepasses.--features lakebase: the Postgres project, branch, and database pickers appear;postgres_branch/postgres_databaseare set;bundle validatepasses.--features analytics --set analytics.sql-warehouse.id=...: no picker; the--setvalue is used.--features lakebase: no prompts, same output as before.This pull request and its description were written by Isaac.