[jira] [Created] (NIFI-12549) Failing to change version when using parameter context provider

2023-12-27 Thread Gal Doron (Jira)
Gal Doron created NIFI-12549:


 Summary: Failing to change version when using parameter context 
provider
 Key: NIFI-12549
 URL: https://issues.apache.org/jira/browse/NIFI-12549
 Project: Apache NiFi
  Issue Type: Bug
  Components: Flow Versioning
Affects Versions: 1.22.0
Reporter: Gal Doron


When using AWS secret manager as a parameter context provider we get 
thefollowing error when trying to change flow versions

 
{code:java}
ava.lang.IllegalArgumentException: Parameters for Context 
[AWS-secret-manager-dev] cannot be manually updated because they are provided 
by Parameter Provider [a9bf83ea-0188-1000--b5a6b423]
at 
org.apache.nifi.parameter.StandardParameterContext.verifyCanSetParameters(StandardParameterContext.java:728)
at 
org.apache.nifi.parameter.StandardParameterContext.verifyCanSetParameters(StandardParameterContext.java:721)
at 
org.apache.nifi.parameter.StandardParameterContext.setParameters(StandardParameterContext.java:138)
at 
org.apache.nifi.flow.synchronization.StandardVersionedComponentSynchronizer.addMissingConfiguration(StandardVersionedComponentSynchronizer.java:2176)
at 
org.apache.nifi.flow.synchronization.StandardVersionedComponentSynchronizer.updateParameterContext(StandardVersionedComponentSynchronizer.java:1966)
at 
org.apache.nifi.flow.synchronization.StandardVersionedComponentSynchronizer.synchronize(StandardVersionedComponentSynchronizer.java:305)
at 
org.apache.nifi.flow.synchronization.StandardVersionedComponentSynchronizer.lambda$synchronize$0(StandardVersionedComponentSynchronizer.java:266)
at 
org.apache.nifi.controller.flow.AbstractFlowManager.withParameterContextResolution(AbstractFlowManager.java:550)
at 
org.apache.nifi.flow.synchronization.StandardVersionedComponentSynchronizer.synchronize(StandardVersionedComponentSynchronizer.java:261)
at 
org.apache.nifi.groups.StandardProcessGroup.synchronizeFlow(StandardProcessGroup.java:3974)
at 
org.apache.nifi.groups.StandardProcessGroup.updateFlow(StandardProcessGroup.java:3954)
at 
org.apache.nifi.web.dao.impl.StandardProcessGroupDAO.updateProcessGroupFlow(StandardProcessGroupDAO.java:435)
at 
org.apache.nifi.web.dao.impl.StandardProcessGroupDAO$$FastClassBySpringCGLIB$$10a99b47.invoke()
at 
org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at 
org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
at 
org.apache.nifi.audit.ProcessGroupAuditor.updateProcessGroupFlowAdvice(ProcessGroupAuditor.java:308)
at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at 
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634)
at 
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624)
at 
org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72)
at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at 
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at 
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)
at 
org.apache.nifi.web.dao.impl.StandardProcessGroupDAO$$EnhancerBySpringCGLIB$$32f6e8ff.updateProcessGroupFlow()
at 
org.apache.nifi.web.StandardNiFiServiceFacade$13.update(StandardNiFiServiceFacade.java:5772)
at 
org.apache.nifi.web.revision.NaiveRevisionManager.updateRevision(NaiveRevisionManager.java:130)
at 
org.apache.nifi.web.StandardNiFiServiceFacade.updateProcessGroupContents(StandardNiFiServiceFacade.java:5767)
at 

[jira] [Created] (NIFI-12550) Support OIDC Device Authorization Grant for API

2023-12-27 Thread Igor Milavec (Jira)
Igor Milavec created NIFI-12550:
---

 Summary: Support OIDC Device Authorization Grant for API
 Key: NIFI-12550
 URL: https://issues.apache.org/jira/browse/NIFI-12550
 Project: Apache NiFi
  Issue Type: Improvement
  Components: Security
Affects Versions: 1.23.2
 Environment: NiFi with OIDC provider configured
Reporter: Igor Milavec


Please add support for OIDC Device Authorization Grant. This is useful for 
running scripts that access the NiFi API from the CLI. At this time the options 
are:
 # Copy __Secure-Authorization-Bearer cookie from the browser session: not 
