NIFI-9288: Updated data model to use for cnofig verification requests…#5452
NIFI-9288: Updated data model to use for cnofig verification requests…#5452markap14 wants to merge 3 commits intoapache:mainfrom
Conversation
|
Will review... |
gresockj
left a comment
There was a problem hiding this comment.
This refactor does make the config verification API look cleaner to me. Some minor comments, and then I plan to test out the behavior later this week.
| final Map<String, String> referencedAttributes = determineReferencedAttributes(properties, processorNode, parameterContext); | ||
|
|
||
| final ConfigurationAnalysisDTO dto = new ConfigurationAnalysisDTO(); | ||
| dto.setComponentId(processorId); | ||
| dto.setProperties(properties); | ||
| dto.setReferencedAttributes(referencedAttributes); | ||
|
|
||
| final ConfigurationAnalysisEntity entity = new ConfigurationAnalysisEntity(); | ||
| entity.setConfigurationAnalysis(dto); | ||
| return entity; |
There was a problem hiding this comment.
It seems that this whole section could be reused between the three analyzeXConfiguration methods.
There was a problem hiding this comment.
Yeah that's a good catch. Will do so.
| ) | ||
| public Response analyzeConfiguration( | ||
| @ApiParam(value = "The controller service id.", required = true) @PathParam("id") final String controllerServiceId, | ||
| @ApiParam(value = "The configuration verification request.", required = true) final ConfigurationAnalysisEntity configurationAnalysis) { |
There was a problem hiding this comment.
Perhaps "configuration analysis request"
| ) | ||
| public Response analyzeConfiguration( | ||
| @ApiParam(value = "The processor id.", required = true) @PathParam("id") final String processorId, | ||
| @ApiParam(value = "The processor configuration verification request.", required = true) final ConfigurationAnalysisEntity configurationAnalysis) { |
There was a problem hiding this comment.
"configuration analysis request"
| ) | ||
| public Response analyzeConfiguration( | ||
| @ApiParam(value = "The reporting task id.", required = true) @PathParam("id") final String reportingTaskId, | ||
| @ApiParam(value = "The configuration verification request.", required = true) final ConfigurationAnalysisEntity configurationAnalysis) { |
|
|
||
| VerifyControllerServiceConfigRequestEntity deleteConfigVerificationRequest(String serviceId, String verificationRequestId) throws NiFiClientException, IOException; | ||
| VerifyConfigRequestEntity deleteConfigVerificationRequest(String serviceId, String verificationRequestId) throws NiFiClientException, IOException; | ||
|
|
There was a problem hiding this comment.
What do you think about adding submitConfigAnalysisRequest here and in the other clients in order to support some new system tests?
There was a problem hiding this comment.
I think adding that in, along with system tests is definitely a good idea. But I don't think we should block this PR in order to provide system tests. And I'd recommend not implementing that in the client until we build the system tests that can exercise & verify the behavior. It's not immediately clear to me how this might be used from the client outside of the context of system tests, so I'd recommend we implement it in a future PR.
...ework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
Show resolved
Hide resolved
… so that only properties are necessary not the full component/config dtos. Also added endpoint necessary for determining which attributes are referenced by a component's properties and removed the referencedAttributes field from the compnoents themselves, since there's now a new endpoint for it. Also fixed a bug that was encountered where the VerifyConfigRequestDTO's complete flag was incorrect in case of failures.
…mponent, it populates default values instead of returning null for default values. Also ignore any properties that don't support expression language when determining which attributes are referenced
|
Thanks for the review @gresockj - addressed comments and rebased against main so used a force push. Thanks! |
… so that only properties are necessary not the full component/config dtos. Also added endpoint necessary for determining which attributes are referenced by a component's properties and removed the referencedAttributes field from the compnoents themselves, since there's now a new endpoint for it. Also fixed a bug that was encountered where the VerifyConfigRequestDTO's complete flag was incorrect in case of failures Signed-off-by: Joe Gresock <jgresock@gmail.com> This closes apache#5452.
… so that only properties are necessary not the full component/config dtos. Also added endpoint necessary for determining which attributes are referenced by a component's properties and removed the referencedAttributes field from the compnoents themselves, since there's now a new endpoint for it. Also fixed a bug that was encountered where the VerifyConfigRequestDTO's complete flag was incorrect in case of failures.
Thank you for submitting a contribution to Apache NiFi.
Please provide a short description of the PR here:
Description of PR
Enables X functionality; fixes bug NIFI-YYYY.
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.