Repository navigation
Check that the CLI's Go SDKs match the releases its generated files describe - #7823
parthban-db wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Automated review at 978b9e7. Each finding was verified against the code.
No blocking issues found. 1 non-blocking comment(s) below.
This PR adds task check-go-sdks, a Python CI check that validates the CLI's Go SDK versions match the releases its generated files describe. The classic-SDK half of the check (comparing .codegen/_openapi_sha with the SDK's _last_sha) duplicates TestConsistentDatabricksSdkVersion, which already runs in CI. The sdk-go module half is well-structured but currently gated behind a file that doesn't exist yet. The implementation is correct; the duplication should be resolved.
| classic_sha = f.read().strip() | ||
| with open(".codegen/_openapi_sha") as f: | ||
| openapi_sha = f.read().strip() | ||
| if openapi_sha != classic_sha: |
There was a problem hiding this comment.
[nice to have] The openapi_sha != classic_sha comparison checks the same invariant as TestConsistentDatabricksSdkVersion in internal/build/sdk_consistency_test.go (lines 20–52), which already runs in CI through test-unit-root. Both read the databricks-sdk-go version from go.mod, obtain its .codegen/_last_sha, and compare it with .codegen/_openapi_sha — the Go test via an HTTP fetch, this script via go mod download. Can one of them be removed, or does having both serve a purpose the existing test doesn't?
✅ Integration test reportCommit: 19288b1
Top 5 slowest tests (at least 2 minutes):
|
978b9e7 to
a1c21a0
Compare
…escribe Co-authored-by: Isaac <no-reply@databricks.com>
a1c21a0 to
19288b1
Compare
Changes
Adds
task check-go-sdks, which runs intask checksand so in CI. It fails when the CLI's two Go SDKs and its generated files don't describe the same release:.codegen/_openapi_sha, which.codegen/cli.jsonwas generated from, must be the Universe commit that the classic Go SDK ingo.modwas released from (its.codegen/_last_sha).climod/.codegen/_last_shanames the Universe commit of thesdk-gorelease thatclimod/was generated from. That must be a published (tagged)sdk-gorelease, and everygithub.com/databricks/sdk-go/...module ingo.modmust be at its version in that release: the top release in the package'sCHANGELOG.mdat the release commit, whose tag must exist, read and tagged the way genkitapply-tagdoes.Until
climod/is first generated, it has no_last_shaand only the first check runs, so the check passes onmaintoday.Why
The CLI uses both Go SDKs, so their versions and the generated
cli.jsonandclimod/have to describe the same API. The daily Go SDK update keeps them aligned: https://github.com/databricks-eng/universe/pull/3168251 makes it generateclimod/from the newestsdk-gorelease at or before the classic release's commit and record that commit inclimod/.codegen/_last_sha, and https://github.com/databricks-eng/universe/pull/3170943 makes it pin thesdk-gomodules to that release the same way. This check catches a change that breaks the alignment, such as bumping ansdk-gomodule by hand. It can't check that thesdk-gorelease is at or before the classic release's commit, because that needs Universe's history; the update enforces it.Tests
tools/test_check_go_sdks.pyruns against a local repository: finding the tagged release for a commit skips an untagged release and a tagged commit without the marker; matching versions pass; a version that differs from the release's, a module whose release version has no tag yet, and a marker with no release fail../task check-go-sdkspasses on this branch.climod/.codegen/_last_shaset to the Universe commit ofsdk-go's Nov 18 release, the check reports thatgo.modpinsfilesv0.3.0 while that release has v0.8.0, and passesauth,coreandoptions. With a commit that no release came from, it reports that.This pull request and its description were written by Isaac.