really a good practice, work and error prone
 # Enable MTLS: painful for the users as the browser starts to frequently 
challenge for the client cert and even if it worked fine, client certificate 
management process is typically lagging behind OIDC identity management
 # Use passwords: insecure and prohibited by policy

Having an API endpoint in the Access group that would allow the caller to 
exchange OIDC id or refresh token for a NiFi session token would be perfect for 
this use case.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] NIFI-12411: Update PublishAMQP to read AMQP headers value from FlowFile attributes and `amq$headers` string [nifi]

2023-12-27 Thread via GitHub


umarhussain15 commented on code in PR #8105:
URL: https://github.com/apache/nifi/pull/8105#discussion_r1437008408


##
nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/PublishAMQP.java:
##
@@ -58,36 +59,42 @@
 + "that happens you will see a log in both app-log and bulletin stating to 
that effect, and the FlowFile will be routed to the 'failure' relationship.")
 @SystemResourceConsideration(resource = SystemResource.MEMORY)
 @ReadsAttributes({
-@ReadsAttribute(attribute = "amqp$appId", description = "The App ID field 
to set on the AMQP Message"),
-@ReadsAttribute(attribute = "amqp$contentEncoding", description = "The 
Content Encoding to set on the AMQP Message"),
-@ReadsAttribute(attribute = "amqp$contentType", description = "The Content 
Type to set on the AMQP Message"),
-@ReadsAttribute(attribute = "amqp$headers", description = "The headers to 
set on the AMQP Message"),
-@ReadsAttribute(attribute = "amqp$deliveryMode", description = "The 
numeric indicator for the Message's Delivery Mode"),
-@ReadsAttribute(attribute = "amqp$priority", description = "The Message 
priority"),
-@ReadsAttribute(attribute = "amqp$correlationId", description = "The 
Message's Correlation ID"),
-@ReadsAttribute(attribute = "amqp$replyTo", description = "The value of 
the Message's Reply-To field"),
-@ReadsAttribute(attribute = "amqp$expiration", description = "The Message 
Expiration"),
-@ReadsAttribute(attribute = "amqp$messageId", description = "The unique ID 
of the Message"),
-@ReadsAttribute(attribute = "amqp$timestamp", description = "The timestamp 
of the Message, as the number of milliseconds since epoch"),
-@ReadsAttribute(attribute = "amqp$type", description = "The type of 
message"),
-@ReadsAttribute(attribute = "amqp$userId", description = "The ID of the 
user"),
-@ReadsAttribute(attribute = "amqp$clusterId", description = "The ID of the 
AMQP Cluster"),
+@ReadsAttribute(attribute = AbstractAMQPProcessor.AMQP_APPID_ATTRIBUTE, 
description = "The App ID field to set on the AMQP Message"),
+@ReadsAttribute(attribute = 
AbstractAMQPProcessor.AMQP_CONTENT_ENCODING_ATTRIBUTE, description = "The 
Content Encoding to set on the AMQP Message"),
+@ReadsAttribute(attribute = 
AbstractAMQPProcessor.AMQP_CONTENT_TYPE_ATTRIBUTE, description = "The Content 
Type to set on the AMQP Message"),
+@ReadsAttribute(attribute = AbstractAMQPProcessor.AMQP_HEADERS_ATTRIBUTE, 
description = "The headers to set on the AMQP Message"),
+@ReadsAttribute(attribute = 
AbstractAMQPProcessor.AMQP_DELIVERY_MODE_ATTRIBUTE, description = "The numeric 
indicator for the Message's Delivery Mode"),
+@ReadsAttribute(attribute = AbstractAMQPProcessor.AMQP_PRIORITY_ATTRIBUTE, 
description = "The Message priority"),
+@ReadsAttribute(attribute = 
AbstractAMQPProcessor.AMQP_CORRELATION_ID_ATTRIBUTE, description = "The 
Message's Correlation ID"),
+@ReadsAttribute(attribute = AbstractAMQPProcessor.AMQP_REPLY_TO_ATTRIBUTE, 
description = "The value of the Message's Reply-To field"),
+@ReadsAttribute(attribute = 
AbstractAMQPProcessor.AMQP_EXPIRATION_ATTRIBUTE, description = "The Message 
Expiration"),
+@ReadsAttribute(attribute = 
AbstractAMQPProcessor.AMQP_MESSAGE_ID_ATTRIBUTE, description = "The unique ID 
of the Message"),
+@ReadsAttribute(attribute = 
AbstractAMQPProcessor.AMQP_TIMESTAMP_ATTRIBUTE, description = "The timestamp of 
the Message, as the number of milliseconds since epoch"),
+@ReadsAttribute(attribute = AbstractAMQPProcessor.AMQP_TYPE_ATTRIBUTE, 
description = "The type of message"),
+@ReadsAttribute(attribute = AbstractAMQPProcessor.AMQP_USER_ID_ATTRIBUTE, 
description = "The ID of the user"),
+@ReadsAttribute(attribute = 
AbstractAMQPProcessor.AMQP_CLUSTER_ID_ATTRIBUTE, description = "The ID of the 
AMQP Cluster"),
 })
 public class PublishAMQP extends AbstractAMQPProcessor {
-private static final String ATTRIBUTES_PREFIX = "amqp$";
 
+public static final AllowableValue HEADERS_FROM_ATTRIBUTES = new 
AllowableValue("headersFromAttributes", "Attributes Matching Regex",
+"Select attributes based on regex pattern to put in rabbitmq 
headers. Key of the attribute will be used as header key");
+public static final AllowableValue HEADERS_FROM_STRING = new 
AllowableValue("headersFromString", "Attribute 'amp$headers' Value",
+"Prepare headers from 'amp$headers' attribute string");
+public static final AllowableValue HEADERS_FROM_BOTH = new 
AllowableValue("headersFromBoth", "Regex Match And 'amp$headers' Value",
+"Take headers from both sources: 'amp$headers' attribute and 
attributes matching Regex. In case of key duplication precedence property will 
define which value to take.");
 public static final PropertyDescriptor EXCHANGE = new 
PropertyDescriptor.Builder()
-.name("Exchange Name")
+ 

Re: [PR] NIFI-12411: Update PublishAMQP to read AMQP headers value from FlowFile attributes and `amq$headers` string [nifi]

2023-12-27 Thread via GitHub


umarhussain15 commented on code in PR #8105:
URL: https://github.com/apache/nifi/pull/8105#discussion_r1437011582


##
nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/ConsumeAMQP.java:
##
@@ -191,6 +204,19 @@ public class ConsumeAMQP extends 
AbstractAMQPProcessor {
 objectMapper = new ObjectMapper();
 }
 
+@OnScheduled
+public void onScheduled(ProcessContext context) {
+super.onScheduled(context);
+batchSize = context.getProperty(BATCH_SIZE).asInteger();
+queueName = context.getProperty(QUEUE).getValue();
+headerFormat = context.getProperty(HEADER_FORMAT).getValue();
+headerAttributePrefix = 
context.getProperty(HEADER_KEY_PREFIX).getValue();
+removeCurlyBraces=context.getProperty(REMOVE_CURLY_BRACES).asBoolean();
+valueSeparatorForHeaders = 
context.getProperty(HEADER_SEPARATOR).getValue();
+autoAcknowledge = context.getProperty(AUTO_ACKNOWLEDGE).asBoolean();
+prefetchCount =  context.getProperty(PREFETCH_COUNT).asInteger();

Review Comment:
   I moved these to class level variables since they are only evaluated when 
processor is scheduled and will not change during `onTrigger`. Most of them 
don't have `ExpressionLanguageScope.FLOWFILE_ATTRIBUTES` or only have 
`ExpressionLanguageScope.ENVIRONMENT`.
   But I can move them back to be method local, if they don't provide any 
benefit performance wise.



-- 
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-unsubscr...@nifi.apache.org

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



Re: [PR] NIFI-12529: Enable/Disable Controller Service [nifi]

2023-12-27 Thread via GitHub


rfellows commented on PR #8185:
URL: https://github.com/apache/nifi/pull/8185#issuecomment-1870277075

   will review


-- 
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-unsubscr...@nifi.apache.org

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



[PR] Nifi 12505 system diagnostics [nifi]

2023-12-27 Thread via GitHub


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

   # Summary
   
   [NIFI-12505](https://issues.apache.org/jira/browse/NIFI-12505)
   
   * Added System Diagnostics dialog
   * Refactored Status History to follow the same pattern where we use one 
action to initiate the load and open of the dialog rather than letting the 
dialog initiate the load after it is opened.


-- 
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-unsubscr...@nifi.apache.org

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



[jira] [Updated] (NIFI-12505) System Diagnostics

2023-12-27 Thread Rob Fellows (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-12505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rob Fellows updated NIFI-12505:
---
Status: Patch Available  (was: In Progress)

> System Diagnostics
> --
>
> Key: NIFI-12505
> URL: https://issues.apache.org/jira/browse/NIFI-12505
> Project: Apache NiFi
>  Issue Type: Sub-task
>Reporter: Rob Fellows
>Assignee: Rob Fellows
>Priority: Major
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] NIFI-12394 when synching to a VersionedFlow, make sure processor references to new controller services are valid [nifi]

2023-12-27 Thread via GitHub


NissimShiman commented on PR #8184:
URL: https://github.com/apache/nifi/pull/8184#issuecomment-1870398821

   Reviewing...


-- 
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-unsubscr...@nifi.apache.org

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



Re: [PR] NIFI-12547: Set the width of the Property editor. [nifi]

2023-12-27 Thread via GitHub


rfellows commented on PR #8188:
URL: https://github.com/apache/nifi/pull/8188#issuecomment-1870407007

   reviewing...


-- 
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-unsubscr...@nifi.apache.org

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



Re: [PR] NIFI-12547: Set the width of the Property editor. [nifi]

2023-12-27 Thread via GitHub


rfellows merged PR #8188:
URL: https://github.com/apache/nifi/pull/8188


-- 
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-unsubscr...@nifi.apache.org

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



[jira] [Commented] (NIFI-12547) Fix issue with Property Editor Width

2023-12-27 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/NIFI-12547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17800817#comment-17800817
 ] 

ASF subversion and git services commented on NIFI-12547:


Commit 211d1001f2efb3e386bdf747124ddc0da7d09489 in nifi's branch 
refs/heads/main from Matt Gilman
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=211d1001f2 ]

NIFI-12547: (#8188)

- Set the width of the Property editor. This ensures the width looks correct 
and the overflow scroll policy works as expected.
- Fixed table layout issues where width: 100% from listing table wasn't correct.

This closes #8188

> Fix issue with Property Editor Width
> 
>
> Key: NIFI-12547
> URL: https://issues.apache.org/jira/browse/NIFI-12547
> Project: Apache NiFi
>  Issue Type: Sub-task
>Reporter: Matt Gilman
>Assignee: Matt Gilman
>Priority: Major
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (NIFI-12547) Fix issue with Property Editor Width

2023-12-27 Thread Rob Fellows (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-12547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rob Fellows updated NIFI-12547:
---
Fix Version/s: 2.0.0
   Resolution: Fixed
   Status: Resolved  (was: Patch Available)

> Fix issue with Property Editor Width
> 
>
> Key: NIFI-12547
> URL: https://issues.apache.org/jira/browse/NIFI-12547
> Project: Apache NiFi
>  Issue Type: Sub-task
>Reporter: Matt Gilman
>Assignee: Matt Gilman
>Priority: Major
> Fix For: 2.0.0
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] NIFI-12529: Enable/Disable Controller Service [nifi]

2023-12-27 Thread via GitHub


rfellows commented on PR #8185:
URL: https://github.com/apache/nifi/pull/8185#issuecomment-1870425764

   reviewing


-- 
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-unsubscr...@nifi.apache.org

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



Re: [PR] Nifi 12505 system diagnostics [nifi]

2023-12-27 Thread via GitHub


mcgilman commented on PR #8190:
URL: https://github.com/apache/nifi/pull/8190#issuecomment-1870440114

   Will review...


-- 
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-unsubscr...@nifi.apache.org

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



[jira] [Created] (NIFI-12551) Fix dialog resizing when changing tabs

2023-12-27 Thread Rob Fellows (Jira)
Rob Fellows created NIFI-12551:
--

 Summary: Fix dialog resizing when changing tabs
 Key: NIFI-12551
 URL: https://issues.apache.org/jira/browse/NIFI-12551
 Project: Apache NiFi
  Issue Type: Sub-task
Reporter: Rob Fellows
 Attachments: Kapture 2023-12-27 at 11.46.46.gif

The processor configuration dialog seems to adjust size when changing tabs. See 
the attached screen recording.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] NIFI-11858 Configurable Column Name Normalization in PutDatabaseRecord and UpdateDatabaseTable [nifi]

2023-12-27 Thread via GitHub


dan-s1 commented on code in PR #7544:
URL: https://github.com/apache/nifi/pull/7544#discussion_r1437164753


##
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UpdateDatabaseTable.java:
##
@@ -460,15 +488,18 @@ public void onTrigger(final ProcessContext context, final 
ProcessSession session
 
 private synchronized OutputMetadataHolder checkAndUpdateTableSchema(final 
Connection conn, final DatabaseAdapter databaseAdapter, final RecordSchema 
schema,
 final 
String catalogName, final String schemaName, final String tableName,
-final 
boolean createIfNotExists, final boolean translateFieldNames, final boolean 
updateFieldNames,
+final 
boolean createIfNotExists, final boolean translateFieldNames,
+final 
TranslationStrategy translationStrategy, Pattern translationRegex, final 
boolean updateFieldNames,
 final 
Set primaryKeyColumnNames, final boolean quoteTableName, final boolean 
quoteColumnNames) throws IOException {
 // Read in the current table metadata, compare it to the reader's 
schema, and
 // add any columns from the schema that are missing in the table
+//final ColumnNameNormalizer normalizer = new 
ColumnNameNormalizer(translateFieldNames, translationStrategy, 
translationRegex);

Review Comment:
   Remove commented out code



##
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/ColumnNameNormalizerUtility.java:
##
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+
+package org.apache.nifi.processors.standard.db;
+
+
+import java.util.Objects;
+import java.util.regex.Pattern;
+
+/**
+ * ColumnNameNormalizerUtility is a utility class that helps to normalize 
column names. It provides various strategies to
+ * modify column names based on the TranslationStrategy enum. Column names can 
be normalized by removing underscores,
+ * spaces, all special characters, or by using a custom regular expression 
defined by the user.
+ */
+public class ColumnNameNormalizerUtility {
+// Regular expression to remove all special characters from a string.
+private static final Pattern REMOVE_ALL_SPECIAL_CHAR_REGEX = 
Pattern.compile("[^a-zA-Z0-9]");
+
+/**
+ * Normalizes the given column name based on the specified strategy.
+ *
+ * @param colName The column name to be normalized.
+ * @param isTranslationEnabled Boolean value to denote normalization is 
enabled
+ * @param strategy The TranslationStrategy for normalizing column name
+ * @param translationRegex Regex For translation
+ * @return The normalized column name as a String.
+ */
+public static String getNormalizedName(final String colName, boolean 
isTranslationEnabled, TranslationStrategy strategy, Pattern translationRegex) {
+// If the column name is null or translation is not enabled, return 
the original column name.
+if (colName == null || !isTranslationEnabled) {
+return colName;
+}
+
+return switch (Objects.requireNonNull(strategy)) {
+case REMOVE_UNDERSCORE -> colName.toUpperCase().replace("_", "");
+case REMOVE_SPACE -> colName.toUpperCase().replace(" ", "");
+case REMOVE_ALL_SPECIAL_CHAR -> REMOVE_ALL_SPECIAL_CHAR_REGEX 
.matcher(colName.toUpperCase()).replaceAll( "");

Review Comment:
   ```suggestion
   case REMOVE_ALL_SPECIAL_CHAR -> REMOVE_ALL_SPECIAL_CHAR_REGEX 
.matcher(colName.toUpperCase()).replaceAll("");
   ```



-- 
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-unsubscr...@nifi.apache.org

For queries about this service, please contact Infr

Re: [PR] NIFI-11858 Configurable Column Name Normalization in PutDatabaseRecord and UpdateDatabaseTable [nifi]

2023-12-27 Thread via GitHub


ravinarayansingh commented on code in PR #7544:
URL: https://github.com/apache/nifi/pull/7544#discussion_r1437177360


##
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UpdateDatabaseTable.java:
##
@@ -460,15 +488,18 @@ public void onTrigger(final ProcessContext context, final 
ProcessSession session
 
 private synchronized OutputMetadataHolder checkAndUpdateTableSchema(final 
Connection conn, final DatabaseAdapter databaseAdapter, final RecordSchema 
schema,
 final 
String catalogName, final String schemaName, final String tableName,
-final 
boolean createIfNotExists, final boolean translateFieldNames, final boolean 
updateFieldNames,
+final 
boolean createIfNotExists, final boolean translateFieldNames,
+final 
TranslationStrategy translationStrategy, Pattern translationRegex, final 
boolean updateFieldNames,
 final 
Set primaryKeyColumnNames, final boolean quoteTableName, final boolean 
quoteColumnNames) throws IOException {
 // Read in the current table metadata, compare it to the reader's 
schema, and
 // add any columns from the schema that are missing in the table
+//final ColumnNameNormalizer normalizer = new 
ColumnNameNormalizer(translateFieldNames, translationStrategy, 
translationRegex);

Review Comment:
   i have removed the commented  code 



-- 
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-unsubscr...@nifi.apache.org

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



Re: [PR] NIFI-12529: Enable/Disable Controller Service [nifi]

2023-12-27 Thread via GitHub


rfellows commented on code in PR #8185:
URL: https://github.com/apache/nifi/pull/8185#discussion_r1437221742


##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/app.module.ts:
##
@@ -56,7 +57,13 @@ import { MatDialogModule } from '@angular/material/dialog';
 routerState: RouterState.Minimal,
 navigationActionTiming: NavigationActionTiming.PostActivation
 }),
-EffectsModule.forRoot(UserEffects, ExtensionTypesEffects, 
AboutEffects, StatusHistoryEffects),
+EffectsModule.forRoot(
+UserEffects,
+ExtensionTypesEffects,
+AboutEffects,
+StatusHistoryEffects,
+EnableControllerServiceEffects

Review Comment:
   This name, `EnableControllerServiceEffects`, gives the impression the 
effects are only useful for enabling controller services. However, all of the 
disable-related effects are defined in there as well.
   Can we find a more appropriate name? I suppose this would include the 
actions, reducers, and selectors as well.



##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/controller-service/disable-controller-service/disable-controller-service.component.html:
##
@@ -0,0 +1,119 @@
+
+
+Disable Controller Service
+
+
+
+
+
+
+
+Service
+{{ 
controllerService.component.name }}
+
+
+Scope
+Service and referencing 
components
+
+
+
+Referencing Components
+
+
+
+
+
+
+
+Cancel
+Disable
+
+
+
+
+
+
+
+Service
+{{ 
controllerService.component.name }}
+
+
+Steps To Disable {{ 
controllerService.component.name }}
+
+
+Stopping referencing 
processors and reporting tasks
+
+
+
+Disabling referencing 
controller services
+
+
+
+Disabling this 
controller service
+
+
+
+
+{{ 
disableRequest.error.error }}

Review Comment:
   Might consider putting some kind of max-width or something on these error 
containers. At the moment, they make the dialog grow when an error is 
encountered:
   
   Before error:
   https://github.com/apache/nifi/assets/713866/372425e2-44ab-4f4d-80b7-a939d5318851";>
   
   
   After error: 
   https://github.com/apache/nifi/assets/713866/1f7066b9-33d4-4284-8e7d-1150fa150733";>
   
   
   _almost doubles in width_
   



-- 
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-unsubscr...@nifi.apache.org

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



[jira] [Created] (NIFI-12552) Add pagination to Summary tables

2023-12-27 Thread Rob Fellows (Jira)
Rob Fellows created NIFI-12552:
--

 Summary: Add pagination to Summary tables
 Key: NIFI-12552
 URL: https://issues.apache.org/jira/browse/NIFI-12552
 Project: Apache NiFi
  Issue Type: Sub-task
Reporter: Rob Fellows
Assignee: Rob Fellows


The number of records in the summary tables can get quite large and become 
unwieldy. Add front-end pagination of the results. Be sure to account for 
pagination when displaying the number of filtered results above the filter 
controls as it could be confusing to the user to see a filtered count greater 
than the page size. Consider changing the wording to make it more 
understandable.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (NIFI-12400) Remaining items to migrate UI to currently supported/active framework

2023-12-27 Thread Rob Fellows (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-12400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rob Fellows updated NIFI-12400:
---
Description: 
The purpose of this Jira is to track all remaining items following the initial 
commit [1] for NIFI-11481. The description will be kept up to date with 
remaining features, tasks, and improvements. As each items is worked, a new sub 
task Jira will be created and referenced in this description.
 * Support Parameters in Properties with Allowable Values (NIFI-12401)
 * Summary (NIFI-12437)
 ** Remaining work not addressed in initial Jira:
 *** input ports (NIFI-12504)
 *** output ports (NIFI-12504)
 *** remote process groups (NIFI-12504)
 *** process groups (NIFI-12504)
 *** connections (NIFI-12504)
 *** System Diagnostics (NIFI-12505)
 *** support for cluster-specific ui elements (NIFI-12537)
 *** Add pagination (NIFI-12552)
 * Counters (NIFI-12415)
 * Bulletin Board
 * Provenance (NIFI-12445)
 ** Event Listing (NIFI-12445)
 ** Search (NIFI-12445)
 ** Event Dialog (NIFI-12445)
 ** Lineage (NIFI-12485)
 ** Replay from context menu (NIFI-12445)

 * Flow Analysis Rules
 * Registry Clients (NIFI-12486)
 * Import from Registry
 * Parameter Providers
 * Cluster
 * Flow Configuration History
 * Node Status History
 * Users (NIFI-12543)
 * Policies (NIFI-12548)
 * Help
 * About
 * Show Upstream/Downstream
 * Align
 * List Queue
 * Empty [all] Queue
 * View Content
 * View State
 * Change Version
 * PG Version
 ** Start
 ** Commit
 ** Force Commit
 ** Show changes
 ** Revert changes
 ** Change Flow version
 ** Stop

 * Configure PG (NIFI-12417)
 * Process Group Services (NIFI-12425)
 ** Listing (NIFI-12425)
 ** Create (NIFI-12425)
 ** Configure (NIFI-12425)
 ** Delete (NIFI-12425)
 ** Enable (NIFI-12529)
 ** Disable (NIFI-12529)
 ** Improve layout and breadcrumbs
 * Configure Processor
 ** Service Link (NIFI-12425)
 ** Create inline Service (NIFI-12425)
 ** Parameter Link (NIFI-12502)
 ** Convert to Parameter (NIFI-12502)
 ** Fix issue with Property Editor width (NIFI-12547)

 * Download Flow
 * Create RPG
 * Configure RPG
 * RPG Remote Ports
 * RPG Go To
 * Color
 * Move to Front
 * Copy/Paste
 * Run unit tests are part of standard build
 * Update all API calls to consider disconnect node confirmation
 * Update API calls to use uiOnly flag
 * Routing error handling
 * Prevent navigate to Service when configuration form is dirty
 * Introduce header in new pages to unify with canvas and offer better 
navigation.
 * Prompt user to save Parameter Context when Edit form is dirty

[1] [https://github.com/apache/nifi/pull/8053]

  was:
The purpose of this Jira is to track all remaining items following the initial 
commit [1] for NIFI-11481. The description will be kept up to date with 
remaining features, tasks, and improvements. As each items is worked, a new sub 
task Jira will be created and referenced in this description.
 * Support Parameters in Properties with Allowable Values (NIFI-12401)
 * Summary (NIFI-12437)
 ** Remaining work not addressed in initial Jira:
 *** input ports (NIFI-12504)
 *** output ports (NIFI-12504)
 *** remote process groups (NIFI-12504)
 *** process groups (NIFI-12504)
 *** connections (NIFI-12504)
 *** System Diagnostics (NIFI-12505)
 *** support for cluster-specific ui elements (NIFI-12537)
 *** Add pagination
 * Counters (NIFI-12415)
 * Bulletin Board
 * Provenance (NIFI-12445)
 ** Event Listing (NIFI-12445)
 ** Search (NIFI-12445)
 ** Event Dialog (NIFI-12445)
 ** Lineage (NIFI-12485)
 ** Replay from context menu (NIFI-12445)

 * Flow Analysis Rules
 * Registry Clients (NIFI-12486)
 * Import from Registry
 * Parameter Providers
 * Cluster
 * Flow Configuration History
 * Node Status History
 * Users (NIFI-12543)
 * Policies (NIFI-12548)
 * Help
 * About
 * Show Upstream/Downstream
 * Align
 * List Queue
 * Empty [all] Queue
 * View Content
 * View State
 * Change Version
 * PG Version
 ** Start
 ** Commit
 ** Force Commit
 ** Show changes
 ** Revert changes
 ** Change Flow version
 ** Stop

 * Configure PG (NIFI-12417)
 * Process Group Services (NIFI-12425)
 ** Listing (NIFI-12425)
 ** Create (NIFI-12425)
 ** Configure (NIFI-12425)
 ** Delete (NIFI-12425)
 ** Enable (NIFI-12529)
 ** Disable (NIFI-12529)
 ** Improve layout and breadcrumbs
 * Configure Processor
 ** Service Link (NIFI-12425)
 ** Create inline Service (NIFI-12425)
 ** Parameter Link (NIFI-12502)
 ** Convert to Parameter (NIFI-12502)
 ** Fix issue with Property Editor width (NIFI-12547)

 * Download Flow
 * Create RPG
 * Configure RPG
 * RPG Remote Ports
 * RPG Go To
 * Color
 * Move to Front
 * Copy/Paste
 * Run unit tests are part of standard build
 * Update all API calls to consider disconnect node confirmation
 * Update API calls to use uiOnly flag
 * Routing error handling
 * Prevent navigate to Service when configuration form is dirty
 * Introduce header in new pages to unify with canvas and offer better 
naviga

Re: [PR] NIFI-12529: Enable/Disable Controller Service [nifi]

2023-12-27 Thread via GitHub


mcgilman commented on PR #8185:
URL: https://github.com/apache/nifi/pull/8185#issuecomment-1870672940

   Thanks for the review @rfellows! I've pushed a new commit addressing the 
items you outlined.


-- 
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-unsubscr...@nifi.apache.org

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



Re: [PR] NIFI-12236 Improving fault tolerancy of the QuestDB backed metrics repository [nifi]

2023-12-27 Thread via GitHub


exceptionfactory commented on code in PR #8152:
URL: https://github.com/apache/nifi/pull/8152#discussion_r1435330854


##
nifi-commons/nifi-utils/src/test/java/org/apache/nifi/retry/ExceptionExcludingRetryConditionTest.java:
##
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ */
+package org.apache.nifi.retry;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import javax.naming.OperationNotSupportedException;
+import java.io.IOException;
+import java.util.Arrays;
+
+class ExceptionExcludingRetryConditionTest {
+final ExceptionExcludingRetryCondition testSubject = getTestSubject();
+
+@Test
+public void testAllowIfNoException() {
+final MutableRetryExecutionContext context = new 
MutableRetryExecutionContext();
+Assertions.assertTrue(testSubject.allowNextAttempt(context));

Review Comment:
   As a general rule, it is best to use static imports for assert and mock 
methods to helpful with readability of tests.
   



##
nifi-commons/nifi-utils/src/test/java/org/apache/nifi/retry/SynchronousRetryTemplateTest.java:
##
@@ -0,0 +1,224 @@
+/*
+ * 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.
+ */
+package org.apache.nifi.retry;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.function.BiConsumer;
+
+public class SynchronousRetryTemplateTest {
+public static final int NUMBER_OF_RETRIES = 2;
+public static final Callable FALLBACK_ACTION = () -> "fallback";
+public static final Callable FALLBACK_ACTION_FAILING = () -> {

Review Comment:
   Are these values used in other test classes? I may have missed the 
references, otherwise it would be helpful to lower the visibility.



##
nifi-nar-bundles/nifi-questdb-bundle/nifi-questdb-status-history/src/main/java/org/apache/nifi/controller/status/history/questdb/QuestDbStatusHistoryStorage.java:
##
@@ -0,0 +1,181 @@
+/*
+ * 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.
+ */
+package org.apache.nifi.controller.status.history.questdb;
+
+import org.apache.nifi.controller.status.ConnectionStatus;
+import org.apache.nifi.controller.status.NodeStatus;
+import org.apache.nifi.controller.status.ProcessGroupStatus;
+import org.apache.nifi.controller.status.ProcessorStatus;
+import org.apache.nifi.controller.status.RemoteProcessGroupStatus;
+import org.apache.nifi.controller.status.history.GarbageCollectionStatus;
+import org.apache.nifi.controller.status.history.StandardMetricDescriptor;
+import org.apache.nifi.controller.status.history.StandardStatusSnapshot;
+i