Skip to content

Expose stage/release status in schema#5443

Open
janniklasrose wants to merge 8 commits into
mainfrom
janniklasrose/sdk-field-status-in-schema
Open

Expose stage/release status in schema#5443
janniklasrose wants to merge 8 commits into
mainfrom
janniklasrose/sdk-field-status-in-schema

Conversation

@janniklasrose
Copy link
Copy Markdown
Contributor

@janniklasrose janniklasrose commented Jun 4, 2026

Changes

Expose launch stage/release status in the bundle schema

Why

Non-GA fields should be annotated as such when viewing a bundle in IDEs.

Tests

Example vector search endpoint:

Enum with one GA, one PuPr:
Screenshot 2026-06-04 at 14 29 40

PuPr field without any annotation:
Screenshot 2026-06-04 at 14 29 49

Side fix: DEVELOPMENT enum values no longer leak into the schema

While wiring up per-enum-value metadata, we noticed the schema on main was emitting enum values that genkit drops from the SDK because they're tagged DEVELOPMENT in the OpenAPI spec (e.g. vectorsearch.EndpointType.STANDARD_ON_ORION — no Go constant exists, deploys with that value would fail server-side). The extractor was copying OpenAPI's enum list verbatim, never consulting x-databricks-enum-metadata.

Fixed in the same PR by filtering DEVELOPMENT values at extraction time so they never reach annotations_openapi.yml or the schema.

Add per-enum-value plumbing on top of the field-level launch-stage support:

- libs/jsonschema/extension.go: EnumMetadata + EnumValueMetadata for parsing
  x-databricks-enum-metadata from the OpenAPI spec; EnumDescriptionMap for
  x-databricks-enum-descriptions; EnumDescriptions []string for the output
  schema's parallel enumDescriptions array.
- bundle/internal/annotation/descriptor.go: EnumLaunchStages and
  EnumDescriptions maps so the per-value data persists in annotations_openapi.yml.
- bundle/internal/schema/parser.go: extractEnumLaunchStages and
  extractEnumDescriptions helpers; wired into extractAnnotations on both the
  root-type and per-property paths.
- bundle/internal/schema/annotations.go: buildEnumDescriptions builds the
  parallel []string aligned 1:1 with Enum. enumDescriptionLabel formats one
  entry; previewTagShort returns the compact bracketed label ([PuPr], [Beta],
  [PrPr]) so VSCode can render per-value status next to each enum value in
  autocomplete dropdowns.
- Unit tests cover buildEnumDescriptions (all paths, including non-string
  entries), extractEnumLaunchStages, extractEnumDescriptions, and
  assignAnnotation's per-value behavior.

Schema regeneration is deferred until the DEVELOPMENT-value filter lands in
the next commit, so we only regenerate once.

Co-authored-by: Isaac
Genkit drops DEVELOPMENT-stage enum values when generating the SDK, so the
SDK Go types have no constants for them. The CLI's annotation extractor
didn't mirror that and copied the OpenAPI spec's enum list verbatim,
causing values like vectorsearch.EndpointType.STANDARD_ON_ORION to land in
bundle/schema/jsonschema.json on every regen. IDE schema validation would
accept them; deploys would fail server-side.

Fix:

- bundle/internal/schema/parser.go: add filterDevelopmentEnumValues helper
  that drops any enum value whose x-databricks-enum-metadata marks it
  DEVELOPMENT. Wire it into extractAnnotations on both the root-type and
  per-property paths (Enum: filterDevelopmentEnumValues(...)). Also skip
  DEVELOPMENT entries in extractEnumLaunchStages and extractEnumDescriptions
  so the per-value metadata can't reintroduce the value names through a
  side channel.
- bundle/internal/schema/annotations_test.go: add TestFilterDevelopmentEnumValues
  and extend the per-value extraction tests with DEVELOPMENT cases.
