feat(panettone): Send notifications when issues are closed

Send an irc notification when issues are marked closed, in a similar
format to the notifications sent when new issues are created.

Change-Id: I2fdde33f0dedc223a5c2265eed778161938f8e9a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2126
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
Griffin Smith 2020-11-22 14:05:00 -05:00 committed by glittershark
parent 96eac23250
commit 92a1f72f41

View file

@ -454,11 +454,13 @@
(model:create-issue :subject subject (model:create-issue :subject subject
:body body :body body
:author-dn (dn *user*)))) :author-dn (dn *user*))))
(send-irc-notification (format nil "b/~A: \"~A\" opened by ~A - https://b.tvl.fyi/issues/~A" (send-irc-notification
(id issue) subject (cn *user*) (format nil
(id issue)) "b/~A: \"~A\" opened by ~A - https://b.tvl.fyi/issues/~A"
:channel (or (uiop:getenvp "ISSUECHANNEL") (id issue) subject (cn *user*)
"##tvl-dev")) (id issue))
:channel (or (uiop:getenvp "ISSUECHANNEL")
"##tvl-dev"))
(hunchentoot:redirect "/")))) (hunchentoot:redirect "/"))))
(defroute show-issue (defroute show-issue
@ -515,6 +517,13 @@
:method :post) :method :post)
(&path (id 'integer)) (&path (id 'integer))
(model:set-issue-status id :closed) (model:set-issue-status id :closed)
(let ((issue (model:get-issue id)))
(send-irc-notification
(format nil
"b/~A: \"~A\" closed by ~A - https://b.tvl.fyi/issues/~A"
id (subject issue) (cn *user*) id)
:channel (or (uiop:getenvp "ISSUECHANNEL")
"##tvl-dev")))
(hunchentoot:redirect (format nil "/issues/~A" id))) (hunchentoot:redirect (format nil "/issues/~A" id)))
(defroute open-issue (defroute open-issue