You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "simonbence (via GitHub)" <gi...@apache.org> on 2023/03/06 22:11:46 UTC

[GitHub] [nifi] simonbence opened a new pull request, #7017: NIFI-11213 Showing version change in older (pre 1.18.0) contained version flows properly

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

   # Summary
   
   Contained versioned flows using registryUri to localize flows vere not handled properly when checking for local changes in the flow. This PR aims to solve this issue.
   
   [NIFI-11213](https://issues.apache.org/jira/browse/NIFI-11213)
   
   # 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 11
     - [ ] JDK 17
   
   ### 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


[GitHub] [nifi] markap14 commented on pull request #7017: NIFI-11213 Showing version change in older (pre 1.18.0) contained version flows properly

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

   Thanks @simonbence +1 merged to main.


-- 
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


[GitHub] [nifi] markap14 merged pull request #7017: NIFI-11213 Showing version change in older (pre 1.18.0) contained version flows properly

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


-- 
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


[GitHub] [nifi] simonbence commented on a diff in pull request #7017: NIFI-11213 Showing version change in older (pre 1.18.0) contained version flows properly

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


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/util/FlowDifferenceFilters.java:
##########
@@ -192,22 +193,13 @@ public static boolean isIgnorableVersionedFlowCoordinateChange(final FlowDiffere
                 final VersionedFlowCoordinates coordinatesB = versionedProcessGroupB.getVersionedFlowCoordinates();
 
                 if (coordinatesA != null && coordinatesB != null) {
-                    String registryUrlA = coordinatesA.getRegistryUrl();
-                    String registryUrlB = coordinatesB.getRegistryUrl();
-
-                    if (registryUrlA != null && registryUrlB != null && !registryUrlA.equals(registryUrlB)) {
-                        if (registryUrlA.endsWith("/")) {
-                            registryUrlA = registryUrlA.substring(0, registryUrlA.length() - 1);
-                        }
-
-                        if (registryUrlB.endsWith("/")) {
-                            registryUrlB = registryUrlB.substring(0, registryUrlB.length() - 1);
-                        }
-
-                        if (registryUrlA.equals(registryUrlB)) {
-                            return true;
-                        }
+                    if (coordinatesA.getStorageLocation() != null || coordinatesB.getStorageLocation() != null) {
+                        return false;
                     }
+
+                    return  !FlowDifferenceUtil.areRegistryStrictlyEqual(coordinatesA, coordinatesB)
+                            && FlowDifferenceUtil.areRegistryUrlsEqual(coordinatesA, coordinatesB)

Review Comment:
   My first approach and assumption was that, but with that, test `TestFlowDifferenceFilter#testFilterIgnorableVersionCoordinateDifferenceWithNonIgnorableDifference`has broken and after careful check, it turned out this distinction in the original code is deliberate. Our considerations might changed since but removing that would bring in a potential regression



-- 
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


[GitHub] [nifi] markap14 commented on a diff in pull request #7017: NIFI-11213 Showing version change in older (pre 1.18.0) contained version flows properly

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


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/util/FlowDifferenceFilters.java:
##########
@@ -192,22 +193,13 @@ public static boolean isIgnorableVersionedFlowCoordinateChange(final FlowDiffere
                 final VersionedFlowCoordinates coordinatesB = versionedProcessGroupB.getVersionedFlowCoordinates();
 
                 if (coordinatesA != null && coordinatesB != null) {
-                    String registryUrlA = coordinatesA.getRegistryUrl();
-                    String registryUrlB = coordinatesB.getRegistryUrl();
-
-                    if (registryUrlA != null && registryUrlB != null && !registryUrlA.equals(registryUrlB)) {
-                        if (registryUrlA.endsWith("/")) {
-                            registryUrlA = registryUrlA.substring(0, registryUrlA.length() - 1);
-                        }
-
-                        if (registryUrlB.endsWith("/")) {
-                            registryUrlB = registryUrlB.substring(0, registryUrlB.length() - 1);
-                        }
-
-                        if (registryUrlA.equals(registryUrlB)) {
-                            return true;
-                        }
+                    if (coordinatesA.getStorageLocation() != null || coordinatesB.getStorageLocation() != null) {
+                        return false;
                     }
+
+                    return  !FlowDifferenceUtil.areRegistryStrictlyEqual(coordinatesA, coordinatesB)
+                            && FlowDifferenceUtil.areRegistryUrlsEqual(coordinatesA, coordinatesB)

Review Comment:
   I don't think this logic is accurate. We're saying here "If the registry URLs are different but logically the same" - and the version is the same. Shouldn't the `!FlowDifferenceUtil.areRegistryStrictlyEqual(coordinatesA, coordinatesB)` be removed?



-- 
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