bobpaulin commented on code in PR #11581:
URL: https://github.com/apache/nifi/pull/11581#discussion_r3845924503


##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/components/connector/StandardConnectorNode.java:
##########
@@ -419,11 +420,57 @@ private Map<String, StepConfiguration> 
migrateProperties(final List<VersionedCon
             initial.put(versionedConfigStep.getName(), new 
StepConfiguration(toValueReferenceMap(versionedConfigStep)));
         }
 
+        final Set<String> persistedStepNames = new 
LinkedHashSet<>(initial.keySet());
         final StandardConnectorPropertyConfiguration propertyConfiguration = 
new StandardConnectorPropertyConfiguration(initial, this.toString());
         try (final NarCloseable ignored = 
NarCloseable.withComponentNarLoader(extensionManager, 
getConnector().getClass(), getIdentifier())) {
             getConnector().migrateProperties(propertyConfiguration);
+            return 
applyMissingRequiredPropertyDefaults(propertyConfiguration.getMutatedProperties(),
 persistedStepNames, getConnector().getConfigurationSteps());
         }
-        return propertyConfiguration.getMutatedProperties();
+    }
+
+    /**
+     * Fills in the default value for any required property that has no value 
in the migrated configuration, so a NAR
+     * upgrade that adds a required property with a default does not make the 
Connector invalid. Only required
+     * properties are filled, so inheriting a default cannot activate a 
dependent property. A step the Connector

Review Comment:
   Ok the tests adds clarity.  I find the comment confusing then.  Why is it 
important to the reader that "so inheriting a default cannot activate a 
dependent property"?
   
   Can this comment be more clear that it's just going to set everything and 
the dependencies are really the irrelevant part?



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