You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by achristianson <gi...@git.apache.org> on 2018/01/08 17:26:10 UTC

[GitHub] nifi-minifi-cpp pull request #231: MINIFICPP-359 Generate connection name fi...

GitHub user achristianson opened a pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/231

    MINIFICPP-359 Generate connection name field if none provided, thereb…

    …y enabling anonymous connections.
    
    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:
    - [x] Is there a JIRA ticket associated with this PR? Is it referenced
         in the commit message?
    
    - [x] Does your PR title start with MINIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
    
    - [x] Has your PR been rebased against the latest commit within the target branch (typically master)?
    
    - [x] Is your initial contribution a single, squashed commit?
    
    ### For code changes:
    - [x] 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)?
    - [x] If applicable, have you updated the LICENSE file?
    - [x] If applicable, have you updated the NOTICE file?
    
    ### For documentation related changes:
    - [x] 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 travis-ci for build issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/achristianson/nifi-minifi-cpp MINIFICPP-359

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi-minifi-cpp/pull/231.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #231
    
----
commit 8ec27c7b11230524bfa3a3d3b9984b2cdba11c0e
Author: Andy I. Christianson <an...@...>
Date:   2018-01-08T17:05:13Z

    MINIFICPP-359 Generate connection name field if none provided, thereby enabling anonymous connections.

----


---

[GitHub] nifi-minifi-cpp pull request #231: MINIFICPP-359 Generate connection name fi...

Posted by achristianson <gi...@git.apache.org>.
Github user achristianson commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/231#discussion_r160426137
  
    --- Diff: libminifi/include/core/yaml/YamlConfiguration.h ---
    @@ -245,11 +245,11 @@ class YamlConfiguration : public FlowConfiguration {
        *
        * @param yamlNode a pointer to the YAML::Node that will be checked for the
        *                   presence of an idField
    -   * @param idField  the string of the name of the idField to check for. This
    +   * @param field  the string of the name of the idField to check for. This
        *                   is optional and defaults to 'id'
        * @return         the parsed or generated UUID string
        */
    -  std::string getOrGenerateId(YAML::Node *yamlNode, const std::string &idField = "id");
    +  std::string getOrGenerateField(YAML::Node *yamlNode, const std::string &field = "id");
    --- End diff --
    
    The checkRequiredField call was removed:
    
    ```diff
    -        checkRequiredField(&connectionNode, "name",
     -        CONFIG_YAML_CONNECTIONS_KEY);
    ```
    
    So the current behavior is that name can be left unspecified. In that case it will be generated.


---

[GitHub] nifi-minifi-cpp issue #231: MINIFICPP-359 Generate connection name field if ...

Posted by achristianson <gi...@git.apache.org>.
Github user achristianson commented on the issue:

    https://github.com/apache/nifi-minifi-cpp/pull/231
  
    @phrocker removed getOrGenerateField change.


---

[GitHub] nifi-minifi-cpp pull request #231: MINIFICPP-359 Generate connection name fi...

Posted by achristianson <gi...@git.apache.org>.
Github user achristianson commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/231#discussion_r160422690
  
    --- Diff: libminifi/include/core/yaml/YamlConfiguration.h ---
    @@ -245,11 +245,11 @@ class YamlConfiguration : public FlowConfiguration {
        *
        * @param yamlNode a pointer to the YAML::Node that will be checked for the
        *                   presence of an idField
    -   * @param idField  the string of the name of the idField to check for. This
    +   * @param field  the string of the name of the idField to check for. This
        *                   is optional and defaults to 'id'
        * @return         the parsed or generated UUID string
        */
    -  std::string getOrGenerateId(YAML::Node *yamlNode, const std::string &idField = "id");
    +  std::string getOrGenerateField(YAML::Node *yamlNode, const std::string &field = "id");
    --- End diff --
    
    End goal is outlined in https://issues.apache.org/jira/browse/MINIFICPP-359. getOrGenerateField is used in this PR for name now, not just id: `std::string name = getOrGenerateField(&connectionNode, "name");`


---

[GitHub] nifi-minifi-cpp issue #231: MINIFICPP-359 Generate connection name field if ...

Posted by achristianson <gi...@git.apache.org>.
Github user achristianson commented on the issue:

    https://github.com/apache/nifi-minifi-cpp/pull/231
  
    @phrocker fixed conflct should be ready for re-review.


---

[GitHub] nifi-minifi-cpp pull request #231: MINIFICPP-359 Generate connection name fi...

Posted by phrocker <gi...@git.apache.org>.
Github user phrocker commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/231#discussion_r160425167
  
    --- Diff: libminifi/include/core/yaml/YamlConfiguration.h ---
    @@ -245,11 +245,11 @@ class YamlConfiguration : public FlowConfiguration {
        *
        * @param yamlNode a pointer to the YAML::Node that will be checked for the
        *                   presence of an idField
    -   * @param idField  the string of the name of the idField to check for. This
    +   * @param field  the string of the name of the idField to check for. This
        *                   is optional and defaults to 'id'
        * @return         the parsed or generated UUID string
        */
    -  std::string getOrGenerateId(YAML::Node *yamlNode, const std::string &idField = "id");
    +  std::string getOrGenerateField(YAML::Node *yamlNode, const std::string &field = "id");
    --- End diff --
    
    I see that you added the assignment, but I don't see how we are generating fields other than ID fields with that function. In this case it is okay because name will exist at this point in the code by virtue of the checkRequiredFields call. 
    
    In the case where someone else uses it, there is little to indicate other than const std::string &field = "id" that they will get a uuid field value per the conditional in getOrGenerateField. In my opinion they are getting or generating an ID in the current function, hence my confusion. 


---

[GitHub] nifi-minifi-cpp pull request #231: MINIFICPP-359 Generate connection name fi...

Posted by phrocker <gi...@git.apache.org>.
Github user phrocker commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/231#discussion_r160290778
  
    --- Diff: libminifi/include/core/yaml/YamlConfiguration.h ---
    @@ -245,11 +245,11 @@ class YamlConfiguration : public FlowConfiguration {
        *
        * @param yamlNode a pointer to the YAML::Node that will be checked for the
        *                   presence of an idField
    -   * @param idField  the string of the name of the idField to check for. This
    +   * @param field  the string of the name of the idField to check for. This
        *                   is optional and defaults to 'id'
        * @return         the parsed or generated UUID string
        */
    -  std::string getOrGenerateId(YAML::Node *yamlNode, const std::string &idField = "id");
    +  std::string getOrGenerateField(YAML::Node *yamlNode, const std::string &field = "id");
    --- End diff --
    
    What is the end goal of this PR? It seems that you want to generalize the function name to eventually be used elsewhere.


---

[GitHub] nifi-minifi-cpp pull request #231: MINIFICPP-359 Generate connection name fi...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/nifi-minifi-cpp/pull/231


---