You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "NissimShiman (via GitHub)" <gi...@apache.org> on 2025/12/26 18:17:37 UTC

[PR] NIFI-12598 Allow Starting/Stopping of PG components to be recorded in Flow Configuration History when started/stopped at PG level [nifi]

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

   
   
   <!-- Licensed to the Apache Software Foundation (ASF) under one or more -->
   <!-- contributor license agreements.  See the NOTICE file distributed with -->
   <!-- this work for additional information regarding copyright ownership. -->
   <!-- The ASF licenses this file to You under the Apache License, Version 2.0 -->
   <!-- (the "License"); you may not use this file except in compliance with -->
   <!-- the License.  You may obtain a copy of the License at -->
   <!--     http://www.apache.org/licenses/LICENSE-2.0 -->
   <!-- Unless required by applicable law or agreed to in writing, software -->
   <!-- distributed under the License is distributed on an "AS IS" BASIS, -->
   <!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
   <!-- See the License for the specific language governing permissions and -->
   <!-- limitations under the License. -->
   
   # Summary
   
   [NIFI-12598](https://issues.apache.org/jira/browse/NIFI-12598)
   This allows Starting/Stopping of PG components to be recorded in Flow Configuration History when started/stopped at PG level
   
   This code is also called when changing parameter context values (whether stored in NiFi or in an external parameter context provider), as well as when local versioned process group changes are reverted (or changed to a different version), as well as when a process group is replaced (i.e. using toolkit's cli.sh nifi pg-replace)
   
   This allows internal components stop/starting to be captured in these cases as well.  
   
   These cases were also tested/verified as part of this effort.
   
   
   
   # 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 `./mvnw clean install -P contrib-check`
     - [ ] JDK 21
     - [ ] JDK 25
   
   ### 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-12598 Allow Starting/Stopping of PG components to be recorded in Flow Configuration History when started/stopped at PG level [nifi]

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


##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/ProcessGroupAuditor.java:
##########
@@ -273,6 +276,21 @@ private List<Action> getComponentActions(final String groupId, final Collection<
             port = processGroup.findOutputPort(componentId);
             if (port != null) {
                 actions.add(generateUpdateConnectableAction(port, operation, Component.OutputPort));
+                continue;
+            }
+
+            ProcessGroup internalProcessGroup = processGroup.findProcessGroup(componentId);
+            if (internalProcessGroup != null) {
+                actions.add(generateUpdateProcessGroupAction(internalProcessGroup, operation));
+                continue;
+            }
+
+            RemoteGroupPort remoteGroupPort = processGroup.findRemoteGroupPort(componentId);
+            if (remoteGroupPort != null) {
+                RemoteProcessGroup remoteProcessGroup = remoteGroupPort.getRemoteProcessGroup();
+                if (remoteProcessGroup != null) {
+                    actions.add(generateUpdateRemoteProcessGroupAction(remoteProcessGroup, operation));
+                }
             }

Review Comment:
   Is that intended to register an action on the RPG instead of the remote port?



-- 
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-12598 Allow Starting/Stopping of PG components to be recorded in Flow Configuration History when started/stopped at PG level [nifi]

Posted by "pvillard31 (via GitHub)" <gi...@apache.org>.
pvillard31 closed pull request #10696: NIFI-12598 Allow Starting/Stopping of PG components to be recorded in Flow Configuration History when started/stopped at PG level
URL: https://github.com/apache/nifi/pull/10696


-- 
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-12598 Allow Starting/Stopping of PG components to be recorded in Flow Configuration History when started/stopped at PG level [nifi]

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


##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/ProcessGroupAuditor.java:
##########
@@ -273,6 +276,21 @@ private List<Action> getComponentActions(final String groupId, final Collection<
             port = processGroup.findOutputPort(componentId);
             if (port != null) {
                 actions.add(generateUpdateConnectableAction(port, operation, Component.OutputPort));
+                continue;
+            }
+
+            ProcessGroup internalProcessGroup = processGroup.findProcessGroup(componentId);
+            if (internalProcessGroup != null) {
+                actions.add(generateUpdateProcessGroupAction(internalProcessGroup, operation));
+                continue;
+            }
+
+            RemoteGroupPort remoteGroupPort = processGroup.findRemoteGroupPort(componentId);
+            if (remoteGroupPort != null) {
+                RemoteProcessGroup remoteProcessGroup = remoteGroupPort.getRemoteProcessGroup();
+                if (remoteProcessGroup != null) {
+                    actions.add(generateUpdateRemoteProcessGroupAction(remoteProcessGroup, operation));
+                }
             }

Review Comment:
   Yes, this is the intended behavior.
   
   We don't capture Remote Port in the flow history auditing. [1]
   
   Any actions done to the remote port are captured as being done to the RPG. [2]
   
   [1] [List of capturable components](https://github.com/apache/nifi-api/blob/nifi-api-2.5.0/src/main/java/org/apache/nifi/action/Component.java)
   [2] There is auditing done for remote port [here](https://github.com/apache/nifi/blob/rel/nifi-2.7.2/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/RemoteProcessGroupAuditor.java#L412) as well.
   It is ultimately also captured as a [remotePG](https://github.com/apache/nifi/blob/rel/nifi-2.7.2/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/RemoteProcessGroupAuditor.java#L326) 



-- 
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-12598 Allow Starting/Stopping of PG components to be recorded in Flow Configuration History when started/stopped at PG level [nifi]

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


##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/ProcessGroupAuditor.java:
##########
@@ -273,6 +276,21 @@ private List<Action> getComponentActions(final String groupId, final Collection<
             port = processGroup.findOutputPort(componentId);
             if (port != null) {
                 actions.add(generateUpdateConnectableAction(port, operation, Component.OutputPort));
+                continue;
+            }
+
+            ProcessGroup internalProcessGroup = processGroup.findProcessGroup(componentId);
+            if (internalProcessGroup != null) {
+                actions.add(generateUpdateProcessGroupAction(internalProcessGroup, operation));
+                continue;
+            }
+
+            RemoteGroupPort remoteGroupPort = processGroup.findRemoteGroupPort(componentId);
+            if (remoteGroupPort != null) {
+                RemoteProcessGroup remoteProcessGroup = remoteGroupPort.getRemoteProcessGroup();
+                if (remoteProcessGroup != null) {
+                    actions.add(generateUpdateRemoteProcessGroupAction(remoteProcessGroup, operation));
+                }
             }

Review Comment:
   Thanks for the references, that makes sense



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