Skip to content

Task/2145 Warn about dataExtension fields needing manual deletion after deploy - #2548

Merged
JoernBerkefeld merged 4 commits into
developfrom
copilot/warn-deletion-of-dataextension-fields
Mar 15, 2026
Merged

JoernBerkefeld merged 4 commits into
developfrom
copilot/warn-deletion-of-dataextension-fields

Conversation

Copilot AI commented Mar 14, 2026 •

Copy link
Copy Markdown
Contributor

The SOAP API silently ignores missing fields when updating Data Extensions — it won't delete fields absent from the deploy payload. This can lead to schema drift. This PR adds a deploy-time warning identifying such fields and providing the exact deletion command to run.

Changes

DataExtensionField.prepareDeployColumnsOnUpdate

  • Captures original deploy payload field names (lowercase) before the processing loop (to handle renames correctly via Name_new)
  • After the loop, diffs server fields (existingFieldByName) against deploy field names to identify removed fields
  • Emits a warn + gray info command hint if any removed fields are detected:
warn:  - 2 field(s) of testExisting_dataExtension found on the server but not in the deploy payload.
       Fields cannot be auto-deleted due to potential data loss. To delete them, please run:
info: mcdev delete testInstance/testBU -m dataExtensionField:"testExisting_dataExtension.decimalField" dataExtensionField:"testExisting_dataExtension.numberField"

DataExtension.createOrUpdate

  • Adds DataExtensionField.buObject = this.buObject alongside the existing client and properties assignments before calling prepareDeployColumnsOnUpdate, so the credential/BU path is available for the warning message.

Documentation

No documentation update required — this is a UX improvement surfacing an existing manual step.

Issues

Original prompt

This section details on the original issue you should resolve

<issue_title>[TASK] warn that dataExtension fields have to be deleted manually after deploy</issue_title>
<issue_description>should only be shown if DEs were updated; listing all DE keys that would need to be checked, informing that deleted fields cannot get auto-deployed but instead this is a post-deployment step.</issue_description>

<agent_instructions>the soap api used for updating dataExtensions ignores missing fields during updates and simply keeps them as is. to delete fields, one has to run mcdev delete cred/bu -m dataExtensionField:dataExtensionKey.fieldName1 dataExtensionField:dataExtensionKey.fieldName2.
this is not done automatically because it could lead to unwanted data loss. we should instead print a warning during deployment suggesting what command to run to delete the fields. to identify these fields, compare what fields were cached with what fields are in the update payload</agent_instructions>

Comments on the Issue (you are @copilot in this section)


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI changed the title [WIP] Add warning for manual deletion of DataExtension fields after deploy #1784 Warn about dataExtension fields needing manual deletion after deploy Mar 14, 2026
Copilot AI requested a review from JoernBerkefeld March 14, 2026 23:37
@JoernBerkefeld JoernBerkefeld changed the title #1784 Warn about dataExtension fields needing manual deletion after deploy Task/2145 Warn about dataExtension fields needing manual deletion after deploy Mar 15, 2026
@JoernBerkefeld JoernBerkefeld added this to the 9.0.3 - dataExtensions milestone Mar 15, 2026
Comment thread lib/metadataTypes/DataExtensionField.js Resolved
@JoernBerkefeld
JoernBerkefeld marked this pull request as ready for review March 15, 2026 08:44
@github-actions

Copy link
Copy Markdown

Coverage Report

Commit:ef02af7
Base: develop@ab8a090

Type Base This PR
Total Statements Coverage  71.05%  71.07%  (+0.02%)
Total Branches Coverage  70.77%  70.78%  (+0.01%)
Total Functions Coverage  83.77%  83.77%  (+0%)
Total Lines Coverage  71.05%  71.07%  (+0.02%)
Details (changed files):
File Statements Branches Functions Lines
lib/metadataTypes/DataExtension.js  79.15%  72.05%  94.44%  79.15%
lib/metadataTypes/DataExtensionField.js  83.06%  70.27%  92.85%  83.06%

@JoernBerkefeld
JoernBerkefeld merged commit 30e9e94 into develop Mar 15, 2026
10 checks passed
@JoernBerkefeld
JoernBerkefeld deleted the copilot/warn-deletion-of-dataextension-fields branch March 15, 2026 08:54
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.

[TASK] warn that dataExtension fields have to be deleted manually after deploy

2 participants