You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "markap14 (via GitHub)" <gi...@apache.org> on 2026/01/23 21:30:42 UTC

[PR] NIFI-15467: Ensure that Connectors' versions are automatically resolv… [nifi]

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

   …ed on startup
   
   - Allow connectors to specify Bundle Compatability when updating flow
   - Default to BundleCompatability.RESOLVE_BUNDLE when connectors are updating flows
   - Bug fixes; updated MockConnectorInitializationContext to extend from StandardConnectorInitializationContext to cut down on code duplication
   
   <!-- Licensed to the Apache Software Foundation (ASF) under one or more -->
   <!-- contributor license agreements.  See the NOTICE file distributed with -->
   <!-- this work for additional information regarding copyright ownership. -->
   <!-- The ASF licenses this file to You under the Apache License, Version 2.0 -->
   <!-- (the "License"); you may not use this file except in compliance with -->
   <!-- the License.  You may obtain a copy of the License at -->
   <!--     http://www.apache.org/licenses/LICENSE-2.0 -->
   <!-- Unless required by applicable law or agreed to in writing, software -->
   <!-- distributed under the License is distributed on an "AS IS" BASIS, -->
   <!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
   <!-- See the License for the specific language governing permissions and -->
   <!-- limitations under the License. -->
   
   # Summary
   
   [NIFI-00000](https://issues.apache.org/jira/browse/NIFI-00000)
   
   # 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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15467: Ensure that Connectors' versions are automatically resolv… [nifi]

Posted by "markap14 (via GitHub)" <gi...@apache.org>.
markap14 commented on code in PR #10811:
URL: https://github.com/apache/nifi/pull/10811#discussion_r2729232051


##########
nifi-commons/nifi-connector-utils/src/main/java/org/apache/nifi/components/connector/util/VersionedFlowUtils.java:
##########
@@ -390,189 +389,26 @@ public static void updateToLatestBundles(final VersionedProcessGroup processGrou
 
     /**
      * Updates the given processor to use the latest available bundle version.
-     * See {@link #getLatest(List)} for details on how version comparison is performed.
+     * See {@link ComponentBundleLookup#getLatestBundle(String)} for details on how version comparison is performed.
      *
      * @param processor the processor to update
      * @param componentBundleLookup the lookup used to find available bundles for the processor type
      */
     public static void updateToLatestBundle(final VersionedProcessor processor, final ComponentBundleLookup componentBundleLookup) {
-        final Bundle latest = getLatestBundle(processor, componentBundleLookup);
+        final Bundle latest = componentBundleLookup.getLatestBundle(processor.getType());
         processor.setBundle(latest);
     }
 
     /**
      * Updates the given controller service to use the latest available bundle version.
-     * See {@link #getLatest(List)} for details on how version comparison is performed.
+     * See {@link ComponentBundleLookup#getLatestBundle(String)} for details on how version comparison is performed.
      *
      * @param service the controller service to update
      * @param componentBundleLookup the lookup used to find available bundles for the service type
      */
     public static void updateToLatestBundle(final VersionedControllerService service, final ComponentBundleLookup componentBundleLookup) {
-        final Bundle latest = getLatestBundle(service, componentBundleLookup);
+        final Bundle latest = componentBundleLookup.getLatestBundle(service.getType());

Review Comment:
   Yeah, that's a good catch. We shouldn't be setting the bundle to null. So if doesn't have a bundle, we should just keep whatever is already set. Will update.



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15467: Ensure that Connectors' versions are automatically resolv… [nifi]

Posted by "sfc-gh-mpayne (via GitHub)" <gi...@apache.org>.
sfc-gh-mpayne commented on code in PR #10811:
URL: https://github.com/apache/nifi/pull/10811#discussion_r2729034172


##########
nifi-commons/nifi-connector-utils/src/main/java/org/apache/nifi/components/connector/util/VersionedFlowUtils.java:
##########
@@ -390,189 +389,26 @@ public static void updateToLatestBundles(final VersionedProcessGroup processGrou
 
     /**
      * Updates the given processor to use the latest available bundle version.
-     * See {@link #getLatest(List)} for details on how version comparison is performed.
+     * See {@link ComponentBundleLookup#getLatestBundle(String)} for details on how version comparison is performed.
      *
      * @param processor the processor to update
      * @param componentBundleLookup the lookup used to find available bundles for the processor type
      */
     public static void updateToLatestBundle(final VersionedProcessor processor, final ComponentBundleLookup componentBundleLookup) {
-        final Bundle latest = getLatestBundle(processor, componentBundleLookup);
+        final Bundle latest = componentBundleLookup.getLatestBundle(processor.getType());
         processor.setBundle(latest);
     }
 
     /**
      * Updates the given controller service to use the latest available bundle version.
-     * See {@link #getLatest(List)} for details on how version comparison is performed.
+     * See {@link ComponentBundleLookup#getLatestBundle(String)} for details on how version comparison is performed.
      *
      * @param service the controller service to update
      * @param componentBundleLookup the lookup used to find available bundles for the service type
      */
     public static void updateToLatestBundle(final VersionedControllerService service, final ComponentBundleLookup componentBundleLookup) {
-        final Bundle latest = getLatestBundle(service, componentBundleLookup);
+        final Bundle latest = componentBundleLookup.getLatestBundle(service.getType());

Review Comment:
   Yeah, that's a good catch. We shouldn't be setting the bundle to `null`. So if doesn't have a bundle, we should just keep whatever is already set. Will update.



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15467: Ensure that Connectors' versions are automatically resolv… [nifi]

Posted by "sfc-gh-mpayne (via GitHub)" <gi...@apache.org>.
sfc-gh-mpayne commented on code in PR #10811:
URL: https://github.com/apache/nifi/pull/10811#discussion_r2729034172


##########
nifi-commons/nifi-connector-utils/src/main/java/org/apache/nifi/components/connector/util/VersionedFlowUtils.java:
##########
@@ -390,189 +389,26 @@ public static void updateToLatestBundles(final VersionedProcessGroup processGrou
 
     /**
      * Updates the given processor to use the latest available bundle version.
-     * See {@link #getLatest(List)} for details on how version comparison is performed.
+     * See {@link ComponentBundleLookup#getLatestBundle(String)} for details on how version comparison is performed.
      *
      * @param processor the processor to update
      * @param componentBundleLookup the lookup used to find available bundles for the processor type
      */
     public static void updateToLatestBundle(final VersionedProcessor processor, final ComponentBundleLookup componentBundleLookup) {
-        final Bundle latest = getLatestBundle(processor, componentBundleLookup);
+        final Bundle latest = componentBundleLookup.getLatestBundle(processor.getType());
         processor.setBundle(latest);
     }
 
     /**
      * Updates the given controller service to use the latest available bundle version.
-     * See {@link #getLatest(List)} for details on how version comparison is performed.
+     * See {@link ComponentBundleLookup#getLatestBundle(String)} for details on how version comparison is performed.
      *
      * @param service the controller service to update
      * @param componentBundleLookup the lookup used to find available bundles for the service type
      */
     public static void updateToLatestBundle(final VersionedControllerService service, final ComponentBundleLookup componentBundleLookup) {
-        final Bundle latest = getLatestBundle(service, componentBundleLookup);
+        final Bundle latest = componentBundleLookup.getLatestBundle(service.getType());

Review Comment:
   Yeah, that's a good catch. We shouldn't be setting the bundle to `null`. So if doesn't have a bundle, we should just keep whatever is already set. Will update.



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15467: Ensure that Connectors' versions are automatically resolv… [nifi]

Posted by "bbende (via GitHub)" <gi...@apache.org>.
bbende commented on code in PR #10811:
URL: https://github.com/apache/nifi/pull/10811#discussion_r2729006079


##########
nifi-commons/nifi-connector-utils/src/main/java/org/apache/nifi/components/connector/util/VersionedFlowUtils.java:
##########
@@ -390,189 +389,26 @@ public static void updateToLatestBundles(final VersionedProcessGroup processGrou
 
     /**
      * Updates the given processor to use the latest available bundle version.
-     * See {@link #getLatest(List)} for details on how version comparison is performed.
+     * See {@link ComponentBundleLookup#getLatestBundle(String)} for details on how version comparison is performed.
      *
      * @param processor the processor to update
      * @param componentBundleLookup the lookup used to find available bundles for the processor type
      */
     public static void updateToLatestBundle(final VersionedProcessor processor, final ComponentBundleLookup componentBundleLookup) {
-        final Bundle latest = getLatestBundle(processor, componentBundleLookup);
+        final Bundle latest = componentBundleLookup.getLatestBundle(processor.getType());
         processor.setBundle(latest);
     }
 
     /**
      * Updates the given controller service to use the latest available bundle version.
-     * See {@link #getLatest(List)} for details on how version comparison is performed.
+     * See {@link ComponentBundleLookup#getLatestBundle(String)} for details on how version comparison is performed.
      *
      * @param service the controller service to update
      * @param componentBundleLookup the lookup used to find available bundles for the service type
      */
     public static void updateToLatestBundle(final VersionedControllerService service, final ComponentBundleLookup componentBundleLookup) {
-        final Bundle latest = getLatestBundle(service, componentBundleLookup);
+        final Bundle latest = componentBundleLookup.getLatestBundle(service.getType());

Review Comment:
   It looks like if there are no compatible bundles, then the standard look up returns `null`, would we only want to call `setBundle` if its not null?
   
   Alternatively, could consider the method in the API to return `Optional<Bundle>` in order to force scenarios like this to decide. The Java Doc does say it returns null if not found, so I could go either way on the API



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15467: Ensure that Connectors' versions are automatically resolv… [nifi]

Posted by "bbende (via GitHub)" <gi...@apache.org>.
bbende merged PR #10811:
URL: https://github.com/apache/nifi/pull/10811


-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org