NIFI-15694 Classify property-migration diffs as environmental changes in versioned flows - #11643
Open
mattcasters wants to merge 1 commit into
Open
Conversation
mattcasters
force-pushed
the
NIFI-15694-environmental-property-migration
branch
2 times, most recently
from
September 8, 2026 08:52
f982ce6 to
3b9540a
Compare
… in versioned flows Signed-off-by: Matt Casters <mattcasters@gmail.com>
mattcasters
force-pushed
the
NIFI-15694-environmental-property-migration
branch
from
September 8, 2026 08:59
3b9540a to
e6342b7
Compare
mattcasters
marked this pull request as ready for review
September 8, 2026 09:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This addresses NIFI-15694: after a NiFi upgrade, property migrations on processors/controller services are reported as local modifications on version-controlled process groups. That blocks Change Version / Git deploy, and Revert does not stick because
migratePropertiesis applied again.Use case
A customer is upgrading NiFi 2.9.0 → 2.11.0 with process groups tracked in Git.
AvroSchemaRegistry(NIFI-15960) replaced:Validate Field Names/avro-reg-validated-field-names=true/falseValidation Strategy=VALIDATE/NONEOn startup / flow sync,
migrateProperties()rewrites the live flow andflow.json. The Git (or Registry) snapshot for the currently tracked version still has the old property.getModifications()then reports:PROPERTY_REMOVEDValidate Field NamesPROPERTY_ADDEDValidation StrategyThe group becomes
LOCALLY_MODIFIED(orLOCALLY_MODIFIED_AND_STALEif Git also has newer commits). Change Version is refused because the group is dirty.Revert applies the Git snapshot (old property), then
StandardVersionedComponentSynchronizerre-runsmigratePropertieson the updated component so it remains valid. The new property comes back and the group is still dirty. Revert looks successful in the UI, then the local change reappears.This is the same general failure mode described on NIFI-15694 (also seen with e.g. ConsumeAzureEventHub
Authentication Strategy).AvroSchemaRegistryis an especially sharp instance because it is@DynamicProperty(named schemas):isStaticPropertyRemovedpreviously refused to treat the dropped static property as environmental, so it looked like a user-deleted dynamic property.Re-running migration after loading Git content is correct. The bug is classifying those diffs as user edits.
Changes
No change to
AvroSchemaRegistry.migratePropertiesitself.isStaticPropertyRemovedIf the versioned snapshot recorded the removed property as non-dynamic, treat it as a dropped static property even when the live component supports dynamic properties. User-deleted schemas (
dynamic=true) remain local changes.Dry-run
migratePropertiesComponentNode.previewMigratedProperties()(implemented for processors and controller services viaPropertyMigrationPreview) runsmigratePropertieson a copy of the snapshot properties. It does not persist and does not create controller services (NAR classloader is used in production).FlowDifferenceFilters.buildEnvironmentalChangeContextmarks a property diff environmental only when that dry-run explains it and the local value equals the migrated value:true→VALIDATEandfalse→NONEare both environmentalVALIDATE, localNONE) stays a local change (NIFI-15863 preserved more accurately)Tests in
TestFlowDifferenceFiltersandTestPropertyMigrationPreviewcovering snapshot-static removal on a@DynamicPropertycomponent, user-removed dynamic properties, both boolean→enum mappings, and post-migration user edits.Customer workarounds (until this is released)
Revert cannot clear the dirty state on an upgraded node.
Validation Strategy, then on the other environments stop version control and start it again from that commit (or rewrite the stored version identifier as described on the Jira). Revert will not help.Validation Strategywould be stored as a dynamic schema on 2.9AvroSchemaRegistry.Tracking
Verification
./mvnw -pl nifi-framework-bundle/nifi-framework/nifi-framework-components -am test -Dtest=TestFlowDifferenceFilters,TestPropertyMigrationPreview -Dsurefire.failIfNoSpecifiedTests=falsecontrib-checknot run on this draft (happy to run if reviewers want it)Review
This is a draft — I would very much appreciate a code review on the approach before we treat it as ready to merge.
In particular I would like feedback on:
migratePropertiesas the source of truth vs. more value-matching heuristicsdynamic=falseexemption inisStaticPropertyRemovedfor@DynamicPropertycomponentspreviewMigratedPropertiesbelongs onComponentNode(default no-op) with processor/CS overridesThank you in advance for taking a look.