Working with Slack (Changes to Webhook or a new Plugin)

209 views
Skip to first unread message

Andrei Nadin

unread,
May 5, 2015, 12:38:26 AM5/5/15
to scmma...@googlegroups.com
We keep coming up with problems integrating SCM-Manager with Slack, at the moment we are (kind of) getting it working with the web hook plugin but it involves using another app/site etc. to filter the web hook into the channels. We have 3 Repositories (all SVN) but within we run multiple projects. The current web hook functionality only allows us to set a web hook per repository, it would be suer useful to be able to set a hook per top level folder in our repository (project level) or perhaps a new slack plugin?

Sebastian Sdorra

unread,
May 6, 2015, 10:35:04 AM5/6/15
to scmma...@googlegroups.com
I think a new plugin would be the way to go. Are you familiar with java? Do you think you could write the plugin by your own (of course with help from me)? If not please open a ticket with detailed explanations at https://bitbucket.org/sdorra/scm-manager/issues

Sebastian

2015-05-05 6:38 GMT+02:00 Andrei Nadin <andrei...@gmail.com>:
We keep coming up with problems integrating SCM-Manager with Slack, at the moment we are (kind of) getting it working with the web hook plugin but it involves using another app/site etc. to filter the web hook into the channels. We have 3 Repositories (all SVN) but within we run multiple projects. The current web hook functionality only allows us to set a web hook per repository, it would be suer useful to be able to set a hook per top level folder in our repository (project level) or perhaps a new slack plugin?

--
You received this message because you are subscribed to the Google Groups "scmmanager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scmmanager+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sebastian Sdorra

unread,
May 6, 2015, 12:10:07 PM5/6/15
to scmma...@googlegroups.com
I've looked at the slack api and it looks very smooth. I will try to write the plugin within the next days. Pleas explain what you expect from a SCM-Manager slack plugin.

Sebastian

Andrei Nadin

unread,
May 6, 2015, 9:30:30 PM5/6/15
to scmma...@googlegroups.com
Hi Sebastian, thats fantastic news.

Yeah so quick off the cuff is we set up web hooks per channel in Slack so idealy a way to associate paths with a web hook, or a path contains <name of root folder> with we can then associate set the target URL for the Slack Post.

I suppose an interface we we can add a series of Slack channels, set the search string, and some of the variable stuff. 

This is the kind of stuff that Zapier offers which maps to the fields that can be changed when posting to Slack

Sebastian Sdorra

unread,
May 26, 2015, 3:29:26 PM5/26/15
to scmma...@googlegroups.com
Sorry for the delay, but i've started the development of the plugin at https://bitbucket.org/sdorra/scm-slack-plugin. The plugin requires the upcoming version 1.46 of scm-manager.

Sebastian

Andrei Nadin

unread,
May 27, 2015, 12:00:10 AM5/27/15
to scmma...@googlegroups.com
Excellent news, looking forward to it

Sebastian Sdorra

unread,
Jun 19, 2015, 4:08:31 PM6/19/15
to scmma...@googlegroups.com
I've finished a first version of the scm-slack-plugin. Could you please test it?

Sebastian

Andrei Nadin

unread,
Jun 20, 2015, 12:40:41 AM6/20/15
to scmma...@googlegroups.com
So far so good, excellent to have it, just configuring for another couple of channels now, is it possible to insert the change description in the template, I have tried a few variants of {{changset.id}} but so far I can't make it work.

Andrei Nadin

unread,
Jun 20, 2015, 12:50:09 AM6/20/15
to scmma...@googlegroups.com
OK so a little more confused now :)

I added a second on to my repo for a different channel and now its posting in two channels each time I check in.


You received this message because you are subscribed to a topic in the Google Groups "scmmanager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scmmanager/8l1OJHG9ncI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scmmanager+...@googlegroups.com.

Sebastian Sdorra

unread,
Jun 20, 2015, 3:04:06 AM6/20/15
to scmma...@googlegroups.com
To get the description of the commit, you have to loop over the pushed commits (this is beacuse of the git and mercurial support):

{{#changesets}}{{id}}: {{description}}{{/changesets}}

You get two messages, because you have defined two hooks which matches any commit. In your case you have to use the "modification" matcher.
This matcher uses the parameter to match modified paths of the commit. Note the parameter has to be a regex which matches the whole path.

Sebastian

Andrei Nadin

unread,
Jun 20, 2015, 3:56:56 AM6/20/15
to scmma...@googlegroups.com
Cool thats working great (descriptions), I assume this will make it into the documentation :)

Got to say that I am struggling on the regex of the path too, do you have an example?, as in do you mean FQDN/scm/scn/repo/project/trunk etc? I have tried a few. Or is {{Project:xx}}

Can’t see anyway to ‘browse’ this info.


On 20 Jun 2015, at 5:04 pm, Sebastian Sdorra <s.sd...@gmail.com> wrote:

To get the description of the commit, you have to loop over the pushed commits (this is beacuse of the git and mercurial support):

{{#changesets}}{{id}}: {{description}}{{/changesets}}

You get two messages, because you have defined two hooks which matches any commit. In your case you have to use the "modification" matcher.
This matcher uses the parameter to match modified paths of the commit. Note the parameter has to be a regex which matches the whole path.

Sebastian
2015-06-20 6:50 GMT+02:00 Andrei Nadin <andrei...@gmail.com>:
OK so a little more confused now :)

I added a second on to my repo for a different channel and now its posting in two channels each time I check in.

<PastedGraphic-1.png>

Sebastian Sdorra

unread,
Jun 20, 2015, 4:48:06 AM6/20/15
to scmma...@googlegroups.com
You have to match the whole path in the repository. You have to insert something like this:

Proj1/.*

For more informations and options have a look at the javadoc for Pattern:


Sebastian

Andrei Nadin

unread,
Jun 20, 2015, 5:23:48 AM6/20/15
to scmma...@googlegroups.com
Sweet, that works now, so far confirmed across two, will add it to the rest and let you know if there are any problems but so far the implementation is great. Thanks so much.
Reply all
Reply to author
Forward
0 new messages