Skip to content

Add --allow-empty-types option to plugin sync#15

Merged
mkholt merged 1 commit into
mainfrom
allow-empty-types-dd1
Jun 26, 2026
Merged

Add --allow-empty-types option to plugin sync#15
mkholt merged 1 commit into
mainfrom
allow-empty-types-dd1

Conversation

@mkholt

@mkholt mkholt commented Jun 26, 2026

Copy link
Copy Markdown
Member

Keep plugin types registered when they no longer have steps instead of deleting them. Avoids forcing a full upgrade of managed solutions, where deleting a component would otherwise require one. The steps are still removed, leaving an empty type behind.

The flag is read via injected PluginSyncCommandOptions in the difference calculator, consistent with how PrintService consumes ExecutionContext, so the diff/preview output is accurate too.

Keep plugin types registered when they no longer have steps instead of
deleting them. Avoids forcing a full upgrade of managed solutions, where
deleting a component would otherwise require one. The steps are still
removed, leaving an empty type behind.

The flag is read via injected PluginSyncCommandOptions in the difference
calculator, consistent with how PrintService consumes ExecutionContext,
so the diff/preview output is accurate too.

Co-Authored-By: Claude <noreply@anthropic.com> via Conducktor <conducktor@contextand.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new --allow-empty-types flag to plugin synchronization to prevent deletion of plugin types that no longer have any steps, helping avoid forcing full upgrades for managed solutions while still removing orphaned steps/images.

Changes:

  • Introduce --allow-empty-types CLI option (with aliases) and propagate it through root + plugin sync commands into PluginSyncCommandOptions.
  • Update difference calculation to suppress plugin type deletions when AllowEmptyTypes is enabled (while still deleting orphaned steps/images).
  • Add/adjust tests and documentation (README + changelog) to cover and describe the new behavior.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
XrmSync/Constants/CliOptions.cs Defines the new --allow-empty-types option and aliases.
XrmSync/Commands/CommandOptions.cs Exposes the new option as a shared Option<bool?> instance.
XrmSync/Commands/XrmSyncRootCommand.cs Adds root-level override support and merges the flag into PluginSyncItem.
XrmSync/Commands/PluginSyncCommand.cs Wires CLI/profile merge and injects AllowEmptyTypes into DI via PluginSyncCommandOptions.
Model/XrmSyncOptions.cs Extends PluginSyncItem with AllowEmptyTypes for profile/config support.
Model/Plugin/PluginSyncCommandOptions.cs Extends command options record with AllowEmptyTypes.
SyncService/Difference/DifferenceCalculator.cs Injects plugin sync options and suppresses type deletes when enabled.
Tests/Plugins/DifferenceUtilityTests.cs Adds coverage ensuring remote-only types are preserved when AllowEmptyTypes is true.
Tests/CustomApis/DifferenceCalculatorCustomApiTests.cs Updates constructor usage to provide required plugin options dependency.
README.md Documents the new CLI option and its purpose.
CHANGELOG.md Adds release note entry for the new flag.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mkholt mkholt merged commit 9d115a3 into main Jun 26, 2026
2 checks passed
@mkholt mkholt deleted the allow-empty-types-dd1 branch June 26, 2026 12:05
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.

2 participants