Skip to content

Commit

Permalink
Merge pull request #222 from okurz/feature/reopen
Browse files Browse the repository at this point in the history
Mention NO_REMINDER_REGEX as additional option to prevent reminders
  • Loading branch information
mergify[bot] authored Aug 2, 2024
2 parents a0c389a + a02d9bc commit 166a7b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions openqa_review/openqa_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def pluralize(_1, _2, plural):
1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
3. The bugref in the openQA scenario is removed or replaced, e.g. `label:wontfix:boo1234`
4. For "record_soft_failure" references the reference is removed or matches the pattern '$no_reminder_pattern'
Expect the next reminder at the earliest in $time_next days if nothing changes in this ticket.
"""
Expand Down Expand Up @@ -1651,9 +1652,13 @@ def reminder_comment_on_issue(ie, args):
if last_comment_text and re.search(re.escape(ie._url(f)), last_comment_text):
return
next_threshold = args.min_days_unchanged if args.no_exponential_backoff else 2 * threshold
comment = openqa_issue_comment.substitute(
{"name": f["name"], "url": urljoin(ie._url(f), link_to_module), "time_next": next_threshold}
).strip()
pattern = {
"name": f["name"],
"url": urljoin(ie._url(f), link_to_module),
"time_next": next_threshold,
"no_reminder_pattern": args.ignore_pattern.pattern,
}
comment = openqa_issue_comment.substitute(pattern).strip()
if args.reopen == "all" or args.reopen == issue.issue_type:
issue.reopen(comment)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_openqa_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,8 @@ def test_reminder_comments_are_ignored_on_no_reminder(browser_mock):
# there should be no comment with default WONTFIX|NO_REMINDER softfail pattern
openqa_review.reminder_comment_on_issues(report, args)
browser_mock.assert_not_called()
# without the pattern, there shall be one reminder
args.ignore_pattern = None
# without a match on the pattern, there shall be one reminder
args.ignore_pattern = re.compile("THIS_WILL_NOT_MATCH")
args.reopen = "none"
openqa_review.reminder_comment_on_issues(report, args)
browser_mock.assert_not_called()
Expand Down

0 comments on commit 166a7b1

Please sign in to comment.