Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the output of the databricks bundle init command #795

Merged
merged 15 commits into from
Oct 19, 2023

Conversation

lennartkats-db
Copy link
Contributor

Improve the output of help, prompts, and so on for databricks bundle init and the default template.

Among other things, this PR adds support for a new welcome_message property that lets a template print a custom message on success:

$ databricks bundle init
Template to use [default-python]:
Unique name for this project [my_project]: lennart_project
Include a stub (sample) notebook in 'lennart_project/src': yes
Include a stub (sample) Delta Live Tables pipeline in 'lennart_project/src': yes
Include a stub (sample) Python package in 'lennart_project/src': yes

✨ Your new project has been created in the 'lennart_project' directory!

Please refer to the README.md of your project for further instructions on getting started.
Or read the documentation on Databricks Asset Bundles at https://docs.databricks.com/dev-tools/bundles/index.html.

@lennartkats-db lennartkats-db marked this pull request as ready for review September 25, 2023 08:32
@lennartkats-db lennartkats-db changed the title Improve the output of the 'databricks bundle init' command Improve the output of the databricks bundle init command Sep 25, 2023
cmd/bundle/init.go Outdated Show resolved Hide resolved
libs/jsonschema/schema.go Outdated Show resolved Hide resolved
libs/template/renderer.go Outdated Show resolved Hide resolved
libs/template/materialize.go Show resolved Hide resolved
Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

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

Nice work, LGTM!

@mingyu89 @vladimirk-db Once this is merged and released, you could consider adding a message to the MLops stack template. Nice to have a call to action after initialization.

@shreyas-goenka Can you do the final approval?

libs/jsonschema/extension.go Outdated Show resolved Hide resolved
Copy link
Contributor

@shreyas-goenka shreyas-goenka left a comment

Choose a reason for hiding this comment

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

LGTM with some minor comments. Approving to unblock.

Let's keep the cobra.MaximumNArgs(1) unless there's a good reason not to.

cmd/bundle/init.go Show resolved Hide resolved
libs/template/config_test.go Show resolved Hide resolved
libs/template/config_test.go Show resolved Hide resolved
@lennartkats-db
Copy link
Contributor Author

I'll followup, needed to prioritize some roadmap/serverless work.

@lennartkats-db lennartkats-db added this pull request to the merge queue Oct 19, 2023
Merged via the queue into main with commit a2ee8bb Oct 19, 2023
4 checks passed
@lennartkats-db lennartkats-db deleted the tune-template-output branch October 19, 2023 07:14
shreyas-goenka added a commit that referenced this pull request Oct 19, 2023
CLI:
 * Fix rendering of streaming response ([#876](#876)).
 * Rename MLOps Stack to MLOps Stacks ([#881](#881)).
 * Support Python wheels larger than 10MB ([#879](#879)).
 * Improve the output of the `databricks bundle init` command ([#795](#795)).

Bundles:
 * **FILL THIS IN MANUALLY BY MOVING RELEVANT ITEMS FROM ABOVE LIST**

Internal:
 * **FILL THIS IN MANUALLY BY MOVING RELEVANT ITEMS FROM ABOVE LIST**
@shreyas-goenka shreyas-goenka mentioned this pull request Oct 19, 2023
github-merge-queue bot pushed a commit that referenced this pull request Oct 19, 2023
CLI:
* Fix rendering of streaming response
([#876](#876)).
 
Bundles:
* Rename MLOps Stack to MLOps Stacks
([#881](#881)).
* Support Python wheels larger than 10MB
([#879](#879)).
* Improve the output of the `databricks bundle init` command
([#795](#795)).
github-merge-queue bot pushed a commit that referenced this pull request Nov 7, 2023
## Changes
This PR removes validation for default value against the regex pattern
specified in a JSON schema at schema load time. This is required because
#795 introduces parameterising the
default value as a Go text template impling that the default value now
does not necessarily have to match the pattern at schema load time.

This will also unblock:
databricks/mlops-stacks#108

Note, this does not remove runtime validation for input parameters right
before template initialization, which happens here:
https://github.com/databricks/cli/blob/fb32e78c9b9fb000ce898b8a60b0b47920f487d3/libs/template/materialize.go#L76

## Tests
Changes to existing test.
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.

3 participants