AMashenkov commented on code in PR #6276:
URL: https://github.com/apache/ignite-3/pull/6276#discussion_r2218780044


##########
modules/runner/src/test/java/org/apache/ignite/internal/configuration/compatibility/framework/ConfigurationTreeComparator.java:
##########
@@ -232,12 +230,444 @@ public static ComparisonContext 
create(Set<ConfigurationModule> configurationMod
 
         private final KeyIgnorer deletedItems;
 
+        private final Set<String> skipAddRemoveKeys = new HashSet<>();
+
         ComparisonContext(Collection<String> deletedPrefixes) {
             this.deletedItems = 
KeyIgnorer.fromDeletedPrefixes(deletedPrefixes);
         }
 
         boolean shouldIgnore(String path) {
             return deletedItems.shouldIgnore(path);
         }
+
+        boolean shouldIgnore(ConfigNode node, String childName) {
+            return shouldIgnore(node.path() + "." + childName);
+        }
+
+        boolean ignoreAddOrRemove(String path) {
+            return skipAddRemoveKeys.contains(path);
+        }
+
+        boolean ignoreAddOrRemove(ConfigNode node, String childName) {
+            return ignoreAddOrRemove(node.path() + "." + childName);
+        }
+    }
+
+    private static void validateConfigNode(
+            @Nullable String instanceType,
+            ConfigNode original,
+            ConfigNode updated,
+            ComparisonContext context,
+            Errors errors
+    ) {
+        errors.push(instanceType);
+        doValidateConfigNode(original, updated, context, errors);
+        errors.pop();
+    }
+
+    private static void validateNewConfigNode(
+            @Nullable String instanceType,
+            ConfigNode updated,
+            ComparisonContext compContext,
+            Errors errors
+    ) {
+        if (compContext.shouldIgnore(updated.path())) {
+            return;
+        }

Review Comment:
   Why do we check new node against `deleted regexp`?
   New nodes should never be considered as deleted, because (depending on 
Configuration module logic)
   either we ignore breaking changes or allow values that can't be used, which 
looks like a bug.
   Should we report a error instead?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to