pvillard31 opened a new pull request, #11166:
URL: https://github.com/apache/nifi/pull/11166

   # 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](https://issues.apache.org/jira/browse/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](https://issues.apache.org/jira/browse/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](https://issues.apache.org/jira/browse/NIFI-15776) / 
[NIFI-15830](https://issues.apache.org/jira/browse/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
   
   - [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue 
created
   
   ### 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](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
 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](https://apache.org/licenses/LICENSE-2.0) according to the [License 
Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` 
files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to