Gentoo Archives: gentoo-commits

From: Magnus Granberg <zorry@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: buildbot_gentoo_ci/config/, buildbot_gentoo_ci/reporters/
Date: Mon, 24 Jan 2022 00:42:10
Message-Id: 1642984913.d6008c0cba2239c0ba2c243a2d51b7f9285593c5.zorry@gentoo
1 commit: d6008c0cba2239c0ba2c243a2d51b7f9285593c5
2 Author: Magnus Granberg <zorry <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 24 00:41:53 2022 +0000
4 Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 24 00:41:53 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=d6008c0c
7
8 use notice for channel msg
9
10 Signed-off-by: Magnus Granberg <zorry <AT> gentoo.org>
11
12 buildbot_gentoo_ci/config/reporters.py | 8 ++++----
13 buildbot_gentoo_ci/reporters/irc.py | 9 ++++++---
14 2 files changed, 10 insertions(+), 7 deletions(-)
15
16 diff --git a/buildbot_gentoo_ci/config/reporters.py b/buildbot_gentoo_ci/config/reporters.py
17 index 44edeab..1bfb70f 100644
18 --- a/buildbot_gentoo_ci/config/reporters.py
19 +++ b/buildbot_gentoo_ci/config/reporters.py
20 @@ -7,7 +7,7 @@ from buildbot.reporters.message import MessageFormatter
21
22 from buildbot_gentoo_ci.reporters import irc
23 irc_template = '''{% set resultsList = ["\x0303SUCCESS", "\x0308WARNINGS", "\x0304FAILURE"] %}\
24 -Buildbot: {{ "\x02" }}{{ build['properties']['cpv'][0] }}{{ "\x02" }} {{ "\x0303" }}repo/{{ projects }}{{ "\x03" }} \
25 +{{ "\x02" }}{{ build['properties']['cpv'][0] }}{{ "\x02" }} {{ "\x0303" }}repo/{{ projects }}{{ "\x03" }} \
26 {{ build['properties']['revision'][0]|truncate(10, True) }} {{ "\x0302" }}{{ build['properties']['owners'][0][0] }}{{ "\x03" }} \
27 {{ build['properties']['project_data'][0]['name'] }} \
28 {{ "\x02" }}{{ "Build: "}}{{ resultsList[build['results']] }}{{ "\x03" }}{{ "\x02" }} {{ "\x0312" }}{{ build_url }}{{ "\x03" }}\
29 @@ -22,7 +22,6 @@ def ircGenerators():
30 ]
31 mode = [
32 'failing',
33 - 'passing',
34 'warnings',
35 ]
36 return [
37 @@ -34,10 +33,11 @@ def ircGenerators():
38 ]
39 #FIXME:
40 # server, nick channel should be set in config
41 -irc_reporter = irc.IRCStatusPush("irc.freenode.net", "gentoo_ci_test",
42 +irc_reporter = irc.IRCStatusPush("irc.libera.chat", "gci_test",
43 channels=[{"channel": "#gentoo-ci"},
44 ],
45 - generators=ircGenerators()
46 + generators=ircGenerators(),
47 + noticeOnChannel=True
48 )
49
50 def gentoo_reporters(r=[]):
51
52 diff --git a/buildbot_gentoo_ci/reporters/irc.py b/buildbot_gentoo_ci/reporters/irc.py
53 index 6e0bc6b..b60ad3a 100644
54 --- a/buildbot_gentoo_ci/reporters/irc.py
55 +++ b/buildbot_gentoo_ci/reporters/irc.py
56 @@ -139,8 +139,8 @@ class IRCStatusPush(ReporterBase):
57 self.join_channels, self.pm_to_nicks,
58 self.authz, self.tags,
59 self.notify_events, parent=self,
60 - noticeOnChannel=noticeOnChannel,
61 - useRevisions=useRevisions,
62 + noticeOnChannel=self.noticeOnChannel,
63 + useRevisions=self.useRevisions,
64 showBlameList=showBlameList,
65 lostDelay=lostDelay,
66 failedDelay=failedDelay,
67 @@ -170,4 +170,7 @@ class IRCStatusPush(ReporterBase):
68 if isinstance(c, dict):
69 channel = c.get('channel', None)
70 print(channel)
71 - self.f.p.msg(channel, assembleFormattedText(A.normal[body]))
72 + if self.noticeOnChannel:
73 + self.f.p.notice(channel, assembleFormattedText(A.normal[body]))
74 + else:
75 + self.f.p.msg(channel, assembleFormattedText(A.normal[body]))