direct: ignore remote-only changes on name-based ID fields#5599
Open
denik wants to merge 3 commits into
Open
Conversation
Contributor
Approval status: pending
|
Resources fetched by a name-based ID (schemas, volumes, registered models, apps, secret scopes, postgres resources, etc.) cannot exhibit real remote drift on the fields composing that ID: a successful get-by-ID means a differing remote value can only be backend normalization (e.g. UC lowercasing), since an out-of-band rename would 404 and is already handled as resource-gone. Reacting with recreate or rename is therefore never correct for remote-only diffs on these fields. Encode this declaratively: - named_id_fields: ID components; local changes recreate, remote-only diffs are skipped. Replaces their recreate_on_changes entries. - update_id_on_local_changes (renamed from update_id_on_changes): same skip for remote-only diffs; local changes still rename via DoUpdateWithID. normalize_case is unchanged: it covers local case-only edits, which the get-by-ID argument does not, and which would otherwise recreate a resource UC considers unchanged. Co-authored-by: Isaac
Revert the cosmetic update_id_on_changes -> update_id_on_local_changes rename to minimize the diff (catalogs, external_locations, volumes, secret_scopes.permissions keep their existing key). The semantics shift is explained in comments instead: update_id_on_changes now only governs local changes, since remote-only diffs on these ID fields are skipped by shouldSkipIDField. Co-authored-by: Isaac
de92903 to
380841e
Compare
The fields hold a user-provided name that forms the resource ID (as opposed to a server-generated id); "provided" makes clear why a remote-only difference can only be backend normalization. Source-only rename; reason strings (id_field) are unchanged. Also regenerate volumes/uppercase-name/out.deploy.direct.txt, whose id_field reasons were reverted to the stale uc_case by the rebase auto-merge. Co-authored-by: Isaac
Collaborator
Integration test reportCommit: 4f7b7ab
24 interesting tests: 15 SKIP, 6 RECOVERED, 2 FAIL, 1 KNOWN
Top 25 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.
The direct engine reacted to remote-only changes on the name fields that compose a resource's ID — recreating schemas/volumes or renaming catalogs on a no-op redeploy. Such a difference can only be backend normalization: the resource was just fetched by that ID, so a real out-of-band rename would 404 (already handled as resource-gone), not come back as a changed value.
Encode this declaratively with a new
resources.ymlkey,named_id_fields: local changes recreate as before, but remote-only differences are skipped.update_id_on_changesgains the same skip (its name is kept to minimize the diff; the local-only semantics are documented). Applied to every name-keyed resource.normalize_casestill covers the one case the get-by-ID argument can't — a local case-only edit.