Skip to content

WIP simpler copy in resource imlementations#4822

Draft
denik wants to merge 16 commits intomainfrom
denik/smarter-copy
Draft

WIP simpler copy in resource imlementations#4822
denik wants to merge 16 commits intomainfrom
denik/smarter-copy

Conversation

@denik
Copy link
Contributor

@denik denik commented Mar 24, 2026

Changes

Why

Tests

denik added 16 commits March 23, 2026 17:22
Introduce libs/structs/fieldcopy for reflection-based struct copying with
test-time completeness validation. ForceSendFields is auto-filtered.
Migrate cluster's RemapState, makeCreateCluster, makeEditCluster.

Co-authored-by: Isaac
- job: makeCreateJob (JobSettings → CreateJob)
- pipeline: makePipelineRemote (PipelineSpec → CreatePipeline),
  pipelineRemoteCopy (GetPipelineResponse → PipelineRemote),
  DoUpdate (CreatePipeline → EditPipeline)
- model_serving_endpoint: autoCaptureConfigOutputToInput,
  servedEntitiesOutputToInput, RemapState

Co-authored-by: Isaac
…tion

Remove caller-maintained skip lists from fieldcopy.Copy and replace
Validate() with Report() that generates a human-readable summary of
unmatched fields. The dresources test uses testdiff golden file approach
so unmatched fields are auto-recorded and visible in diffs without
requiring manual maintenance.

Co-authored-by: Isaac
Skip auto-handling of ForceSendFields when it is promoted from an
embedded struct (len(Index) > 1), since fieldcopy only copies direct
fields. Rename golden file to out.fieldcopy.txt.

Co-authored-by: Isaac
…, sql_warehouse to fieldcopy

Replace manual field-by-field struct copying with fieldcopy.Copy for
five more resource types. ForceSendFields is now auto-filtered.
sql_warehouse requires post-processing for WarehouseType due to
different named string types that aren't assignable.

Co-authored-by: Isaac
Each dresources file now defines init() to register fieldcopy instances
via registerCopy(), which both initializes the copy (Init) and appends
to a global list used by the golden file test. Do() panics if called
without Init, catching unregistered copies at runtime.

Co-authored-by: Isaac
Inline makeCreateCluster, makeEditCluster, makeResetJob into their
callers. Extract shared forceNumWorkers helper for the duplicated
NumWorkers logic. Move all init() functions to the bottom of each
resource file and declare copy vars near the first function that uses them.

Co-authored-by: Isaac
Returning a pointer eliminates the two-liner pattern in RemapState
methods (assign to local, return &local) and is equally convenient
for callers that modify the result after copying.

Co-authored-by: Isaac
newCopy[Src, Dst]() creates, initializes, and registers a fieldcopy
instance in one call, eliminating all init() functions from resource files.

Co-authored-by: Isaac
Store ops, autoFSF, fsfSrcIdx, fsfDstIdx, validFSFNames, and ready
as struct fields populated by Init, instead of capturing them in a
closure. Do is now a regular method reading from the struct.

Co-authored-by: Isaac
@denik denik temporarily deployed to test-trigger-is March 24, 2026 07:58 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Mar 24, 2026

Commit: 668efe8

Run: 23479009968

Env 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 1 9 271 801 8:10
🟨​ aws windows 7 1 9 273 799 6:26
💚​ aws-ucws linux 8 9 369 716 8:15
🔄​ aws-ucws windows 3 7 9 369 714 6:15
💚​ azure linux 2 11 274 799 6:57
💚​ azure windows 2 11 276 797 4:35
🔄​ azure-ucws linux 4 1 11 371 712 9:31
🔄​ azure-ucws windows 3 1 11 374 710 7:35
💚​ gcp linux 2 11 270 802 6:27
💚​ gcp windows 2 11 272 800 4:54
20 interesting tests: 9 SKIP, 7 KNOWN, 4 flaky
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
🟨​ TestAccept 🟨​K 🟨​K 💚​R 🔄​f 💚​R 💚​R 💚​R 🔄​f 💚​R 💚​R
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🙈​ TestAccept/bundle/resources/postgres_branches/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/update_protected 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/without_branch_id 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_projects/update_display_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestAccept/ssh/connect-serverless-gpu 🙈​s 🙈​s ✅​p 🔄​f 🙈​s 🙈​s 🔄​f 🔄​f 🙈​s 🙈​s
🔄​ TestAccept/ssh/connect-serverless-gpu/DATABRICKS_BUNDLE_ENGINE=direct ✅​p 🔄​f 🔄​f 🔄​f
🔄​ TestAccept/ssh/connection 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 🔄​f 💚​R 💚​R 💚​R
🔄​ TestAccept/ssh/connection/DATABRICKS_BUNDLE_ENGINE=direct ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p
Top 22 slowest tests (at least 2 minutes):
duration env testname
4:41 gcp linux TestAccept/ssh/connection/DATABRICKS_BUNDLE_ENGINE=direct
4:14 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:13 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:11 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:45 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:27 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:27 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:22 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:13 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:08 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:52 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:44 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:42 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:41 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:41 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:39 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:39 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:37 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:29 gcp windows TestAccept/ssh/connection/DATABRICKS_BUNDLE_ENGINE=direct
2:25 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:18 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:11 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform

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.

2 participants