Skip to content

Commit

Permalink
feat: verify bugs which still have affected versions associated
Browse files Browse the repository at this point in the history
  • Loading branch information
pyoor committed Dec 9, 2023
1 parent cc9f676 commit 9a82264
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
11 changes: 11 additions & 0 deletions bugmon/bugmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 13 additions & 0 deletions tests/test_bugmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9a82264

Please sign in to comment.