Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2500)

Unified Diff: appengine/trooper_o_matic/model/patch-summary.html

Issue 845963005: trooper-o-matic: Add patch attempt timeline view to CQ graphs (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@+addAlternateBuildViews
Patch Set: Review changes Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/trooper_o_matic/model/patch-summary.html
diff --git a/appengine/trooper_o_matic/model/patch-summary.html b/appengine/trooper_o_matic/model/patch-summary.html
index a49aa8a80cbac883ff55ceee5d24593d514b1776..224d5211a0449a94af7e8f8d4a7c386f79c4485f 100644
--- a/appengine/trooper_o_matic/model/patch-summary.html
+++ b/appengine/trooper_o_matic/model/patch-summary.html
@@ -19,22 +19,34 @@ this.PatchSummary = function PatchSummary(value, unit, issue, patchset, alertThr
this.issue = issue;
this.patchset = patchset;
this.alertThreshold = alertThreshold;
+ this.list = null;
var reviewHost = 'https://codereview.chromium.org';
this._patchURL = '{1}/{2}#ps{3}'.assign(reviewHost, this.issue, this.patchset);
this._issueTitle = null;
- this._summary = null;
+ var logHost = '//chromium-cq-status.appspot.com';
+ this._statusURL = '{1}/patch-status/{2}/{3}'.assign(
+ logHost, this.issue, this.patchset);
+ this._recentURL = '{1}/recent#issue={2},patchset={3}'.assign(
+ logHost, this.issue, this.patchset);
this._columnValues = [];
this._jobViewBuilderBuilds = {};
+ this._summaryPromise = cqStatsUtil.loadPatchSummary(issue, patchset);
+ this._summary = null;
var self = this;
var issueURL = '{1}/api/{2}'.assign(reviewHost, this.issue);
net.json({url: issueURL, cache: true}).then(function(json) {
self._issueTitle = json.subject;
}).catch(log);
- cqStatsUtil.loadPatchSummary(issue, patchset).then(function(summary) {
+ self._summaryPromise.then(function(summary) {
self._summary = summary;
+ summary.attempts.forEach(function(attempt, i) {
+ attempt.number = summary.attempts.length - i;
+ attempt.summaryText = getAttemptSummaryText(attempt);
+ });
+
self._columnValues = PatchSummary.summaryColumns.map(function(column) {
return column.getter(summary);
});
@@ -46,6 +58,10 @@ this.PatchSummary = function PatchSummary(value, unit, issue, patchset, alertThr
}).catch(log);
};
+PatchSummary.prototype.getSummary = function() {
+ return this._summaryPromise;
+}
+
function getJobs(summary, jobView) {
switch (jobView) {
case 'flaky':
@@ -104,6 +120,32 @@ function secondsToMinutes(seconds) {
return (seconds / 60).toFixed(0);
}
+function getAttemptSummaryText(attempt) {
+ var successText = (function(){
+ switch (attempt.success) {
+ case true:
+ return 'Success';
+ case null:
+ return 'Running';
+ default:
+ var text = 'Fail';
+ var reason = attempt.fail_reason;
+ if (reason && reason.fail_type) {
+ text += ': ';
+ if (reason.fail_type === 'failed_jobs') {
+ var getBuilder = function(detail) { return detail.builder };
+ text += reason.fail_details.map(getBuilder).join(' ');
+ } else {
+ text += reason.fail_type;
+ }
+ }
+ return text;
+ }
+ })();
+ return '{1} ({2}min)'.assign(
+ successText, secondsToMinutes(attempt.durations.total));
+}
+
PatchSummary.summaryColumns = [
{
header: 'False rejects',
« no previous file with comments | « appengine/trooper_o_matic/model/cqstats-ratio-graph-data.html ('k') | appengine/trooper_o_matic/model/patch-summary-list.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698