You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "skeossei (via GitHub)" <gi...@apache.org> on 2026/08/20 17:06:13 UTC

[PR] NIFI-16236 - Validate versioned Parameter names and allow removal of legacy invalid Parameters. [nifi]

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

   <!-- 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-16236](https://issues.apache.org/jira/browse/NIFI-16236)
   
   Validates Parameter names while synchronizing versioned flows so invalid names cannot enter live Parameter Contexts. Allows deletion requests for legacy invalid Parameters so affected contexts can be repaired, while continuing to reject creation or modification of invalid names.
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [x] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI-16236) issue created
   
   ### Pull Request Tracking
   
   - [x] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
   - [x] 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
   
   - [x] Pull Request based on current revision of the `main` branch
   - [x] 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
   
   Focused tests completed using JDK 21:
   
   - `VersionedFlowSynchronizerTest`: 13 tests passed
   - `ParameterContextResourceTest`: 2 tests passed
   
   ### Licensing
   
   - [x] 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)
   - [x] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
   
   No new dependencies were added, so no `LICENSE` or `NOTICE` changes are required.
   
   ### Documentation
   
   - [x] Documentation formatting appears as expected in rendered files
   
   No documentation files were changed.


-- 
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-16236 - Validate versioned Parameter names and allow removal of legacy invalid Parameters. [nifi]

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


##########
nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ParameterNameValidator.java:
##########
@@ -0,0 +1,17 @@
+package org.apache.nifi.web.api.dto;
+
+import java.util.regex.Pattern;
+
+public final class ParameterNameValidator {

Review Comment:
   Placing in this class in the `nifi-client-dto` does not seem like the best place, it should go into `nifi-web-api`.



##########
nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ParameterNameValidator.java:
##########
@@ -0,0 +1,17 @@
+package org.apache.nifi.web.api.dto;

Review Comment:
   This class is missing a license header.



##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/web/api/ParameterContextResourceTest.java:
##########
@@ -0,0 +1,54 @@
+package org.apache.nifi.web.api;
+
+import org.apache.nifi.web.api.dto.ParameterContextDTO;
+import org.apache.nifi.web.api.dto.ParameterDTO;
+import org.apache.nifi.web.api.entity.ParameterEntity;
+import org.junit.jupiter.api.Test;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Set;
+
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+class ParameterContextResourceTest {
+    @Test
+    void testMutationAllowsRemovalOfParameterNameLoadedFromVersionedFlow() throws NoSuchMethodException {
+        final String invalidParameterName = "OPENFLOW_NETJETS_SECRET_{{ envi }}";
+        final ParameterDTO parameter = new ParameterDTO();
+        parameter.setName(invalidParameterName);
+
+        final ParameterEntity parameterEntity = new ParameterEntity();
+        parameterEntity.setParameter(parameter);
+
+        final ParameterContextDTO parameterContext = new ParameterContextDTO();
+        parameterContext.setParameters(Set.of(parameterEntity));
+
+        final Method validateParameterNames = ParameterContextResource.class.getDeclaredMethod("validateParameterNames", ParameterContextDTO.class);
+        validateParameterNames.setAccessible(true);

Review Comment:
   Using reflection in test should be avoided in general.



-- 
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-16236 - Validate versioned Parameter names and allow removal of legacy invalid Parameters. [nifi]

Posted by "skeossei (via GitHub)" <gi...@apache.org>.
skeossei closed pull request #11573: NIFI-16236 - Validate versioned Parameter names and allow removal of legacy invalid Parameters.
URL: https://github.com/apache/nifi/pull/11573


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