From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-1541279-garchives=archives.gentoo.org@lists.gentoo.org> 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 1B70D15800A for <garchives@archives.gentoo.org>; Wed, 26 Jul 2023 09:23:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 55DCEE0848; Wed, 26 Jul 2023 09:23:15 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3CA66E0848 for <gentoo-commits@lists.gentoo.org>; Wed, 26 Jul 2023 09:23:15 +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) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 45D8B34157A for <gentoo-commits@lists.gentoo.org>; Wed, 26 Jul 2023 09:23:14 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A7D11ACD for <gentoo-commits@lists.gentoo.org>; Wed, 26 Jul 2023 09:23:12 +0000 (UTC) From: "Magnus Granberg" <zorry@gentoo.org> 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" <zorry@gentoo.org> Message-ID: <1690363276.db8e966eef3ede0212dcf85d6d5b82c28d3dfcd5.zorry@gentoo> Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: buildbot_gentoo_ci/steps/ X-VCS-Repository: proj/tinderbox-cluster X-VCS-Files: buildbot_gentoo_ci/steps/bugs.py buildbot_gentoo_ci/steps/logs.py X-VCS-Directories: buildbot_gentoo_ci/steps/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: db8e966eef3ede0212dcf85d6d5b82c28d3dfcd5 X-VCS-Branch: master Date: Wed, 26 Jul 2023 09:23:12 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 6f38549a-ceb7-45ea-a28d-164c84a321c7 X-Archives-Hash: 8899112fcf7441e6b517c9bedaabb30b commit: db8e966eef3ede0212dcf85d6d5b82c28d3dfcd5 Author: Magnus Granberg <zorry <AT> gentoo <DOT> org> AuthorDate: Wed Jul 26 09:21:16 2023 +0000 Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org> CommitDate: Wed Jul 26 09:21:16 2023 +0000 URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=db8e966e Check issue titel nice Signed-off-by: Magnus Granberg <zorry <AT> gentoo.org> buildbot_gentoo_ci/steps/bugs.py | 13 +++++++++++-- buildbot_gentoo_ci/steps/logs.py | 31 +++++++++++++++---------------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/buildbot_gentoo_ci/steps/bugs.py b/buildbot_gentoo_ci/steps/bugs.py index ad87be9..4d958b7 100644 --- a/buildbot_gentoo_ci/steps/bugs.py +++ b/buildbot_gentoo_ci/steps/bugs.py @@ -126,13 +126,22 @@ class GetBugs(BuildStep): for match_word in match_search_text: if match_word in match_bug_text: matches = matches + 1 - print(f"Bug: {str(bug['id'])} Matched words: {str(matches)} Summary: {bug['summary']}") - if matches >= 5: + # try to match the nice words + matches_nice = 0 + match_search_text_nice = list(self.getProperty('error_dict')['title_issue_nice'].split()) + #FIXME: add check for cp + for match_word in match_search_text_nice: + if match_word in match_bug_text: + matches_nice = matches_nice + 1 + print(f"Bug: {str(bug['id'])} Matched words: {str(matches)} {str(matches_nice)} Summary: {bug['summary']}") + #FIXME: set it in bug_config + if matches >= 6 or matches_nice >= 6: 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") + yield log.addStdout(f"Line to match: {self.getProperty('error_dict')['title_issue_nice']}\n") if match: yield log.addStdout('Match bug: YES\n') yield log.addStdout(f"Bug: {str(match['id'])} Summary: {match['summary']}\n") diff --git a/buildbot_gentoo_ci/steps/logs.py b/buildbot_gentoo_ci/steps/logs.py index 47112e0..d71eb99 100644 --- a/buildbot_gentoo_ci/steps/logs.py +++ b/buildbot_gentoo_ci/steps/logs.py @@ -184,18 +184,18 @@ class MakeIssue(BuildStep): def __init__(self, **kwargs): super().__init__(**kwargs) - def getNiceErrorLine(self, line): + def getNiceErrorLine(self, full_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 + # https://github.com/toralf/tinderbox/blob/main/bin/job.sh#L469 # FIXME: Add the needed line when needed - if re.search(': line', line): - line = re.sub(r"\d", "<snip>", 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 + new_line = [] + for line in full_line.split(' '): + # Shorten the path + if line.startswith('/usr/') or line.startswith('/var/') or line.startswith('../'): + split_path_line = os.path.split(line) + line = line.replace(split_path_line[0], '...') + new_line.append(line) + return ' '.join(new_line) def ClassifyIssue(self): # get the title for the issue @@ -215,11 +215,12 @@ class MakeIssue(BuildStep): self.error_dict['title_found'] = True else: self.error_dict['title_issue'] = 'title_issue : None' - self.error_dict['title_nice'] = 'title_issue : None' + self.error_dict['title_issue_nice'] = 'title_issue_nice : None' self.error_dict['title_found'] = False - self.error_dict['title_phase'] = 'failed in '+ self.error_dict['phase'] + self.error_dict['title_phase'] = 'fails to '+ self.error_dict['phase'] + ':' #set the error title - self.error_dict['title'] = self.error_dict['title_phase'] + ' - ' + self.error_dict['title_issue'] + self.error_dict['title'] = ' '.join([self.error_dict['title_phase'], self.error_dict['title_issue']]) + self.error_dict['title_nice'] = ' '.join([self.error_dict['title_phase'], self.error_dict['title_issue_nice']]) @defer.inlineCallbacks def run(self): @@ -249,8 +250,6 @@ class MakeIssue(BuildStep): yield self.ClassifyIssue() print(self.error_dict) self.setProperty("status", 'failed', 'status') - #FIXME: nice description for post bug - self.error_dict['summary_log_nice'] = '' self.setProperty("error_dict", self.error_dict, 'error_dict') self.aftersteps_list.append(bugs.GetBugs()) if warning: @@ -463,7 +462,7 @@ class SetupBugReportSteps(BuildStep): bug_args['user'] = bug_config['user'] bug_args['passwd'] = yield p.render(util.Secret("bugs_password")) bug_params = {} - title = separator.join([bug_config['extra_summery'], self.getProperty('error_dict')['cpv'], self.getProperty('error_dict')['title']]) + title = separator.join([bug_config['extra_summery'], self.getProperty('error_dict')['cpv'], self.getProperty('error_dict')['title_nice']]) # bug title max 170 if len(title) >= 170: title = title[:167] + '...'