-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NIFI-3785: Added feature to move controller services between process … #8965
base: main
Are you sure you want to change the base?
Conversation
@markap14 @exceptionfactory I've resubmitted this PR with the changes done to the new UI. The backend is the same as it was in the closed PR(#7734), but the UI changes were done against the new UI. |
Thanks for putting in the work to refactor this for the new UI @Freedom9339. |
Thanks for the mention @exceptionfactory! I'll have a look... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @Freedom9339! I've left a number of comments below that mostly appear to be from using the Enable/Disable Service dialog has a starting point. Since that dialog needs to be used for both Services in the Flow and in the Controller Settings there area a number of considerations there that are not needed here.
In addition to the items below, please ensure you run prettier and that this PR isn't introducing any new lint issues (I think there are currently 31 left that we're slowly trying to work through). From nifi/nifi-frontend/src/main/frontend
please run:
$ npx nx prettier:format
$ npx nx lint
I will defer to @exceptionfactory or @markap14 for a more thorough review of the back end changes.
...ps/nifi/src/app/pages/flow-designer/state/controller-services/controller-services.effects.ts
Outdated
Show resolved
Hide resolved
...ps/nifi/src/app/pages/flow-designer/state/controller-services/controller-services.effects.ts
Outdated
Show resolved
Hide resolved
...ps/nifi/src/app/pages/flow-designer/state/controller-services/controller-services.reducer.ts
Outdated
Show resolved
Hide resolved
...i/common/controller-service/controller-service-table/controller-service-table.component.html
Outdated
Show resolved
Hide resolved
.../ui/common/controller-service/move-controller-service/move-controller-service.component.html
Outdated
Show resolved
Hide resolved
...pp/ui/common/controller-service/move-controller-service/move-controller-service.component.ts
Outdated
Show resolved
Hide resolved
...pp/ui/common/controller-service/move-controller-service/move-controller-service.component.ts
Outdated
Show resolved
Hide resolved
nifi-frontend/src/main/frontend/apps/nifi/src/app/state/shared/index.ts
Outdated
Show resolved
Hide resolved
...ps/nifi/src/app/pages/flow-designer/state/controller-services/controller-services.effects.ts
Outdated
Show resolved
Hide resolved
.../common/controller-service/move-controller-service/move-controller-service.component.spec.ts
Outdated
Show resolved
Hide resolved
@mcgilman Just checking in. Any updates on this? |
Thanks for the ping. Sorry for the delay, I'll try to get some more eyes on this PR this week. |
@mcgilman Sorry the pinging again. Just want to make sure this doesn't fall through the cracks. |
I just pulled down the latest. After rebasing against current
I then tried running with the built application but I'm seeing this error in dev tools when attempting to open the
Once the PR is updated I should be able to get some more eyes on it quickly. |
9392904
to
9009d70
Compare
@mcgilman I fixed the issue caused by rebasing and pushed. Thank You! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the rebase! I've left some additional feedback below.
.../src/app/pages/flow-designer/ui/move-controller-service/move-controller-service.component.ts
Outdated
Show resolved
Hide resolved
...ps/nifi/src/app/pages/flow-designer/state/controller-services/controller-services.effects.ts
Outdated
Show resolved
Hide resolved
...d/src/main/frontend/apps/nifi/src/app/pages/flow-designer/state/controller-services/index.ts
Outdated
Show resolved
Hide resolved
.../src/app/pages/flow-designer/ui/move-controller-service/move-controller-service.component.ts
Outdated
Show resolved
Hide resolved
...ps/nifi/src/app/pages/flow-designer/state/controller-services/controller-services.effects.ts
Outdated
Show resolved
Hide resolved
9009d70
to
5a86dbe
Compare
@mcgilman I've completed the change/fixes requested. Thank You! |
@mcgilman Sorry, I just realized my latest commit didn't go through. It's there now. |
c368f43
to
712413e
Compare
@mcgilman Any update on this? I just did a fresh rebase. |
There was a problem hiding this 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 @Freedom9339! I've left a few more comments below.
.../src/app/pages/flow-designer/ui/move-controller-service/move-controller-service.component.ts
Outdated
Show resolved
Hide resolved
.../src/app/pages/flow-designer/ui/move-controller-service/move-controller-service.component.ts
Outdated
Show resolved
Hide resolved
...rc/app/pages/flow-designer/ui/move-controller-service/move-controller-service.component.html
Outdated
Show resolved
Hide resolved
.../src/app/pages/flow-designer/ui/move-controller-service/move-controller-service.component.ts
Outdated
Show resolved
Hide resolved
...rc/app/pages/flow-designer/ui/move-controller-service/move-controller-service.component.html
Outdated
Show resolved
Hide resolved
...rc/app/pages/flow-designer/ui/move-controller-service/move-controller-service.component.html
Outdated
Show resolved
Hide resolved
...rc/app/pages/flow-designer/ui/move-controller-service/move-controller-service.component.html
Outdated
Show resolved
Hide resolved
712413e
to
275c18d
Compare
@mcgilman Thank you for the review. I've made the requested changes. Thank You. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Freedom9339 Thanks again for the updates! It's looking good. I've left a couple comments and I've noted a number of nit-picky coding style things to better follow some of the conventions currently practiced.
.../src/app/pages/flow-designer/ui/move-controller-service/move-controller-service.component.ts
Outdated
Show resolved
Hide resolved
...rc/app/pages/flow-designer/ui/move-controller-service/move-controller-service.component.html
Outdated
Show resolved
Hide resolved
|
||
// build the form | ||
this.moveControllerServiceForm = this.formBuilder.group({ | ||
processGroups: new FormControl('Process Group', Validators.required) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Process Group
is not a valid value for this field. We could initialize the value to null
but we're setting the value below. We could instead determine the value before creating the form and then just use the correct value when creating the FormControl
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean by this. "Process Group" is what is shown whenever there is no process group selected. The only time this happens is if there are no valid process groups available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first argument to the FormControl is the value. The string Process Group
is not a valid value. What you see in the control when no value is select comes from the mat-label
in the mat-form-field
. If you want something else than the mat-label
value you can specify a placeholder
on the mat-select
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I've removed the initial value.
.../src/app/pages/flow-designer/ui/move-controller-service/move-controller-service.component.ts
Outdated
Show resolved
Hide resolved
.../src/app/pages/flow-designer/ui/move-controller-service/move-controller-service.component.ts
Outdated
Show resolved
Hide resolved
.../src/app/pages/flow-designer/ui/move-controller-service/move-controller-service.component.ts
Outdated
Show resolved
Hide resolved
.../src/app/pages/flow-designer/ui/move-controller-service/move-controller-service.component.ts
Outdated
Show resolved
Hide resolved
.../src/app/pages/flow-designer/ui/move-controller-service/move-controller-service.component.ts
Outdated
Show resolved
Hide resolved
.../src/app/pages/flow-designer/ui/move-controller-service/move-controller-service.component.ts
Outdated
Show resolved
Hide resolved
nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/service/flow.service.ts
Outdated
Show resolved
Hide resolved
59ef48f
to
47df567
Compare
...esigner/ui/controller-service/move-controller-service/move-controller-service.component.html
Outdated
Show resolved
Hide resolved
47df567
to
94b6dd4
Compare
There was a problem hiding this 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 @Freedom9339. I've left a few comments below. I didn't call out a specific line but the new move-options
endpoint should not be providing options and exposing details for parent or child Process Groups that the end user does not have permissions to. Please ensure your trying out all these scenarios when your PR changes.
Thanks!
export const selectProcessGroupFlow = createSelector( | ||
selectFlowState, | ||
(state: FlowState) => state.flow.processGroupFlow | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer used and can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
import { | ||
ControllerServiceEntity, | ||
ControllerServiceReferencingComponent, | ||
ControllerServiceReferencingComponentEntity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unused and is causing a lint
warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
import { NifiSpinnerDirective } from 'apps/nifi/src/app/ui/common/spinner/nifi-spinner.directive'; | ||
import { MoveControllerServiceDialogRequestSuccess } from '../../../state/controller-services'; | ||
import { moveControllerService } from '../../../state/controller-services/controller-services.actions'; | ||
import { BreadcrumbEntity } from '../../../state/shared'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unused and is causing a lint
warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
controllerServiceDTO.getReferencingComponents().forEach(e -> { | ||
if (processGroup.getProcessGroup().findProcessor(e.getId()) == null | ||
&& processGroup.getProcessGroup().findControllerService(e.getId(), true, false) == null) { | ||
conflictingComponents.add("[" + e.getComponent().getName() + "]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I take away permissions from a component that references the Service I'm trying to remove this line generates a NullPointerException
2024-11-18 16:04:51,256 ERROR [NiFi Web Server-76] o.a.nifi.web.api.config.ThrowableMapper An unexpected error has occurred: java.lang.NullPointerException: Cannot invoke "org.apache.nifi.web.api.dto.ControllerServiceReferencingComponentDTO.getName()" because the return value of "org.apache.nifi.web.api.entity.ControllerServiceReferencingComponentEntity.getComponent()" is null. Returning Internal Server Error response.
java.lang.NullPointerException: Cannot invoke "org.apache.nifi.web.api.dto.ControllerServiceReferencingComponentDTO.getName()" because the return value of "org.apache.nifi.web.api.entity.ControllerServiceReferencingComponentEntity.getComponent()" is null
at org.apache.nifi.web.api.ControllerServiceResource.lambda$generateProcessGroupOption$18(ControllerServiceResource.java:751)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
selector: 'move-controller-service', | ||
standalone: true, | ||
templateUrl: './move-controller-service.component.html', | ||
imports: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A number of the imports
below are no longer used. Once they are removed from here, please ensure the the corresponding import
above is removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed unused imports.
…groups with the new UI
… component to flow-designer. Added disabling options that have a move conflict
…upflow in the state and just load the info needed.
…I call. Moved move dialog to ui/controller-service.
94b6dd4
to
bedb313
Compare
@mcgilman Sorry for the delay. I addressed the issues you mentioned and added more user validation to not expose any unauthorized components. I've tested every scenario I could think of. Please let me know if there is one I missed. |
…groups with the new UI
Summary
NIFI-3785: Added an option on the controller services grid that moves a controller service to a specified process group. The controller service can be moved to the parent process group or a child process group. However, it can only be moved one level at a time. If there are any scope conflicts with referencing components, the move will fail displaying the reason.
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000
NIFI-00000
Pull Request Formatting
main
branchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-check
Licensing
LICENSE
andNOTICE
filesDocumentation