[variant_expiration] Do not rely on `is_patch` to identify patches (#2207)

This commit is contained in:
Suhaib Mujahid 2023-08-28 10:29:29 -04:00 коммит произвёл GitHub
Родитель 8687ec9277
Коммит 89f921833f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -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"]
)