Skip to content

NIFI-15863 - User edits to newly-introduced component properties silently classified as environmental changes#11166

Merged
pvillard31 merged 2 commits into
apache:mainfrom
pvillard31:NIFI-15863
Apr 21, 2026
Merged

NIFI-15863 - User edits to newly-introduced component properties silently classified as environmental changes#11166
pvillard31 merged 2 commits into
apache:mainfrom
pvillard31:NIFI-15863

Conversation

@pvillard31
Copy link
Copy Markdown
Contributor

Summary

NIFI-15863 - User edits to newly-introduced component properties silently classified as environmental changes

When a newer bundle declares a static property that did not exist in the versioned flow snapshot, FlowDifferenceFilters.isPropertyAddedFromMigration (added in NIFI-15776) classifies the resulting PROPERTY_ADDED diff as environmental regardless of value. If the user later edits that property the diff relative to the registry is still PROPERTY_ADDED (the property descriptor is absent from the snapshot), so the edit is also swallowed as environmental: the flow is not marked dirty and the change cannot be committed through normal local-change workflows.

NIFI-15830 refined related behavior but only addressed cases detected through isNewPropertyWithDefaultValue, which compares valueB against the descriptor default. It did not tighten isPropertyAddedFromMigration, which continues to return true for any statically-declared property missing from the snapshot, independent of the value. As a result, user edits away from the default on a newly-introduced property remain indistinguishable from the framework-applied default and are still filtered out.

We need to tighten isPropertyAddedFromMigration to only treat a PROPERTY_ADDED diff as environmental when valueB equals the descriptor's default value. This preserves the NIFI-15776 / NIFI-15830 behavior for bundle upgrades (framework-applied defaults remain filtered), while surfacing genuine user edits as local changes.

Narrow regression: if a component's migrateProperties explicitly assigns a new static property to a non-default value, that value will now show as a local change and the user must commit once after upgrade.

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 contains commits signed with a registered key indicating Verified status

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 ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

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

@pvillard31 pvillard31 added the bug label Apr 21, 2026
Copy link
Copy Markdown
Contributor

@markap14 markap14 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 conceptually changes make sense. Just had one concern about the method name. Otherwise looks good.

Comment on lines +995 to +1000
return isNotDynamicProperty(fieldName.get(), componentNode);
if (!isNotDynamicProperty(fieldName.get(), componentNode)) {
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.

It looks like this is the only place we're using this method. Can we rename to isDynamicProperty and invert it? I don't like negations in method names but we definitely shouldn't be negating the result of a method called isNotDynamicProperty

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.

Fair, pushed a commit to remove the negation

@pvillard31 pvillard31 merged commit f62ad76 into apache:main Apr 21, 2026
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants