Add public API regression guard for databricks.bundles.core - #6439
Merged
Conversation
Sankalp-Mittal
enabled auto-merge
August 31, 2026 10:38
Sankalp-Mittal
disabled the stack merge
September 2, 2026 09:23
_bases() filtered out `object` but not underscore-prefixed private bases, so a generated private base (e.g. _GeneratedResources introduced by the wiring refactor) would surface in the golden as a false positive even though the public contract is intact. Mirror _members()'s underscore filter. No-op for the current golden on this branch, where Resources has no private base. Co-authored-by: Isaac <no-reply@databricks.com>
The core public-API snapshot doesn't exercise the CLI end to end, so it belongs with the other pure-Python pydabs tests rather than in acceptance/. Move it to databricks_tests/core/test_public_api.py, comparing against a committed golden (regenerate with UPDATE_SNAPSHOTS=1). Gate on Python >= 3.11 (via skipif, and a sys.version_info guard so pyright at 3.10 is happy) instead of pinning an exact interpreter, since typing.get_overloads needs 3.11+ and the output is identical on 3.11/3.12/3.13. Removes the acceptance/bundle/python/public-api test. Co-authored-by: Isaac <no-reply@databricks.com>
Sankalp-Mittal
force-pushed
the
sankalp-mittal/pydabs-public-api-guard
branch
from
September 3, 2026 08:56
01b685b to
d25d843
Compare
The whitespace linter (task checks -> ws) strips a trailing blank line and then git diff --exit-code fails; in acceptance/ the golden was in the ws skip-list, but as a committed .txt under python/ it is checked. Emit a single trailing newline. Co-authored-by: Isaac <no-reply@databricks.com>
janniklasrose
approved these changes
Sep 3, 2026
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.
Summary
A regression guard has been added to the public facing API's on PyDABs, this is done to test that auto generating the code does not change any public API's.
Why
The upcoming PyDABs codegen/wiring refactor (#6397) converts the hand-written
databricks.bundles.corewiring —Resources, the*_mutatorfunctions, the_ResourceTyperegistry,__all__— into generated code. Nothing today guards the typed public surface customers import and type-check against, so that refactor (or a future one) could silently drop a type hint, move a*keyword marker, rename a method, or change the export set.This lands a golden snapshot of that surface on main first, freezing the known-good pre-refactor API. #6397 then merges main in and must reproduce the identical golden — that passing test is the proof the refactor preserved the public API.
generate-checkcannot do this: after the refactor regenerates the wiring it trivially passes ("checked-in == regenerated"); only a golden captured here, before the refactor, can show the new generated wiring equals the old hand-written surface.What
An acceptance test at
acceptance/bundle/python/public-api/whosescriptruns a checked-indump_public_api.pyunderuv, snapshottingdatabricks.bundles.core's__all__, everyResources.add_*signature and property, the*_mutatoroverloads,Variable/VariableOr*, the support types, and the_ResourceType.all()registry.Notable design decisions
Variable[str], notdatabricks.bundles.core._variable.Variable). The refactor moves internal_-prefixed modules; a golden keyed on internal paths would false-fail even when the public API is unchanged. Public imports go through thecore.__init__re-exports, which is exactly what the golden pins.inspect.Signatureso/,*,*args,**kwargsmarkers render explicitly and stably.--python 3.11is pinned so the golden is reproducible independent of the repo-wideUV_PYTHONminimum, andtyping.get_overloads(3.11+) is available. Output verified identical on 3.11 and 3.12.This pull request and its description were written by Isaac.