Repository navigation
Generate the boilerplate resource and lifecycle descriptions in the schema annotations - #7356
Draft
janniklasrose wants to merge 2 commits into
Draft
janniklasrose wants to merge 2 commits into
janniklasrose wants to merge 2 commits into
Conversation
…chema annotations The generator now fills the resource-level description and the lifecycle field description when an entry is missing or a placeholder, instead of inserting PLACEHOLDER. Hand-written text is never replaced, and PLACEHOLDER is still used for all other undocumented fields. The filled text is written into annotations.yml. Co-authored-by: Isaac <no-reply@databricks.com>
The lifecycle field descriptions that the schema generator now fills in are reflected in the generated PyDABs dataclasses. Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
Integration test reportCommit: ae42b28
Top 3 slowest tests (at least 2 minutes):
|
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
./task generate-schemainsertsPLACEHOLDERfor every field without a description inbundle/internal/schema/annotations.yml. Two of those descriptions are the same for every resource type and were copied by hand each time: the resource-level sentence ("The X definitions for the bundle, where each key is the name of the X.") and thelifecyclefield sentence. The generator now fills both fromconfig.SupportedResources()and one constant when the entry is missing or still a placeholder. Hand-written text is never replaced, and every other field keeps the placeholder behaviour, soTestRequiredAnnotationsForNewFieldsstill catches undocumented fields.Running the generator filled 18 entries that were still placeholders on main (13 resource-level descriptions and 5
lifecycledescriptions);jsonschema.jsonand the five PyDABs models that embed the lifecycle text are regenerated accordingly. A unit test covers a new resource type receiving both texts instead of placeholders.The generated resource-level text lowercases the singular name, so acronyms read as plain words; a hand edit to the entry is preserved on the next run.
Why
A new resource type should not require hand-pasting two sentences into a generated file, and the ones that forgot shipped with placeholders in the published schema.
Tests
go test ./bundle/internal/schema/... -count=1, including the new test../task generate-checkis clean after the commits (schema, validation, direct and PyDABs output all consistent).cd python && uv run pytest databricks_tests/core -qpasses.This pull request and its description were written by Isaac.