- bundle/internal/schema/illegal-enum-in-schema.md: document why the filter
  exists (genkit's behavior is the source of truth) so future readers
  don't reintroduce the divergence.
- bundle/internal/schema/sync-missing-annotations.md: track an orthogonal
  follow-up (stale PLACEHOLDER entries in annotations.yml) that surfaced
  while validating this work.
- Regenerated bundle/internal/schema/annotations_openapi.yml,
  bundle/schema/jsonschema.json, bundle/schema/jsonschema_for_docs.json
  with the filter active. STANDARD_ON_ORION and any other DEVELOPMENT-stage
  enum values are gone.

Co-authored-by: Isaac
The DEVELOPMENT case in previewTag was dead code: extractAnnotations
in parser.go already returns early for DEVELOPMENT-stage types/properties,
so a DEVELOPMENT value never reaches assignAnnotation. If it ever did
(e.g. via a hand-edited annotation file), the previous behavior would
leak a [Development] marker into the public schema — exactly what we
filter out elsewhere. The companion previewTagShort already returned ""
for DEVELOPMENT; this restores consistency between the two.

Co-authored-by: Isaac
The legacy x-databricks-preview extension's PUBLIC value literally means
"Public Preview" per the upstream source at
universe/openapi/openapi/openapi.go:

  PrivatePreviewType: "PRIVATE"
  PublicPreviewType:  "PUBLIC"   // ← Public Preview, not GA
  GAPreviewType:      "GA"

  func (pt PreviewType) IsPublicPreview() bool { return pt == PublicPreviewType }

The CLI's annotation extractor was stripping PUBLIC in normalizePreview
(treating it as a GA-equivalent default), losing the preview signal for
any field that only carried the legacy extension. In practice the modern
x-databricks-launch-stage is the primary source today, but PUBLIC could
silently shadow real preview status if a spec entry has only the legacy
field set.

Fix:

- bundle/internal/schema/parser.go: normalizePreview now drops only
  empty/UNKNOWN/GA values; PUBLIC and PRIVATE are preserved.
- bundle/internal/schema/annotations.go: previewTag maps PUBLIC ->
  [Public Preview] alongside the existing PRIVATE -> [Private Preview]
  fallback. Launch stage still wins precedence when both are set, so a
  field with both PUBLIC and PUBLIC_PREVIEW only gets one [Public Preview]
  prefix.
- prefixWithPreviewTag is hardened against double-tagging: if the
  description already starts with the tag, it's returned unchanged.
- Unit tests cover the table of (launchStage, preview) combinations,
  the no-double-tag guarantee on the helper, and the assignAnnotation
  scenarios that exercise the new fallback. Test-only at the helper
  level so we don't assert against the same fact across multiple
  generated files.
- Regenerated annotations_openapi.yml and both jsonschema files now
  carry x-databricks-preview: PUBLIC entries for fields tagged that way
  in the spec; their descriptions show [Public Preview] exactly once.

Co-authored-by: Isaac
Comment thread bundle/docsgen/main.go
@@ -139,13 +139,51 @@ func assignAnnotation(s *jsonschema.Schema, a annotation.Descriptor) {
s.Deprecated = true
s.DeprecationMessage = a.DeprecationMessage
}
if a.Preview == "PRIVATE" {
s.DoNotSuggest = true
if a.Preview != "" {
Copy link
Copy Markdown
Contributor

@ilyakuz-db ilyakuz-db Jun 5, 2026

Choose a reason for hiding this comment

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

@shreyas-goenka do we still use docsgen?

Brings in SDK bump v0.132.0 -> v0.141.0 (OpenAPI sha a499dda -> c68a27fa).
Conflicts were limited to three generated schema files:

- bundle/internal/schema/annotations_openapi.yml: hand-merged as the union
  of main's new SDK content (fields, types, rewritten descriptions) and this
  branch's x-databricks-launch-stage / x-databricks-enum-launch-stages
  annotations. This file is produced by a non-standard genkit that emits
  launch-stage, so it cannot be regenerated from the universe master
  toolchain without wiping the 390 launch-stage annotations.

  Enum-value conflicts were resolved using the branch's own rule (see
  filterDevelopmentEnumValues in parser.go): genkit drops DEVELOPMENT-stage
  values from the SDK, so a value is dropped iff it has no Go SDK constant at
  v0.141.0. Dropped: CREATE_FEATURE, READ_FEATURE (catalog.Privilege);
  UPGRADING (database.DatabaseInstanceState); FILE
  (pipelines.FileIngestionOptionsFileFormat); FILE_PERMISSION,
  GROUP_MEMBERSHIP (GoogleDrive/Sharepoint EntityType); AVRO, PROTOBUF
  (pipelines.TransformerFormat). Kept GPU_XLARGE (present in the SDK).

- bundle/schema/jsonschema.json, bundle/schema/jsonschema_for_docs.json:
  regenerated from the resolved annotations via
  `go run ./bundle/internal/schema` (no DATABRICKS_OPENAPI_SPEC, so the
  hand-merged annotations_openapi.yml is consumed, not overwritten).

reference.md / resources.md are left at main's v0.141.0 output; the branch's
docsgen launch-stage prefixes were not yet applied to the human docs (also
true before this merge).

Co-authored-by: Isaac
Follow-up to the origin/main merge, addressing review feedback on stale
generated artifacts and previewTag drift.

- bundle/docsgen/main.go: previewTag had drifted from the schema-side copy in
  bundle/internal/schema/annotations.go — it still mapped DEVELOPMENT to
  [Development] and lacked the legacy x-databricks-preview PUBLIC ->
  [Public Preview] fallback. Aligned the two and noted the keep-in-sync
  invariant.

- bundle/docsgen/output/{reference,resources}.md: regenerated. The docsgen
  launch-stage prefixes added on this branch had never been applied to the
  committed docs; they now match jsonschema.json (e.g. budget_policy_id is
  tagged [Public Preview], no [Development] markers leak).

- python/databricks/bundles/**: regenerated via pydabs-codegen, which reads
  bundle/schema/jsonschema.json. Picks up the launch-stage prefixes and drops
  the DEVELOPMENT enum values filtered from the schema (catalog.Privilege
  loses CREATE_FEATURE/READ_FEATURE/etc.; pipelines.TransformerFormat loses
  AVRO/PROTOBUF), keeping the Python models consistent with the Go schema.

- bundle/internal/schema/parser.go: defer creating the per-type annotation
  map until after the DEVELOPMENT early-return, so a DEVELOPMENT root type no
  longer leaves an empty package entry in annotations_openapi.yml.

Co-authored-by: Isaac
@janniklasrose janniklasrose marked this pull request as ready for review June 8, 2026 11:25
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 8, 2026

Approval status: pending

/bundle/ - needs approval

10 files changed
Suggested: @pietern
Also eligible: @shreyas-goenka, @andrewnester, @denik, @lennartkats-db, @anton-107

/internal/ - needs approval

Files: internal/genkit/tagging.py.lock
Suggested: @simonfaltum
Also eligible: @tanmay-db, @rauchy, @parthban-db, @renaudhartert-db, @hectorcast-db, @Divyansh-db, @tejaskochar-db, @mihaimitrea-db, @chrisst

General files (require maintainer)

69 files changed
Based on git history:

  • @simonfaltum -- recent work in python/databricks/bundles/pipelines/_models/, bundle/schema/, bundle/internal/schema/

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db) can approve all areas.
See OWNERS for ownership rules.

@eng-dev-ecosystem-bot
Copy link
Copy Markdown
Collaborator

Commit: a4089fd

Run: 27134356101

Env 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 7 15 261 923 5:55
💚​ aws windows 7 15 263 921 8:03
💚​ aws-ucws linux 7 15 357 837 6:55
💚​ aws-ucws windows 7 15 359 835 11:56
💚​ azure linux 1 17 264 921 5:35
💚​ azure windows 1 17 266 919 9:14
💚​ azure-ucws linux 1 17 362 833 8:01
💚​ azure-ucws windows 1 17 364 831 9:55
💚​ gcp linux 1 17 260 924 7:02
🔄​ gcp windows 3 17 260 922 10:29
24 interesting tests: 15 SKIP, 6 RECOVERED, 3 flaky
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
🔄​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 🔄​f
🔄​ TestAccept/bundle/destroy/jobs-and-pipeline ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f
🔄​ TestAccept/bundle/destroy/jobs-and-pipeline/DATABRICKS_BUNDLE_ENGINE=direct ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/resources/postgres_branches/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/replace_existing 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/update_protected 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/without_branch_id 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_projects/update_display_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/grants/select 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
Top 24 slowest tests (at least 2 minutes):
duration env testname
4:58 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:56 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:55 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:49 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:52 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:39 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:34 aws-ucws windows TestAccept
3:34 azure windows TestAccept
3:28 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:26 aws windows TestAccept
3:22 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:19 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:13 azure-ucws windows TestAccept
3:07 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:02 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:57 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:54 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:52 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:45 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:37 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:32 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:26 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:24 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:23 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct

@janniklasrose janniklasrose enabled auto-merge June 8, 2026 12:35
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