databricks-cli/bundle/schema
shreyas-goenka 9a51f72f0b
Make bundle and sync fields optional (#757)
## Changes
This PR:
1. Makes the bundle and sync properties optional in the generated
schema.
2. Fixes schema generation that was broken due to a rogue "description"
field in the bundle docs.

## Tests
Tested manually. The generated schema no longer has "bundle" and "sync"
marked as required.
2023-09-11 08:16:22 +00:00
..
docs Make bundle and sync fields optional (#757) 2023-09-11 08:16:22 +00:00
README.md Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
docs.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
docs_test.go Add JSON schema validation for input template parameters (#598) 2023-08-01 14:09:27 +00:00
openapi.go Support Model Serving Endpoints in bundles (#682) 2023-09-07 21:54:31 +00:00
openapi_test.go Add JSON schema validation for input template parameters (#598) 2023-08-01 14:09:27 +00:00
schema.go Add internal tag for bundle fields to be skipped from schema (#636) 2023-08-10 10:03:52 +00:00
schema_test.go Add internal tag for bundle fields to be skipped from schema (#636) 2023-08-10 10:03:52 +00:00
tracker.go Use tracker for reference loop tracking (#252) 2023-03-16 12:57:57 +01:00

README.md

Overview

docs/bundle_descriptions.json contains both autogenerated as well as manually written descriptions for the json schema. Specifically

  1. resources : almost all descriptions are autogenerated from the OpenAPI spec
  2. targets : almost all descriptions are copied over from root level entities (eg: bundle, artifacts)
  3. bundle : manually editted
  4. include : manually editted
  5. workspace : manually editted
  6. artifacts : manually editted

These descriptions are rendered in the inline documentation in an IDE

SOP: Add schema descriptions for new fields in bundle config

  1. You can autogenerate empty descriptions for the new fields by running databricks bundle schema --only-docs > ~/databricks/bundle/schema/docs/bundle_descriptions.json
  2. Manually edit bundle_descriptions.json to add your descriptions
  3. Build again to embed the new bundle_descriptions.json into the binary (go build)
  4. Again run databricks bundle schema --only-docs > ~/databricks/bundle/schema/docs/bundle_descriptions.json to copy over any applicable descriptions to targets
  5. push to repo

SOP: Update descriptions in resources from a newer openapi spec

  1. Run databricks bundle schema --only-docs --openapi PATH_TO_SPEC > ~/databricks/bundle/schema/docs/bundle_descriptions.json
  2. push to repo