From 89f921833f81e9abc4a1cd99bcd4c4a6e2ab5025 Mon Sep 17 00:00:00 2001 From: Suhaib Mujahid Date: Mon, 28 Aug 2023 10:29:29 -0400 Subject: [PATCH] [variant_expiration] Do not rely on `is_patch` to identify patches (#2207) --- bugbot/rules/variant_expiration.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bugbot/rules/variant_expiration.py b/bugbot/rules/variant_expiration.py index 41d27c3e..d19687da 100644 --- a/bugbot/rules/variant_expiration.py +++ b/bugbot/rules/variant_expiration.py @@ -340,11 +340,13 @@ class VariantExpiration(BzCleaner, Nag): return bug def is_with_patch(self, bug: dict) -> bool: - """Check if the bug has a patch""" + """Check if the bug has a patch (not obsolete))""" return any( - attachment["is_patch"] - and not attachment["is_obsolete"] - and attachment["content_type"] == "text/x-phabricator-request" + not attachment["is_obsolete"] + and ( + attachment["content_type"] == "text/x-phabricator-request" + or attachment["is_patch"] + ) for attachment in bug["attachments"] )