NissimShiman commented on code in PR #9967:
URL: https://github.com/apache/nifi/pull/9967#discussion_r2157626826
##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java:
##########
@@ -2802,6 +2819,24 @@ public Set<ComponentDifferenceDTO>
createComponentDifferenceDtosForLocalModifica
return differencesByComponent.keySet();
}
+ private static final Pattern DIFFERENCE_DESCRIPTION_PATTERN =
Pattern.compile(".*artifact='(.*)'.*version='(.*)'].*version='(.*)']'$");
+
+ /*
+ * Create a custom difference with a simpler difference description, only
for matching descriptions.
+ */
+ DifferenceDTO createDifferenceDto(final FlowDifference difference) {
+ final DifferenceDTO dto = new DifferenceDTO();
+ dto.setDifferenceType(difference.getDifferenceType().getDescription());
+
+ String description = difference.getDescription();
+ final Matcher matcher =
DIFFERENCE_DESCRIPTION_PATTERN.matcher(description);
+ if (matcher.matches()) {
+ description = matcher.group(1) + " version " + matcher.group(2) + "
to " + matcher.group(3);
Review Comment:
I think this is a good idea as well. The default is unwieldy.
##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java:
##########
@@ -5531,12 +5531,7 @@ public FlowComparisonEntity getLocalModifications(final
String processGroupId) {
+ " but cannot find a Flow Registry with that identifier");
}
Review Comment:
Nice catch, based on the above code
--
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]