postgres: read ids from Status instead of parsing Name#5274
Open
pietern wants to merge 3 commits into
Open
Conversation
Define Postgres{Branch,Endpoint,Project}Remote types that embed the
corresponding SDK *Spec and expose the identifier and output-only fields at
the top level. DoRead returns the new shape so state-side and remote-side
paths line up, which is a prerequisite for drift detection on spec fields
once the backend starts echoing spec on GET. Today the embedded fields are
auto-classified spec:input_only from the API field behaviors in
resources.generated.yml, so drift is correctly suppressed.
Follows the pattern set by PipelineRemote and AppRemote. Prompted by
#5265 (comment).
Co-authored-by: Isaac
# Conflicts: # acceptance/bundle/refschema/out.fields.txt # bundle/direct/dresources/postgres_branch.go # bundle/direct/dresources/postgres_endpoint.go # bundle/direct/dresources/type_test.go
The Postgres GET API now echoes the leaf id on the Status payload (BranchStatus.BranchId, EndpointStatus.EndpointId, ProjectStatus.ProjectId). Drop the regex-based ParsePostgresName recovery in the three make*Remote helpers and read the id directly from Status. The component helper and its unit test go with it; the one remaining call site in all_test.go now uses the project id literal it just created. Fields added in SDK v0.129.0 (databricks/databricks-sdk-go#1644); available in the CLI since #5237 bumped the SDK to v0.132.0. The testserver was taught to populate these fields in the companion PR #5246, so local acceptance fixtures are unchanged. Co-authored-by: Isaac
Contributor
Waiting for approvalBased on git history, these people are best suited to review:
Eligible reviewers: Suggestions based on git history. See OWNERS for ownership rules. |
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.
The Postgres GET API now echoes the leaf id on the Status payload (
BranchStatus.BranchId,EndpointStatus.EndpointId,ProjectStatus.ProjectId). Drop the regex-basedParsePostgresNamerecovery in the threemake*Remotehelpers and read the id directly from Status. The component helper and its unit test go with it; the one remaining call site inall_test.gonow uses the project id literal it just created.Fields added in SDK v0.129.0 (databricks/databricks-sdk-go#1644); available in the CLI since #5237 bumped the SDK to v0.132.0. The testserver was taught to populate these fields in the companion PR #5246, so local acceptance fixtures are unchanged.
Stacked on #5273 — base will retarget to
mainonce that merges.This pull request and its description were written by Isaac.