mcgilman opened a new pull request, #11487:
URL: https://github.com/apache/nifi/pull/11487
…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.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]