aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'buildbot_gentoo_ci/steps/bugs.py')
-rw-r--r--buildbot_gentoo_ci/steps/bugs.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/buildbot_gentoo_ci/steps/bugs.py b/buildbot_gentoo_ci/steps/bugs.py
index 6a097d4..52bd08d 100644
--- a/buildbot_gentoo_ci/steps/bugs.py
+++ b/buildbot_gentoo_ci/steps/bugs.py
@@ -123,26 +123,36 @@ class GetBugs(BuildStep):
# we splite the lines to lists and try to match the words
matches = 0
bug_words = list(bug['summary'].split())
+ # add c/p and v
+ for word in bug_words:
+ if pkgsplit(word) is not None:
+ bug_words.append(pkgsplit(word)[0])
+ bug_words.append(cpv_getversion(word))
print(bug_words)
print(self.getProperty('error_dict')['words'])
for word in bug_words:
# clean the word
word = finishTitle(stripQuotesAndMore(word))
- print(word)
for match_word in self.getProperty('error_dict')['words']:
- if match_word in word:
+ if match_word == word:
matches = matches + 1
print(f"Bug: {str(bug['id'])} Matched words: {str(matches)} Summary: {bug['summary']}")
- if matches >= len(self.getProperty('error_dict')['title_nice']) - self.bug_config['min_match_word']:
+ len_match_words = len(self.getProperty('error_dict')['words']) - self.bug_config['min_match_word']
+ print(f"Min words to matchs: {str(len_match_words)}")
+ if matches >= len_match_words or matches >= self.bug_config['max_match_word']:
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"Nice line to match: {self.getProperty('error_dict')['title_nice']}\n")
+ yield log.addStdout(f"Words to match: {self.getProperty('error_dict')['words']}\n")
if match:
yield log.addStdout('Match bug: YES\n')
yield log.addStdout(f"Bug: {str(match['id'])} Summary: {match['summary']}\n")
self.setProperty("bgo", match, 'bgo')
+ print(f"Match bug: YES")
+ print(f"Bug: {str(match['id'])} Summary: {match['summary']}")
return match
yield log.addStdout('Match bug: NO\n')
return match