+
+ this.bug = this._annotation.bug;
+ // FIXME: Bug labels would be simpler to implement as a filter in the UI.
+ if (this.bug != null)
+ this.bugLabel = 'Bug ' + /([0-9]{3,})/.exec(this.bug)[0];
+ else
+ this.bugLabel = undefined;
+};
+
+CTFailureGroup._mergeAnnotations = function(failureAnnotations) {
+ // FIXME: This should be a union of all bugs.
+ var bug = failureAnnotations.map('bug').compact().first();
+
+ // The group is only snoozed if all the failures specify a snooze-time, and only
+ // until the first has elapsed.
+ var snoozeTimes = failureAnnotations.map('snoozeTime').compact();
+ var snoozeTime = snoozeTimes.length < failureAnnotations.length ? undefined : snoozeTimes.min();
+
+ var annotation = {};
+ if (bug != null) {
+ annotation.bug = bug;
+ }
+ if (snoozeTime != null) {
+ annotation.snoozeTime = snoozeTime;
+ }
+ return annotation;