Skip to content

Commit 99925dd

Browse files
authored
[FXP-4257] Highlight summaries that include critical signatures in Alerts View (#8767)
* Add badge for critical alerts * Add tests for critical badge * Change badge color to red
1 parent 55981ac commit 99925dd

File tree

3 files changed

+248
-1
lines changed

3 files changed

+248
-1
lines changed
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
[
2+
{
3+
"id": 45203,
4+
"push_id": 1642059,
5+
"prev_push_id": 1641848,
6+
"original_revision": "b0b17a89100ea5b69c3d0d178db2e3ce5a161fc7",
7+
"created": "2025-05-19T14:38:04.220598",
8+
"first_triaged": "2025-05-20T07:05:46.695160",
9+
"triage_due_date": "2025-05-22T14:38:04.220598",
10+
"repository": "autoland",
11+
"framework": 15,
12+
"alerts": [
13+
{
14+
"id": 207233,
15+
"status": 2,
16+
"series_signature": {
17+
"id": 5310512,
18+
"framework_id": 15,
19+
"signature_hash": "21cf18e10f1e44ab68d249bb9614213f31132b28",
20+
"machine_platform": "android-hw-a55-14-0-aarch64-shippable",
21+
"suite": "newssite-applink-startup",
22+
"test": "org.mozilla.fenix:tab-cpu-time",
23+
"lower_is_better": true,
24+
"has_subtests": false,
25+
"option_collection_hash": "102210fe594ee9b33d82058545b1ed14f4c8206e",
26+
"tags": [""],
27+
"extra_options": [""],
28+
"measurement_unit": "ms",
29+
"suite_public_name": null,
30+
"test_public_name": null
31+
},
32+
"taskcluster_metadata": {
33+
"task_id": "FJiL-fxNQ1uS_lM7jISANw",
34+
"retry_id": 0
35+
},
36+
"prev_taskcluster_metadata": {
37+
"task_id": "SObVYzqKQyuZnAGUOU9PQw",
38+
"retry_id": 0
39+
},
40+
"profile_url": null,
41+
"prev_profile_url": null,
42+
"is_regression": true,
43+
"prev_value": 1639.67,
44+
"new_value": 1733.67,
45+
"t_value": 7.67,
46+
"amount_abs": 94,
47+
"amount_pct": 5.73,
48+
"summary_id": 45203,
49+
"related_summary_id": 45124,
50+
"manually_created": false,
51+
"classifier": "mozilla-ldap/[email protected]",
52+
"starred": false,
53+
"classifier_email": "[email protected]",
54+
"backfill_record": null,
55+
"noise_profile": "OK",
56+
"title": "newssite-applink-startup org.mozilla.fenix:tab-cpu-time android-hw-a55-14-0-aarch64-shippable opt "
57+
}
58+
],
59+
"related_alerts": [],
60+
"status": 2,
61+
"bug_number": null,
62+
"bug_due_date": "2025-05-26T14:38:04.220598",
63+
"bug_updated": null,
64+
"issue_tracker": 1,
65+
"notes": "critical",
66+
"revision": "b0b17a89100ea5b69c3d0d178db2e3ce5a161fc7",
67+
"push_timestamp": 1747350318,
68+
"prev_push_revision": "f1179ba7534bb4eadfb8169fbfad30316b0f7b2b",
69+
"original_prev_push_revision": "f1179ba7534bb4eadfb8169fbfad30316b0f7b2b",
70+
"assignee_username": "mozilla-ldap/[email protected]",
71+
"assignee_email": "[email protected]",
72+
"performance_tags": [],
73+
"duplicated_summaries_ids": []
74+
},
75+
{
76+
"id": 43496,
77+
"push_id": 1569312,
78+
"prev_push_id": 1569310,
79+
"original_revision": "456afe4a2f64308edf7db0c6180162908b079f00",
80+
"created": "2025-01-28T10:45:12.185252",
81+
"first_triaged": "2025-01-28T11:00:00.701053",
82+
"triage_due_date": "2025-01-31T10:45:12.185252",
83+
"repository": "autoland",
84+
"framework": 13,
85+
"alerts": [
86+
{
87+
"id": 198443,
88+
"status": 3,
89+
"series_signature": {
90+
"id": 83179,
91+
"framework_id": 13,
92+
"signature_hash": "3e95e6310a714f9518ef82d2f1798fe67032cbc7",
93+
"machine_platform": "windows11-64-shippable-qr",
94+
"suite": "speedometer3",
95+
"test": "",
96+
"lower_is_better": false,
97+
"has_subtests": true,
98+
"option_collection_hash": "102210fe594ee9b33d82058545b1ed14f4c8206e",
99+
"tags": ["fission", "webrender"],
100+
"extra_options": ["fission", "webrender"],
101+
"measurement_unit": "score",
102+
"suite_public_name": null,
103+
"test_public_name": null
104+
},
105+
"taskcluster_metadata": {},
106+
"prev_taskcluster_metadata": {},
107+
"profile_url": null,
108+
"prev_profile_url": null,
109+
"is_regression": false,
110+
"prev_value": 21.4,
111+
"new_value": 21.84,
112+
"t_value": 7.99,
113+
"amount_abs": 0.43,
114+
"amount_pct": 2.03,
115+
"summary_id": 43496,
116+
"related_summary_id": null,
117+
"manually_created": false,
118+
"classifier": "mozilla-ldap/[email protected]",
119+
"starred": false,
120+
"classifier_email": "[email protected]",
121+
"backfill_record": null,
122+
"noise_profile": "OK",
123+
"title": "speedometer3 windows11-64-shippable-qr opt fission webrender"
124+
},
125+
{
126+
"id": 198444,
127+
"status": 3,
128+
"series_signature": {
129+
"id": 83394,
130+
"framework_id": 13,
131+
"signature_hash": "b8d27425e488568dcfedc4e240e25b2c24d880d2",
132+
"machine_platform": "windows11-64-shippable-qr",
133+
"suite": "speedometer3",
134+
"test": "score",
135+
"lower_is_better": false,
136+
"has_subtests": false,
137+
"option_collection_hash": "102210fe594ee9b33d82058545b1ed14f4c8206e",
138+
"tags": ["fission", "webrender"],
139+
"extra_options": ["fission", "webrender"],
140+
"measurement_unit": "score",
141+
"suite_public_name": null,
142+
"test_public_name": null
143+
},
144+
"taskcluster_metadata": {},
145+
"prev_taskcluster_metadata": {},
146+
"profile_url": null,
147+
"prev_profile_url": null,
148+
"is_regression": false,
149+
"prev_value": 21.4,
150+
"new_value": 21.84,
151+
"t_value": 7.99,
152+
"amount_abs": 0.43,
153+
"amount_pct": 2.03,
154+
"summary_id": 43496,
155+
"related_summary_id": null,
156+
"manually_created": false,
157+
"classifier": "mozilla-ldap/[email protected]",
158+
"starred": false,
159+
"classifier_email": "[email protected]",
160+
"backfill_record": null,
161+
"noise_profile": "OK",
162+
"title": "speedometer3 score windows11-64-shippable-qr opt fission webrender"
163+
}
164+
],
165+
"related_alerts": [],
166+
"status": 3,
167+
"bug_number": null,
168+
"bug_due_date": "2025-02-04T10:45:12.185252",
169+
"bug_updated": null,
170+
"issue_tracker": 1,
171+
"notes": null,
172+
"revision": "456afe4a2f64308edf7db0c6180162908b079f00",
173+
"push_timestamp": 1737978529,
174+
"prev_push_revision": "b205a226904a3b8077cb27d749234c65faddcd4a",
175+
"original_prev_push_revision": null,
176+
"assignee_username": "mozilla-ldap/[email protected]",
177+
"assignee_email": "[email protected]",
178+
"performance_tags": [],
179+
"duplicated_summaries_ids": []
180+
}
181+
]
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import React from 'react';
2+
import { render, waitFor } from '@testing-library/react';
3+
import { createBrowserHistory } from 'history';
4+
import { Provider, ReactReduxContext } from 'react-redux';
5+
import { ConnectedRouter } from 'connected-react-router';
6+
7+
import AlertHeaderTitle from '../../../../ui/perfherder/alerts/AlertHeaderTitle';
8+
import testAlertSummaries from '../../mock/alert_summaries_with_critical_tests.json';
9+
import { configureStore } from '../../../../ui/job-view/redux/configureStore';
10+
11+
const history = createBrowserHistory();
12+
13+
const frameworks = [
14+
{
15+
id: 15,
16+
name: 'mozperftest',
17+
},
18+
{
19+
id: 13,
20+
name: 'browsertime',
21+
},
22+
];
23+
24+
afterEach(() => history.push('/alerts'));
25+
26+
const alertHeaderTitleTest = (alertSummary) => {
27+
const store = configureStore(history);
28+
29+
return render(
30+
<Provider store={store} context={ReactReduxContext}>
31+
<ConnectedRouter history={history} context={ReactReduxContext}>
32+
<AlertHeaderTitle alertSummary={alertSummary} frameworks={frameworks} />
33+
</ConnectedRouter>
34+
</Provider>,
35+
);
36+
};
37+
38+
test("Critical badge is displayed near alert summary for 'newssite-applink a55' test", async () => {
39+
const { findByText } = alertHeaderTitleTest(testAlertSummaries[0]);
40+
41+
const criticalTag = await waitFor(() => findByText('critical'));
42+
43+
expect(criticalTag.textContent).toBe('critical');
44+
});
45+
46+
test("Critical badge is displayed near alert summary for 'speedometer3 score windows11 shippable' test", async () => {
47+
const { findByText } = alertHeaderTitleTest(testAlertSummaries[1]);
48+
49+
const criticalTag = await waitFor(() => findByText('critical'));
50+
51+
expect(criticalTag.textContent).toBe('critical');
52+
});

ui/perfherder/alerts/AlertHeaderTitle.jsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import { Link } from 'react-router-dom';
66
import { Row, Col, Badge } from 'reactstrap';
77

88
import Clipboard from '../../shared/Clipboard';
9-
import { getFrameworkName, getTitle } from '../perf-helpers/helpers';
9+
import {
10+
getFrameworkName,
11+
getTitle,
12+
containsText,
13+
} from '../perf-helpers/helpers';
1014

1115
export default class AlertHeaderTitle extends React.Component {
1216
constructor(props) {
@@ -17,6 +21,11 @@ export default class AlertHeaderTitle extends React.Component {
1721
render() {
1822
const { alertSummary, frameworks } = this.props;
1923

24+
const title = getTitle(alertSummary);
25+
const isCritical =
26+
containsText(title, 'speedometer3 score windows11 shippable') ||
27+
containsText(title, 'newssite-applink a55');
28+
2029
return (
2130
<Row>
2231
<Col className="d-flex align-items-start p-0">
@@ -31,6 +40,11 @@ export default class AlertHeaderTitle extends React.Component {
3140
<Badge className="mr-2">
3241
{getFrameworkName(frameworks, alertSummary.framework)}
3342
</Badge>
43+
{isCritical ? (
44+
<Badge className="mr-2" color="danger">
45+
critical
46+
</Badge>
47+
) : null}
3448
Alert #{alertSummary.id} - {alertSummary.repository} -{' '}
3549
{getTitle(alertSummary)}{' '}
3650
<FontAwesomeIcon

0 commit comments

Comments
 (0)