-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
feat: Support syncing deleted configuration items between environments #5419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
@@ -105,6 +105,7 @@ sync_item_module.controller("SyncItemController", | |||
$scope.hasDiff = | |||
clusterDiff.diffs.createItems.length | |||
+ clusterDiff.diffs.updateItems.length | |||
+ clusterDiff.diffs.deleteItems.length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misleading line break before '+'; readers may interpret this as an expression boundary.
Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
…tem sync Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
Both issues have been addressed:
Fixed in commit c5467d5. |
I understand your suggestion to add a checkbox for users to explicitly choose whether to show deleted items. This would indeed simplify the implementation by removing the automatic "Select All" logic and giving users direct control. Would you like me to implement this checkbox approach instead of the current "Select All" behavior? I can modify the UI to add the checkbox and update the backend logic accordingly. |
@copilot Please go ahead with the checkbox approach instead of the current "Select All" behavior. |
Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
Implemented the checkbox approach as requested. Replaced the automatic "Select All" logic with an explicit "Include Deleted Items" checkbox that gives users direct control over whether deleted items are synchronized. The checkbox is located in Step 1 of the sync interface and works independently of item selection. Fixed in commit f94a25a. |
@copilot OK, please undo the previous changes related to "Select All" behavior. |
… functionality Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
Reverted all "Select All" behavior changes as requested. Removed the conditional logic and checkbox UI while keeping the core deleted items sync functionality always active. The deleted items are now synchronized in all cases without requiring explicit user selection. Fixed in commit 10866bb. |
@@ -171,10 +171,10 @@ public List<ItemDTO> findBranchItems(@PathVariable("appId") String appId, @PathV | |||
} | |||
|
|||
@PostMapping(value = "/namespaces/{namespaceName}/diff", consumes = {"application/json"}) | |||
public List<ItemDiffs> diff(@RequestBody NamespaceSyncModel model) { | |||
public List<ItemDiffs> diff(@PathVariable String namespaceName, @RequestBody NamespaceSyncModel model) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change seems unnecessary as namespaceName is not used in the parseChangeSets method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely right. Removed the unnecessary namespaceName
parameter from the parseChangeSets
method and cascaded the change up through compare
and syncItems
methods. The parameter was never used in the implementation. Fixed in commit 48fd3d5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, please remove the unnecessary namespaceName parameter as well.
Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
Overview
This PR implements support for syncing deleted configuration items between environments in Apollo configuration management system. Previously, when syncing configurations, only new and modified items were synchronized - deleted items were ignored, leading to configuration drift between environments.
Problem
When users sync configurations between environments using Apollo's sync feature, deleted configuration items (items that exist in target environment but not in source) are not synchronized. This means:
Solution
Added comprehensive support for detecting and syncing deleted items:
Backend Changes
parseChangeSets()
method to detect items that exist in target but not in sourceItemChangeSets.deleteItems
for proper synchronizationFrontend Changes
removeItem()
functionTest Coverage
Behavior
The sync process now properly handles all three types of configuration changes:
User Experience
Users will see deleted items in the sync preview interface with:
Example
Consider syncing from DEV to PROD environments:
Before this change:
app.name=MyApp
,app.version=2.0
app.name=MyApp
,app.version=1.0
,app.debug=true
app.name=MyApp
,app.version=2.0
,app.debug=true
❌ (debug config remains)After this change:
app.version
, DELETEapp.debug
app.name=MyApp
,app.version=2.0
✅ (complete sync)This ensures complete configuration synchronization and prevents configuration drift between environments.
Fixes #4697.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.