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 2021/09/06 11:30:29 UTC

[GitHub] [nifi-minifi-cpp] lordgamez opened a new pull request #1166: MINIFICPP-1331 Upgrade yaml-cpp to eliminate issues with "NULL" string in config

lordgamez opened a new pull request #1166:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1166


   Upgraded yaml-cpp version to 0.7.0. Parsing the value "NULL" for a configuration node does not throw anymore.
   
   https://issues.apache.org/jira/browse/MINIFICPP-1331
   
   --------------------------------------------------------------------------
   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] lordgamez commented on a change in pull request #1166: MINIFICPP-1331 Upgrade yaml-cpp to eliminate issues with "NULL" string in config

Posted by GitBox <gi...@apache.org>.
lordgamez commented on a change in pull request #1166:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1166#discussion_r703300008



##########
File path: extensions/standard-processors/tests/unit/YamlConnectionParserTest.cpp
##########
@@ -163,10 +163,10 @@ TEST_CASE("Connections components are parsed from yaml", "[YamlConfiguration]")
             "flowfile expiration: \n"
             "drop empty: \n"});
         YamlConnectionParser yaml_connection_parser(connection_node, "test_node", parent_ptr, logger);
-        CHECK_THROWS(yaml_connection_parser.getWorkQueueSizeFromYaml());
-        CHECK_THROWS(yaml_connection_parser.getWorkQueueDataSizeFromYaml());
-        CHECK_THROWS(yaml_connection_parser.getFlowFileExpirationFromYaml());
-        CHECK_THROWS(yaml_connection_parser.getDropEmptyFromYaml());
+        REQUIRE(0 == yaml_connection_parser.getWorkQueueSizeFromYaml());
+        REQUIRE(0 == yaml_connection_parser.getWorkQueueDataSizeFromYaml());
+        REQUIRE(0 == yaml_connection_parser.getFlowFileExpirationFromYaml());
+        REQUIRE(0 == yaml_connection_parser.getDropEmptyFromYaml());

Review comment:
       Also disabled `readability/check` linter rule in 3e4ccdb98e53fbd2b49176eb3f32d86bb0cb06d0 as it suggested using CHECK_EQ instead of CHECK, but catch2 does not have a CHECK_EQ assertion.




-- 
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] lordgamez commented on a change in pull request #1166: MINIFICPP-1331 Upgrade yaml-cpp to eliminate issues with "NULL" string in config

Posted by GitBox <gi...@apache.org>.
lordgamez commented on a change in pull request #1166:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1166#discussion_r703273131



##########
File path: extensions/standard-processors/tests/unit/YamlConnectionParserTest.cpp
##########
@@ -163,10 +163,10 @@ TEST_CASE("Connections components are parsed from yaml", "[YamlConfiguration]")
             "flowfile expiration: \n"
             "drop empty: \n"});
         YamlConnectionParser yaml_connection_parser(connection_node, "test_node", parent_ptr, logger);
-        CHECK_THROWS(yaml_connection_parser.getWorkQueueSizeFromYaml());
-        CHECK_THROWS(yaml_connection_parser.getWorkQueueDataSizeFromYaml());
-        CHECK_THROWS(yaml_connection_parser.getFlowFileExpirationFromYaml());
-        CHECK_THROWS(yaml_connection_parser.getDropEmptyFromYaml());
+        REQUIRE(0 == yaml_connection_parser.getWorkQueueSizeFromYaml());
+        REQUIRE(0 == yaml_connection_parser.getWorkQueueDataSizeFromYaml());
+        REQUIRE(0 == yaml_connection_parser.getFlowFileExpirationFromYaml());
+        REQUIRE(0 == yaml_connection_parser.getDropEmptyFromYaml());

Review comment:
       I agree, updated in 3d60c2431ccbd6073868aba88924e94d16867b80




-- 
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] lordgamez commented on pull request #1166: MINIFICPP-1331 Upgrade yaml-cpp to eliminate issues with "NULL" string in config

Posted by GitBox <gi...@apache.org>.
lordgamez commented on pull request #1166:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1166#issuecomment-914081118


   It's not strictly connected to this PR, but as one of the Ubuntu builds timed out for this change, I also increased the timeout to 120 minutes as part of this PR.


