Skip to content

Use interactive prompt to select resource to run if not specified#762

Merged
pietern merged 2 commits intomainfrom
bundle-run-prompt
Sep 11, 2023
Merged

Use interactive prompt to select resource to run if not specified#762
pietern merged 2 commits intomainfrom
bundle-run-prompt

Conversation

@pietern
Copy link
Copy Markdown
Contributor

@pietern pietern commented Sep 11, 2023

Changes

Display an interactive prompt with a list of resources to run if one isn't specified and the command is run interactively.

Tests

Manually confirmed:

  • The new prompt works
  • Shell completion still works
  • Specifying a key argument still works

@lennartkats-db
Copy link
Copy Markdown
Contributor

@pietern Nice! Could you include a screenshot?

@pietern
Copy link
Copy Markdown
Contributor Author

pietern commented Sep 11, 2023

Same prompter as we use for other commands:
Screenshot 2023-09-11 at 11 59 19

@fjakobs
Copy link
Copy Markdown
Contributor

fjakobs commented Sep 11, 2023

Love it!

@lennartkats-db
Copy link
Copy Markdown
Contributor

Niice! @pietern shouldn't the base question UI that is used here actually show the prompt before the search box?

Please choose which resource to run
Search: |
[dev pieter-noordhuis] ...
[dev pieter-noordhuis] ...

instead of

Search: |
Resource to run
[dev pieter-noordhuis] ...
[dev pieter-noordhuis] ...

@pietern
Copy link
Copy Markdown
Contributor Author

pietern commented Sep 11, 2023

@lennartkats-db The prompting library doesn't support switching it around.

If we end up replacing it at some point we could fix that.

@lennartkats-db
Copy link
Copy Markdown
Contributor

Ok. I wonder if that could be worked around by printing the prompt ourselves and leaving the prompt passed to the library empty? In any case, certainly not blocking for this work.

@pietern
Copy link
Copy Markdown
Contributor Author

pietern commented Sep 11, 2023

@lennartkats-db The prompt library removes that prompt label from the output once selected, which is nice. If we print this to stderr ourselves we wouldn't (without doing ANSI magic ourselves).

@pietern pietern added this pull request to the merge queue Sep 11, 2023
Merged via the queue into main with commit a2775f8 Sep 11, 2023
@pietern pietern deleted the bundle-run-prompt branch September 11, 2023 18:07
lennartkats-db added a commit that referenced this pull request Sep 12, 2023
pietern added a commit that referenced this pull request Sep 12, 2023
This release marks the public preview phase of Databricks Asset Bundles.

For more information, please refer to our online documentation at
https://docs.databricks.com/en/dev-tools/bundles/.

CLI:
 * Prompt once for a client profile ([#727](#727)).

Bundles:
 * Use clearer error message when no interpolation value is found. ([#764](#764)).
 * Use interactive prompt to select resource to run if not specified ([#762](#762)).
 * Add documentation link bundle command group description ([#770](#770)).
@pietern pietern mentioned this pull request Sep 12, 2023
github-merge-queue bot pushed a commit that referenced this pull request Sep 12, 2023
This release marks the public preview phase of Databricks Asset Bundles.

For more information, please refer to our online documentation at
https://docs.databricks.com/en/dev-tools/bundles/.

CLI:
* Prompt once for a client profile
([#727](#727)).

Bundles:
* Use clearer error message when no interpolation value is found.
([#764](#764)).
* Use interactive prompt to select resource to run if not specified
([#762](#762)).
* Add documentation link bundle command group description
([#770](#770)).
hectorcast-db pushed a commit that referenced this pull request Oct 13, 2023
## Changes

Display an interactive prompt with a list of resources to run if one
isn't specified and the command is run interactively.

## Tests

Manually confirmed:
* The new prompt works
* Shell completion still works
* Specifying a key argument still works
hectorcast-db pushed a commit that referenced this pull request Oct 13, 2023
This release marks the public preview phase of Databricks Asset Bundles.

For more information, please refer to our online documentation at
https://docs.databricks.com/en/dev-tools/bundles/.

CLI:
* Prompt once for a client profile
([#727](#727)).

Bundles:
* Use clearer error message when no interpolation value is found.
([#764](#764)).
* Use interactive prompt to select resource to run if not specified
([#762](#762)).
* Add documentation link bundle command group description
([#770](#770)).
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.

4 participants