[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16489248#comment-16489248 ] ASF GitHub Bot commented on NIFIREG-160: Github user asfgit closed the pull request at: https://github.com/apache/nifi-registry/pull/118 > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Bryan Bende >Priority: Major > Fix For: 0.2.0 > > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16489203#comment-16489203 ] ASF GitHub Bot commented on NIFIREG-160: GitHub user bbende opened a pull request: https://github.com/apache/nifi-registry/pull/118 NIFIREG-160 Fixing issue where version created event throws an except… …ion when comments are not provided You can merge this pull request into a Git repository by running: $ git pull https://github.com/bbende/nifi-registry NIFIREG-160-exception Alternatively you can review and apply these changes as the patch at: https://github.com/apache/nifi-registry/pull/118.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 #118 commit a1f16a2ac068dcbe9d138b81de10df336d0745fa Author: Bryan BendeDate: 2018-05-24T15:23:16Z NIFIREG-160 Fixing issue where version created event throws an exception when comments are not provided > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Bryan Bende >Priority: Major > Fix For: 0.2.0 > > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16476209#comment-16476209 ] ASF GitHub Bot commented on NIFIREG-160: Github user pvillard31 commented on the issue: https://github.com/apache/nifi-registry/pull/117 Merged to master, thanks! > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Bryan Bende >Priority: Major > Fix For: 0.2.0 > > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16476208#comment-16476208 ] ASF GitHub Bot commented on NIFIREG-160: Github user asfgit closed the pull request at: https://github.com/apache/nifi-registry/pull/117 > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16476189#comment-16476189 ] ASF GitHub Bot commented on NIFIREG-160: Github user bbende commented on the issue: https://github.com/apache/nifi-registry/pull/117 @pvillard31 thanks for the review, i'm fine with you doing the minor cleanup on merge, thanks! > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16476187#comment-16476187 ] ASF GitHub Bot commented on NIFIREG-160: Github user pvillard31 commented on the issue: https://github.com/apache/nifi-registry/pull/117 @bbende I just did some tests with various possible configurations and different hooks, it's working as expected. The dedicated log file is really great and useful. Let me know if you want to do something regarding my comments or I can take care of it while merging if you are OK with it. > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16476145#comment-16476145 ] ASF GitHub Bot commented on NIFIREG-160: Github user pvillard31 commented on a diff in the pull request: https://github.com/apache/nifi-registry/pull/117#discussion_r188350335 --- Diff: nifi-registry-framework/src/main/java/org/apache/nifi/registry/provider/flow/StandardFlowSnapshotContext.java --- @@ -33,8 +33,8 @@ private final String flowName; private final int version; private final String comments; -private final long snapshotTimestamp; --- End diff -- Really nitpick but I think the changes on this class seem unnecessary, no? > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16476144#comment-16476144 ] ASF GitHub Bot commented on NIFIREG-160: Github user pvillard31 commented on a diff in the pull request: https://github.com/apache/nifi-registry/pull/117#discussion_r188357732 --- Diff: pom.xml --- @@ -110,8 +110,8 @@ 2.1 2.26 2.9.2 -2.0.0.M7 -5.0.0.RELEASE +2.0.2.RELEASE --- End diff -- It seems we are also specifying the versions in the notice files. Should be updated as well. > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16476143#comment-16476143 ] ASF GitHub Bot commented on NIFIREG-160: Github user pvillard31 commented on a diff in the pull request: https://github.com/apache/nifi-registry/pull/117#discussion_r188356239 --- Diff: nifi-registry-framework/src/test/java/org/apache/nifi/registry/provider/hook/TestScriptEventHookProvider.java --- @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.registry.provider.hook; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + +import org.apache.nifi.registry.extension.ExtensionManager; +import org.apache.nifi.registry.properties.NiFiRegistryProperties; +import org.apache.nifi.registry.provider.ProviderCreationException; +import org.apache.nifi.registry.provider.ProviderFactory; +import org.apache.nifi.registry.provider.StandardProviderFactory; +import org.junit.Test; +import org.mockito.Mockito; + +public class TestScriptEventHookProvider { + +@Test(expected = ProviderCreationException.class) +public void testBadScriptProvider() { --- End diff -- can't test on my side but is it going to work for a build on Windows? > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16476141#comment-16476141 ] ASF GitHub Bot commented on NIFIREG-160: Github user pvillard31 commented on a diff in the pull request: https://github.com/apache/nifi-registry/pull/117#discussion_r188356638 --- Diff: nifi-registry-framework/src/test/java/org/apache/nifi/registry/service/TestRegistryService.java --- @@ -81,6 +81,7 @@ public void setup() { metadataService = mock(MetadataService.class); flowPersistenceProvider = mock(FlowPersistenceProvider.class); +// eventHookProvider = mock(EventHookProvider.class); --- End diff -- To be removed? > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16476142#comment-16476142 ] ASF GitHub Bot commented on NIFIREG-160: Github user pvillard31 commented on a diff in the pull request: https://github.com/apache/nifi-registry/pull/117#discussion_r188356509 --- Diff: nifi-registry-framework/src/test/java/org/apache/nifi/registry/provider/hook/TestScriptEventHookProvider.java --- @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.registry.provider.hook; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + +import org.apache.nifi.registry.extension.ExtensionManager; +import org.apache.nifi.registry.properties.NiFiRegistryProperties; +import org.apache.nifi.registry.provider.ProviderCreationException; +import org.apache.nifi.registry.provider.ProviderFactory; +import org.apache.nifi.registry.provider.StandardProviderFactory; +import org.junit.Test; +import org.mockito.Mockito; + +public class TestScriptEventHookProvider { + +@Test(expected = ProviderCreationException.class) +public void testBadScriptProvider() { --- End diff -- ok nevermind, since we expect it to fail, it should also fail on Windows > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16475489#comment-16475489 ] ASF GitHub Bot commented on NIFIREG-160: Github user pvillard31 commented on the issue: https://github.com/apache/nifi-registry/pull/117 Hi @bbende - I should be able to review and test shortly, will let you know. Thanks again for this PR! > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16474336#comment-16474336 ] ASF GitHub Bot commented on NIFIREG-160: Github user bbende commented on the issue: https://github.com/apache/nifi-registry/pull/117 @pvillard31 this should be good to go pending any review feedback, let me know if you have any cycles to take a look, thanks > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16469486#comment-16469486 ] ASF GitHub Bot commented on NIFIREG-160: Github user bbende commented on the issue: https://github.com/apache/nifi-registry/pull/117 For an easy way to test this you can turn uncomment the LoggingEventHookProvider in providers.xml and then use the registry as normal to create buckets and save flows from NiFi, then tail or inspect logs/nifi-registry-event.log > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16469484#comment-16469484 ] ASF GitHub Bot commented on NIFIREG-160: GitHub user bbende opened a pull request: https://github.com/apache/nifi-registry/pull/117 NIFIREG-160 Implement a hook provider For whoever reviews/merges this, please keep the commit history and don't squash. You can merge this pull request into a Git repository by running: $ git pull https://github.com/bbende/nifi-registry hook-provider Alternatively you can review and apply these changes as the patch at: https://github.com/apache/nifi-registry/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 3371a07068dbbd5b3984f386cf61bc297ba608a9 Author: Pierre VillardDate: 2018-04-06T14:58:33Z NIFIREG-160 - Initial hook provider commit f99cf19d49bf5d301ada83a5c128b645da00458f Author: Bryan Bende Date: 2018-05-08T17:38:33Z NIFIREG-160 - Making event hooks asynchronous > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16469029#comment-16469029 ] ASF GitHub Bot commented on NIFIREG-160: 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! > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16469030#comment-16469030 ] ASF GitHub Bot commented on NIFIREG-160: Github user pvillard31 closed the pull request at: https://github.com/apache/nifi-registry/pull/110 > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16469013#comment-16469013 ] ASF GitHub Bot commented on NIFIREG-160: 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. > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16468998#comment-16468998 ] ASF GitHub Bot commented on NIFIREG-160: 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? > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16468927#comment-16468927 ] ASF GitHub Bot commented on NIFIREG-160: 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. > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Assignee: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFIREG-160) Implement a hook provider
[ https://issues.apache.org/jira/browse/NIFIREG-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16429481#comment-16429481 ] ASF GitHub Bot commented on NIFIREG-160: 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 org.apache.nifi.registry.provider.flow.FileSystemFlowPersistenceProvider ./flow_storage org.apache.nifi.registry.provider.hook.ScriptFlowHookProvider /tmp/test.sh /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 VillardDate: 2018-04-06T14:58:33Z NIFIREG-160 - WIP - Hook provider > Implement a hook provider > - > > Key: NIFIREG-160 > URL: https://issues.apache.org/jira/browse/NIFIREG-160 > Project: NiFi Registry > Issue Type: New Feature >Reporter: Pierre Villard >Priority: Major > > In order to extend NiFi Registry and NiFi CLI features to integrate with > automated deployment pipelines, it would be useful to provide a hook > extension point that can be configured by users to trigger actions when a new > flow snapshot version is committed in the Registry. > A first implementation of this extension point could be a "script hook": a > script would be executed when a new flow snapshot version is committed. > Arguments passed to the script would be: bucket ID, flow ID, version, author > and comment. > This would enable a lot of scenarios including automatically deploy flows > from one environment to another. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)