-- 
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] lordgamez commented on a change in pull request #1166: MINIFICPP-1331 Upgrade yaml-cpp to eliminate issues with "NULL" string in config

Posted by GitBox <gi...@apache.org>.
lordgamez commented on a change in pull request #1166:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1166#discussion_r702872128



##########
File path: cmake/BundledYamlCpp.cmake
##########
@@ -16,39 +16,51 @@
 # under the License.
 
 function(use_bundled_yamlcpp SOURCE_DIR BINARY_DIR)
+    if (WIN32)
+        set(CMAKE_INSTALL_LIBDIR "lib")
+    else()
+        include(GNUInstallDirs)
+    endif()
+
     # Define byproducts
     if (WIN32)
-        if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
-            set(BYPRODUCT "lib/libyaml-cppmdd.lib")
-        else()
-            set(BYPRODUCT "lib/libyaml-cppmd.lib")
-        endif()
+        set(BYPRODUCT "${CMAKE_INSTALL_LIBDIR}/yaml-cpp.lib")
     else()
-        set(BYPRODUCT "lib/libyaml-cpp.a")
+        set(BYPRODUCT "${CMAKE_INSTALL_LIBDIR}/libyaml-cpp.a")
     endif()
 
     # Set build options
     set(YAMLCPP_CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS}
-            "-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/yaml-cpp-install")
+            "-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/yaml-cpp-install"
+            "-DCMAKE_DEBUG_POSTFIX="
+            "-DBUILD_SHARED_LIBS=OFF"
+            "-DYAML_CPP_BUILD_TESTS=OFF"
+            "-DYAML_CPP_BUILD_TOOLS=OFF")
 
     # Build project
     ExternalProject_Add(
             yaml-cpp-external
-            SOURCE_DIR "${SOURCE_DIR}/thirdparty/yaml-cpp-yaml-cpp-20171024"
+            GIT_REPOSITORY "https://github.com/jbeder/yaml-cpp.git"
+            GIT_TAG "yaml-cpp-0.7.0"

Review comment:
       Good point, replaced it in f4946e92e5724d97e95163fa8c3b3797669f14a7




-- 
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 change in pull request #1166: MINIFICPP-1331 Upgrade yaml-cpp to eliminate issues with "NULL" string in config

Posted by GitBox <gi...@apache.org>.
fgerlits commented on a change in pull request #1166:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1166#discussion_r703244790



##########
File path: extensions/standard-processors/tests/unit/YamlConnectionParserTest.cpp
##########
@@ -163,10 +163,10 @@ TEST_CASE("Connections components are parsed from yaml", "[YamlConfiguration]")
             "flowfile expiration: \n"
             "drop empty: \n"});
         YamlConnectionParser yaml_connection_parser(connection_node, "test_node", parent_ptr, logger);
-        CHECK_THROWS(yaml_connection_parser.getWorkQueueSizeFromYaml());
-        CHECK_THROWS(yaml_connection_parser.getWorkQueueDataSizeFromYaml());
-        CHECK_THROWS(yaml_connection_parser.getFlowFileExpirationFromYaml());
-        CHECK_THROWS(yaml_connection_parser.getDropEmptyFromYaml());
+        REQUIRE(0 == yaml_connection_parser.getWorkQueueSizeFromYaml());
+        REQUIRE(0 == yaml_connection_parser.getWorkQueueDataSizeFromYaml());
+        REQUIRE(0 == yaml_connection_parser.getFlowFileExpirationFromYaml());
+        REQUIRE(0 == yaml_connection_parser.getDropEmptyFromYaml());

Review comment:
       I would leave these as `CHECK(...)`.  In general, `CHECK` is preferable to `REQUIRE`: if eg. the second and fourth tests fail, then with `CHECK`, we will get this info at once, but with `REQUIRE`, we will only know on the first run that the second test failed, then we'll have to fix it and rerun the test to find out that the fourth test fails, 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] lordgamez commented on a change in pull request #1166: MINIFICPP-1331 Upgrade yaml-cpp to eliminate issues with "NULL" string in config

Posted by GitBox <gi...@apache.org>.
lordgamez commented on a change in pull request #1166:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1166#discussion_r702871594



##########
File path: cmake/BundledYamlCpp.cmake
##########
@@ -16,39 +16,51 @@
 # under the License.
 
 function(use_bundled_yamlcpp SOURCE_DIR BINARY_DIR)
