Revert "[uplift_beta] Drop a workaround to handle the new uplift workflow"

This reverts commit 371d0f9c7b.
This commit is contained in:
Suhaib Mujahid 2023-07-12 11:28:39 -04:00 коммит произвёл Suhaib Mujahid
Родитель 15151b057e
Коммит cbaf4bf900
1 изменённых файлов: 28 добавлений и 1 удалений

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

@ -37,6 +37,11 @@ class UpliftBeta(BzCleaner):
return ["id", "summary", "assignee"]
def handle_bug(self, bug, data):
# XXX: This is a temporary workaround, should be dropped after
# fixing https://github.com/mozilla/bugbot/issues/1953
if self._has_patch_after_closed(bug):
return
bugid = str(bug["id"])
assignee = bug.get("assigned_to", "")
@ -84,7 +89,14 @@ class UpliftBeta(BzCleaner):
def get_bz_params(self, date):
self.date = lmdutils.get_date_ymd(date)
fields = [self.status_beta, "regressions"]
fields = [
self.status_beta,
"regressions",
"attachments.creation_time",
"attachments.is_obsolete",
"attachments.content_type",
"cf_last_resolved",
]
params = {
"include_fields": fields,
"bug_type": "defect",
@ -119,6 +131,21 @@ class UpliftBeta(BzCleaner):
return params
def _has_patch_after_closed(self, bug):
patches = [
attachment["creation_time"]
for attachment in bug["attachments"]
if attachment["content_type"] == "text/x-phabricator-request"
and not attachment["is_obsolete"]
]
if len(patches) == 0:
return False
latest_patch_at = max(patches)
resolved_at = bug["cf_last_resolved"]
return latest_patch_at > resolved_at
def get_bugs(self, date="today", bug_ids=[]):
bugs = super(UpliftBeta, self).get_bugs(date=date, bug_ids=bug_ids)
bugs = self.filter_by_regr(bugs)