Skip to content

#2601 warn before changeKeyField key collision causes a deploy error - #2673

Open
Pushpak731 wants to merge 2 commits into
Accenture:mainfrom
Pushpak731:fix/changekeyfield-deploy-key-corruption
Open

Pushpak731 wants to merge 2 commits into
Accenture:mainfrom
Pushpak731:fix/changekeyfield-deploy-key-corruption

Conversation

@Pushpak731

Copy link
Copy Markdown

PR details

What changes did you make? (Give an overview)

When --changeKeyField derives a new key that is already used by a different cached item, the deploy previously failed with a cryptic "already exists" API error (the root cause of the intermittent failure reported in #2601). The collision is now detected before the key change: a clear error is logged naming the conflicting key, and the change is skipped for that item, allowing the rest of the deploy to proceed.

Further details (optional)

The check in MetadataType.createOrUpdate looks up the derived key in the cache via cache.getByKey(type, newKey) before overwriting metadataMap[metadataKey][keyField]. If a different cached item already owns that key, the item is flagged with hasError = true and the key is left unchanged — the same skip mechanism already used for GUID keys and fixed-key types. When the derived key is free (or belongs to the same item, i.e. is already the current key), the change proceeds as before.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • test scripts updated
  • Wiki updated (if applicable) — N/A, validation-guard addition only

…oy error

When --changeKeyField derives a new key that is already used by a
DIFFERENT cached item, the deploy would previously fail with a cryptic
'already exists' API error. The collision is now detected before the
key change, logging a clear error and skipping the change for that
item.
Copilot AI balanced review requested due to automatic review settings October 5, 2026 17:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

[BUG] Failing to deploy data extension when using changeKeyField

2 participants