rfellows opened a new pull request, #11893: URL: https://github.com/apache/nifi/pull/11893
# Summary [NIFI-16550](https://issues.apache.org/jira/browse/NIFI-16550) When enabling or disabling a Controller Service, the UI walks referencing components to collect revisions for the references API. `StandardNiFiServiceFacade` sets `referenceCycle` on a Controller Service that has already been visited and omits that node's `referencingComponents`. The client previously stopped only because an undefined list was treated as empty. This change records the cycle node's revision, then returns before recursing when `referenceCycle` is true. Real server responses should behave the same. If a response sets the flag and still includes children, the walk is bounded instead of recursing without limit. # Tracking ### 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 contains [commits signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) with a registered key indicating `Verified` status # Why The revision walk must visit nested Controller Services (service-only) and nested Processors and Reporting Tasks (schedulable). Cycle nodes are part of that graph: they still need their revision included, but their children must not be walked again. Relying on a missing child list is implicit. An explicit `referenceCycle` check matches the server contract and protects against a response that sets the flag and still includes children. # Changes - `ControllerServiceStateService.getReferencingComponentRevisions` records the revision of each matching referencing component (Controller Service for the service-only walk; Processor or Reporting Task for the schedulable walk), then returns before recursing when `component.referenceCycle` is true. - Uses `ControllerServiceReferencingComponentEntity` from `@nifi/shared`, accepts undefined children, optional-chains a missing `component`, keys the revision map by entity id, and no longer depends on `NiFiCommon.isEmpty`. - New `controller-service-state.service.spec.ts` (5 tests): - `updateReferencingServices`: nested Controller Services included, processors omitted; a cycle node whose children the server omits is included with its revision; a cycle node that still carries children is included but those children are not walked (cycle node revision asserted). - `updateReferencingSchedulableComponents`: processors and reporting tasks beneath nested services included; a cycle node's processor children are not walked and a sibling processor is still included. # Testing - New spec: 5 of 5 pass. Together with `controller-service-state.effects.spec.ts`: 21 of 21 pass. - Moving the `referenceCycle` return above the revision write makes the two service-only cycle tests fail. - Removing the guard makes the two tests where a cycle node carries children fail. - `npx nx lint nifi` passes; Prettier is clean on both files; `tsc --noEmit` for `apps/nifi/tsconfig.app.json` has no errors. - Known unrelated issue: `tsc` for `apps/nifi/tsconfig.spec.json` reports errors in other existing spec files (canvas renderer specs and `component-state.component.spec.ts`), none in the two changed files. The full nifi unit test suite was not run. -- 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]
