Draft
Conversation
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
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
…ckages 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
Co-authored-by: Isaac
Collaborator
|
Commit: 668efe8
20 interesting tests: 9 SKIP, 7 KNOWN, 4 flaky
Top 22 slowest tests (at least 2 minutes):
|
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.
Changes
Why
Tests