Skip to content

Generate the boilerplate resource and lifecycle descriptions in the schema annotations - #7356

Draft
janniklasrose wants to merge 2 commits into
mainfrom
janniklasrose/schema-boilerplate-descriptions
Draft

janniklasrose wants to merge 2 commits into
mainfrom
janniklasrose/schema-boilerplate-descriptions

Conversation

@janniklasrose

Copy link
Copy Markdown
Member

Changes

./task generate-schema inserts PLACEHOLDER for every field without a description in bundle/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 the lifecycle field sentence. The generator now fills both from config.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, so TestRequiredAnnotationsForNewFields still catches undocumented fields.

Running the generator filled 18 entries that were still placeholders on main (13 resource-level descriptions and 5 lifecycle descriptions); jsonschema.json and 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-check is clean after the commits (schema, validation, direct and PyDABs output all consistent).
  • cd python && uv run pytest databricks_tests/core -q passes.

This pull request and its description were written by Isaac.

janniklasrose and others added 2 commits November 4, 2026 15:42
…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>
@janniklasrose janniklasrose added the new-resource-work Skills, docs and small refactors for onboarding new bundle resources label Nov 4, 2026
@github-actions github-actions Bot added the DABs DABs related issues label Nov 4, 2026
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: ae42b28

Run: 41862295928

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 271 15 7:15
✅​ aws-windows-latest-4core-16gb 273 13 4:43
✅​ azure linux-2core-8gb 270 15 7:03
✅​ azure-windows-latest-4core-16gb 272 13 4:17
✅​ gcp linux-2core-8gb 271 15 7:06
✅​ gcp-windows-latest-4core-16gb 273 13 4:30
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:32 gcp-windows-latest-4core-16gb TestAccept
3:31 aws-windows-latest-4core-16gb TestAccept
3:27 azure-windows-latest-4core-16gb TestAccept

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues new-resource-work Skills, docs and small refactors for onboarding new bundle resources

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants