Skip to content

Generate all public-preview and GA PyDABs resources - #6528

Merged
Sankalp-Mittal merged 63 commits into
mainfrom
sankalp-mittal/pydabs-generate-all-resources
Sep 8, 2026
Merged

Generate all public-preview and GA PyDABs resources#6528
Sankalp-Mittal merged 63 commits into
mainfrom
sankalp-mittal/pydabs-generate-all-resources

Conversation

@Sankalp-Mittal

@Sankalp-Mittal Sankalp-Mittal commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

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_NAMESPACE allowlist and derives the PyDABs resource set from the bundle schema's Resources struct, 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:

  • Below Public Preview (Public Beta), excluded by the stage gate: postgres_projects, postgres_branches, postgres_endpoints, postgres_catalogs, postgres_databases, postgres_roles, postgres_synced_tables.
  • Uses a field type the generator can't model yet (denylisted): cluster_policies, dashboards, genie_spaces (arbitrary JSON — Go interface{}); 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.

Sankalp-Mittal and others added 25 commits September 3, 2026 12:54
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
…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>
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 96a84c3

Run: 34243527285

Env 🔄​flaky 💚​RECOVERED ✅​pass 🙈​skip Time
🔄​ aws linux 1 1 274 32 12:25
💚​ aws windows 1 277 30 7:08
🔄​ azure linux 1 1 273 32 15:59
💚​ azure windows 1 276 30 10:31
🔄​ gcp linux 1 1 274 32 13:57
💚​ gcp windows 1 277 30 10:31
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🔄​ TestSyncFullFileSync 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p
🔄​ TestSyncIncrementalFileSync ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p
🔄​ TestSyncNestedFolderDoesntFailOnNonEmptyDirectory ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p
Top 16 slowest tests (at least 2 minutes):
duration env testname
6:30 azure linux TestFilerWorkspaceFilesExtensionsDelete
6:10 azure linux TestFilerWorkspaceFilesExtensionsStat
5:02 gcp windows TestFilerWorkspaceFilesExtensionsReadDir
3:58 gcp windows TestSyncIncrementalFileSync
3:56 gcp linux TestFilerWorkspaceFilesExtensionsReadDir
3:54 gcp windows TestFilerWorkspaceFilesExtensionsDelete
3:37 azure linux TestFilerRecursiveDelete/workspace_files
3:24 azure windows TestAccept
3:14 gcp windows TestAccept
3:12 aws windows TestAccept
3:05 aws windows TestFilerWorkspaceFilesExtensionsRead
3:01 azure windows TestFilerWorkspaceFilesExtensionsReadDir
2:36 gcp windows TestFilerRecursiveDelete/workspace_files_extensions
2:35 gcp windows TestImportDir
2:35 gcp linux TestLock
2:03 azure windows TestImportDirWithOverwriteFlag

Sankalp-Mittal and others added 4 commits September 4, 2026 13:04
…-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>
Sankalp-Mittal and others added 2 commits September 8, 2026 10:05
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>
Sankalp-Mittal and others added 13 commits September 8, 2026 08:14
…-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
Comment thread python/codegen/codegen/generated_enum.py
Base automatically changed from sankalp-mittal/pydabs-acceptance-tests-skill to main September 8, 2026 14:40
Sankalp-Mittal and others added 2 commits September 8, 2026 15:03
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
@Sankalp-Mittal
Sankalp-Mittal added this pull request to the merge queue Sep 8, 2026
Merged via the queue into main with commit 6d7fada Sep 8, 2026
34 checks passed
@Sankalp-Mittal
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants