Skip to content

NIFI-15714: Updating the logic to locate components within Connectors…#11005

Merged
rfellows merged 1 commit intoapache:NIFI-15258from
mcgilman:NIFI-15714
Mar 16, 2026
Merged

NIFI-15714: Updating the logic to locate components within Connectors…#11005
rfellows merged 1 commit intoapache:NIFI-15258from
mcgilman:NIFI-15714

Conversation

@mcgilman
Copy link
Contributor

… when authorizing and populating provenance events.

NIFI-15714: Fix provenance event handling for connector-managed components

Description

Provenance event authorization and DTO enrichment failed with a 404 ("The component that generated this event is no longer part of the data flow") for connections and remote group ports belonging to connector-managed process groups. This occurred because the existing lookups used rootGroup.findConnection() and rootGroup.findRemoteGroupPort(), which only search the root process group hierarchy and cannot reach the isolated process groups managed by connectors.

What's Changed

  • Added findConnectionIncludingConnectorManaged() and findRemoteGroupPortIncludingConnectorManaged() public methods to FlowController that search both the root process group hierarchy and all connector-managed process groups
  • Updated StandardProvenanceAuthorizableFactory to use the new FlowController methods for connection and remote group port authorization, replacing direct rootGroup.findConnection() / findRemoteGroupPort() calls
  • Updated ControllerFacade.setComponentDetails() to use the new FlowController methods for populating provenance event DTOs with group ID, connector ID, and component name for connections and remote group ports
  • Simplified the remote group port branch in setComponentDetails() to obtain the process group directly from remoteGroupPort.getProcessGroup() instead of the roundabout root.findProcessGroup() lookup, which had the same connector-managed scoping issue
  • Removed the now-unused root variable from setComponentDetails()
  • Added comprehensive unit tests for StandardProvenanceAuthorizableFactory covering all three factory methods across root group, connector-managed, and not-found scenarios
  • Added unit tests for ControllerFacade covering connection, remote group port, and not-found branches of setComponentDetails

Key Features

  • Consolidated lookup logic: Connector-aware component search is centralized on FlowController, eliminating duplication and providing a reusable API for future callers
  • Null-safe connector iteration: Both methods handle connectors with null activeFlowContext gracefully
  • Consistent pattern: All three branches in setComponentDetails (connectable, remote group port, connection) now obtain their process group directly from the component object

… when authorizing and populating provenance events.
@mcgilman mcgilman added the NIP-11 NIP-11 adds support for Connectors label Mar 13, 2026
Copy link
Contributor

@rfellows rfellows left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates here @mcgilman 👍

@rfellows rfellows merged commit 2209d96 into apache:NIFI-15258 Mar 16, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NIP-11 NIP-11 adds support for Connectors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants