NIFI-7012: Refactored OnConfigurationRestored to support sensitive property validation#5415
NIFI-7012: Refactored OnConfigurationRestored to support sensitive property validation#5415markap14 merged 1 commit intoapache:mainfrom
Conversation
gresockj
left a comment
There was a problem hiding this comment.
Thanks for this fix, @mattyb149! A few minor suggestions and questions below. I haven't verified runtime behavior yet, but will shortly.
...ifi-framework-components/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
Outdated
Show resolved
Hide resolved
.../nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractComponentNode.java
Outdated
Show resolved
Hide resolved
.../nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractComponentNode.java
Outdated
Show resolved
Hide resolved
| } | ||
| final Optional<Parameter> parameterRef = parameterContext.getParameter(paramName); | ||
| if (parameterRef.isPresent()) { | ||
| ParameterDescriptor parameterDescriptor = parameterRef.get().getDescriptor(); |
There was a problem hiding this comment.
I think parameterDescriptor could still be final here.
...nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowSnippet.java
Show resolved
Hide resolved
...rk/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardReloadComponent.java
Show resolved
Hide resolved
| * | ||
| * @param context The ProcessContext associated with the Processor configuration | ||
| */ | ||
| public abstract void onConfigurationRestored(ProcessContext context); |
There was a problem hiding this comment.
Curious, why does ProcessorNode get an onConfigurationRestored method, but not ControllerServiceNode or ReportingTaskNode?
There was a problem hiding this comment.
They will eventually need one, but I think not right now because of NIFI-5547
|
I also verified the runtime behavior of this. |
gresockj
left a comment
There was a problem hiding this comment.
Thanks for the updates, @mattyb149! I just saw one comment left unaddressed -- after that I'll be a +1.
| } | ||
| final Optional<Parameter> parameterRef = parameterContext.getParameter(paramName); | ||
| if (parameterRef.isPresent()) { | ||
| ParameterDescriptor parameterDescriptor = parameterRef.get().getDescriptor(); |
There was a problem hiding this comment.
I think parameterDescriptor could still be final here.
…operty validation
|
Thanks @mattyb149 and @gresockj changes look good to me. +1 will merge to main |
…operty validation (apache#5415)
Thank you for submitting a contribution to Apache NiFi.
Please provide a short description of the PR here:
Description of PR
Validation of contexts/properties was sometimes happening out of the intended lifecycle order. For InvokeScriptedProcessor
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically
main)?Is your initial contribution a single, squashed commit? Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not
squashor use--forcewhen pushing to allow for clean monitoring of changes.For code changes:
mvn -Pcontrib-check clean installat the rootnififolder?LICENSEfile, including the mainLICENSEfile undernifi-assembly?NOTICEfile, including the mainNOTICEfile found undernifi-assembly?.displayNamein addition to .name (programmatic access) for each of the new properties?For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI for build issues and submit an update to your PR as soon as possible.