You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "pvillard31 (via GitHub)" <gi...@apache.org> on 2025/04/04 15:41:07 UTC

[PR] NIFI-14435 - FlowComparator should offer deep recursive comparison [nifi]

pvillard31 opened a new pull request, #9848:
URL: https://github.com/apache/nifi/pull/9848

   # Summary
   
   [NIFI-14435](https://issues.apache.org/jira/browse/NIFI-14435) - FlowComparator should offer deep recursive comparison
   
   > Consider a versioned process group PG.
   > Add a new child process group inside of PG.
   > Do many modifications in the child PG (add processors, etc).
   > If showing local changes for PG, it'll only say that a process group childPG has been added but nothing about what has been done in childPG.
   > This JIRA is to add a new Flow Comparator Versioned Strategy in order to offer the option for a full exhaustive listing of the differences to also include the list of what is being added inside a newly added process group.
   > There is no intent with this work to change what is returned to the UI when showing local changes as it should be further evaluated in terms of side effects.
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [ ] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
   
   ### Pull Request Tracking
   
   - [ ] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
   - [ ] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
   
   ### Pull Request Formatting
   
   - [ ] Pull Request based on current revision of the `main` branch
   - [ ] Pull Request refers to a feature branch with one commit containing changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request creation.
   
   ### Build
   
   - [ ] Build completed using `mvn clean install -P contrib-check`
     - [ ] JDK 21
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


-- 
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: issues-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-14435 - FlowComparator should offer deep recursive comparison [nifi]

Posted by "pvillard31 (via GitHub)" <gi...@apache.org>.
pvillard31 commented on code in PR #9848:
URL: https://github.com/apache/nifi/pull/9848#discussion_r2029057347


##########
nifi-registry/nifi-registry-core/nifi-registry-flow-diff/src/main/java/org/apache/nifi/registry/flow/diff/StandardFlowComparator.java:
##########
@@ -529,16 +538,6 @@ private void compare(final VersionedProcessGroup groupA, final VersionedProcessG
             return;
         }
 
-        if (groupA == null) {
-            differences.add(difference(DifferenceType.COMPONENT_ADDED, groupA, groupB, groupA, groupB));
-            return;
-        }
-
-        if (groupB == null) {
-            differences.add(difference(DifferenceType.COMPONENT_REMOVED, groupA, groupB, groupA, groupB));
-            return;
-        }
-

Review Comment:
   This part is removed because this is dead code. This is already done with `compareComponents()` that would return true if groupA or groupB is null and add the same differences just a few lines before.



-- 
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: issues-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-14435 - FlowComparator should offer deep recursive comparison [nifi]

Posted by "pvillard31 (via GitHub)" <gi...@apache.org>.
pvillard31 commented on PR #9848:
URL: https://github.com/apache/nifi/pull/9848#issuecomment-2787021198

   Thanks @exceptionfactory - I just pushed a commit that removes the new strategy and instead updates the existing `DEEP` strategy. I also added full details for both deletion and addition of a child process group.


-- 
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: issues-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-14435 - FlowComparator should offer deep recursive comparison [nifi]

Posted by "pvillard31 (via GitHub)" <gi...@apache.org>.
pvillard31 commented on code in PR #9848:
URL: https://github.com/apache/nifi/pull/9848#discussion_r2029057347


##########
nifi-registry/nifi-registry-core/nifi-registry-flow-diff/src/main/java/org/apache/nifi/registry/flow/diff/StandardFlowComparator.java:
##########
@@ -529,16 +538,6 @@ private void compare(final VersionedProcessGroup groupA, final VersionedProcessG
             return;
         }
 
-        if (groupA == null) {
-            differences.add(difference(DifferenceType.COMPONENT_ADDED, groupA, groupB, groupA, groupB));
-            return;
-        }
-
-        if (groupB == null) {
-            differences.add(difference(DifferenceType.COMPONENT_REMOVED, groupA, groupB, groupA, groupB));
-            return;
-        }
-

Review Comment:
   This part is removed because this dead code. This is already done with `compareComponents()` that would return true and add the same differences just a few lines before.



-- 
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: issues-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-14435 - FlowComparator should offer deep recursive comparison [nifi]

Posted by "pvillard31 (via GitHub)" <gi...@apache.org>.
pvillard31 commented on PR #9848:
URL: https://github.com/apache/nifi/pull/9848#issuecomment-2785763002

   Thanks @exceptionfactory for the feedback.
   
   Great point on deletion. My thoughts were really in the context of showing changes between two versions (n and n+1) and in my mind, whoever is looking at the changes is most likely already familiar with version n, so I thought that showing only that the process group (and its content) was deleted is enough because I assumed that the person already knows what was inside the deleted process group. When adding a process group, there is no way to already know what's inside. That's the way I approached it. I can definitely also consider full details for the removal of a process group.
   
   I do agree with you that the existing strategy `DEEP` had a good meaning but it sounds like this is more about the level of metadata being returned rather than "deep" in the sense of recursive listing.
   
   I did think about just updating the DEEP strategy and I'm OK taking this approach to be honest, I was just concerned about potential side effects on existing APIs that rely on this (show local changes for versioned process groups being one).
   
   With this additional context, do you have any preference?


-- 
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: issues-unsubscribe@nifi.apache.org

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


Re: [PR] NIFI-14435 - FlowComparator should offer deep recursive comparison [nifi]

Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory merged PR #9848:
URL: https://github.com/apache/nifi/pull/9848


-- 
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: issues-unsubscribe@nifi.apache.org

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