markap14 commented on code in PR #11677:
URL: https://github.com/apache/nifi/pull/11677#discussion_r4329695942


##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/components/connector/StandardConnectorNode.java:
##########
@@ -487,16 +487,20 @@ private Map<String, StepConfiguration> 
migrateProperties(final List<VersionedCon
             initial.put(versionedConfigStep.getName(), new 
StepConfiguration(toValueReferenceMap(versionedConfigStep)));
         }
 
+        return migrateProperties(getConnector(), initial);
+    }
+
+    private Map<String, StepConfiguration> migrateProperties(final Connector 
connector, final Map<String, StepConfiguration> initial) {
         final Set<String> persistedStepNames = new 
LinkedHashSet<>(initial.keySet());
-        final Map<String, StepConfiguration> migratedProperties = 
migratePersistedProperties(initial);
-        return applyMissingRequiredPropertyDefaults(migratedProperties, 
persistedStepNames, getConnector().getConfigurationSteps());
+        final Map<String, StepConfiguration> migratedProperties = 
migratePersistedProperties(connector, initial);
+        return applyMissingRequiredPropertyDefaults(migratedProperties, 
persistedStepNames, connector.getConfigurationSteps());
     }
 
-    private Map<String, StepConfiguration> migratePersistedProperties(final 
Map<String, StepConfiguration> initial) {
+    private Map<String, StepConfiguration> migratePersistedProperties(final 
Connector connector, final Map<String, StepConfiguration> initial) {
         final StandardConnectorPropertyConfiguration propertyConfiguration = 
new StandardConnectorPropertyConfiguration(initial, this.toString());
-        try (final NarCloseable ignored = 
NarCloseable.withComponentNarLoader(extensionManager, 
getConnector().getClass(), getIdentifier())) {
-            getConnector().migrateProperties(propertyConfiguration);
-            return 
retainDeclaredProperties(propertyConfiguration.getMutatedProperties(), 
getConnector().getConfigurationSteps());
+        try (final NarCloseable ignored = 
NarCloseable.withComponentNarLoader(extensionManager, connector.getClass(), 
getIdentifier())) {

Review Comment:
   [Claude Opus 5.5] @mcgilman Good catch. During a version change, 
`StandardReloadComponent` registers the new version's `InstanceClassLoader` 
only after `replaceConnector` returns, so looking up the connector ID still 
returned the old version's classloader while the replacement migrated. 
`migratePersistedProperties` now uses 
`NarCloseable.withComponentNarLoader(connector.getClass().getClassLoader())`, 
matching how `replaceConnector` already runs `initialize` and the 
step-configured callback. 
`testReplaceConnectorMigratesConfigurationUsingReplacement` now makes the ID 
lookup return a separate "previous version" classloader and verifies that the 
replacement's `migrateProperties` sees its own classloader. Addressed in 
bf1996d8774.



##########
nifi-frontend/src/main/frontend/apps/nifi/src/app/service/extension-types.service.ts:
##########
@@ -103,4 +103,13 @@ export class ExtensionTypesService {
     getConnectorTypes(): Observable<any> {
         return 
this.httpClient.get(`${ExtensionTypesService.API}/flow/connector-types`);
     }
+
+    getConnectorVersionsForType(connectorType: string, bundle: Bundle): 
Observable<any> {
+        const params = {
+            bundleGroupFilter: bundle.group,
+            bundleArtifactFilter: bundle.artifact,
+            type: connectorType
+        };

Review Comment:
   [Claude Opus 5.5] @mcgilman Agreed. I added `ConnectorTypesEndpointMerger`, 
which delegates to `DocumentedTypesMerger.mergeDocumentedTypes()` like the 
other types mergers, and registered it in `StandardHttpResponseMapper`. 
`DocumentedTypeDTO` equality includes the bundle version, so only versions 
installed on every node are offered. 
`StandardHttpResponseMapperTest.testConnectorTypesMergedAcrossNodes` covers 
three nodes with different version sets and verifies that only the common 
version is returned. Addressed in bf1996d8774.



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