about summary refs log tree commit diff
path: root/web/panettone/src/panettone.lisp
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2021-04-03T18·42-0400
committerglittershark <grfn@gws.fyi>2021-04-04T14·17+0000
commit6c78cb69c77113545361dcbcad40fe136d982ae5 (patch)
tree6183cb80251e9b6db112affe37549f3e95588ffe /web/panettone/src/panettone.lisp
parent606d2af2da946c9ddf15e737d77d9b193b7725bc (diff)
feat(panettone): Send notifications when issues are reopened r/2430
Send notifications both to IRC and email when issues are reopened after
being closed

Change-Id: I3a63419c6547ac28eeaafbe212a2a01a5fc2b5af
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2808
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'web/panettone/src/panettone.lisp')
-rw-r--r--web/panettone/src/panettone.lisp15
1 files changed, 15 insertions, 0 deletions
diff --git a/web/panettone/src/panettone.lisp b/web/panettone/src/panettone.lisp
index 9a9aa9ce62a1..1067f483397b 100644
--- a/web/panettone/src/panettone.lisp
+++ b/web/panettone/src/panettone.lisp
@@ -600,6 +600,21 @@ given subject an body (in a thread, to avoid blocking)"
                         :method :post)
     (&path (id 'integer))
   (model:set-issue-status id :open)
+  (let ((issue (model:get-issue id)))
+    (send-irc-notification
+     (format nil
+             "b/~A: \"~A\" reopened by ~A - https://b.tvl.fyi/issues/~A"
+             id
+             (subject issue)
+             (irc:noping (cn *user*))
+             id)
+     :channel (or (uiop:getenvp "ISSUECHANNEL")
+                  "##tvl-dev"))
+    (send-email-for-issue
+     id
+     :subject (format nil "~A reopened \"~A\""
+                      (dn *user*)
+                      (subject issue))))
   (hunchentoot:redirect (format nil "/issues/~A" id)))
 
 (defroute styles ("/main.css") ()