Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Any configuration for webhooks plugin? #3755

atlsk8r ·

I'm trying to get our Quickbuild server to send build notifications to a Slack channel.

We set up an Slack webhook endpoint. I confirmed that Posts to the endpoint will post to the Slack channel by calling curl from our Quickbuild server:

curl -X POST -H 'Content-type: application/json' --data '{"text":"Hello, world"}' https://hooks.slack.com/services/<hook_path_here>

I then configured the QuickBuild "Webhooks" with the Slack endpoint I tested earlier, per the attached image.

webhook_setup.JPG

When I kick a build, however, I do not see any Slack posts. I check the Quickbuild server logs and saw that the server did appear to POST to the webhook endpoint, but that the POST failed.

ERROR - Unable to post data to webhook https://hooks.slack.com/services/stuff/morestuff due to no_text

The no_text error is returned by Slack API when it does not detect any message text in webhook POST.

Is there anything else I need to do to configure this Quickbuild WebHook plugin? I don't see a place to configure a Notification Template, like you can for Email/Jabber notifications. Also the Misc/Webhooks listing in the Plugin Admin screen doesn't have a "Configure" Operation link like it does for some other plugins.

Just checking if there are any other steps I need to perform to ensure Quickbuild includes text in the build notification.

Thanks!
Greg
Prophecy Games, Inc.

  • replies 3
  • views 1535
  • stars 0
steveluo ADMIN ·
atlsk8r ·

Hi Steve,

Thanks for the follow-up! Yeah, I assume it was something with the message formatting. As it definitely appeared that the server was successfully making a POST to Slack.

Regarding the Slack message step - I did give that a try. I think I had an issue with the test, but I'll have to retry it to refresh my memory. When I saw the webhook, I thought that was a good option, as it is guaranteed to execute at the end of any builds that inherit it.

But the Slack step should work as well. I'll just have to investigate what QB configuration variables are available at the time the step is run to give me a good indication of the build's success/failure. Also, I wasn't too familiar with the best method of generating an auth token from Slack to add to Slack Message step. The one example I saw generated a token that expired in 24 hours. If that's the only option, we'd need to inject the token into the build process.

But I can investigate that process more. We've only just started using Slack, so I'm not too familiar with it's features. Nor am I a QuickBuild expert either :).

Thanks!

steveluo ADMIN ·

I wasn't too familiar with the best method of generating an auth token from Slack to add to Slack Message step.

You can: