From 8b1d625e72a07d90dffc761bed0bdb8885d3225f Mon Sep 17 00:00:00 2001 From: Pierre Villard Date: Mon, 7 Jul 2025 14:23:34 +0200 Subject: [PATCH 1/2] NIFI-14750 - Set registered flow snapshot metadata in AbstractEventAccess Signed-off-by: Pierre Villard --- .../apache/nifi/reporting/AbstractEventAccess.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/reporting/AbstractEventAccess.java b/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/reporting/AbstractEventAccess.java index 2345472f7646..81ee0f283dbe 100644 --- a/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/reporting/AbstractEventAccess.java +++ b/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/reporting/AbstractEventAccess.java @@ -53,6 +53,7 @@ import org.apache.nifi.groups.RemoteProcessGroup; import org.apache.nifi.processor.Relationship; import org.apache.nifi.provenance.ProvenanceEventRecord; +import org.apache.nifi.registry.flow.RegisteredFlowSnapshotMetadata; import org.apache.nifi.registry.flow.VersionControlInformation; import org.apache.nifi.registry.flow.VersionedFlowState; import org.apache.nifi.registry.flow.VersionedFlowStatus; @@ -540,6 +541,18 @@ ProcessGroupStatus getGroupStatus(final ProcessGroup group, final RepositoryStat final VersionControlInformation vci = group.getVersionControlInformation(); if (vci != null) { + final RegisteredFlowSnapshotMetadata registeredFlowSnapshotMetadata = new RegisteredFlowSnapshotMetadata(); + registeredFlowSnapshotMetadata.setBranch(vci.getBranch()); + registeredFlowSnapshotMetadata.setBucketIdentifier(vci.getBucketIdentifier()); + registeredFlowSnapshotMetadata.setFlowIdentifier(vci.getFlowIdentifier()); + registeredFlowSnapshotMetadata.setVersion(vci.getVersion()); + registeredFlowSnapshotMetadata.setComments(Map.of( + "registryName", vci.getRegistryName(), + "flowName", vci.getFlowName(), + "flowDescription", vci.getFlowDescription(), + "bucketName", vci.getBucketName(), + "status", vci.getStatus().getState().name()).toString()); + status.setRegisteredFlowSnapshotMetadata(registeredFlowSnapshotMetadata); try { final VersionedFlowStatus flowStatus = vci.getStatus(); if (flowStatus != null && flowStatus.getState() != null) { From 143a109a408f185292e771daf57e26c7a658bf7e Mon Sep 17 00:00:00 2001 From: Pierre Villard Date: Mon, 14 Jul 2025 18:34:43 +0200 Subject: [PATCH 2/2] review --- .../java/org/apache/nifi/reporting/AbstractEventAccess.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/reporting/AbstractEventAccess.java b/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/reporting/AbstractEventAccess.java index 81ee0f283dbe..1d0df564f07d 100644 --- a/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/reporting/AbstractEventAccess.java +++ b/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/reporting/AbstractEventAccess.java @@ -546,12 +546,6 @@ ProcessGroupStatus getGroupStatus(final ProcessGroup group, final RepositoryStat registeredFlowSnapshotMetadata.setBucketIdentifier(vci.getBucketIdentifier()); registeredFlowSnapshotMetadata.setFlowIdentifier(vci.getFlowIdentifier()); registeredFlowSnapshotMetadata.setVersion(vci.getVersion()); - registeredFlowSnapshotMetadata.setComments(Map.of( - "registryName", vci.getRegistryName(), - "flowName", vci.getFlowName(), - "flowDescription", vci.getFlowDescription(), - "bucketName", vci.getBucketName(), - "status", vci.getStatus().getState().name()).toString()); status.setRegisteredFlowSnapshotMetadata(registeredFlowSnapshotMetadata); try { final VersionedFlowStatus flowStatus = vci.getStatus();