Skip to content

NIFI-8762 ADLSCredentialControllerService does not support EL for Storage Account name#5229

Closed
adenes wants to merge 3 commits intoapache:mainfrom
adenes:NIFI-8762
Closed

NIFI-8762 ADLSCredentialControllerService does not support EL for Storage Account name#5229
adenes wants to merge 3 commits intoapache:mainfrom
adenes:NIFI-8762

Conversation

@adenes
Copy link
Copy Markdown
Contributor

@adenes adenes commented Jul 19, 2021

  • 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.

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 squash or use --force when pushing to allow for clean monitoring of changes.

For code changes:

  • Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
  • Have you written or updated unit tests to verify your changes?
  • Have you verified that the full build is successful on JDK 8?
  • Have you verified that the full build is successful on JDK 11?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
  • If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
  • If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

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.

…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.
Copy link
Copy Markdown
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of keeping the local ACCOUNT_KEY property descriptor, it would be better to replace existing references to use AzureStorageUtils.ACCOUNT_KEY directly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as ACCOUNT_KEY, it would be better to replace references to SAS_TOKEN with AzureStorageUtils.PROP_SAS_TOKEN.

@adenes
Copy link
Copy Markdown
Contributor Author

adenes commented Jul 19, 2021

Thanks @exceptionfactory for the review, I have updated the PR according to your suggestion. I also added a test case to cover the changes.

Copy link
Copy Markdown
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes and adding the unit tests @adenes!

Do you have any other feedback @pvillard31?

@asfgit asfgit closed this in 47eeabd Jul 20, 2021
krisztina-zsihovszki pushed a commit to krisztina-zsihovszki/nifi that referenced this pull request Jun 28, 2022
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants