Skip to content

Commit 76cfac5

Browse files
committed
Surface field launch stage in the bundle schema from cli.json
Read launch_stage, enum_launch_stages and enum_descriptions from the checked-in .codegen/cli.json and surface them in the generated bundle schema and docs: - Prefix field descriptions with [Public Preview] / [Public Beta] / [Private Preview] so the stage shows in editor hover tooltips. - Emit the parallel enumDescriptions array so VSCode renders a per-value stage label and description in autocomplete dropdowns. - Carry the raw x-databricks-launch-stage alongside the existing x-databricks-preview, and hide PRIVATE_PREVIEW fields via doNotSuggest. cli.json is filtered upstream at min-stage=PRIVATE_PREVIEW, so no DEVELOPMENT surface reaches the extractor and launch_stage is already clean (GA plus the three preview stages). The OpenAPI-spec-based DEVELOPMENT filtering and preview normalization the earlier version carried are no longer needed. assignAnnotation flags an open question (in a comment) on whether either x-databricks-preview or x-databricks-launch-stage is consumed downstream of the published schema, pending confirmation with the team. Regenerated jsonschema.json, jsonschema_for_docs.json, annotations_openapi.yml and the bundle docs. Co-authored-by: Isaac
1 parent ea21ed6 commit 76cfac5

13 files changed

Lines changed: 4461 additions & 1185 deletions

File tree

bundle/docsgen/main.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,39 @@ func assignAnnotation(s *jsonschema.Schema, a annotation.Descriptor) {
143143
s.DoNotSuggest = true
144144
s.Preview = a.Preview
145145
}
146+
if a.LaunchStage != "" {
147+
s.LaunchStage = a.LaunchStage
148+
if a.LaunchStage == "PRIVATE_PREVIEW" {
149+
s.DoNotSuggest = true
150+
}
151+
}
146152
if a.OutputOnly != nil && *a.OutputOnly {
147153
s.DoNotSuggest = true
148154
}
155+
156+
if tag := previewTag(a.LaunchStage); tag != "" {
157+
if s.Description != "" {
158+
s.Description = tag + " " + s.Description
159+
} else {
160+
s.Description = tag
161+
}
162+
}
163+
}
164+
165+
// previewTag returns the human-readable launch-stage prefix to prepend to a
166+
// field's description in the generated docs.
167+
//
168+
// Keep this in sync with previewTag in bundle/internal/schema/annotations.go.
169+
func previewTag(launchStage string) string {
170+
switch launchStage {
171+
case "PRIVATE_PREVIEW":
172+
return "[Private Preview]"
173+
case "PUBLIC_BETA":
174+
return "[Public Beta]"
175+
case "PUBLIC_PREVIEW":
176+
return "[Public Preview]"
177+
}
178+
return ""
149179
}
150180

151181
func fillTemplateVariables(s string) string {

bundle/docsgen/output/reference.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)