Skip to content

NIFI-14555 - Option to empty parameter values in git registry clients#9927

Merged
exceptionfactory merged 4 commits intoapache:mainfrom
pvillard31:NIFI-14555
May 13, 2025
Merged

NIFI-14555 - Option to empty parameter values in git registry clients#9927
exceptionfactory merged 4 commits intoapache:mainfrom
pvillard31:NIFI-14555

Conversation

@pvillard31
Copy link
Copy Markdown
Contributor

Summary

NIFI-14555 - Option to empty parameter values in git registry clients

The goal of this PR is to add an optional property for all Git based registry clients. The property "Empty Parameters" will default to false to retain current behavior. If set to true, all values of all parameters will be removed before the flow is being versioned and stored in the git repo.

Parameters are usually environment dependent and it might not be desirable to include in the versioned flow the parameters values that have been set in a lower/dev environment while designing the flow.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using mvn clean install -P contrib-check
    • JDK 21

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

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 @pvillard31, the general concept sounds useful. As I often comment on Boolean properties, this might be better expressed as an enumeration like Parameter Context Values with options of Retain and Remove, with Retain being the default option. Perhaps there aren't other options, but raising it for consideration. What do you think?

@pvillard31
Copy link
Copy Markdown
Contributor Author

Thanks @exceptionfactory - good point, adjusted the code

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 adjusting the approach @pvillard31. I noted one more recommendation to use an enum implementing DescribedValue for the definition, then this should be ready to go.

Comment on lines +97 to +98
static final AllowableValue RETAIN = new AllowableValue("retain", "Retain", "Will not modify the parameter values");
static final AllowableValue REMOVE = new AllowableValue("remove", "Remove", "Will remove the parameter values");
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 using AllowableValue, it would be helpful to define this as an enum, there the enum name can be the value itself, as opposed to the lowercase retain and remove. This also makes the property retrieval cleaner with asAllowableValue().

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.

Thanks @exceptionfactory - pushed a commit to use an enum instead

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 the updates @pvillard31, I pushed a small change to use the enum name() instead of an additional String value, aligning with other enum values. I plan to merge following a successful build.

@exceptionfactory exceptionfactory merged commit 2cfd6f4 into apache:main May 13, 2025
6 checks passed
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.

2 participants