Repository navigation
Generate the modular Go SDK's field mapping in climod with genkit's cli-mod mode - #7268
Draft
parthban-db wants to merge 1 commit into
Draft
parthban-db wants to merge 1 commit into
parthban-db wants to merge 1 commit into
Conversation
Collaborator
Integration test reportCommit: 6917043
Top 6 slowest tests (at least 2 minutes):
|
parthban-db
force-pushed
the
parthban/sdk-go-field-paths
branch
from
October 30, 2026 17:39
eb8f623 to
9c36f74
Compare
…li-mod mode The modular Go SDK's structs carry no JSON tags, and its names differ from the classic SDK names in .codegen/cli.json. task generate-clijson now also runs genkit's cli-mod mode on climod/, which writes climod/.codegen/sdk-go-field-paths.txt, with every request and response field's Go path next to its JSON path, and climod/.codegen/cli.json, with the same mapping per message. Co-authored-by: Isaac <no-reply@databricks.com>
parthban-db
force-pushed
the
parthban/sdk-go-field-paths
branch
from
October 30, 2026 18:05
9c36f74 to
6917043
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Adds
climod/, a genkit target in the newcli-modmode, which maps every field of the modular Go SDK (github.com/databricks/sdk-go) to its JSON path. It generates two files from the same data:climod/.codegen/sdk-go-field-paths.txt, the mapping for people. For each request and response message, it lists every field's Go path next to the JSON path that the SDK writes:A oneof member's Go path goes through the oneof field, while its JSON path doesn't, for example
Spec.Expiration.Ttlandspec.ttl.[*]is a list element and.*is a map value, the same notation aslibs/structs/structpath.climod/.codegen/cli.json, the same mapping for code, in the shape of.codegen/cli.json. Each message is keyed by package path and Go type, and each field by its JSON name, with the Go path and arefto nested messages:task generate-clijsonnow also builds the Go SDK's proto descriptor set at the pinned Universe commit and runsgenkit experimental-update-sdk --dir climodto refresh both files.Why
The modular Go SDK's public structs carry no JSON tags, so a developer can't tell from the Go type which JSON field a struct field becomes. Its names also differ from the classic SDK's names in
.codegen/cli.json, for examplepostgres/v1.BranchSpecwith the oneofExpiration, againstpostgres.BranchSpecwith a plainttlfield. So the files come from the Go SDK's own proto view, through a genkit mode like the SDKs', rather than from the OpenAPI spec. The mode can grow to carry more of what the CLI needs about the modular SDK.This PR depends on the genkit change that adds the
cli-modmode, which hasn't merged in Universe yet. Until.codegen/_openapi_shapoints at a Universe commit that has the mode,task generate-clijsonfails at the new step, so this PR should merge only after that pin bump. The committed files were generated from the Universe change itself. The automated SDK bumper runsupdate-sdkon its own and doesn't refreshclimod/yet; that is a follow-up.Tests
cli.jsonhas 2,975 messages, and everyrefresolves to a schema in the file.Taskfile.ymlparses. I didn't runtask generate-clijsonend to end, because the pinned Universe commit doesn't have the new mode yet.This pull request and its description were written by Isaac.