diff --git a/bugmon/bugmon.py b/bugmon/bugmon.py index 4762848..10bb018 100644 --- a/bugmon/bugmon.py +++ b/bugmon/bugmon.py @@ -12,8 +12,6 @@ import logging import os import zipfile -from datetime import datetime as dt -from datetime import timedelta from pathlib import Path from typing import Optional, List, Dict, cast @@ -147,10 +145,10 @@ def _confirm_open(self) -> None: if "confirmed" not in self.bug.commands: self.report(f"Verified bug as reproducible on {tip.build_str}.") self._bisect(evaluator) - else: - change = dt.strptime(self.bug.last_change_time, "%Y-%m-%dT%H:%M:%SZ") - if dt.now() - timedelta(days=30) > change: - self.report(f"Bug remains reproducible on {tip.build_str}") + # else: + # change = dt.strptime(self.bug.last_change_time, "%Y-%m-%dT%H:%M:%SZ") + # if dt.now() - timedelta(days=30) > change: + # self.report(f"Bug remains reproducible on {tip.build_str}") elif tip.status == EvaluatorResult.BUILD_PASSED: bid = self.bug.initial_build_id orig = self._reproduce_bug(evaluator, self.bug.branch, bid) @@ -411,13 +409,15 @@ def detect_config(self) -> Optional[BaseEvaluatorConfig]: self._close_bug = True return None - def process(self) -> None: + def process(self, force_confirm: bool = False) -> None: """Process bugmon commands present in whiteboard Available commands: verify - Attempt to verify the bug state bisect - Attempt to bisect the bug regression or, if RESOLVED, the bug fix confirm - Attempt to confirm that testcase reproduces + + :param force_confirm: Force confirmation regardless of bug state """ if not self.is_supported(): self.commit() @@ -425,7 +425,7 @@ def process(self) -> None: if self.needs_verify(): self._verify_fixed() - elif self.needs_confirm(): + elif force_confirm or self.needs_confirm(): self._confirm_open() elif self.needs_bisect(): self._bisect() diff --git a/bugmon/main.py b/bugmon/main.py index d99d4b6..ffbd877 100644 --- a/bugmon/main.py +++ b/bugmon/main.py @@ -34,6 +34,12 @@ def parse_args(argv: Any = None) -> argparse.Namespace: action="store_true", help="Disable bug modification", ) + parser.add_argument( + "-f", + "--force-confirm", + action="store_true", + help="Force bug confirmation regardless of status", + ) # Bug selection bugs = parser.add_mutually_exclusive_group(required=True) @@ -99,7 +105,7 @@ def main(argv: Optional[Dict[str, Any]] = None) -> int: f"(Status: {bugmon.bug.status}, " f"Resolution: {bugmon.bug.resolution})" ) - bugmon.process() + bugmon.process(args.force_confirm) except BugmonException as e: log.error(f"Error processing bug {bug.id}: {e}") return 1