+    if (WIN32)
+        set(CMAKE_INSTALL_LIBDIR "lib")
+    else()
+        include(GNUInstallDirs)
+    endif()
+
     # Define byproducts
     if (WIN32)
-        if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
-            set(BYPRODUCT "lib/libyaml-cppmdd.lib")
-        else()
-            set(BYPRODUCT "lib/libyaml-cppmd.lib")
-        endif()
+        set(BYPRODUCT "${CMAKE_INSTALL_LIBDIR}/yaml-cpp.lib")
     else()
-        set(BYPRODUCT "lib/libyaml-cpp.a")
+        set(BYPRODUCT "${CMAKE_INSTALL_LIBDIR}/libyaml-cpp.a")
     endif()
 
     # Set build options
     set(YAMLCPP_CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS}
-            "-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/yaml-cpp-install")
+            "-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/yaml-cpp-install"
+            "-DCMAKE_DEBUG_POSTFIX="
+            "-DBUILD_SHARED_LIBS=OFF"
+            "-DYAML_CPP_BUILD_TESTS=OFF"
+            "-DYAML_CPP_BUILD_TOOLS=OFF")
 
     # Build project
     ExternalProject_Add(
             yaml-cpp-external
-            SOURCE_DIR "${SOURCE_DIR}/thirdparty/yaml-cpp-yaml-cpp-20171024"
+            GIT_REPOSITORY "https://github.com/jbeder/yaml-cpp.git"
+            GIT_TAG "yaml-cpp-0.7.0"

Review comment:
       Good point, replaced it in f4946e92e5724d97e95163fa8c3b3797669f14a7




-- 
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 change in pull request #1166: MINIFICPP-1331 Upgrade yaml-cpp to eliminate issues with "NULL" string in config

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #1166:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1166#discussion_r702833271



##########
File path: cmake/BundledYamlCpp.cmake
##########
@@ -16,39 +16,51 @@
 # under the License.
 
 function(use_bundled_yamlcpp SOURCE_DIR BINARY_DIR)
+    if (WIN32)
+        set(CMAKE_INSTALL_LIBDIR "lib")
+    else()
+        include(GNUInstallDirs)
+    endif()
+
     # Define byproducts
     if (WIN32)
-        if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
-            set(BYPRODUCT "lib/libyaml-cppmdd.lib")
-        else()
-            set(BYPRODUCT "lib/libyaml-cppmd.lib")
-        endif()
+        set(BYPRODUCT "${CMAKE_INSTALL_LIBDIR}/yaml-cpp.lib")
     else()
-        set(BYPRODUCT "lib/libyaml-cpp.a")
+        set(BYPRODUCT "${CMAKE_INSTALL_LIBDIR}/libyaml-cpp.a")
     endif()
 
     # Set build options
     set(YAMLCPP_CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS}
-            "-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/yaml-cpp-install")
+            "-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/yaml-cpp-install"
+            "-DCMAKE_DEBUG_POSTFIX="
+            "-DBUILD_SHARED_LIBS=OFF"
+            "-DYAML_CPP_BUILD_TESTS=OFF"
+            "-DYAML_CPP_BUILD_TOOLS=OFF")
 
     # Build project
     ExternalProject_Add(
             yaml-cpp-external
-            SOURCE_DIR "${SOURCE_DIR}/thirdparty/yaml-cpp-yaml-cpp-20171024"
+            GIT_REPOSITORY "https://github.com/jbeder/yaml-cpp.git"
+            GIT_TAG "yaml-cpp-0.7.0"

Review comment:
       Please prefer downloading the tarball (or zip): https://github.com/jbeder/yaml-cpp/archive/refs/tags/yaml-cpp-0.7.0.tar.gz
   Git is slower and it's prone to patching issues, although the latter doesn't apply in this case. I'm also experimenting with a local caching http(s) proxy (to avoid excessive downloading when benchmarking clean build performance), and it works fine with archives, but doesn't play well with git over http(s).




-- 
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 closed pull request #1166: MINIFICPP-1331 Upgrade yaml-cpp to eliminate issues with "NULL" string in config

Posted by GitBox <gi...@apache.org>.
szaszm closed pull request #1166:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1166


   


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