You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by JPercivall <gi...@git.apache.org> on 2018/02/28 02:45:54 UTC

[GitHub] nifi-minifi pull request #117: MINIFI-424 Adding the ability to evaluate boo...

GitHub user JPercivall opened a pull request:

    https://github.com/apache/nifi-minifi/pull/117

    MINIFI-424 Adding the ability to evaluate bootstrap properties in the…

    … config YAML prior to translation into flow.xml and nifi.properties
    
    Thank you for submitting a contribution to Apache NiFi - MiNiFi.
    
    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] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi-minifi folder?
    - [X] Have you written or updated unit tests to verify your 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, including the main LICENSE file under minifi-assembly?
    - [X] If applicable, have you updated the NOTICE file, including the main NOTICE file found under minifi-assembly?
    
    ### 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/JPercivall/nifi-minifi MINIFI-424

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

    https://github.com/apache/nifi-minifi/pull/117.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 #117
    
----
commit 959a7cfffe76ab3795a1bfa361c3580f1f194775
Author: Joe Percivall <jp...@...>
Date:   2018-02-28T02:44:39Z

    MINIFI-424 Adding the ability to evaluate bootstrap properties in the config YAML prior to translation into flow.xml and nifi.properties

----


---

[GitHub] nifi-minifi pull request #117: MINIFI-424 Adding the ability to evaluate boo...

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

    https://github.com/apache/nifi-minifi/pull/117#discussion_r177177296
  
    --- Diff: minifi-bootstrap/src/main/java/org/apache/nifi/minifi/bootstrap/RunMiNiFi.java ---
    @@ -1176,11 +1191,18 @@ public boolean accept(final File dir, final String filename) {
     
         @SuppressWarnings({"rawtypes", "unchecked"})
         public void start() throws IOException, InterruptedException {
    +        Properties bootstrapProperties = getBootstrapProperties();
    +
    +        final String confDir = bootstrapProperties.getProperty(CONF_DIR_KEY);
    +        final File configFile = new File(bootstrapProperties.getProperty(MINIFI_CONFIG_FILE_KEY));
    +        final Properties transformationConfigProperties = getConfigTransformationProperties(bootstrapProperties);
    +
    +        for(String name: transformationConfigProperties.stringPropertyNames()) {
    +            defaultLogger.error("config property: name:[" + name + "] value:[" + transformationConfigProperties.getProperty(name) + "] ");
    --- End diff --
    
    Would this be better as `info`?


---

[GitHub] nifi-minifi pull request #117: MINIFI-424 Adding the ability to evaluate boo...

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

    https://github.com/apache/nifi-minifi/pull/117#discussion_r183258883
  
    --- Diff: minifi-bootstrap/src/main/java/org/apache/nifi/minifi/bootstrap/RunMiNiFi.java ---
    @@ -1176,11 +1191,18 @@ public boolean accept(final File dir, final String filename) {
     
         @SuppressWarnings({"rawtypes", "unchecked"})
         public void start() throws IOException, InterruptedException {
    +        Properties bootstrapProperties = getBootstrapProperties();
    +
    +        final String confDir = bootstrapProperties.getProperty(CONF_DIR_KEY);
    +        final File configFile = new File(bootstrapProperties.getProperty(MINIFI_CONFIG_FILE_KEY));
    +        final Properties transformationConfigProperties = getConfigTransformationProperties(bootstrapProperties);
    +
    +        for(String name: transformationConfigProperties.stringPropertyNames()) {
    +            defaultLogger.error("config property: name:[" + name + "] value:[" + transformationConfigProperties.getProperty(name) + "] ");
    --- End diff --
    
    Most definitely better as `info`


---

[GitHub] nifi-minifi pull request #117: MINIFI-424 Adding the ability to evaluate boo...

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

    https://github.com/apache/nifi-minifi/pull/117#discussion_r177183684
  
    --- Diff: minifi-toolkit/minifi-toolkit-configuration/src/main/java/org/apache/nifi/minifi/toolkit/configuration/ConfigMain.java ---
    @@ -106,10 +108,22 @@ public static void printValidateUsage() {
         }
     
         public int validate(String[] args) {
    -        if (args.length != 2) {
    +        if (args.length != 2 && args.length != 3) {
                 printValidateUsage();
    --- End diff --
    
    Does `printValidateUsage()` need updated?


---

[GitHub] nifi-minifi pull request #117: MINIFI-424 Adding the ability to evaluate boo...

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

    https://github.com/apache/nifi-minifi/pull/117#discussion_r176170883
  
    --- Diff: minifi-commons/minifi-commons-schema/src/test/java/org/apache/nifi/minifi/commons/schema/serialization/SchemaLoaderTest.java ---
    @@ -84,13 +85,92 @@ public void testUnsupportedVersion() throws IOException, SchemaLoaderException {
             }
         }
     
    +    @Test
    +    public void testMinimalConfigV3VersionUnusedProperties() throws IOException, SchemaLoaderException {
    +        Properties inputProperties = new Properties();
    --- End diff --
    
    Minor, but could we also have these tests drawing from a sample bootstrap.conf in lieu of just seeding the properties.  With some of the work that is underway surrounding C2 would not want to miss coverage of this functionality.


---

[GitHub] nifi-minifi pull request #117: MINIFI-424 Adding the ability to evaluate boo...

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

    https://github.com/apache/nifi-minifi/pull/117


---