Add --allow-empty-types option to plugin sync#15
Merged
Conversation
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>
There was a problem hiding this comment.
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-typesCLI option (with aliases) and propagate it through root + plugin sync commands intoPluginSyncCommandOptions. - Update difference calculation to suppress plugin type deletions when
AllowEmptyTypesis 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.
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.
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.