Bug 2007005 - Automatically mirror the bug status to the alert status in our database#9401
Conversation
16740bb to
81c43cb
Compare
junngo
left a comment
There was a problem hiding this comment.
I've added a new bug_status field to mirror the bug resolution from bugzilla. If you have any questions or feedback, feel free to let me know.
| continue | ||
| new_bug_status = bug_status_map.get(bug["resolution"]) | ||
| if new_bug_status is None and bug["resolution"] == "": | ||
| new_bug_status = PerformanceAlertSummary.BUG_NEW |
There was a problem hiding this comment.
If the status is changed to ASSIGNED or REOPENED, the resolution is empty. In this case, we set it to
the NEW case. Is this the correct behavior?
Also, if the resolution is not mapped (line 73), we skip it. Is this correct as well?
There was a problem hiding this comment.
Oh good catch! Yes, let's default to NEW in that case.
| (BUG_INCOMPLETE, "INCOMPLETE"), | ||
| (BUG_MOVED, "MOVED"), | ||
| ) | ||
| bug_status = models.IntegerField(choices=BUG_STATUSES, null=True, default=None) |
There was a problem hiding this comment.
- I've added the bug status fields to the
PerformanceAlertSummarytable only, not to the base class (PerformanceAlertSummaryBase), to avoid adding unnecessary fields toPerformanceTelemetryAlertSummaryandPerformanceAlertSummaryTesting. - I've added the
BUG_prefix to avoid ambiguity, sincePerformanceAlertSummaryBasealready hasFIXED,INVALID,WONTFIXetc. in itsSTATUSES. - I've also defined these statuses independently rather than reusing
PerformanceTelemetryAlert's statuses to avoid unnecessary coupling between the two models.
81c43cb to
73c0ef4
Compare
|
Thanks for the review, everyone :) |
|
Thank you! Currently, the new bug status is not reflected in the user interface in any way. If the summary has a regression bug where the status is "fixed" for example, the summary's status will still be displayed as "investigating". @junngo Could you please create a follow-up ticket to display the bug's actual status (if it differs from "new") instead of the summary's "investigating" status? |
|
Thanks @beatrice-acasandrei |
73c0ef4 to
9bd9848
Compare
This PR syncs the alert summary status between the Treeherder database and Bugzilla.
It searches for bugs from Bugzilla with the following conditions:
perf-alertThe bug statuses are then mirrored into the Treeherder database.
If you have any feedback on the query conditions or other improvements, feel free to share.
Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=2007005