+2013-10-26 Ryosuke Niwa <rniwa@webkit.org>
+
+ Make new bug link in flakiness dashboard configurable
+ https://bugs.webkit.org/show_bug.cgi?id=123386
+
+ Reviewed by Alexey Proskuryakov.
+
+ * config.json: Added Bugzilla as the default destination for new bugs.
+ * public/api/manifest.php: Include newBugLinks in the manifest.
+ * public/index.html:
+ (TestResultsView): Initialize _newBugLinks.
+ (TestResultsView.setNewBugLinks): Added.
+ (TestResultsView._populateTestPane):
+ (TestResultsView._createTestResultRow): Replaced the hard-coded Bugzilla URL by the code
+ to generate hyper-links based on _newBugLinks. Also added a nullity check while formatting
+ revision checks so that we don't blow up when some build doesn't contain all revision info.
+ (TestResultsView._populateBuilderPane):
+
2013-10-26 Ryosuke Niwa <rniwa@webkit.org>
New flakiness dashboard should support substring matching
this._slaves = {};
this._repositories = {};
this._testCategories = {};
+ this._newBugLinks = [];
});
TestResultsView.setAvailableTests = function (availableTests) {
this._testCategories = testCategories;
}
+TestResultsView.setNewBugLinks = function (newBugLinks) {
+ this._newBugLinks = newBugLinks;
+}
+
TestResultsView.showTooltip = function (anchor, contentElement) {
var tooltipContainer = this._tooltipContainer;
tooltipContainer.style.display = null;
var self = this;
this._sortObjectsByName(builders).forEach(function (builder) {
- tbody.appendChild(self._createTestResultRow(builder.name, resultsByBuilder[builder.id], builder, buildTimes, repositories));
+ tbody.appendChild(self._createTestResultRow(builder.name, resultsByBuilder[builder.id], test, builder, buildTimes, repositories));
})
table.appendChild(tbody);
}
}
-TestResultsView._createTestResultRow = function (title, results, builder, buildTimes, repositories) {
+TestResultsView._createTestResultRow = function (title, results, test, builder, buildTimes, repositories) {
var sortedResults = results.sort(function (result1, result2) { return result2.build.time() - result1.build.time(); });
var cells = new Array();
if (!seenBugLink) {
// FIXME: Make bug tracker configurable.
- formattedModifiers.push(element('a',
- {'href': 'https://bugs.webkit.org/enter_bug.cgi?product=WebKit&component=Tools%20/%20Tests&form_name=enter_bug&keywords=LayoutTestFailure'},
- ['File a bug']));
+ for (var i = 0; i < this._newBugLinks.length; i++) {
+ if (i)
+ formattedModifiers.push(' / ');
+ var link = this._newBugLinks[i];
+ formattedModifiers.push(element('a', {'href': link.url.replace(/\$testName/g, test.name)}, link.label));
+ }
}
var slowestTime = Math.max.apply(Math, results.map(function (result) { return result.roundedTime; }));
if (repositories) {
var build = sortedResults[0].build;
for (var i = 0; i < repositories.length; i++) {
+ if (!build.revision(repositories[i].id))
+ continue;
var revisionInfo = build.formattedRevision(repositories[i].id);
if (latestRevisions.length)
latestRevisions.push(' / ');
event.preventDefault();
return false;
}
- tbody.appendChild(self._createTestResultRow(element('span', [testName, externalTestLink]), results, builder));
+ tbody.appendChild(self._createTestResultRow(element('span', [testName, externalTestLink]), results, test, builder));
});
table.appendChild(tbody);
TestResultsView.setSlaves(mapById(response['slaves']));
TestResultsView.setRepositories(mapById(response['repositories']));
TestResultsView.setTestCategories(response['testCategories']);
+ TestResultsView.setNewBugLinks(response['newBugLinks']);
// FIXME: Updating location.href shouldn't be TestResultsView's responsibility.
var parsedStates = TestResultsView.loadTestsFromLocationHash();
if (parsedStates['builder']) {