From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4D628158094 for ; Thu, 1 Sep 2022 14:57:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 90625E0A7E; Thu, 1 Sep 2022 14:57:08 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7060CE0A7E for ; Thu, 1 Sep 2022 14:57:08 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 782CC3410F3 for ; Thu, 1 Sep 2022 14:57:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D9356599 for ; Thu, 1 Sep 2022 14:57:05 +0000 (UTC) From: "Magnus Granberg" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Magnus Granberg" Message-ID: <1662044202.0d19b4627eba83ffccadc753105b5cbdf53a68e7.zorry@gentoo> Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: buildbot_gentoo_ci/steps/, buildbot_gentoo_ci/config/ X-VCS-Repository: proj/tinderbox-cluster X-VCS-Files: buildbot_gentoo_ci/config/reporters.py buildbot_gentoo_ci/steps/bugs.py buildbot_gentoo_ci/steps/logs.py X-VCS-Directories: buildbot_gentoo_ci/steps/ buildbot_gentoo_ci/config/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: 0d19b4627eba83ffccadc753105b5cbdf53a68e7 X-VCS-Branch: master Date: Thu, 1 Sep 2022 14:57:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0430a4b2-3320-4fe5-99c1-35974fe2b618 X-Archives-Hash: 0706f788b34c543d5f17f137b577bf3a commit: 0d19b4627eba83ffccadc753105b5cbdf53a68e7 Author: Magnus Granberg gentoo org> AuthorDate: Thu Sep 1 14:56:42 2022 +0000 Commit: Magnus Granberg gentoo org> CommitDate: Thu Sep 1 14:56:42 2022 +0000 URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=0d19b462 Add Bug ID for Irc reporter and nice titel Signed-off-by: Magnus Granberg gentoo.org> buildbot_gentoo_ci/config/reporters.py | 7 ++++--- buildbot_gentoo_ci/steps/bugs.py | 24 ++++++++++++++++-------- buildbot_gentoo_ci/steps/logs.py | 16 ++++++++++++++++ 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/buildbot_gentoo_ci/config/reporters.py b/buildbot_gentoo_ci/config/reporters.py index 9832305..bd55037 100644 --- a/buildbot_gentoo_ci/config/reporters.py +++ b/buildbot_gentoo_ci/config/reporters.py @@ -8,10 +8,11 @@ from buildbot.reporters.message import MessageFormatter from buildbot_gentoo_ci.reporters import irc irc_template = '''{% set resultsList = ["\x0303SUCCESS", "\x0308WARNINGS", "\x0304FAILURE"] %}\ -{{ "\x02" }}{{ build['properties']['cpv'][0] }}{{ "\x02" }} {{ "\x0303" }}repo/{{ projects }}:{{ build['properties']['branch'][0] }}{{ "\x03" }} \ +{{ "\x02" }}{{ build['properties']['cpv'][0] }}{{ "\x02" }} {{ "\x0303" }}Repo:{{ projects }}:{{ build['properties']['branch'][0] }}{{ "\x03" }} \ {{ build['properties']['revision'][0]|truncate(10, True) }} {{ "\x0302" }}{{ build['properties']['owners'][0][0] }}{{ "\x03" }} \ -{{ build['properties']['event'][0] }} {{ projects }}:{{ build['properties']['project_data'][0]['name'] }} \ -{{ "\x02" }}{{ "Build: "}}{{ resultsList[build['results']] }}{{ "\x03" }}{{ "\x02" }} {{ "\x0312" }}{{ build_url }}{{ "\x03" }}\ +{{ "\x0306" }}{{ build['properties']['event'][0] }}{{ "\x03" }} {{ projects }}:{{ build['properties']['project_data'][0]['name'] }} \ +{{ "\x02" }}{{ "Build: "}}{{ resultsList[build['results']] }}{{ "\x03" }}{{ "\x02" }} {{ "\x0312" }}{{ build_url }}{{ "\x03" }} \ +{% if build['properties']['bgo'][0]['match'] is true %}{{ "\x0311" }}Bugid: {{build['properties']['bgo'][0]['id']}}{{ "\x03" }}{% endif %}\ ''' def ircGenerators(): diff --git a/buildbot_gentoo_ci/steps/bugs.py b/buildbot_gentoo_ci/steps/bugs.py index 27b1388..801fc98 100644 --- a/buildbot_gentoo_ci/steps/bugs.py +++ b/buildbot_gentoo_ci/steps/bugs.py @@ -87,20 +87,28 @@ class GetBugs(BuildStep): yield log.addStdout('Open Bugs\n') match = False for bug in buglist: - yield log.addStdout('Bug: ' + str(bug['id']) + ' Summary: ' + bug['summary'] +'\n') - if re.search(self.getProperty('error_dict')['title_issue'][:20], bug['summary']): - print('Bug found') - print(bug) + yield log.addStdout(f"Bug: {str(bug['id'])} Summary: {bug['summary']}\n") + # we splite the lines to lists and try to match the words + matches = 0 + match_search_text = list(self.getProperty('error_dict')['title_issue'].split()) + match_bug_text = list(bug['summary'].split()) + #FIXME: add check for cp + for match_word in match_search_text: + if match_word in match_bug_text: + matches = matches + 1 + if matches >= 10: + print(f"Bug: {str(bug['id'])} Summary: {bug['summary']}") match = {} + match['match'] = True match['id'] = bug['id'] match['summary'] = bug['summary'] + yield log.addStdout(f"Line to match: {self.getProperty('error_dict')['title_issue']}\n") if match: - yield log.addStdout('Match bug found\n') - yield log.addStdout('Bug: ' + str(match['id']) + ' Summary: ' + match['summary'] +'\n') + yield log.addStdout('Match bug: YES\n') + yield log.addStdout(f"Bug: {str(match['id'])} Summary: {match['summary']}\n") self.setProperty("bgo", match, 'bgo') return - yield log.addStdout('NO Match bug found\n') - self.setProperty("bgo", False, 'bgo') + yield log.addStdout('Match bug: NO\n') @defer.inlineCallbacks def run(self): diff --git a/buildbot_gentoo_ci/steps/logs.py b/buildbot_gentoo_ci/steps/logs.py index 164bb24..57f9394 100644 --- a/buildbot_gentoo_ci/steps/logs.py +++ b/buildbot_gentoo_ci/steps/logs.py @@ -91,6 +91,7 @@ class SetupPropertys(BuildStep): else: log_cpv = self.getProperty('cpv') self.setProperty("log_cpv", log_cpv, 'log_cpv') + self.setProperty("bgo", dict( match=False), 'bgo') self.descriptionDone = 'Runing log checker on ' + log_cpv return SUCCESS @@ -333,6 +334,19 @@ class MakeIssue(BuildStep): yield log.addStdout(log_cpv['full_logname'] + '\n') yield log.addStdout('world.log' + '\n') + def getNiceErrorLine(self, line): + # strip away hex addresses, loong path names, line and time numbers and other stuff + # https://github.com/toralf/tinderbox/blob/main/bin/job.sh#L467 + # FIXME: Add the needed line when needed + if re.search(': line', line): + line = re.sub(r"\d", "", line) + # Shorten the path + if line.startswith('/usr/'): + line = line.replace(os.path.split(line.split(' ', 1)[0])[0], '/...') + if re.search(': \d:\d: ', line): + line = re.sub(r":\d:\d: ", ": ", line) + return line + def ClassifyIssue(self): # get the title for the issue text_issue_list = [] @@ -344,8 +358,10 @@ class MakeIssue(BuildStep): # add the issue error if text_issue_list != []: self.error_dict['title_issue'] = text_issue_list[0].replace('*', '').strip() + self.error_dict['title_issue_nice'] = self.getNiceErrorLine(text_issue_list[0].replace('*', '').strip()) else: self.error_dict['title_issue'] = 'title_issue : None' + self.error_dict['title_nice'] = 'title_issue : None' self.error_dict['title_phase'] = 'failed in '+ self.error_dict['phase'] #set the error title self.error_dict['title'] = self.error_dict['title_phase'] + ' - ' + self.error_dict['title_issue']