Generate all public-preview and GA PyDABs resources - #6528
Merged
Sankalp-Mittal merged 63 commits intoSep 8, 2026
Conversation
test_add_resource_type and test_add_resource_type_dict had byte-identical bodies, both feeding dict_example, so the add_<resource>(dataclass) normalization path went untested for the parametrized resources. Feed dataclass_example to the non-_dict variant, mirroring test_add_job vs test_add_job_dict. Co-authored-by: Isaac <no-reply@databricks.com>
Stop hand-writing a TestCase per resource in test_resources.py. A new codegen step (generated_test_cases.py, rendered from test_case.py.tmpl) synthesizes dict_example and dataclass_example for every wired resource from the schema model and writes one file per resource under databricks_tests/core/_generated/, collected into test_cases. A newly wired resource now gets its unit-test coverage for free. dict_example and dataclass_example are rendered two independent ways from one synthesized value tree, so the dict->dataclass _transform assertion stays meaningful. Field policy: required fields fully expanded, plus optional composite fields on the resource itself; nested objects contribute only their required fields, which bounds example size and avoids the recursive Task/ForEachTask schema. Optional scalar, deprecated, and private-preview fields are omitted. The hand-written TestCase dataclass moves to _resource_test_case.py so the generated modules can import it without a cycle. Co-authored-by: Isaac <no-reply@databricks.com>
The generator source lives outside databricks/databricks_tests, so pydabs-codegen's targeted ruff --fix does not reach it, but the root ruff check does. Sort imports and merge the two startswith calls into a single tuple call. No change to generated output. Co-authored-by: Isaac <no-reply@databricks.com>
The schema generator only emitted x-databricks-launch-stage for private-preview fields, bundling two concerns in one branch: hiding private-preview fields from editor completions (DoNotSuggest) and emitting the machine-readable launch stage. Downstream codegen could therefore only distinguish private-preview from everything else. Split the two concerns: DoNotSuggest stays private-preview-only, while every field the contract stamps with a launch stage — GA, PUBLIC_BETA, PUBLIC_PREVIEW, PRIVATE_PREVIEW — now emits x-databricks-launch-stage so downstream tooling can read each field's stability. A field the contract leaves unstamped stays unmarked rather than defaulting to GA, via the new parseFieldLaunchStage (the enum path keeps dropping GA, unchanged). Regenerated jsonschema.json. pydabs codegen is unaffected (it branches only on PRIVATE_PREVIEW), so python/databricks/bundles is unchanged. Co-authored-by: Isaac <no-reply@databricks.com>
…lease-version' into sankalp-mittal/pydabs-gen-unit-tests
launchStageOverrides maps whole resource Go-types to a launch stage
(the Postgres* resources at Public Beta), but OverrideLaunchStage was
only applied to fields, so the type's own (self) schema stayed
unstamped. Apply the override to the type descriptor too: the contract
carries no type-level stage, so passing GA ("") returns the override
when one is set, else "". The self descriptor already flows through
assignAnnotation, so the type-level x-databricks-launch-stage now lands
in jsonschema.json.
This makes launchStageOverrides a per-resource stability registry that
tags both the type and its fields.
Regenerated jsonschema.json: the 7 Postgres* resource types gain the
type-level PUBLIC_BETA marker (and the [Beta] description prefix, matching
how their fields already render). pydabs codegen is unaffected.
Co-authored-by: Isaac <no-reply@databricks.com>
Skip optional top-level fields ranked below public preview (public-beta and private-preview), not just private-preview. Mirror the launch-stage rank from internal/clijson/launchstage.go (absent stage = GA) so the comparison uses maturity order rather than a string comparison. Drops jobs.triggers and pipelines.parameters from the generated examples. Co-authored-by: Isaac <no-reply@databricks.com>
…lease-version' into sankalp-mittal/pydabs-gen-unit-tests
…hema-add-release-version
…lease-version' into sankalp-mittal/pydabs-gen-unit-tests
An AI Agent Skill that guides an agent to author the acceptance test for a newly-onboarded PyDABs resource: the acceptance/bundle/python/<plural>-support/ fixture (databricks.yml + resources.py + mutators.py + script + test.toml + generated output.txt). Includes fill-in templates (.tmpl so they stay out of linters). Complements the schema-synthesized unit-test generation; realistic field values are adapted from the resource's invariant config. Co-authored-by: Isaac <no-reply@databricks.com>
test_python_support_coverage fails until each resource in the _ResourceType
registry has an acceptance/bundle/python/<plural>-support/ fixture, so coverage
cannot silently regress as resources are onboarded. Mirrors the invariant-config
coverage guard; shrink-only _LACKING allowlist ({jobs}, whose coverage predates
the convention). Lives in the python test suite (runs in CI via pydabs-test) since
it checks the filesystem rather than exercising the CLI.
Co-authored-by: Isaac <no-reply@databricks.com>
class_name.lower() ran multi-word type names together (e.g. vectorsearchindex). Snake-case the type name instead. No-op for the 6 currently-wired single-word resources. Co-authored-by: Isaac <no-reply@databricks.com>
Extend the experimental marker (previously private-preview only) to public-beta fields and enums via is_experimental_stage. Beta and private preview may still change; GA and public preview are frozen. Co-authored-by: Isaac <no-reply@databricks.com>
Enum values with non-identifier characters (e.g. "amazon-bedrock") produced invalid Python member names. Replace runs of non-alphanumeric characters with an underscore. Co-authored-by: Isaac <no-reply@databricks.com>
Derive the resource set from the Resources struct in the bundle schema instead of a hardcoded allowlist, excluding denylisted resources and those below public preview. Adds 17 resources (23 total). Co-authored-by: Isaac <no-reply@databricks.com>
Per review feedback (skills aren't reliably loaded, and the examples plus a verbose failure are enough): drop the pydabs-acceptance-test skill in favor of the repo's dresources pattern — a path-scoped .agents/rules/ file (auto-loaded when working under acceptance/bundle/python/**) pointing to a concise acceptance/bundle/python/README.md that leans on the existing fixtures. Retarget the coverage guard's message at the README. Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
Integration test reportCommit: 96a84c3
Top 16 slowest tests (at least 2 minutes):
|
…-tests-skill' into sankalp-mittal/pydabs-generate-all-resources
Add tools/validate_cursor_rules.py (wired into `task checks`) so a rule under .agents/rules/ without its .cursor/rules/<name>.mdc symlink fails CI; `--fix` auto-creates missing symlinks and drops stale ones. Also add the symlink for the new pydabs-acceptance-tests rule. Co-authored-by: Isaac <no-reply@databricks.com>
One acceptance/bundle/python/<plural>-support/ fixture per newly generated resource, satisfying the test_python_support_coverage guard. Each loads an instance from YAML and one from Python and runs a mutator over both. Co-authored-by: Isaac <no-reply@databricks.com>
Add tools/validate_cursor_rules.py (wired into `task checks`) so a rule under .agents/rules/ without its .cursor/rules/<name>.mdc symlink fails CI; `--fix` auto-creates missing symlinks and drops stale ones. Also add the symlink for the new pydabs-acceptance-tests rule. Co-authored-by: Isaac <no-reply@databricks.com>
Remove tools/validate_cursor_rules.py and its check-cursor-rules task; the symlink-mirror check is being shipped on its own. Keep the .cursor/rules/pydabs-acceptance-tests.mdc symlink for the rule added here. Co-authored-by: Isaac <no-reply@databricks.com>
…-tests-skill' into sankalp-mittal/pydabs-generate-all-resources # Conflicts: # python/databricks/bundles/pipelines/_models/pipelines_environment.py # python/databricks_tests/core/_generated/__init__.py
test_add_resource_type and test_add_resource_type_dict had byte-identical bodies, both feeding dict_example, so the add_<resource>(dataclass) normalization path went untested for the parametrized resources. Feed dataclass_example to the non-_dict variant, mirroring test_add_job vs test_add_job_dict. Co-authored-by: Isaac <no-reply@databricks.com>
Stop hand-writing a TestCase per resource in test_resources.py. A new codegen step (generated_test_cases.py, rendered from test_case.py.tmpl) synthesizes dict_example and dataclass_example for every wired resource from the schema model and writes one file per resource under databricks_tests/core/_generated/, collected into test_cases. A newly wired resource now gets its unit-test coverage for free. dict_example and dataclass_example are rendered two independent ways from one synthesized value tree, so the dict->dataclass _transform assertion stays meaningful. Field policy: required fields fully expanded, plus optional composite fields on the resource itself; nested objects contribute only their required fields, which bounds example size and avoids the recursive Task/ForEachTask schema. Optional scalar, deprecated, and private-preview fields are omitted. The hand-written TestCase dataclass moves to _resource_test_case.py so the generated modules can import it without a cycle. Co-authored-by: Isaac <no-reply@databricks.com>
The generator source lives outside databricks/databricks_tests, so pydabs-codegen's targeted ruff --fix does not reach it, but the root ruff check does. Sort imports and merge the two startswith calls into a single tuple call. No change to generated output. Co-authored-by: Isaac <no-reply@databricks.com>
Skip optional top-level fields ranked below public preview (public-beta and private-preview), not just private-preview. Mirror the launch-stage rank from internal/clijson/launchstage.go (absent stage = GA) so the comparison uses maturity order rather than a string comparison. Drops jobs.triggers and pipelines.parameters from the generated examples. Co-authored-by: Isaac <no-reply@databricks.com>
An AI Agent Skill that guides an agent to author the acceptance test for a newly-onboarded PyDABs resource: the acceptance/bundle/python/<plural>-support/ fixture (databricks.yml + resources.py + mutators.py + script + test.toml + generated output.txt). Includes fill-in templates (.tmpl so they stay out of linters). Complements the schema-synthesized unit-test generation; realistic field values are adapted from the resource's invariant config. Co-authored-by: Isaac <no-reply@databricks.com>
test_python_support_coverage fails until each resource in the _ResourceType
registry has an acceptance/bundle/python/<plural>-support/ fixture, so coverage
cannot silently regress as resources are onboarded. Mirrors the invariant-config
coverage guard; shrink-only _LACKING allowlist ({jobs}, whose coverage predates
the convention). Lives in the python test suite (runs in CI via pydabs-test) since
it checks the filesystem rather than exercising the CLI.
Co-authored-by: Isaac <no-reply@databricks.com>
Per review feedback (skills aren't reliably loaded, and the examples plus a verbose failure are enough): drop the pydabs-acceptance-test skill in favor of the repo's dresources pattern — a path-scoped .agents/rules/ file (auto-loaded when working under acceptance/bundle/python/**) pointing to a concise acceptance/bundle/python/README.md that leans on the existing fixtures. Retarget the coverage guard's message at the README. Co-authored-by: Isaac <no-reply@databricks.com>
Add tools/validate_cursor_rules.py (wired into `task checks`) so a rule under .agents/rules/ without its .cursor/rules/<name>.mdc symlink fails CI; `--fix` auto-creates missing symlinks and drops stale ones. Also add the symlink for the new pydabs-acceptance-tests rule. Co-authored-by: Isaac <no-reply@databricks.com>
Remove tools/validate_cursor_rules.py and its check-cursor-rules task; the symlink-mirror check is being shipped on its own. Keep the .cursor/rules/pydabs-acceptance-tests.mdc symlink for the rule added here. Co-authored-by: Isaac <no-reply@databricks.com>
…-tests-skill' into sankalp-mittal/pydabs-generate-all-resources # Conflicts: # python/databricks_tests/core/_generated/__init__.py
Base automatically changed from
sankalp-mittal/pydabs-acceptance-tests-skill
to
main
September 8, 2026 14:40
Two distinct enum values that sanitize to the same member name (e.g. "a-b" and "a_b") would silently overwrite each other in the values dict, dropping a member. Raise instead. No collisions today. Co-authored-by: Isaac <no-reply@databricks.com>
…-generate-all-resources # Conflicts: # python/databricks_tests/core/_generated/__init__.py
janniklasrose
approved these changes
Sep 8, 2026
Sankalp-Mittal
deleted the
sankalp-mittal/pydabs-generate-all-resources
branch
September 8, 2026 16:18
chenyuem-db
pushed a commit
to chenyuem-db/cli
that referenced
this pull request
Sep 9, 2026
…atabricks#6548) ## Summary Stacked on top of databricks#6528. `test_python_support_coverage` requires every PyDABs resource to have an `acceptance/bundle/python/<plural>-support/` fixture. `jobs` was the lone exception: it predates the `<plural>-support` convention and was carried in a `_LACKING` shrink-only allowlist ("covered across the suite instead"). This PR covers that gap by: - adding `jobs-support` test - removing the `_LACKING` allowlist ## Testing - `go test ./acceptance -run 'TestAccept/bundle/python/jobs-support'` passes without `-update` across all four variants (both engines × both wheel versions) — deterministic. - `test_python_support_coverage` passes for all 23 resources with no exceptions. This pull request and its description were written by Isaac. Co-authored-by: Isaac <no-reply@databricks.com>
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.
Warning
One thing to keep in mind here is, some resource fields that were not marked as experimental because they were Public Beta, will now be marked as Experimental, since we are marking as experimental both on Public Beta and Private Preview.
Changes
Removes the hardcoded
RESOURCE_NAMESPACEallowlist and derives the PyDABs resource set from the bundle schema'sResourcesstruct, so every eligible resource is generated automatically.Added (17):
apps,clusters,database_catalogs,database_instances,experiments,external_locations,instance_pools,job_runs,model_serving_endpoints,models,quality_monitors,registered_models,secret_scopes,sql_warehouses,synced_database_tables,vector_search_endpoints,vector_search_indexes.(6 were already generated —
jobs,pipelines,catalogs,schemas,volumes,alerts— for 23 total.)Not added:
postgres_projects,postgres_branches,postgres_endpoints,postgres_catalogs,postgres_databases,postgres_roles,postgres_synced_tables.cluster_policies,dashboards,genie_spaces(arbitrary JSON — Gointerface{});secrets(time.Time).Why
Complete resource coverage for PyDABs.
Tests
Testing is handled by the related PRs in the stack (#6516, #6421, #6527): generated per-resource unit tests and the acceptance coverage guard that requires a fixture per resource.