exceptionfactory commented on code in PR #9967:
URL: https://github.com/apache/nifi/pull/9967#discussion_r2423134156
##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java:
##########
@@ -2792,12 +2800,19 @@ public Set<ComponentDifferenceDTO>
createComponentDifferenceDtosForLocalModifica
final ComponentDifferenceDTO componentDiff =
createComponentDifference(difference);
final List<DifferenceDTO> differences =
differencesByComponent.computeIfAbsent(componentDiff, key -> new ArrayList<>());
-
- final DifferenceDTO dto = new DifferenceDTO();
-
dto.setDifferenceType(difference.getDifferenceType().getDescription());
- dto.setDifference(difference.getDescription());
-
- differences.add(dto);
+ differences.add(createDifferenceDto(difference));
+ }
+
+ if (!differencesByComponent.isEmpty()) {
+ // differences were found, so now let's add back in any
BUNDLE_CHANGED differences
+ // since they were initially filtered out as an
environment-specific change
Review Comment:
Does this mean that bundle changes are no longer considered
environment-specific changes?
##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java:
##########
@@ -2821,6 +2846,18 @@ private void flattenProcessGroups(final
VersionedProcessGroup group, final Map<S
}
}
+ private ComponentDifferenceDTO createBundleDifference(final FlowDifference
difference) {
+ VersionedComponent component = difference.getComponentB();
+
+ final ComponentDifferenceDTO dto = new ComponentDifferenceDTO();
+ dto.setComponentType(component.getComponentType().toString());
+ // bundle difference could apply to many components, but use the
Process Group identifier as
+ // the Component Identifier here so that many similar component
differences can be easily deduped
+ dto.setComponentId(component.getGroupIdentifier());
Review Comment:
This seems questionable, would it hide multiple component version
differences in a given Process Group?
##########
nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/util/FlowDifferenceFilters.java:
##########
@@ -73,6 +73,10 @@ public static boolean isEnvironmentalChange(final
FlowDifference difference, fin
|| isLogFileSuffixChange(difference);
}
+ public static boolean isBundleChange(final FlowDifference difference) {
Review Comment:
This only seems to be used once, is it necessary?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]