Copilot commented on code in PR #2221:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2221#discussion_r3656663472


##########
extensions/standard-processors/processors/JoinEnrichmentAttributes.h:
##########
@@ -0,0 +1,139 @@
+/**
+ * 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.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+
+#include "core/FlowFileStore.h"
+#include "core/ProcessorImpl.h"
+#include "core/PropertyDefinitionBuilder.h"
+#include "minifi-cpp/core/PropertyDefinition.h"
+#include "utils/Enum.h"
+#include "utils/RegexUtils.h"

Review Comment:
   JoinEnrichmentAttributes.h uses std::chrono, std::deque, std::optional, 
std::unordered_map, std::vector, std::array, etc., but the header only includes 
<memory> and <string>. Relying on indirect includes is fragile and can cause 
build failures.
   
   This issue also appears on line 131 of the same file.



##########
extensions/standard-processors/tests/unit/JoinEnrichmentAttributesTests.cpp:
##########
@@ -0,0 +1,134 @@
+/**
+ *
+ * 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.
+ */
+#include "JoinEnrichmentAttributes.h"
+#include "unit/Catch.h"
+#include "unit/ProcessorUtils.h"
+#include "unit/SingleProcessorTestController.h"
+#include "utils/EnrichmentUtils.h"

Review Comment:
   This test uses std::this_thread::sleep_for but does not include <thread>, 
which can break compilation depending on transitive includes.



##########
extensions/standard-processors/utils/EnrichmentUtils.h:
##########
@@ -0,0 +1,21 @@
+/**
+ * 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.
+ */
+
+#pragma once
+
+constexpr std::string_view ENRICHMENT_ROLE = "enrichment.role";
+constexpr std::string_view ENRICHMENT_GROUP_ID = "enrichment.group.id";

Review Comment:
   EnrichmentUtils.h uses std::string_view but does not include <string_view>, 
which can break compilation when transitive includes change.



##########
extensions/standard-processors/tests/features/enrichment.feature:
##########
@@ -0,0 +1,47 @@
+# 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.
+
+@CORE @SUPPORTS_WINDOWS
+Feature: ForkEnrichment and JoinEnrichmentAttributes
+
+  Scenario: Merges correctly
+    Given a GenerateFlowFile processor with the "Custom Text" property set to 
"original_${literal("content")}"
+    And the scheduling period of the GenerateFlowFile processor is set to "1 
hour"
+    And the "Data Format" property of the GenerateFlowFile processor is set to 
"Text"
+    And the "Unique FlowFiles" property of the GenerateFlowFile processor is 
set to "false"
+
+    And a ForkEnrichment processor
+    And a JoinEnrichmentAttributes processor
+
+    And a ReplaceText processor with the "Evaluation Mode" property set to 
"Entire text"
+    And the "Replacement Strategy" property of the ReplaceText processor is 
set to "Always Replace"
+    And the "Replacement Value" property of the ReplaceText processor is set 
to "replaced_content"
+
+    And an UpdateAttribute processor with the "extra_prop" property set to 
"foo"
+
+    And a LogAttribute processor with the "Log Payload" property set to "true"
+
+    And the "success" relationship of the GenerateFlowFile processor is 
connected to the ForkEnrichment
+    And the "original" relationship of the ForkEnrichment processor is 
connected to the JoinEnrichmentAttributes
+    And the "enrichment" relationship of the ForkEnrichment processor is 
connected to the ReplaceText
+    And the "success" relationship of the ReplaceText processor is connected 
to the UpdateAttribute
+    And the "success" relationship of the UpdateAttribute processor is 
connected to the JoinEnrichmentAttributes
+    And the "joined" relationship of the JoinEnrichmentAttributes processor is 
connected to the LogAttribute
+    And JoinEnrichmentAttributes's original relationship is auto-terminated
+    And LogAttribute's success relationship is auto-terminated
+    When the MiNiFi instance starts up
+    Then the Minifi logs contain the following message: "key:enrichment.role 
value:JOINED" in less than 10 seconds
+    And the Minifi logs contain the following message: "key:extra_prop 
value:foo" in less than 1 seconds
+    And the Minifi logs contain the following message: "original_content" in 
less than 1 seconds

Review Comment:
   Grammar: "1 seconds" should be singular ("1 second").



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