NIFI-8762 ADLSCredentialControllerService does not support EL for Storage Account name#5229
NIFI-8762 ADLSCredentialControllerService does not support EL for Storage Account name#5229adenes wants to merge 3 commits intoapache:mainfrom
Conversation
…rage Account name - Added FLOWFILE_ATTRIBUTES expression language support to the Storage Account Name and and also to the Storage Account Key property to be consistent with AzureStorageCredentialsControllerService - ADLSCredentialControllerService.ACCOUNT_KEY and ADLSCredentialControllerService.SAS_TOKEN PropertyDescriptor public constants are the same as AzureStorageUtils.ACCOUNT_KEY and AzureStorageUtils.PROP_SAS_TOKEN respectively, but they haven't been removed to keep backward compatibility.
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for providing this update @adenes! This looks like a straightforward change, and it will be helpful to align the properties in ADLSCredentialsControllerService with the properties in other services.
Although it will require a few additional changes, it seems like it would be better to replace the local PropertyDescriptor variables with direct references to the definitions in AzureStorageUtils. That will help clarify the relationship and avoid duplication.
| .description(AzureStorageUtils.ACCOUNT_KEY_BASE_DESCRIPTION) | ||
| .expressionLanguageSupported(ExpressionLanguageScope.NONE) | ||
| .build(); | ||
| public static final PropertyDescriptor ACCOUNT_KEY = AzureStorageUtils.ACCOUNT_KEY; |
There was a problem hiding this comment.
Instead of keeping the local ACCOUNT_KEY property descriptor, it would be better to replace existing references to use AzureStorageUtils.ACCOUNT_KEY directly.
There was a problem hiding this comment.
I was hesitant to remove this (actually first I removed then decided to keep it this way) because this is a public field so theoretically this could have been used by other (3rd party) processors so removing it would be a breaking change.
But I don't have a strong opinion on this. Would you remove it, @exceptionfactory ?
There was a problem hiding this comment.
Thanks for following up. Although it is a public field, processor variables are not part of the public API contract, just the property names themselves. Since the change would still preserve the existing property name, refactoring seems like the best approach.
There was a problem hiding this comment.
gotcha, updating the PR, thanks
| .fromPropertyDescriptor(AzureStorageUtils.PROP_SAS_TOKEN) | ||
| .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES) | ||
| .build(); | ||
| public static final PropertyDescriptor SAS_TOKEN = AzureStorageUtils.PROP_SAS_TOKEN; |
There was a problem hiding this comment.
Same as ACCOUNT_KEY, it would be better to replace references to SAS_TOKEN with AzureStorageUtils.PROP_SAS_TOKEN.
|
Thanks @exceptionfactory for the review, I have updated the PR according to your suggestion. I also added a test case to cover the changes. |
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for making the changes and adding the unit tests @adenes!
Do you have any other feedback @pvillard31?
…rage Account name - Added FLOWFILE_ATTRIBUTES expression language support to the Storage Account Name and and also to the Storage Account Key property to be consistent with AzureStorageCredentialsControllerService - ADLSCredentialControllerService.ACCOUNT_KEY and ADLSCredentialControllerService.SAS_TOKEN PropertyDescriptor public constants are the same as AzureStorageUtils.ACCOUNT_KEY and AzureStorageUtils.PROP_SAS_TOKEN respectively, but they haven't been removed to keep backward compatibility. NIFI-8762 Removed ADLSCredentialsControllerService.ACCOUNT_KEY and SAS_TOKEN static fields NIFI-8762 Add test for EL in Account Name and Account Key Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes apache#5229.
and also to the Storage Account Key property to be consistent with
AzureStorageCredentialsControllerService
PropertyDescriptor public constants are the same as AzureStorageUtils.ACCOUNT_KEY and
AzureStorageUtils.PROP_SAS_TOKEN respectively, but they haven't been removed to keep
backward compatibility.
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.