Bug 2007005 - Automatically mirror the bug status to the alert status in our database#9401
Open
junngo wants to merge 1 commit intomozilla:masterfrom
Open
Bug 2007005 - Automatically mirror the bug status to the alert status in our database#9401junngo wants to merge 1 commit intomozilla:masterfrom
junngo wants to merge 1 commit intomozilla:masterfrom
Conversation
junngo
commented
Apr 14, 2026
9aa8868 to
16740bb
Compare
16740bb to
81c43cb
Compare
junngo
commented
Apr 16, 2026
Contributor
Author
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 |
Contributor
Author
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?
| (BUG_INCOMPLETE, "INCOMPLETE"), | ||
| (BUG_MOVED, "MOVED"), | ||
| ) | ||
| bug_status = models.IntegerField(choices=BUG_STATUSES, null=True, default=None) |
Contributor
Author
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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