Customizable Notification Body

Hi :wave:

We have a pipeline that we’re building that I would like to have some more robust notifications in it.

One step in the pipeline will be setting some environment variables based on terraform outputs. We then want to take this output, and notify our current on-call engineer in slack with it, along with the pipeline state.

While it would be possible to set Slack webhooks and directly post messages from a script, I feel like it would be significantly cleaner and readable to have it live within the pipeline itself.

Also, are there considerations to have a notification step, rather than just an attribute? It would be useful to have notifications outside of just a pass/fail.

:+1: for this.

The fairly recent addition of the notify block in a Pipeline’s yaml definition is a great start, but a native “notify” step type would be much better.

There is surprisingly no Slack notification plugin available, and there would be a fair amount of overhead trying to add this to multiple pipelines and handling Slack credentials.

Buildkite already has its notification integrations, so a step that can leverage those and send custom messages would be awesome to have!

1 Like

+1 from me as well!

We really would like to have more control over Slack notification content, but also be able to create notifications on the step level rather than the pipeline level

I’m getting asked to customize a build notification message. Is there any way to add custom content? I’m thinking that if I can set the build message at the end of the pipeline steps that should be enough to address what’s being asked for, but haven’t had any luck doing that.

Hey @johnf! Sorry for the delayed reply, did you end up finding a workaround?

If not, which service are you sending notifications to? And what kind of content are you after? Just text, or more than that? I don’t think any of our current integrations support custom messages right now, but I can look into what’s involved with adding that.

Hi Harriet,

Thanks for responding. When I wrote that I was looking at sending a slack notification for a test report. Someone had requested more info in the notification body (e.g., test run completed successfully, there were 30 passing, 3 failed and two skipped or something like that.) I couldn’t find a workaround. I know Jenkins supports something like this, think through a plugin. I’d definitely find a use for it if it was available but it’s not a high priority thing.

Thanks

John

We currently don’t use the notify pipeline feature because we want to customise the message template and there doesn’t seem to be a way to do that.

For example

  • to target the slack notifications for a “build broken” we want to include the slack username of the last person to commit, so that they get an @-mention.
  • we don’t use the email, basecamp options.
  • we want to include contextual information about the failure into the failure, like (say) the last few log lines of the command-step, so it’s more tempting for a person to drive-by fix.

Would it be possible to augment the notify feature with “run this binary to produce a document containing a message template”?

Any updates on possibility of this.

It’s the one thing holding me back from fully converting jobs from Jenkins, where I can free form slack/email notifications based on outcomes. That’s a pretty large missing piece for Buildkite.

Hey @cphillips, welcome to the community!:slight_smile:

Does the functionality described in our docs here: Triggering Notifications | Buildkite Documentation give you what you are looking for? Or are there specific features you are still looking for related to the notifications?

Hey @jeremy! So those docs work, but are limiting.

It would be nice to be able to just craft the JSON payload required for Slacks Block Kit directly instead of having to sort out how it’s being parsed via the message key, inside the notify block.

It’d be nice to have like a raw_message where you could craft the JSON as needed.

The two issues I had with the current message was

  • when trying to do [Link Text](link) it didn’t actually convert within Slack when sending the notify.
  • I had tried to use back-ticks in the label for the step, which seems to turn into the subject of the notification, and it ignored the content entirely once sent to Slack.

So there’s unexpected formatting happening with the current approach.

We can make do for now and I’ve explored leveraging a Lambda instead of the Slack Integration, but that seems to defeat the purpose of the integration.

hope this clears it up a little.

Thanks for taking the time to respond on a fairly old thread :smile:

@cphillips apologies for the delay in responding to your message here! For some reason, the message didn’t show up on the thread until now. In any case, I agree that being able to send messages using Slack’s Block Kit would be a good improvement, so when you initially mentioned this I raised this as a feature request with our product team to review :slight_smile:

No worries, it seemed my post got flagged and was being held by some automation, I hadn’t realized until I received an e-mail that my post was released. I’m glad to hear this is a possibility though.

The flexibility of Block Kit opens up the ways we can actively interact with users regarding build promotions, etc.

Is there a feature request I can track somewhere? or just keep my eyes peeled for this post?

Thanks again!

Hey @cphillips :wave:

We don’t have a public place to track feature request, so feel free to ping us here for update :slight_smile:
At the moment there is a lot of work around reliability, and other requests, so this will take time for the product team to analyze.

Thanks!

Understood, I know this is sort of low-priority. Thanks

@jeremy @paula Can you share any updates on it?

Hey!

Unfortunately, we don’t have any news. It hasn´t been prioritized yet :face_with_diagonal_mouth: .

Best!