Skip to content

NIFI-16156: Add connector-scoped Controller Service GET so View Canva… - #11487

Open
mcgilman wants to merge 1 commit into
apache:mainfrom
mcgilman:NIFI-16156
Open

NIFI-16156: Add connector-scoped Controller Service GET so View Canva…#11487
mcgilman wants to merge 1 commit into
apache:mainfrom
mcgilman:NIFI-16156

Conversation

@mcgilman

Copy link
Copy Markdown
Contributor

…s Go To Service works without Troubleshooting.

  • Adding response merging for the Controller Service endpoints.

NIFI-16156: Add connector-scoped Controller Service GET so View Canvas Go To Service works without Troubleshooting

Problem

The "Go To Service" affordance on the property table needs to resolve a Controller Service by ID before it can navigate to it. For services managed by a Connector, the only existing lookup was GET /controller-services/{id}, which is gated so that it only succeeds while the Connector is in Troubleshooting mode. As a result, "Go To Service" was non-functional for Connector-managed services when viewing the canvas normally (outside Troubleshooting).

Changes

Backend (nifi-web-api)

  • Added GET /connectors/{id}/controller-services/{controllerServiceId} to ConnectorResource, authorized via READ on the Connector resource (not the underlying service), and resolved through locateConnectorControllerService so it bypasses the Troubleshooting gate — mirroring the pattern already established for connector-scoped Controller Service state (NIFI-15549).
  • Supports the standard uiOnly=true query param, stripping non-UI-relevant fields the same way ControllerServiceResource.getControllerService does.
  • Added NiFiServiceFacade.getConnectorControllerService / StandardNiFiServiceFacade implementation.

Cluster response merging (nifi-framework-cluster)

  • Registered the new endpoint's URI pattern with the existing ControllerServiceEndpointMerger, so GET responses across cluster nodes are properly merged (validation status/errors, bulletins, referencing-component permissions) instead of an arbitrary node's response being returned unmerged.
  • Also closed a related pre-existing gap: the connector-scoped Controller Services list endpoint (GET /connectors/{id}/flow/process-groups/{processGroupId}/controller-services) had no merger registered either; added its pattern to the existing ControllerServicesEndpointMerger.

Toolkit client

  • Added ConnectorClient.getControllerService / JerseyConnectorClient implementation for the new endpoint.

Frontend (nifi-frontend, upstream only)

  • connector.service.ts: added getControllerService(connectorId, controllerServiceId).
  • connector-canvas.effects.ts and connector-controller-services.effects.ts: wired goToService to call the new connector-scoped endpoint, then dispatch navigateToControllerService and close the dialog.
    • The fetch subscription tears down via takeUntil(dialogRef.afterClosed()) rather than the service's lifetime, so it doesn't outlive the dialog.
    • Navigation is dispatched before the dialog closes, avoiding a race between the two.
    • If the Connector id can't be resolved from the route, a banner error is dispatched instead of silently doing nothing.

Testing

  • TestConnectorResource: new endpoint success, uiOnly=true, and not-authorized cases.
  • StandardNiFiServiceFacadeTest: not-found case for the new facade method.
  • New ControllerServiceEndpointMergerTest / ControllerServicesEndpointMergerTest: canHandle coverage for the connector-scoped patterns (including negative cases for malformed UUIDs, wrong HTTP method, and non-matching sub-paths).
  • connector-canvas.effects.spec.ts / connector-controller-services.effects.spec.ts: success (fetch → navigate → close), HTTP error (banner error), and missing-connector-id (banner error, no HTTP call) cases for goToService in both dialogs.

…s Go To Service works without Troubleshooting.

- Adding response merging for the Controller Service endpoints.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant