revert(panettone): announce newly created issues using irccat
This reverts commit 2e2bdf9c6c
.
Reason for revert: this is not working, and is resulting in newly created issues just showing a blank page (b/74)
Change-Id: I3f06afc52d6c5289269402fc75bb32ad9c376bf4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2082
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
parent
4331bc8da7
commit
e1067b1497
4 changed files with 4 additions and 38 deletions
|
@ -26,7 +26,6 @@ depot.nix.buildLisp.program {
|
||||||
./src/css.lisp
|
./src/css.lisp
|
||||||
./src/authentication.lisp
|
./src/authentication.lisp
|
||||||
./src/model.lisp
|
./src/model.lisp
|
||||||
./src/irc.lisp
|
|
||||||
./src/panettone.lisp
|
./src/panettone.lisp
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
;;;; Using irccat to send IRC notifications
|
|
||||||
|
|
||||||
(in-package :panettone.irc)
|
|
||||||
|
|
||||||
(defun get-irccat-config ()
|
|
||||||
"Reads the IRCCATHOST and IRCCATPORT environment variables, and returns them as two values if they both exist (otherwise, returns NIL)."
|
|
||||||
(destructuring-bind (host port)
|
|
||||||
(mapcar #'uiop:getenvp '("IRCCATHOST" "IRCCATPORT"))
|
|
||||||
(when (and host port)
|
|
||||||
(values host (parse-integer port)))))
|
|
||||||
|
|
||||||
(defun send-irc-notification (body &key channel)
|
|
||||||
"Sends BODY to the IRC channel CHANNEL (starting with #), if an IRCCat server is configured (using the IRCCATHOST and IRCCATPORT environment variables)
|
|
||||||
If CHANNEL is NIL, sends the BODY to the first channel configured in the IRCCat configuration.
|
|
||||||
May signal a condition if sending fails."
|
|
||||||
(multiple-value-bind (irchost ircport)
|
|
||||||
(get-irccat-config)
|
|
||||||
(when irchost
|
|
||||||
(let ((socket (socket-connect irchost ircport)))
|
|
||||||
(unwind-protect
|
|
||||||
(progn
|
|
||||||
(format (socket-stream socket) "~@[~A ~]~A~%" channel body)
|
|
||||||
(finish-output (socket-stream socket)))
|
|
||||||
(ignore-errors (socket-close socket)))))))
|
|
|
@ -7,10 +7,6 @@
|
||||||
(:use :cl :lass)
|
(:use :cl :lass)
|
||||||
(:export :styles))
|
(:export :styles))
|
||||||
|
|
||||||
(defpackage panettone.irc
|
|
||||||
(:use :cl :usocket)
|
|
||||||
(:export :send-irc-notification))
|
|
||||||
|
|
||||||
(defpackage :panettone.authentication
|
(defpackage :panettone.authentication
|
||||||
(:nicknames :authn)
|
(:nicknames :authn)
|
||||||
(:use :cl :panettone.util :klatre)
|
(:use :cl :panettone.util :klatre)
|
||||||
|
@ -51,6 +47,5 @@
|
||||||
:id :subject :body :author-dn :issue-id :status :created-at
|
:id :subject :body :author-dn :issue-id :status :created-at
|
||||||
:field :previous-value :new-value :acting-user-dn
|
:field :previous-value :new-value :acting-user-dn
|
||||||
:issue-comments :num-comments :issue-events)
|
:issue-comments :num-comments :issue-events)
|
||||||
(:import-from :panettone.irc :send-irc-notification)
|
|
||||||
(:shadow :next)
|
(:shadow :next)
|
||||||
(:export :start-pannetone :config :main))
|
(:export :start-pannetone :config :main))
|
||||||
|
|
|
@ -450,14 +450,10 @@
|
||||||
(render/issue-form
|
(render/issue-form
|
||||||
(make-instance 'model:issue :subject subject :body body)
|
(make-instance 'model:issue :subject subject :body body)
|
||||||
"Subject is required")
|
"Subject is required")
|
||||||
(let ((issue
|
(progn
|
||||||
(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"
|
|
||||||
(issue-id issue) subject (dn *user*)
|
|
||||||
(issue-id issue))
|
|
||||||
:channel (uiop:getenvp "ISSUECHANNEL"))
|
|
||||||
(hunchentoot:redirect "/"))))
|
(hunchentoot:redirect "/"))))
|
||||||
|
|
||||||
(defroute show-issue
|
(defroute show-issue
|
||||||
|
|
Loading…
Reference in a new issue