Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention NO_REMINDER_REGEX as additional option to prevent reminders #222

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading