You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/12/01 10:06:31 UTC

[GitHub] [nifi-minifi-cpp] adamdebreceni opened a new pull request, #1466: MINIFICPP-1994 - Route flowfiles with invalid SQL to Failure

adamdebreceni opened a new pull request, #1466:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1466

   Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced
        in the commit message?
   
   - [ ] Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically main)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   ### For code changes:
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the LICENSE file?
   - [ ] If applicable, have you updated the NOTICE file?
   
   ### For documentation related changes:
   - [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
   
   ### Note:
   Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.
   


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


[GitHub] [nifi-minifi-cpp] szaszm commented on a diff in pull request #1466: MINIFICPP-1994 - Route flowfiles with invalid SQL to Failure

Posted by GitBox <gi...@apache.org>.
szaszm commented on code in PR #1466:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1466#discussion_r1073643531


##########
extensions/sql/processors/PutSQL.h:
##########
@@ -53,6 +55,9 @@ class PutSQL : public SQLProcessor {
   void processOnTrigger(core::ProcessContext& context, core::ProcessSession& session) override;
 
   void initialize() override;
+
+ private:
+  static std::shared_ptr<core::logging::Logger> logger_;

Review Comment:
   Static logger here as well



##########
libminifi/test/TestBase.cpp:
##########
@@ -234,12 +234,16 @@ std::shared_ptr<minifi::core::Processor> TestPlan::addProcessor(const std::share
   processor->setFlowIdentifier(flow_version_->getFlowIdentifier());
   processor_mapping_[processor->getUUID()] = processor;
   if (!linkToPrevious) {
-    termination_ = *(relationships.begin());
+    if (!std::empty(relationships)) {
+      termination_ = *(relationships.begin());

Review Comment:
   ```suggestion
         termination_ = relationships.front();
   ```



##########
libminifi/test/TestBase.cpp:
##########
@@ -234,12 +234,16 @@ std::shared_ptr<minifi::core::Processor> TestPlan::addProcessor(const std::share
   processor->setFlowIdentifier(flow_version_->getFlowIdentifier());
   processor_mapping_[processor->getUUID()] = processor;
   if (!linkToPrevious) {
-    termination_ = *(relationships.begin());
+    if (!std::empty(relationships)) {
+      termination_ = *(relationships.begin());
+    }
   } else {
     std::shared_ptr<minifi::core::Processor> last = processor_queue_.back();
     if (last == nullptr) {
       last = processor;
-      termination_ = *(relationships.begin());
+      if (!std::empty(relationships)) {
+        termination_ = *(relationships.begin());

Review Comment:
   ```suggestion
           termination_ = relationships.front();
   ```



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


[GitHub] [nifi-minifi-cpp] szaszm commented on a diff in pull request #1466: MINIFICPP-1994 - Route flowfiles with invalid SQL to Failure

Posted by GitBox <gi...@apache.org>.
szaszm commented on code in PR #1466:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1466#discussion_r1073743383


##########
libminifi/test/TestBase.cpp:
##########
@@ -234,12 +234,16 @@ std::shared_ptr<minifi::core::Processor> TestPlan::addProcessor(const std::share
   processor->setFlowIdentifier(flow_version_->getFlowIdentifier());
   processor_mapping_[processor->getUUID()] = processor;
   if (!linkToPrevious) {
-    termination_ = *(relationships.begin());
+    if (!std::empty(relationships)) {
+      termination_ = *(relationships.begin());

Review Comment:
   It seems to be breaking the build. I thought this is a vector, but the error msg says it's an `std::initializer_list`.



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


[GitHub] [nifi-minifi-cpp] fgerlits commented on a diff in pull request #1466: MINIFICPP-1994 - Route flowfiles with invalid SQL to Failure

Posted by "fgerlits (via GitHub)" <gi...@apache.org>.
fgerlits commented on code in PR #1466:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1466#discussion_r1084254443


##########
extensions/sql/processors/ExecuteSQL.h:
##########
@@ -42,7 +43,8 @@ class ExecuteSQL : public SQLProcessor, public FlowFileSource {
   }
 
   EXTENSIONAPI static const core::Relationship Success;
-  static auto relationships() { return std::array{Success}; }
+  EXTENSIONAPI static const core::Relationship Failure;
+  static auto relationships() { return std::array{Success, Failure}; }

Review Comment:
   please add these two new `failure` relationships to `PROCESSORS.md`, too



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


[GitHub] [nifi-minifi-cpp] adamdebreceni commented on a diff in pull request #1466: MINIFICPP-1994 - Route flowfiles with invalid SQL to Failure

Posted by GitBox <gi...@apache.org>.
adamdebreceni commented on code in PR #1466:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1466#discussion_r1073615202


##########
extensions/sql/processors/ExecuteSQL.h:
##########
@@ -58,6 +60,9 @@ class ExecuteSQL : public SQLProcessor, public FlowFileSource {
 
   EXTENSIONAPI static const std::string RESULT_ROW_COUNT;
   EXTENSIONAPI static const std::string INPUT_FLOW_FILE_UUID;
+
+ private:
+  static const std::shared_ptr<core::logging::Logger> logger_;

Review Comment:
   removed it



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


[GitHub] [nifi-minifi-cpp] adamdebreceni commented on a diff in pull request #1466: MINIFICPP-1994 - Route flowfiles with invalid SQL to Failure

Posted by "adamdebreceni (via GitHub)" <gi...@apache.org>.
adamdebreceni commented on code in PR #1466:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1466#discussion_r1084893848


##########
extensions/sql/processors/ExecuteSQL.h:
##########
@@ -42,7 +43,8 @@ class ExecuteSQL : public SQLProcessor, public FlowFileSource {
   }
 
   EXTENSIONAPI static const core::Relationship Success;
-  static auto relationships() { return std::array{Success}; }
+  EXTENSIONAPI static const core::Relationship Failure;
+  static auto relationships() { return std::array{Success, Failure}; }

Review Comment:
   added



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


[GitHub] [nifi-minifi-cpp] szaszm commented on a diff in pull request #1466: MINIFICPP-1994 - Route flowfiles with invalid SQL to Failure

Posted by GitBox <gi...@apache.org>.
szaszm commented on code in PR #1466:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1466#discussion_r1062624617


##########
libminifi/test/TestBase.cpp:
##########
@@ -564,7 +588,7 @@ std::unique_ptr<minifi::Connection> TestPlan::buildFinalConnection(const std::sh
   std::stringstream connection_name;
   connection_name << processor->getUUIDStr() << "-to-" << processor->getUUIDStr();
   auto connection = std::make_unique<minifi::Connection>(flow_repo_, content_repo_, connection_name.str());
-  connection->addRelationship(termination_);
+  connection->addRelationship(termination_.value());

Review Comment:
   Shouldn't we check if `termination_` is set to something?



##########
extensions/sql/processors/ExecuteSQL.h:
##########
@@ -58,6 +60,9 @@ class ExecuteSQL : public SQLProcessor, public FlowFileSource {
 
   EXTENSIONAPI static const std::string RESULT_ROW_COUNT;
   EXTENSIONAPI static const std::string INPUT_FLOW_FILE_UUID;
+
+ private:
+  static const std::shared_ptr<core::logging::Logger> logger_;

Review Comment:
   Using a static logger is incompatible with #1481 



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


[GitHub] [nifi-minifi-cpp] adamdebreceni commented on a diff in pull request #1466: MINIFICPP-1994 - Route flowfiles with invalid SQL to Failure

Posted by GitBox <gi...@apache.org>.
adamdebreceni commented on code in PR #1466:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1466#discussion_r1073615926


##########
libminifi/test/TestBase.cpp:
##########
@@ -564,7 +588,7 @@ std::unique_ptr<minifi::Connection> TestPlan::buildFinalConnection(const std::sh
   std::stringstream connection_name;
   connection_name << processor->getUUIDStr() << "-to-" << processor->getUUIDStr();
   auto connection = std::make_unique<minifi::Connection>(flow_repo_, content_repo_, connection_name.str());
-  connection->addRelationship(termination_);
+  connection->addRelationship(termination_.value());

Review Comment:
   in theory `buildFinalConnection` is only called when `termination_` is set, added `gsl_Expects` to verify this precondition



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


[GitHub] [nifi-minifi-cpp] martinzink closed pull request #1466: MINIFICPP-1994 - Route flowfiles with invalid SQL to Failure

Posted by "martinzink (via GitHub)" <gi...@apache.org>.
martinzink closed pull request #1466: MINIFICPP-1994 - Route flowfiles with invalid SQL to Failure
URL: https://github.com/apache/nifi-minifi-cpp/pull/1466


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


[GitHub] [nifi-minifi-cpp] adamdebreceni commented on a diff in pull request #1466: MINIFICPP-1994 - Route flowfiles with invalid SQL to Failure

Posted by GitBox <gi...@apache.org>.
adamdebreceni commented on code in PR #1466:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1466#discussion_r1073681265


##########
extensions/sql/processors/PutSQL.h:
##########
@@ -53,6 +55,9 @@ class PutSQL : public SQLProcessor {
   void processOnTrigger(core::ProcessContext& context, core::ProcessSession& session) override;
 
   void initialize() override;
+
+ private:
+  static std::shared_ptr<core::logging::Logger> logger_;

Review Comment:
   removed



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


[GitHub] [nifi-minifi-cpp] adamdebreceni commented on a diff in pull request #1466: MINIFICPP-1994 - Route flowfiles with invalid SQL to Failure

Posted by GitBox <gi...@apache.org>.
adamdebreceni commented on code in PR #1466:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1466#discussion_r1073766411


##########
libminifi/test/TestBase.cpp:
##########
@@ -234,12 +234,16 @@ std::shared_ptr<minifi::core::Processor> TestPlan::addProcessor(const std::share
   processor->setFlowIdentifier(flow_version_->getFlowIdentifier());
   processor_mapping_[processor->getUUID()] = processor;
   if (!linkToPrevious) {
-    termination_ = *(relationships.begin());
+    if (!std::empty(relationships)) {
+      termination_ = *(relationships.begin());

Review Comment:
   reverted



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