Conversation
…s state type Co-authored-by: Isaac <no-reply@databricks.com>
Resources whose state type is a plain subset of the remote type had a hand-written RemapState that mechanically copied same-named fields and filtered ForceSendFields. Replace those with a copier compiled once from the (remote, state) type pair at package init and wired into the adapter when a resource has no custom RemapState. buildCopiers is driven off SupportedResources, so every auto-copied resource is validated at load: anything the copier cannot copy losslessly (kind-changing conversions, mismatched struct shapes) fails there rather than as silent drift at deploy time. Deletes 12 redundant RemapState methods; resources with genuine logic keep theirs. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Drop the duplicate reflection filler in favor of the existing fillNonZero, populating ForceSendFields with a small dedicated helper. Field-per-line table in TestSafeConvert; shorten the README section. Co-authored-by: Isaac <no-reply@databricks.com>
Move the reflection copier (compile-time type check, field/JSON-name copy, ForceSendFields filtering, lossless conversions) out of dresources into a reusable package beside structwalk/structdiff/structaccess. The direct engine wiring (buildCopiers, driven off SupportedResources) stays in dresources and now calls structcopy.Compile. Co-authored-by: Isaac <no-reply@databricks.com>
The auto-generated copier reproduces these 15 RemapState methods exactly, so delete them and let buildCopiers handle the copy: - apps, clusters, sql_warehouses recomputed a lifecycle value DoRead already stores; the copier now carries DoRead's value through (the authoritative one). - jobs, job_runs, pipelines, model_serving_endpoints, quality_monitors and the postgres_* resources were plain field-by-field subset copies. Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
Integration test reportCommit: 3d66375
Top 3 slowest tests (at least 2 minutes):
|
Its ForceSendFields come from a nested field (EndpointDetails.ForceSendFields), which the copier (root ForceSendFields only) cannot reproduce, so the auto-copy diverges. Acceptance caught it on the direct engine; keep the override. Co-authored-by: Isaac <no-reply@databricks.com>
andrewnester
approved these changes
Sep 22, 2026
denik
marked this pull request as draft
September 22, 2026 13:13
denik
force-pushed
the
denik/remapstate-identity-comment
branch
from
September 23, 2026 10:03
9ed6196 to
ded8289
Compare
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.
Stacked on #6777. Now that the framework auto-copies remote→state, 15
RemapStatemethods are dead boilerplate the copier reproduces exactly:apps,clusters,sql_warehousesrecomputed alifecycle.startedvalue thatDoReadalready stores; the copier carriesDoRead's value through. For non-running/terminated transient states this now followsDoRead's mapping (nil), which is the authoritative one per the README.jobs,job_runs,pipelines,model_serving_endpoints,quality_monitors, and the sevenpostgres_*resources were plain field-by-field subset copies.buildCopiersvalidates each at package init, so anything that couldn't be copied safely would fail at load. Verified: unit suite (incl. the init guard) and acceptance tests for the affected resources pass.This pull request and its description were written by Isaac.