markap14 commented on a change in pull request #3544: NIFI-6028: Updates to ignore changes between local version of a flow … URL: https://github.com/apache/nifi/pull/3544#discussion_r297325413
########## File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/util/FlowDifferenceFilters.java ########## @@ -113,4 +117,145 @@ public static boolean isIgnorableVersionedFlowCoordinateChange(final FlowDiffere return false; } + + + public static boolean isNewPropertyWithDefaultValue(final FlowDifference fd, final FlowManager flowManager) { + if (fd.getDifferenceType() != DifferenceType.PROPERTY_ADDED) { + return false; + } + + final VersionedComponent componentB = fd.getComponentB(); + + if (componentB instanceof InstantiatedVersionedProcessor) { + final InstantiatedVersionedProcessor instantiatedProcessor = (InstantiatedVersionedProcessor) componentB; + final ProcessorNode processorNode = flowManager.getProcessorNode(instantiatedProcessor.getInstanceId()); + return isNewPropertyWithDefaultValue(fd, processorNode); + } else if (componentB instanceof InstantiatedVersionedControllerService) { + final InstantiatedVersionedControllerService instantiatedControllerService = (InstantiatedVersionedControllerService) componentB; + final ControllerServiceNode controllerService = flowManager.getControllerServiceNode(instantiatedControllerService.getInstanceId()); + return isNewPropertyWithDefaultValue(fd, controllerService); + } + + return false; + } + + private static boolean isNewPropertyWithDefaultValue(final FlowDifference fd, final ProcessorNode processorNode) { Review comment: D'oh, good point! Will push a new commit that takes advantage of this. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services