You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by pvillard31 <gi...@git.apache.org> on 2018/04/07 17:38:52 UTC

[GitHub] nifi-registry pull request #110: NIFIREG-160 - WIP - Hook provider

GitHub user pvillard31 opened a pull request:

    https://github.com/apache/nifi-registry/pull/110

    NIFIREG-160 - WIP - Hook provider

    To test it quickly, you can do the following changes:
    
    ./conf/providers.xml
    
    ````xml
    <providers>
    
        <flowPersistenceProvider>
            <class>org.apache.nifi.registry.provider.flow.FileSystemFlowPersistenceProvider</class>
            <property name="Flow Storage Directory">./flow_storage</property>
        </flowPersistenceProvider>
    
        <flowHookProvider>
            <class>org.apache.nifi.registry.provider.hook.ScriptFlowHookProvider</class>
            <property name="Script Path">/tmp/test.sh</property>
            <property name="Working Directory"></property>
        </flowHookProvider>
    
    </providers>
    ````
    
    /tmp/test.sh
    
    ````bash
    #!/bin/bash
    echo $@ >> /tmp/registryHook.log
    ````
    
    We can see this kind of ouput:
    
    ````
    CREATE_BUCKET a50f3aac-a3b6-47ed-b0b0-eb7a1c0cb8b5
    CREATE_VERSION 7091404e-1295-4d03-9053-06f2ecb83f91 707b31c8-6741-4525-9816-bd188f1f96eb 2 a comment anonymous
    DELETE_BUCKET a50f3aac-a3b6-47ed-b0b0-eb7a1c0cb8b5
    CREATE_BUCKET 95c7d15a-2ac8-494e-841a-c168e19c1c35
    CREATE_BUCKET 2326a164-7ab3-45a3-af66-4adbf2cd4f32
    DELETE_BUCKET 95c7d15a-2ac8-494e-841a-c168e19c1c35
    DELETE_BUCKET 2326a164-7ab3-45a3-af66-4adbf2cd4f32
    ````

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

    $ git pull https://github.com/pvillard31/nifi-registry hook

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

    https://github.com/apache/nifi-registry/pull/110.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 #110
    
----
commit 4d7d8d21f211d646def86271a9b69c2633f9adf9
Author: Pierre Villard <pi...@...>
Date:   2018-04-06T14:58:33Z

    NIFIREG-160 - WIP - Hook provider

----


---

[GitHub] nifi-registry issue #110: NIFIREG-160 - WIP - Hook provider

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

    https://github.com/apache/nifi-registry/pull/110
  
    @pvillard31 I branched off your commit and resolved conflicts and took a stab at making the the event publishing/consuming asynchronous so that the main request path won't be impacted by any hang-ups from the providers. 
    
    Also tried to make the event concept a little bit less specific to flows so that it can be easily re-used for any other types of items that we may store in the registry like extensions, assets, etc.
    
    My branch is here: https://github.com/bbende/nifi-registry/commits/hook-provider
    
    Let me know what you think about this approach. If we want to head down this path I can submit a PR to your branch, or I can open a new PR against registry that includes your commit + these changes. In the meantime I'll work on some unit tests.


---

[GitHub] nifi-registry issue #110: NIFIREG-160 - WIP - Hook provider

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

    https://github.com/apache/nifi-registry/pull/110
  
    Thanks for the quick review. Using the commit message definitely makes sense, I will add those fields back to the event for creating a flow version. 
    
    I think we could support an option to override the commit message as part of the CLI commands, most likely an optional argument on the import-flow-version command. Eventually it would be nice to have some kind of tags (or a better name) that can be put on flows/items, and then the tags could be used to create these kinds of workflows, but obviously that would be a longer term effort and using the commit message is a nice option for right now.
    
    I'll keep going on my branch with adding the author and comment fields and unit tests and then try and get something posted. Thanks for getting the ball rolling on this, it should be really helpful for users.


---

[GitHub] nifi-registry issue #110: NIFIREG-160 - WIP - Hook provider

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

    https://github.com/apache/nifi-registry/pull/110
  
    @bbende thanks for working on this! I really think it'll be a nice addition to the NiFi Registry and what you did looks great. I think it's best to close this PR and you submit a new one. It'll be easier, and I'll be happy to review it.
    
    I'd just recommend keeping author and comment fields in the Event objects. Reason is: I'd imagine people that could add a specific tag in the comment to trigger automatic actions. Example, I have a flow I'm working on in Dev, and I consider the version I got is ready enough to get tested in Staging and deployed in production. I could commit my changes and comment with something like "[STAGING-READY]". This way, the deployment of the workflow in Staging would be automatically triggered.
    
    I actually think it could be interesting to allow users overriding the comment when importing a new flow version from one registry to another. This would ease automatic deployment across multiple environments using the above mechanism. Just an idea... there could be something better. Do you have something in mind on your side?


---

[GitHub] nifi-registry pull request #110: NIFIREG-160 - WIP - Hook provider

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

    https://github.com/apache/nifi-registry/pull/110


---

[GitHub] nifi-registry issue #110: NIFIREG-160 - WIP - Hook provider

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

    https://github.com/apache/nifi-registry/pull/110
  
    Great! We are definitely on the same page here. Closing this PR, thanks again!


---