From e3db4ea48762127748b1074110c36b55e9832591 Mon Sep 17 00:00:00 2001 From: Marius Kittler Date: Tue, 16 Aug 2022 16:41:57 +0200 Subject: [PATCH] Fix case-sensitivity issue that prevented re-opening tickets to work * Make checks for current progress/bugzilla issue status case-insensitive * See https://progress.opensuse.org/issues/113611 --- openqa_review/openqa_review.py | 6 ++++-- tests/test_openqa_review.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/openqa_review/openqa_review.py b/openqa_review/openqa_review.py index 554aafa..4f12335 100755 --- a/openqa_review/openqa_review.py +++ b/openqa_review/openqa_review.py @@ -796,7 +796,7 @@ def reopen(self, note=None): "https://progress.opensuse.org/projects/openqatests/wiki/Wiki#openqa-review-reminder-handling" ) if self.issue_type == "bugzilla": - if self.status in ["RESOLVED"]: + if self.status.upper() in ["RESOLVED"]: self.bugzilla_browser.json_rpc_post( "/jsonrpc.cgi", "Bug.update", @@ -805,7 +805,9 @@ def reopen(self, note=None): else: self.add_comment(note) elif self.issue_type == "redmine": - status_id = REDMINE_STATUS_ID_FEEDBACK if self.status in ["closed", "rejected", "resolved"] else None + status_id = ( + REDMINE_STATUS_ID_FEEDBACK if self.status.lower() in ["closed", "rejected", "resolved"] else None + ) self.add_comment(note, status_id=status_id) else: assert False, "Only bugzilla or redmine supported as issue type" # pragma: no cover diff --git a/tests/test_openqa_review.py b/tests/test_openqa_review.py index f76c71b..cdfb503 100644 --- a/tests/test_openqa_review.py +++ b/tests/test_openqa_review.py @@ -739,7 +739,7 @@ def test_querying_last_comment_of_unknown_bugrefs(): def test_reopening_progress_issue(browser_mock): args = cache_test_args_factory() issue = issue_factory("poo#102440", "https://progress.opensuse.org/issues/102440", args) - issue.status = "resolved" + issue.status = "Resolved" issue.reopen("Test note") issue.reopen() # with default note issue.status = "workable" @@ -763,7 +763,7 @@ def test_reopening_progress_issue(browser_mock): def test_reopening_bugzilla_ticket(browser_mock_rpc): args = cache_test_args_factory() issue = issue_factory("boo#0815", "https://bugzilla.opensuse.org/show_bug.cgi?id=0815", args) - issue.status = "RESOLVED" + issue.status = "RESOLVEd" issue.reopen("Test note") issue.status = "CONFIRMED" issue.reopen("Test note 2")