Skip to content

Bug 2007005 - Automatically mirror the bug status to the alert status in our database#9401

Open
junngo wants to merge 1 commit intomozilla:masterfrom
junngo:sync-perf-alert-status
Open

Bug 2007005 - Automatically mirror the bug status to the alert status in our database#9401
junngo wants to merge 1 commit intomozilla:masterfrom
junngo:sync-perf-alert-status

Conversation

@junngo
Copy link
Copy Markdown
Contributor

@junngo junngo commented Apr 14, 2026

This PR syncs the alert summary status between the Treeherder database and Bugzilla.
It searches for bugs from Bugzilla with the following conditions:

  • Keyword: perf-alert
  • Resolution changed within the last 7 days

The 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

Comment thread treeherder/perf/auto_perf_sheriffing/performance_alerting/alert_modifier.py Outdated
@junngo junngo force-pushed the sync-perf-alert-status branch from 9aa8868 to 16740bb Compare April 15, 2026 14:19
@junngo junngo force-pushed the sync-perf-alert-status branch from 16740bb to 81c43cb Compare April 16, 2026 13:45
Copy link
Copy Markdown
Contributor Author

@junngo junngo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread treeherder/perf/models.py
(BUG_INCOMPLETE, "INCOMPLETE"),
(BUG_MOVED, "MOVED"),
)
bug_status = models.IntegerField(choices=BUG_STATUSES, null=True, default=None)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I've added the bug status fields to the PerformanceAlertSummary table only, not to the base class (PerformanceAlertSummaryBase), to avoid adding unnecessary fields to PerformanceTelemetryAlertSummary and PerformanceAlertSummaryTesting.
  • I've added the BUG_ prefix to avoid ambiguity, since PerformanceAlertSummaryBase already has FIXED, INVALID, WONTFIX etc. in its STATUSES.
  • I've also defined these statuses independently rather than reusing PerformanceTelemetryAlert's statuses to avoid unnecessary coupling between the two models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants