From 9a82264c03196ca6221a62e8b3d8997185ffa599 Mon Sep 17 00:00:00 2001 From: pyoor Date: Wed, 6 Dec 2023 12:07:30 -0500 Subject: [PATCH] feat: verify bugs which still have affected versions associated --- bugmon/bugmon.py | 11 +++++++++++ tests/conftest.py | 2 +- tests/test_bugmon.py | 13 +++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/bugmon/bugmon.py b/bugmon/bugmon.py index 21e3c08..c9231aa 100644 --- a/bugmon/bugmon.py +++ b/bugmon/bugmon.py @@ -548,6 +548,17 @@ def needs_verify(self) -> bool: if verifiable and "verified" not in self.bug.commands: return True + if self.bug.status == "VERIFIED": + for alias, rel_num in self.bug.branches.items(): + base = "cf_status_firefox" + flag = ( + f"{base}{rel_num}" + if isinstance(rel_num, int) + else f"{base}_{rel_num}" + ) + if getattr(self.bug, flag) == "fixed": + return True + return False def is_supported(self) -> bool: diff --git a/tests/conftest.py b/tests/conftest.py index 2fe7871..7c32d9f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -96,7 +96,7 @@ def bug_data_base(): "is_open": True, "severity": "S2", "cf_status_thunderbird_esr78": "---", - "cf_status_firefox80": "affected", + "cf_status_firefox80": "fixed", "priority": "P1", "cf_root_cause": "---", "cf_status_firefox79": "wontfix", diff --git a/tests/test_bugmon.py b/tests/test_bugmon.py index f6e582f..0bf570b 100644 --- a/tests/test_bugmon.py +++ b/tests/test_bugmon.py @@ -216,3 +216,16 @@ def test_bugmon_verify_requested(bugmon): bugmon.add_command("analyze") bugmon.add_command("verified") assert bugmon.needs_verify() is True + + +def test_bugmon_already_verified_but_not_branches(bugmon): + """Test that bug is verified if the branches have not been confirmed""" + bugmon.bug.status = "VERIFIED" + bugmon.bug.resolution = "FIXED" + # patch branches to match the bug fixture + bugmon.bug._branches = { + "central": 80, + "beta": 79, + "release": 78, + } + assert bugmon.needs_verify() is True