Skip to content

Commit 9dda37c

Browse files
committed
Support generic lookup to bug suggestion when opening the bug filer
1 parent 3a8b25a commit 9dda37c

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

ui/shared/tabs/failureSummary/FailureSummaryTab.jsx

+10-5
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class FailureSummaryTab extends React.Component {
9595

9696
checkInternalFailureOccurrences = (bugInternalId) => {
9797
// Try matching an internal bug already fetched with enough occurences
98-
const { suggestion, suggestions } = this.state;
98+
const { suggestions } = this.state;
9999

100100
const internalBugs = suggestions
101101
.map((s) => s.bugs.open_recent)
@@ -104,11 +104,16 @@ class FailureSummaryTab extends React.Component {
104104
const existingBug = internalBugs.filter(
105105
(bug) => bug.internal_id === bugInternalId,
106106
)[0];
107+
if (!existingBug) {
108+
return;
109+
}
110+
const suggestion = suggestions.find((s) =>
111+
s.bugs.open_recent
112+
.map((bug) => bug.internal_id)
113+
.includes(existingBug.internal_id),
114+
);
107115
// Check if we reached the required number of occurrence to open a bug in Bugzilla
108-
if (
109-
existingBug &&
110-
existingBug.occurrences >= requiredInternalOccurrences - 1
111-
) {
116+
if (existingBug.occurrences >= requiredInternalOccurrences - 1) {
112117
existingBug.occurrences += 1;
113118
this.fileBug(suggestion);
114119
}

0 commit comments

Comments
 (0)