Skip to content

Commit 08a6413

Browse files
Fix CI: auto-discover OpenAPI spec and download in CI workflow
- Schema generator now auto-discovers .codegen/openapi.json relative to the repo root, removing the need for the DATABRICKS_OPENAPI_SPEC env var in the Makefile. - Add explicit "Download OpenAPI spec" step to CI workflow so the spec is available before schema validation. - Use curl --fail with retries instead of wget for spec download. - Sync annotations.yml with new PLACEHOLDER entries from latest SDK. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 963126c commit 08a6413

File tree

4 files changed

+646
-5
lines changed

4 files changed

+646
-5
lines changed

.github/workflows/push.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ jobs:
284284
go.sum
285285
bundle/internal/schema/*.*
286286
287+
- name: Download OpenAPI spec
288+
run: make .codegen/openapi.json
289+
287290
- name: Verify that the schema is up to date
288291
run: |
289292
if ! ( make schema && git diff --exit-code ); then

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ snapshot:
130130
snapshot-release:
131131
goreleaser release --clean --skip docker --snapshot
132132

133-
schema: .codegen/openapi.json
134-
DATABRICKS_OPENAPI_SPEC=.codegen/openapi.json go run ./bundle/internal/schema ./bundle/internal/schema ./bundle/schema/jsonschema.json
133+
schema:
134+
go run ./bundle/internal/schema ./bundle/internal/schema ./bundle/schema/jsonschema.json
135135

136-
schema-for-docs: .codegen/openapi.json
137-
DATABRICKS_OPENAPI_SPEC=.codegen/openapi.json go run ./bundle/internal/schema ./bundle/internal/schema ./bundle/schema/jsonschema_for_docs.json --docs
136+
schema-for-docs:
137+
go run ./bundle/internal/schema ./bundle/internal/schema ./bundle/schema/jsonschema_for_docs.json --docs
138138

139139
INTEGRATION = go run -modfile=tools/go.mod ./tools/testrunner/main.go ${GO_TOOL} gotestsum --format github-actions --rerun-fails --jsonfile output.json --packages "./acceptance ./integration/..." -- -parallel 4 -timeout=2h
140140

@@ -184,7 +184,7 @@ generate:
184184
go test ./bundle/internal/schema
185185

186186
.codegen/openapi.json: .codegen/_openapi_sha
187-
wget -O $@.tmp "https://openapi.dev.databricks.com/$$(cat $<)/specs/all-internal.json" && mv $@.tmp $@ && touch $@
187+
curl --fail --silent --show-error --retry 3 --retry-delay 5 -L -o $@.tmp "https://openapi.dev.databricks.com/$$(cat $<)/specs/all-internal.json" && mv $@.tmp $@ && touch $@
188188

189189
generate-direct: generate-direct-apitypes generate-direct-resources
190190
generate-direct-apitypes: bundle/direct/dresources/apitypes.generated.yml

0 commit comments

Comments
 (0)