tools icon indicating copy to clipboard operation
tools copied to clipboard

Extended the hook_url functionality to Slack

Open muffato opened this issue 1 year ago • 3 comments

Hello,

Got very interested in what @matthdsm did in #1798 . This is a small extension to support Slack as well, since Slack doesn't understand adaptive cards.

Here is how the notifications look like:

Screenshot 2022-09-16 at 11 16 27 Screenshot 2022-09-16 at 11 38 18

The JSON has a very long and tricky line where I try to improve the look-and-feel of the pipeline configuration:

  • paths are printed as code
  • dates are formatted according to the locale settings
  • the hook_url itself is hidden

Note: I am using the legacy "attachments" method of the Slack API, rather than the now-recommended Block Kit method, because I couldn't find how to make the latter put some colour. I think one has to immediately know whether it failed or not, and the colour is faster to recognise than the text itself.

PR checklist

  • [x] This comment contains a description of changes (with reason)
  • [x] CHANGELOG.md is updated
  • [ ] If you've fixed a bug or added code that should be tested, add tests!
  • [ ] Documentation in docs is updated

muffato avatar Sep 16 '22 10:09 muffato

Codecov Report

Merging #1829 (33a09af) into dev (7010335) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##              dev    #1829   +/-   ##
=======================================
  Coverage   63.74%   63.74%           
=======================================
  Files          41       41           
  Lines        4913     4913           
=======================================
  Hits         3132     3132           
  Misses       1781     1781           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Sep 16 '22 11:09 codecov[bot]

Love it, just left one small comment

matthdsm avatar Sep 16 '22 11:09 matthdsm

IM_notification can do. I feel uninspired today and can't find a better name

muffato avatar Sep 16 '22 13:09 muffato

Is this considered to be superseded by https://github.com/Midnighter/nf-slack ?

muffato avatar Nov 03 '22 18:11 muffato

Thank you !

muffato avatar Nov 16 '22 10:11 muffato

Please add documentation about this https://github.com/nf-core/nf-co.re/issues/1455

mashehu avatar Nov 16 '22 10:11 mashehu