1 2016-05-07 Ryosuke Niwa <rniwa@webkit.org>
3 Add horizontal between categories of tests
4 https://bugs.webkit.org/show_bug.cgi?id=157386
6 Reviewed by Darin Adler.
8 Wrap tests in each category by tbody and add a horizontal bar between each category.
10 * public/v3/pages/summary-page.js:
11 (SummaryPage.prototype._constructTable):
12 (SummaryPage.cssTemplate):
14 2016-05-04 Dewei Zhu <dewei_zhu@apple.com>
16 Summary page should show warnings when current or baseline data is missing.
17 https://bugs.webkit.org/show_bug.cgi?id=157339
19 Reviewed by Ryosuke Niwa.
21 Set summary page to be the default page of v3 UI.
22 Show warning icon when either baseline or current data is missing.
23 Make fetchBetween returns a promise.
24 Update unit tests for MeasurementSet.fetchBetween since it returns a promise now.
25 Add a workaround to skip some platform and metric configurations.
27 * public/v3/components/ratio-bar-graph.js:
29 (RatioBarGraph.prototype.update): Add showWarningIcon flag to indicate whether we should show warning icon.
30 (RatioBarGraph.prototype.render): Show warning icon when showWarningIcon is true.
31 (RatioBarGraph.cssTemplate): Add style for warning icon.
32 * public/v3/components/warning-icon.js: Add warning icon.
34 (WarningIcon.cssTemplate):
35 * public/v3/index.html:
37 (main): Set summary page to be the default page of v3 UI.
38 * public/v3/models/measurement-set.js:
40 (MeasurementSet.prototype.fetchBetween): Returns a promise. Fix the bug in previous implementation that we miss
41 some callbacks sometimes. Basically, we will fetch primary cluster first, then secondary clusters. For each
42 secondary cluster fetch, we will always invoke callback even when it fails.
43 (MeasurementSet.prototype._fetchSecondaryClusters): Deleted.
44 (MeasurementSet.prototype._fetch.else.url.api.measurement.set platform): Deleted.
45 * public/v3/pages/summary-page.js:
46 (SummaryPage): Add a variable for excluded configurations.
47 (SummaryPage.prototype._createConfigurationGroup): Pass excluded configurations while building config groups.
48 (SummaryPage.prototype._constructTable): Remove the logic for unified header since it breaks consistency of the table appearance.
49 (SummaryPage.prototype.this._renderQueue.push): Show warning message when baseline/current data is missing.
50 (SummaryPageConfigurationGroup): Add a variable to keep track of the warnings while computing summary.
51 (SummaryPageConfigurationGroup.prototype.warnings): A getter for warnings.
52 (SummaryPageConfigurationGroup._computeSummary): Fix a bug in calculating ratios. We should always use
53 current/baseline for ratio and present the difference between ratio and 1 in the summary page.
54 (SummaryPageConfigurationGroup.set then): Deleted.
55 (SummaryPageConfigurationGroup.set var): Deleted.
56 * unit-tests/measurement-set-tests.js: Add a helper function to wait for fetchBetween. Update unit tests since fetchBetween returns a promise now.
57 (promise.set fetchBetween):
59 (set fetchBetween): Deleted.
61 2016-04-26 Ryosuke Niwa <rniwa@webkit.org>
63 Chart status should always be computed against prior values
64 https://bugs.webkit.org/show_bug.cgi?id=157014
66 Reviewed by Darin Adler.
68 Compare the current value against the last baseline or target value that appear before the current value in time
69 so that the comparison stay the same even when new baseline and target values are reported. Also include the compared
70 baseline or target value in the label for clarity.
72 * public/v3/components/chart-status-view.js:
73 (ChartStatusView.prototype._computeChartStatus):
74 (ChartStatusView.prototype._computeChartStatus.labelForDiff):
75 (ChartStatusView.prototype._findLastPointPriorToTime): Extracted from _relativeDifferenceToLaterPointInTimeSeries.
76 Now finds the last point before the current point's time if there is any, or the last point in baseline / target.
77 (ChartStatusView.prototype._relativeDifferenceToLaterPointInTimeSeries): Deleted.
78 * public/v3/models/metric.js:
79 (Metric.prototype.makeFormatter): Don't use SI units for unit-less metrics.
81 2016-04-13 Ryosuke Niwa <rniwa@webkit.org>
83 REGRESSION(r199444): Perf dashboard always fetches all measurement sets
84 https://bugs.webkit.org/show_bug.cgi?id=156534
86 Reviewed by Darin Adler.
88 The bug was cased by SummaryPage's constructor fetching all measurement sets. Since each page is always
89 constructed in main(), this resulted in all measurement sets being fetched on all pages.
91 * public/v3/pages/summary-page.js:
93 (SummaryPage.prototype.open): Fetch measurement set JSONs here.
94 (SummaryPage.prototype._createConfigurationGroup): Renamed from _createConfigurationGroupAndStartFetchingData.
96 2016-04-12 Ryosuke Niwa <rniwa@webkit.org>
98 Add a summary page to v3 UI
99 https://bugs.webkit.org/show_bug.cgi?id=156531
101 Reviewed by Stephanie Lewis.
103 Add new "Summary" page, which shows the average difference (better or worse) from the baseline across
104 multiple platforms and tests by a single number.
106 * public/include/manifest.php:
107 (ManifestGenerator::generate): Include "summary" in manifest.json.
108 * public/shared/statistics.js:
109 (Statistics.mean): Added.
110 (Statistics.median): Added.
111 * public/v3/components/ratio-bar-graph.js: Added.
112 (RatioBarGraph): Shows a horizontal bar graph that visualizes the relative difference (e.g. 3% better).
113 (RatioBarGraph.prototype.update):
114 (RatioBarGraph.prototype.render):
115 (RatioBarGraph.cssTemplate):
116 (RatioBarGraph.htmlTemplate):
117 * public/v3/index.html:
119 (main): Instantiate SummaryPage and add it to the navigation bar and the router.
120 * public/v3/models/manifest.js:
121 (Manifest._didFetchManifest): Let "summary" pass through from manifest.json to main().
122 * public/v3/models/measurement-set.js:
123 (MeasurementSet.prototype._failedToFetchJSON): Invoke the callback with an error or true in order for
124 the callback can detect a failure.
125 (MeasurementSet.prototype._invokeCallbacks): Ditto.
126 * public/v3/pages/charts-page.js:
127 (ChartsPage.createStateForConfigurationList): Added to add a hyperlink from summary page to charts page.
128 * public/v3/pages/summary-page.js: Added.
129 (SummaryPage): Added.
130 (SummaryPage.prototype.routeName): Added.
131 (SummaryPage.prototype.open): Added.
132 (SummaryPage.prototype.render): Added.
133 (SummaryPage.prototype._createConfigurationGroupAndStartFetchingData): Added.
134 (SummaryPage.prototype._constructTable): Added.
135 (SummaryPage.prototype._constructRatioGraph): Added.
136 (SummaryPage.htmlTemplate): Added.
137 (SummaryPage.cssTemplate): Added.
138 (SummaryPageConfigurationGroup): Added. Represents a set of platforms and tests shown in a single cell.
139 (SummaryPageConfigurationGroup.prototype.ratio): Added.
140 (SummaryPageConfigurationGroup.prototype.label): Added.
141 (SummaryPageConfigurationGroup.prototype.changeType): Added.
142 (SummaryPageConfigurationGroup.prototype.configurationList): Added.
143 (SummaryPageConfigurationGroup.prototype.fetchAndComputeSummary): Added.
144 (SummaryPageConfigurationGroup.prototype._computeSummary): Added.
145 (SummaryPageConfigurationGroup.prototype._fetchAndComputeRatio): Added. Invoked for each time series in
146 the set, and stores the computed ratio of the current values to the baseline in this._setToRatio.
147 The results are aggregated by _computeSummary as a single number later.
148 (SummaryPageConfigurationGroup._medianForTimeRange): Added.
149 (SummaryPageConfigurationGroup._fetchData): A thin wrapper to make MeasurementSet.fetchBetween promise
150 friendly since MeasurementSet doesn't support Promise at the moment (but it should!).
151 * server-tests/api-manifest.js: Updated a test case.
153 2016-04-12 Ryosuke Niwa <rniwa@webkit.org>
155 Make sync-buildbot.js fault safe
156 https://bugs.webkit.org/show_bug.cgi?id=156498
158 Reviewed by Chris Dumez.
160 Fixed a bug that sync-buildbot.js will continue to schedule build requests from multiple test groups
161 if multiple test groups are simultaneously in-progress on the same builder. Also fixed a bug that if
162 a build request had failed without leaving a trace (i.e. no entry on any of the builders we know of),
163 sync-buildbot.js throws an exception.
165 * server-tests/tools-buildbot-triggerable-tests.js: Added test cases.
166 * tools/js/buildbot-syncer.js:
167 (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Renamed. Optionally takes the slave name.
168 When this parameter is specified, schedule the request only if the specified slave is available.
169 * tools/js/buildbot-triggerable.js:
170 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Always use
171 scheduleRequestInGroupIfAvailable to schedule a new build request. Using scheduleRequest for non-first
172 build requests was problematic when there were multiple test groups with pending requests because then
173 we would schedule those pending requests without checking whether there is already a pending job or if
174 we have previously scheduled a job. Also fallback to use any syncer / builder when groupInfo.syncer is
175 not set even if the next request was not the first one in the test group since we can't determine on
176 which builder preceding requests are processed in such cases.
177 * unit-tests/buildbot-syncer-tests.js:
179 2016-04-11 Ryosuke Niwa <rniwa@webkit.org>
181 Replace script runner to use mocha.js tests
182 https://bugs.webkit.org/show_bug.cgi?id=156490
184 Reviewed by Chris Dumez.
186 Replaced run-tests.js, which was a whole test harness for running legacy tests by tools/run-tests.py
187 which is a thin wrapper around mocha.js.
189 * run-tests.js: Removed.
191 * tools/run-tests.py: Added.
194 2016-04-11 Ryosuke Niwa <rniwa@webkit.org>
196 New syncing script sometimes schedules a build request on a wrong builder
197 https://bugs.webkit.org/show_bug.cgi?id=156489
199 Reviewed by Stephanie Lewis.
201 The bug was caused by _scheduleNextRequestInGroupIfSlaveIsAvailable scheduling the next build request on
202 any available syncer regardless of whether the request is the first one in the test group or not because
203 BuildRequest.order was returning a string instead of a number.
205 Also fixed a bug that BuildbotTriggerable.syncOnce was re-ordering test groups by their id's instead of
206 respecting the order in which the perf dashboard returned.
208 * public/v3/models/build-request.js:
209 (BuildRequest.prototype.order): Force the order to be a number.
210 * server-tests/api-build-requests-tests.js: Assert the order as numbers.
211 * server-tests/resources/mock-data.js:
212 (MockData.addAnotherMockTestGroup): Changed the test group id to 601, which is after the first mock data.
213 The old number was masking a bug in BuildbotTriggerable that it was re-ordering test groups by their id's
214 instead of using the order set forth by the perf dashboard.
215 (MockData.mockTestSyncConfigWithSingleBuilder):
216 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for scheduling two build requests in
217 a single call to syncOnce. Each build request should be scheduled on the same builder as the previous build
218 requests in the same test group.
219 * tools/js/buildbot-triggerable.js:
220 (BuildbotTriggerable.prototype.syncOnce): Order test groups by groupOrder, which is the index at which first
221 build request in the group appeared.
222 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Don't re-order build requests
223 as they're already sorted on the server side.
224 (BuildbotTriggerable._testGroupMapForBuildRequests): Added groupOrder to test group info
226 2016-04-09 Ryosuke Niwa <rniwa@webkit.org>
228 Build fix. Don't treat a build number 0 as a pending build.
230 * tools/js/buildbot-syncer.js:
231 (BuildbotBuildEntry.prototype.isPending):
233 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
235 Escape builder names in url* and pathFor* methods of BuildbotSyncer
236 https://bugs.webkit.org/show_bug.cgi?id=156427
238 Reviewed by Darin Adler.
240 The build fix in r199251 breaks other usage of RemoteAPI. Fix it properly by escaping builder names in
241 various methods of BuildbotSyncer.
243 Also fixed a typo in the logging and a bug that the new syncing script never updated "scheduled" to "running".
245 * server-tests/resources/mock-data.js:
246 (MockData.mockTestSyncConfigWithTwoBuilders): Renamed "some-builder-2" to "some builder 2" to test the
247 new escaping behavior in tools-buildbot-triggerable-tests.js and buildbot-syncer-tests.js.
249 * server-tests/tools-buildbot-triggerable-tests.js: Added tests for status url, and added a new test case
250 for updating "scheduled" to "running".
252 * tools/js/buildbot-syncer.js:
253 (BuildbotBuildEntry.buildRequestStatusIfUpdateIsNeeded): Update the status to "running" when the request's
254 status is "scheduled" and the buildbot's build is currently in progress.
255 (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Escape the builder name.
256 (BuildbotSyncer.prototype.pathForBuildJSON): Ditto.
257 (BuildbotSyncer.prototype.pathForForceBuild): Ditto.
258 (BuildbotSyncer.prototype.url): Ditto.
259 (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
261 * tools/js/buildbot-triggerable.js:
262 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers):
263 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Fixed a typo. We are
264 scheduling new build requests, not syncing them.
265 * tools/js/remote.js:
266 (RemoteAPI.sendHttpRequest): Reverted r199251.
267 * unit-tests/buildbot-syncer-tests.js:
269 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
271 Build fix. We need to escape the path or http.request would fail.
273 * tools/js/remote.js:
275 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
277 Fix various bugs in the new syncing script
278 https://bugs.webkit.org/show_bug.cgi?id=156393
280 Reviewed by Darin Adler.
282 * server-tests/resources/common-operations.js: Added. This file was supposed to be added in r199191.
283 (addBuilderForReport):
285 (connectToDatabaseInEveryTest):
287 * tools/js/buildbot-triggerable.js:
288 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Don't log every time we pull from buildbot
289 builder as this dramatically increases the amount of log we generate.
290 * tools/js/parse-arguments.js:
291 (parseArguments): Fixed a typo. This should be parseArgument*s*, not parseArgument.
292 * tools/js/remote.js:
293 (RemoteAPI.prototype.url): Fixed a bug that portSuffix wasn't being expanded in the template literal.
294 (RemoteAPI.prototype.configure): Added more validations with nice error messages.
295 (RemoteAPI.prototype.sendHttpRequest): Falling back to port 80 isn't right when scheme is https. Compute
296 the right port in configure instead based on the scheme.
297 * tools/sync-buildbot.js:
298 (syncLoop): Fixed the bug that syncing multiple times fail because Manifest.fetch() create new Platform
299 and Test objects. This results in various references in BuildRequest objects to get outdated. Fixing this
300 properly in Manifest.fetch() because we do need to "forget" about some tests and platforms in some cases.
301 For now, delete all v3 model objects and start over in each syncing cycle.
302 * unit-tests/tools-js-remote-tests.js: Added. Unit tests for the aforementioned changes to RemoteAPI.
304 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
306 sync-buildbot.js doesn't mark disappeared builds as failed
307 https://bugs.webkit.org/show_bug.cgi?id=156386
309 Reviewed by Chris Dumez.
311 Fix a bug that new syncing script doesn't mark builds that it scheduled but doesn't appear when queried
312 by buildbot's JSON API. These are builds that got canceled by humans (e.g. buildbot was restarted, data
313 loss, pending build was canceled, etc...)
315 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case.
316 * tools/js/buildbot-triggerable.js:
317 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added a set of build requests we've matched
318 against BuildbotBuildEntry's. Mark build requests that didn't have any entry but supposed to be in either
319 'scheduled' or 'running' status as failed.
321 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
323 A/B testing bots should prioritize user created test groups
324 https://bugs.webkit.org/show_bug.cgi?id=156375
326 Reviewed by Chris Dumez.
328 Order build requests preferring user created ones over ones automatically created by detect-changes.js.
330 Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new
331 build request on a builder/slave even when we had previously scheduled another build request.
333 * public/include/build-requests-fetcher.php:
334 (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on
335 author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js.
336 Since we're using ascending order, this would put user created test groups first.
337 * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case
338 for testing that build requests for an user created test group shows up first.
339 * server-tests/resources/mock-data.js:
340 (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name.
341 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests
342 for an user created test group shows up first.
343 * tools/js/buildbot-syncer.js:
344 (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already
345 scheduled new build requests. Don't schedule more requests on these slaves.
346 (BuildbotSyncer.prototype.scheduleRequest):
347 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null
348 when slaveList is not specified) to _slavesWithNewRequests.
349 (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request
350 we have previously scheduled should be included in one of the entires now.
351 * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug.
352 (sampleiOSConfig): Added a second slave for new test cases.
354 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
356 Migrate legacy perf dashboard tests to mocha.js based tests
357 https://bugs.webkit.org/show_bug.cgi?id=156335
359 Reviewed by Chris Dumez.
361 Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise
362 for most of asynchronous operations, refactored the tests to use Promises as well, and added more
363 assertions where appropriate.
365 Also consolidated common helper functions into server-tests/resources/common-operations.js.
366 Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were
367 taking an array of reports while others were taking a single report. New shared implementation in
368 common-operations.js now takes a single report.
370 Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout.
371 Most of tests are passing under 100ms on my computer so 1s should be plenty still.
373 * run-tests.js: Removed.
374 * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js.
375 (reportsForDifferentPlatforms):
376 * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js.
377 (.addBuilder): Moved to common-operations.js.
378 * server-tests/api-build-requests-tests.js:
379 * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps.
380 * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js.
381 (.queryPlatformAndMetric):
383 * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js.
384 * server-tests/api-report-tests.js: Moved from tests/api-report.js.
387 (.reportWithSameSubtestName):
388 * server-tests/resources/common-operations.js: Added.
389 (addBuilderForReport): Extracted from tests.
390 (addSlaveForReport): Ditto.
391 (connectToDatabaseInEveryTest): Added.
392 (submitReport): Extracted from admin-platforms-tests.js.
393 * server-tests/resources/test-server.js:
394 (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start
395 its own Apache instance (that would certainly will fail).
396 * server-tests/tools-buildbot-triggerable-tests.js:
398 * tools/js/database.js:
399 (Database.prototype.selectAll): Added.
400 (Database.prototype.selectFirstRow): Added.
401 (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments.
403 2016-04-05 Ryosuke Niwa <rniwa@webkit.org>
405 New buildbot syncing scripts that supports multiple builders and slaves
406 https://bugs.webkit.org/show_bug.cgi?id=156269
408 Reviewed by Chris Dumez.
410 Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves.
411 The old python script (sync-with-buildbot.py) could only support a single builder and slave
412 for each platform, test pair.
414 The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added
415 throughout the codebase and tests have been refactored.
417 BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible
418 for syncing everything on each builder (on a buildbot).
420 Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored
421 test helpers and mocks as needed.
423 * public/v3/models/build-request.js:
424 (BuildRequest.prototype.status): Added.
425 (BuildRequest.prototype.isScheduled): Added.
426 * public/v3/models/metric.js:
427 (Metric.prototype.fullName): Added.
428 * public/v3/models/platform.js:
429 (Platform): Added the map based on platform name.
430 (Platform.findByName): Added.
431 * public/v3/models/test.js:
432 (Test.topLevelTests):
433 (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would
434 find the test whose name is "B" which has a parent test named "A".
435 (Test.prototype.fullName): Added.
436 * server-tests/api-build-requests-tests.js:
437 (addMockData): Moved to resources/mock-data.js.
438 (addAnotherMockTestGroup): Ditto.
439 * server-tests/resources/mock-data.js: Added.
440 (MockData.resetV3Models): Added.
441 (MockData.addMockData): Moved from api-build-requests-tests.js.
442 (MockData.addAnotherMockTestGroup): Ditto.
443 (MockData.mockTestSyncConfigWithSingleBuilder): Added.
444 (MockData.mockTestSyncConfigWithTwoBuilders): Added.
445 (MockData.pendingBuild): Added.
446 (MockData.runningBuild): Added.
447 (MockData.finishedBuild): Added.
448 * server-tests/resources/test-server.js:
450 (TestServer.prototype.remoteAPI):
451 (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit.
452 (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever.
453 (TestServer.prototype._waitForPid): Increase the timeout.
454 (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards.
455 * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce.
457 (MockLogger.prototype.log): Added.
458 (MockLogger.prototype.error): Added.
459 * tools/detect-changes.js:
460 (parseArgument): Moved to js/parse-arguments.js.
461 * tools/js/buildbot-syncer.js:
462 (BuildbotBuildEntry):
463 (BuildbotBuildEntry.prototype.syncer): Added.
464 (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status
465 for a build request (of the matching build request ID) if it needs to be updated in the server.
466 (BuildbotSyncer): This class
467 (BuildbotSyncer.prototype.addTestConfiguration): Added.
468 (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations.
469 (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on
471 (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request.
472 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for
473 the specified build request on the first slave that's available.
474 (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object.
475 Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it.
476 (BuildbotSyncer.prototype._pullRecentBuilds):
477 (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now
478 only returns the path instead of the full URL since RemoteAPI takes a path, not full URL.
479 (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON.
480 (BuildbotSyncer.prototype.pathForForceBuild): Added.
481 (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL.
482 (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
483 (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test
484 configurations associated with it, find the one matching for this request.
485 (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it.
486 (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of
487 slave names present on this builder.
488 * tools/js/buildbot-triggerable.js: Added.
489 (BuildbotTriggerable): Added.
490 (BuildbotTriggerable.prototype.name): Added.
491 (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls
492 existing build requests from the perf dashboard, pulls buildbot for pending and running/completed
493 builds on each builder (represented by each syncer), schedules build requests on buildbot if there
494 is any builder/slave available, and updates the status of build requests in the database.
495 (BuildbotTriggerable.prototype._validateRequests): Added.
496 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added.
497 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added.
498 (BuildbotTriggerable._testGroupMapForBuildRequests): Added.
499 * tools/js/database.js:
500 * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js.
502 * tools/js/remote.js:
503 (RemoteAPI): Now optionally takes the server configuration.
504 (RemoteAPI.prototype.url): Added.
505 (RemoteAPI.prototype.getJSON): Removed the code for specifying request content.
506 (RemoteAPI.prototype.getJSONWithStatus): Ditto.
507 (RemoteAPI.prototype.postJSON): Added.
508 (RemoteAPI.prototype.postFormUrlencodedData): Added.
509 (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth.
510 * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host.
511 * tools/sync-buildbot.js: Added.
512 (main): Added. Parse the arguments and start the loop.
514 * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as
515 scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed.
517 (smallConfiguration): Added.
518 (smallPendingBuild): Added.
519 (smallInProgressBuild): Added.
520 (smallFinishedBuild): Added.
521 (createSampleBuildRequest): Create a unique build request for each platform.
522 (samplePendingBuild): Optionally specify build time and slave name.
523 (sampleInProgressBuild): Optionally specify slave name.
524 (sampleFinishedBuild): Ditto.
525 * unit-tests/resources/mock-remote-api.js:
526 (assert.notReached.assert.notReached):
527 (MockRemoteAPI.url): Added.
528 (MockRemoteAPI.postFormUrlencodedData): Added.
529 (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus.
530 (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we
531 need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI.
532 (MockRemoteAPI.inject):
533 (MockRemoteAPI.reset): Added.
535 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
537 Simplify API of Test model by removing Test.setParentTest
538 https://bugs.webkit.org/show_bug.cgi?id=156055
540 Reviewed by Joseph Pecoraro.
542 Removed Test.setParentTest. Keep track of the child-parent relationship using the static map instead.
544 Now each test only stores parent's id and uses the ID static map in Test.parentTest().
546 * public/v3/models/manifest.js:
547 (Manifest._didFetchManifest.buildObjectsFromIdMap): Removed the code to create the map of child-parent
548 relationship and call setParentTest.
549 * public/v3/models/test.js:
550 (Test): Updated a static map by the name of "childTestMap" to store itself. We should probably sort
551 child tests using some fixed criteria in the future instead of relying on the creation order but
552 preserve the old code's ordering for now.
553 (Test.prototype.parentTest): Look up the static map by the parent test's id.
554 (Test.prototype.onlyContainsSingleMetric):
555 (Test.prototype.setParentTest): Deleted.
556 (Test.prototype.childTests): Look up the child test map.
558 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
560 BuildRequest should have associated platform and test
561 https://bugs.webkit.org/show_bug.cgi?id=156054
563 Reviewed by Joseph Pecoraro.
565 Added methods to retrieve the platform and the test associated with a build request with tests.
567 * public/v3/models/build-request.js:
569 (BuildRequest.prototype.platform): Added.
570 (BuildRequest.prototype.test): Added.
571 * server-tests/api-build-requests-tests.js:
572 * server-tests/api-manifest.js: Fixed a typo. This tests /api/manifest, not /api/build-requests.
573 * unit-tests/buildbot-syncer-tests.js:
574 (.createSampleBuildRequest): Now takes Platform and Test objects to avoid hitting assertions in
575 BuildRequest's constructor.
577 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
579 BuildRequest should have a method to fetch all in-progress and pending requests for a triggerable
580 https://bugs.webkit.org/show_bug.cgi?id=156008
582 Reviewed by Darin Adler.
584 Add a method to BuildRequest that fetches all pending and in-progress requests for a triggerable.
586 Now, new syncing scripts must be able to figure out the build slave the first build requests in
587 a given test group had used in order to schedule subsequent build requests in the test group.
589 For this purpose, /api/build-requests has been modified to return all build requests whose test
590 group had not finished yet. A test group is finished if all build requests in the test group had
591 finished (completed, failed, or canceled).
593 * public/include/build-requests-fetcher.php:
594 (BuildRequestFetcher::fetch_incomplete_requests_for_triggerable): Return all build requests in test
595 groups that have not been finished.
596 * public/v3/models/build-request.js:
598 (BuildRequest.prototype.testGroupId): Added.
599 (BuildRequest.prototype.isPending): Renamed from hasPending to fix a bad grammar.
600 (BuildRequest.fetchForTriggerable): Added.
601 (BuildRequest.constructBuildRequestsFromData): Extracted from _createModelsFromFetchedTestGroups in
603 * public/v3/models/manifest.js:
604 (Manifest.fetch): Use the full path from root so that it works in server tests.
605 * public/v3/models/test-group.js:
606 (TestGroup.hasPending):
607 (TestGroup._createModelsFromFetchedTestGroups):
608 * server-tests/api-build-requests-tests.js: Added tests to ensure all build requests for a test group
609 is present in the response returned by /api/build-requests iff any build request in the group had not
612 (.addAnotherMockTestGroup): Added.
613 * unit-tests/test-groups-tests.js:
615 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
617 Make dependency injection in unit tests more explicit
618 https://bugs.webkit.org/show_bug.cgi?id=156006
620 Reviewed by Joseph Pecoraro.
622 Make the dependency injection of model objects in unit tests explicit so that server tests that create
623 "real" model objects won't create these mock objects. Now each test that uses mock model objects would call
624 MockModels.inject() to inject before / beforeEach and access each object using a property on MockModels
625 instead of them being implicitly defined on the global object.
627 Similarly, MockRemoteAPI now only replaces global.RemoteAPI during each test so that server tests can use
628 real RemoteAPI to access the test Apache server.
630 * unit-tests/analysis-task-tests.js:
631 * unit-tests/buildbot-syncer-tests.js:
632 (createSampleBuildRequest):
633 * unit-tests/measurement-adaptor-tests.js:
634 * unit-tests/measurement-set-tests.js:
635 * unit-tests/resources/mock-remote-api.js:
636 (MockRemoteAPI.getJSONWithStatus):
637 (MockRemoteAPI.inject): Added. Override RemoteAPI on the global object during each test.
638 * unit-tests/resources/mock-v3-models.js:
639 (MockModels.inject): Added. Create mock model objects before each test, and clear all static maps of
640 various v3 model classes (to remove all singleton objects for those model classes).
641 * unit-tests/test-groups-tests.js:
643 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
645 BuildbotSyncer should be able to fetch JSON from buildbot
646 https://bugs.webkit.org/show_bug.cgi?id=155921
648 Reviewed by Joseph Pecoraro.
650 Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot
651 with lots of unit tests as this has historically been a source of subtle bugs in the old script.
653 New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that
654 the state of some builds may change between each HTTP request. In the old script, we fetched the list
655 of the pending builds, and requested -1, -2, etc... builds for N times. But between each request,
656 a pending build may start running or an in-progress build finish and shift the offset by one. The new
657 script avoids this problem by first requesting all pending builds, then all in-progress and finished
658 builds in a single HTTP request. The results are then merged so that entries for in-progress and
659 finished builds would override the entries for pending builds if they overlap.
661 Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes
662 the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js).
664 * server-tests/api-build-requests-tests.js:
665 * server-tests/api-manifest.js:
666 * tools/js/buildbot-syncer.js:
667 (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as
668 we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished
669 builds as 'currentStep' is always defined but null in those builds.
670 (BuildbotBuildEntry.prototype.buildNumber): Added.
671 (BuildbotBuildEntry.prototype.isPending): Added.
672 (BuildbotBuildEntry.prototype.hasFinished): Added.
673 (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds.
674 (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds.
675 (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added.
676 (BuildbotSyncer.prototype.urlForBuildJSON): Added.
677 (BuildbotSyncer.prototype.url): Added.
678 (BuildbotSyncer.prototype.urlForBuildNumber): Added.
679 * tools/js/remote.js:
680 (RemoteAPI.prototype.getJSON): Renamed from fetchJSON.
681 (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus.
682 * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node.
683 * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot
684 (samplePendingBuild):
685 (sampleInProgressBuild): Added.
686 (sampleFinishedBuild): Added.
687 * unit-tests/resources/mock-remote-api.js:
688 (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus.
690 2016-03-24 Ryosuke Niwa <rniwa@webkit.org>
692 Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code
693 https://bugs.webkit.org/show_bug.cgi?id=155863
695 Reviewed by Joseph Pecoraro.
697 Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability
698 added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed
699 /admin/regenerate-manifest since it has been superseded by /api/manifest.
701 This patch also extracts manifest.js out of main.js so that it could be used and tested without the
704 * public/admin/regenerate-manifest.php: Deleted.
705 * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with
706 a trailing backslash.
707 * public/include/manifest.php:
708 (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories.
709 * public/v3/index.html:
712 * public/v3/models/bug-tracker.js:
713 (BugTracker.prototype.newBugUrl): Added.
714 (BugTracker.prototype.repositories): Added.
715 * public/v3/models/manifest.js: Added. Extracted from main.js.
716 (Manifest.fetch): Moved from main.js' fetchManifest.
717 (Manifest._didFetchManifest): Moved from main.js' didFetchManifest.
718 * public/v3/models/platform.js:
719 (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of
720 the same name. This is tested by the newly added test cases.
721 * server-tests/api-build-requests-tests.js:
722 * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js
723 with additional assertions for v3 UI model objects.
724 * server-tests/resources/test-server.js:
725 (TestServer.prototype.start):
726 (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API.
727 Also no longer takes dataDirectory as an argument since it's always the same.
728 (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data.
729 (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests.
730 (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an
731 unintended side effect of slowing down unit tests even through they don't need Postgres or Apache.
732 * tests/admin-regenerate-manifest.js: Removed.
733 * tools/js/database.js:
734 * tools/js/v3-models.js:
736 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
738 Add mocha server tests for /api/build-requests
739 https://bugs.webkit.org/show_bug.cgi?id=155831
741 Reviewed by Chris Dumez.
743 Added the new mocha.js based server-tests for /api/build-requests. The new harness automatically:
744 - starts a new Apache instance
745 - switches the database during testing via setting an environmental variable
746 - backups and restores public/data directory during testing
748 As a result, developer no longer has to manually setup Apache, edit config.json manually to use
749 a testing database, or run /api/manifest.php to re-generate the manifest file after testing.
751 This patch also makes ID resolution optional on /api/build-requests so that v3 model based syncing
752 scripts can re-use the same code as the v3 UI to process the JSON. tools/sync-with-buildbot.py has
753 been modified to use this option (useLegacyIdResolution).
755 * config.json: Added configurations for the test httpd server.
756 * init-database.sql: Don't error when tables and types don't exist (when database is empty).
757 * public/api/build-requests.php:
758 (main): Made the ID resolution optional with useLegacyIdResolution. Also removed "updates" from the
759 results JSON since it's never used.
760 * public/include/build-requests-fetcher.php:
761 (BuildRequestsFetcher::__construct):
762 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Fixed the bug that we would include the same
763 commit multiple times for each root set.
764 * public/include/db.php:
765 (config): If present, use ORG_WEBKIT_PERF_CONFIG_PATH instead of Websites/perf.webkit.org/config.json.
766 * server-tests: Added.
767 * server-tests/api-build-requests-tests.js: Added. Tests for /api/build-requests.
769 * server-tests/resources: Added.
770 * server-tests/resources/test-server.conf: Added. Apache configuration file for testing.
771 * server-tests/resources/test-server.js: Added.
773 (TestSever.prototype.start): Added.
774 (TestSever.prototype.stop): Added.
775 (TestSever.prototype.remoteAPI): Added. Configures RemoteAPI to be used with the test sever.
776 (TestSever.prototype.database): Added. Returns Database configured to use the test database.
777 (TestSever.prototype._constructTestConfig): Creates config.json for testing. The file is generated by
778 _start and db.php's config() reads it from the environmental variable: ORG_WEBKIT_PERF_CONFIG_PATH.
779 (TestSever.prototype._ensureDataDirectory): Renames public/data to public/original-data if exists,
780 and creates a new empty public/data.
781 (TestSever.prototype._restoreDataDirectory): Deletes public/data and renames public/original-data
783 (TestSever.prototype._ensureTestDatabase): Drops the test database if exists and creates a new one.
784 (TestSever.prototype.initDatabase): Run init-database.sql to start each test with a consistent state.
785 (TestSever.prototype._executePgsqlCommand): Executes a postgres command line tool such as psql.
786 (TestSever.prototype._determinePgsqlDirectory): Finds the directory that contains psql.
787 (TestSever.prototype._startApache): Starts an Apache instance for testing.
788 (TestSever.prototype._stopApache): Stops the Apache instance for testing.
789 (TestSever.prototype._waitForPid): Waits for the Apache pid file to appear or disappear.
790 (before): Start the test server at the beginning.
791 (beforeEach): Re-initialize all tables before each test.
792 (after): Stop the test server at the end.
793 * tools/js/config.js:
794 (Config.prototype.path):
795 (Config.prototype.serverRoot): Added. The path to Websites/perf.webkit.org/public/.
796 (Config.prototype.pathFromRoot): Added. Resolves a path from Websites/perf.webkit.org.
797 * tools/js/database.js:
798 (Database): Now optionally takes the database name to use a different database during testing.
799 (Database.prototype.connect):
800 (Database.prototype.query): Added.
801 (Database.prototype.insert): Added.
802 (tableToPrefixMap): Maps table name to its prefix. Used by Database.insert.
803 * tools/js/remote.js: Added.
804 (RemoteAPI): Added. This is node.js equivalent of RemoteAPI in public/v3/remote.js.
805 (RemoteAPI.prototype.configure): Added.
806 (RemoteAPI.prototype.fetchJSON): Added.
807 (RemoteAPI.prototype.fetchJSONWithStatus): Added.
808 (RemoteAPI.prototype.sendHttpRequest): Added.
809 * tools/sync-with-buildbot.py:
810 (main): Use useLegacyIdResolution as this script relies on the legacy behavior.
811 * unit-tests/checkconfig.js: pg was never directly used in this test.
813 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
815 Delete a file that was supposed to be removed in r198614 for real.
817 * unit-tests/resources/v3-models.js: Removed.
819 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
821 Add a model for parsing buildbot JSON with unit tests
822 https://bugs.webkit.org/show_bug.cgi?id=155814
824 Reviewed by Joseph Pecoraro.
826 Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests.
827 They will be used in the new syncing scripts to improve A/B testing.
829 * public/v3/models/build-request.js:
831 * tools/js/buildbot-syncer.js: Added.
832 (BuildbotBuildEntry): Added.
833 (BuildbotBuildEntry.prototype.slaveName): Added.
834 (BuildbotBuildEntry.prototype.buildRequestId): Added.
835 (BuildbotBuildEntry.prototype.isInProgress): Added.
836 (BuildbotSyncer): Added.
837 (BuildbotSyncer.prototype.testPath): Added.
838 (BuildbotSyncer.prototype.builderName): Added.
839 (BuildbotSyncer.prototype.platformName): Added.
840 (BuildbotSyncer.prototype.fetchPendingRequests): Added.
841 (BuildbotSyncer.prototype._propertiesForBuildRequest): Added.
842 (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added.
843 (BuildbotSyncer._loadConfig): Added.
844 (BuildbotSyncer._validateAndMergeConfig): Added.
845 (BuildbotSyncer._validateAndMergeProperties): Added.
846 * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js.
847 (beforeEach): Deleted since this only defined inside mocha.
848 * unit-tests/analysis-task-tests.js:
849 * unit-tests/buildbot-syncer-tests.js: Added.
851 (createSampleBuildRequest):
852 (.smallConfiguration):
853 * unit-tests/measurement-adaptor-tests.js:
854 * unit-tests/measurement-set-tests.js:
855 * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js.
857 * unit-tests/test-groups-tests.js:
860 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
862 Add unit tests for test-group.js
863 https://bugs.webkit.org/show_bug.cgi?id=155781
865 Reviewed by Joseph Pecoraro.
867 Added unit tests for test-group.js that would have caught regressions fixed in r198503.
869 * public/v3/components/chart-pane-base.js:
870 (ChartPaneBase.prototype._renderAnnotations): Added a forgotten break statement.
871 * public/v3/models/build-request.js:
872 (BuildRequest.prototype.setResult):
874 * public/v3/models/test-group.js:
875 * unit-tests/measurement-set-tests.js: Use ./resources/v3-models.js to reduce the code duplication.
876 * unit-tests/resources/v3-models.js: Import more stuff from v3 models.
878 * unit-tests/test-groups-tests.js: Added. Added some unit tests for TestGroup.
880 (.testGroupWithStatusList):
882 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
888 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
890 Commit log viewer repaints too frequently after r198499
891 https://bugs.webkit.org/show_bug.cgi?id=155732
893 Reviewed by Joseph Pecoraro.
895 The bug was caused by InteractiveTimeSeriesChart invoking onchange callback whenever mouse moved even
896 if the current point didn't change. Fixed the bug by avoiding the work if the indicator hadn't changed
897 and avoiding work in the commit log viewer when the requested repository and the revision range were
898 the same as those of the last request.
900 * public/v3/components/commit-log-viewer.js:
902 (CommitLogViewer.prototype.currentRepository): Exit early when repository and the revision range are
903 identical to the one we already have to avoid repaints and issuing multiple network requests.
904 * public/v3/components/interactive-time-series-chart.js:
905 (InteractiveTimeSeriesChart.prototype._mouseMove): Don't invoke _notifyIndicatorChanged if the current
906 indicator hadn't changed.
907 * public/v3/pages/chart-pane.js:
908 (ChartPane.prototype._indicatorDidChange): Fixed the bug that unlocking the indicator wouldn't update
909 the URL. We need to check whether the lock state had changed. The old condition was also redundant
910 since _mainChartIndicatorWasLocked is always identically equal to isLocked per the prior assignment.
912 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
914 Fix A/B testing after r198503.
916 * public/include/build-requests-fetcher.php:
918 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
920 Analysis task page is broken after r198479
921 https://bugs.webkit.org/show_bug.cgi?id=155735
923 Rubber-stamped by Chris Dumez.
925 * public/api/measurement-set.php:
926 (AnalysisResultsFetcher::fetch_commits): We need to emit the commit ID as done for regular data.
927 * public/include/build-requests-fetcher.php:
928 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Ditto. Don't use a fake ID after r198479.
929 * public/v3/models/commit-log.js:
930 (CommitLog): Assert that all commit log IDs are integers to catch regressions like this in future.
931 * public/v3/models/root-set.js:
932 (RootSet): Don't resolve Repository here as doing so would modify the shared "root" entry in the JSON
933 we fetched, and subsequent construction of RootSet would fail since this line would blow up trying to
934 find the repository with "[object]" as the ID.
935 * public/v3/models/test-group.js:
936 (TestGroup._createModelsFromFetchedTestGroups): Resolve Repository here.
938 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
940 v3 UI sometimes don't update the list of revisions on the commit log viewer
941 https://bugs.webkit.org/show_bug.cgi?id=155729
943 Rubber-stamped by Chris Dumez.
945 Fixed multiple bugs that were affecting the list of blame range and commit logs for the range weren't
946 updated in some cases on v3 UI. Also, the commit log viewer state is now a part of the URL state so
947 opening and closing the commit log viewer will persist across page loads.
949 Also fixed a regression from r198479 that Test object can't be created for a top level test.
951 * public/v3/components/chart-pane-base.js:
952 (ChartPaneBase.prototype.configure):
953 (ChartPaneBase.prototype._mainSelectionDidChange): Fixed the bug that the list of blame range nor the
954 commit log viewer don't get updated when the selected range changes.
955 (ChartPaneBase.prototype._indicatorDidChange):
956 (ChartPaneBase.prototype._didFetchData):
957 (ChartPaneBase.prototype._updateStatus): Extracted from _indicatorDidChange and _didFetchData.
958 (ChartPaneBase.prototype._requestOpeningCommitViewer): Renamed from _openCommitViewer.
960 * public/v3/components/chart-status-view.js:
961 (ChartStatusView.prototype.updateStatusIfNeeded): Fixed the bug that the blame range doesn't get set
962 on the initial page load when the selection range is set but the chart data hadn't been fetched yet.
964 * public/v3/components/commit-log-viewer.js:
965 (CommitLogViewer.prototype.view): Fixed the bug that we don't clear out the old list of commits while
966 loading the next set of commits to show as it looked as if the list was never updated.
967 (CommitLogViewer.prototype.render): Fixed the bug that the view always show the last repository name
968 even if there were nothing being fetched or commits to show.
970 * public/v3/components/pane-selector.js:
971 (PaneSelector.prototype.focus): Removed superfluous call to console.log.
973 * public/v3/models/data-model.js:
974 (DataModelObject.listForStaticMap): Generalized the code for all to fix the bug in Test.
975 (DataModelObject.all):
977 * public/v3/models/test.js:
978 (Test): Fixed the bug that this code was relying on the static map to be an array.
979 (Test.topLevelTests): Use newly added listForStaticMap to convert the dictionary to an array.
981 * public/v3/pages/chart-pane-status-view.js:
982 (ChartPaneStatusView): Always initialize _usedRevisionRange as a triple to simplify code elsewhere.
983 (ChartPaneStatusView.prototype.render): Invoke _revisionCallback when user clicks on a repository
984 expansion mark (>>). Also fixed click handler from the row since this made selecting revision range
985 on the view cumbersome. Now user has to explicitly click on the expansion mark (>>).
986 (ChartPaneStatusView.prototype._setRevisionRange): Now takes shouldNotify, from, and to as arguments
987 as this function must not invoke_revisionCallback inside _updateRevisionListForNewCurrentRepository.
988 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Use newly added setCurrentRepository
989 instead of manually invoking setCurrentRepository and updateRevisionListWithNotification.
990 (ChartPaneStatusView.prototype.setCurrentRepository): Fixed the bug that we weren't updating the
992 (ChartPaneStatusView.prototype.updateRevisionList): Renamed from updateRevisionListWithNotification
993 since we no longer call _revisionCallback. In general, callbacks are only meant to communicate user
994 initiated actions, and not program induced updates like this API so this was a bad pattern anyway.
995 ChartPane now explicitly updates the commit log viewer instead of relying on this function calling
996 _requestOpeningCommitViewer implicitly.
997 (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Extracted from
998 updateRevisionListWithNotification so that setCurrentRepository can also call this function.
1000 * public/v3/pages/chart-pane.js:
1001 (ChartPane.prototype._requestOpeningCommitViewer): Overrides ChartPaneBase's method. Open the same
1002 repository in other panes via ChartsPage.setOpenRepository.
1003 (ChartPane.prototype.setOpenRepository): This method is called when the user selected a repository in
1004 another pane. Open the same repository in this pane if it wasn't already open.
1006 * public/v3/pages/charts-page.js:
1007 (ChartsPage): Added this._currentRepositoryId.
1008 (ChartsPage.prototype.serializeState): Serialize _currentRepositoryId.
1009 (ChartsPage.prototype.updateFromSerializedState): Set the commit log viewer's
1010 (ChartsPage.prototype.setOpenRepository): Added.
1012 * tests/api-measurement-set.js: Fixed a test after r198479.
1014 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
1016 V3 Perf Dashboard should automatically select initial range when creating a new task
1017 https://bugs.webkit.org/show_bug.cgi?id=155677
1019 Reviewed by Joseph Pecoraro.
1021 Select the entire range of points for which the analysis task is created by default so that creating
1022 a test group to confirm the regression / progression is easy.
1024 * public/v3/pages/analysis-task-page.js:
1025 (AnalysisTaskPage): Added a boolean flag which indicates the user had modified main chart's selection.
1026 * public/v3/pages/analysis-task-page.js:
1027 (AnalysisTaskPage.prototype.render): Set the main chart's selection to the entire range of points in
1028 the analysis task if the user had never modified selection.
1029 (AnalysisTaskPage.prototype._chartSelectionDidChange): This callback is invoked only when the user had
1030 modified the selection so set _selectionWasModifiedByUser true here unconditionally.
1032 2016-03-19 Ryosuke Niwa <rniwa@webkit.org>
1034 Associated commits don't immediately show up on an analysis task page
1035 https://bugs.webkit.org/show_bug.cgi?id=155692
1037 Reviewed by Darin Adler.
1039 The bug was caused by resolveCommits in AnalysisTask._constructAnalysisTasksFromRawData not being
1040 able to find the matching commit log if the commit log had been created by the charts which don't
1041 set the remote identifiers on each CommitLog objects.
1043 Fixed the bug by modifying /api/measurement-set to include the commit ID, and making CommitLog
1044 use the real database ID as its ID instead of a fake ID we create from repository and revision.
1046 Also added a bunch of Mocha unit tests for AnalysisTask.fetchAll.
1048 * public/api/measurement-set.php:
1049 (MeasurementSetFetcher::execute_query): Fetch commit_id.
1050 (MeasurementSetFetcher::format_run): Use pass-by-reference to avoid making a copy of the row.
1051 (MeasurementSetFetcher::parse_revisions_array): Include commit_id as the first item in the result.
1052 * public/v3/instrumentation.js:
1053 * public/v3/models/analysis-task.js:
1054 (AnalysisTask): Fixed a bug that _buildRequestCount and _finishedBuildRequestCount could be kept
1055 as strings and hasPendingRequests() could return a wrong result because it would perform string
1056 inequality instead of numerical inequality.
1057 (AnalysisTask.prototype.updateSingleton): Ditto.
1058 (AnalysisTask.prototype.dissociateCommit):
1059 (AnalysisTask._constructAnalysisTasksFromRawData):
1060 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Use findById now that CommitLog
1061 objects all use the same id as the database id.
1062 * public/v3/models/commit-log.js:
1064 (CommitLog.prototype.remoteId): Deleted since we no longer create a fake id for commit logs for
1066 (CommitLog.findByRemoteId): Deleted.
1067 (CommitLog.ensureSingleton): Deleted.
1068 (CommitLog.fetchBetweenRevisions):
1070 * public/v3/models/data-model.js:
1071 (DataModelObject.clearStaticMap): Added to aid unit testing.
1072 (DataModelObject.ensureNamedStaticMap): Fixed a typo. Each map is a dictionary, not an array.
1073 * public/v3/models/metric.js:
1074 * public/v3/models/platform.js:
1075 * public/v3/models/root-set.js:
1076 (RootSet): Updated per the interface change in CommitLog.ensureSingleton.
1077 (MeasurementRootSet): Updated per /api/measurement-set change. Use the first value as the id.
1078 * public/v3/models/test.js:
1079 * unit-tests/analysis-task-tests.js: Added.
1080 (sampleAnalysisTask):
1081 (measurementCluster):
1082 * unit-tests/checkconfig.js: Added some assertion message to help aid diagnosing the failure.
1083 * unit-tests/measurement-adaptor-tests.js: Updated the sample data per the API change in
1084 /api/measurement-set and also added assertions for commit log ids.
1085 * unit-tests/measurement-set-tests.js:
1087 * unit-tests/resources: Added.
1088 * unit-tests/resources/mock-remote-api.js: Added. Extracted from measurement-set-tests.js to be
1089 used in analysis-task-tests.js.
1090 (assert.notReached.assert.notReached):
1091 (global.RemoteAPI.getJSON):
1092 (global.RemoteAPI.getJSONWithStatus):
1094 * unit-tests/resources/v3-models.js: Added. Extracted from measurement-set-tests.js to be used in
1095 analysis-task-tests.js and added more imports as needed.
1099 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1101 Build fix after r198464.
1103 * public/v3/components/analysis-results-viewer.js:
1104 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
1106 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1108 Build fix after r198234.
1110 * public/api/commits.php:
1111 (main): Typo: fetch_latest_reported -> fetch_last_reported.
1112 * public/include/commit-log-fetcher.php:
1113 (CommitLogFetcher::format_single_commit): commits should be an array.
1115 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1117 Perf Dashboard v3 confuses better and worse on A/B task page
1118 https://bugs.webkit.org/show_bug.cgi?id=155675
1119 <rdar://problem/25208723>
1121 Reviewed by Joseph Pecoraro.
1123 The analysis results viewer on v3 UI sometimes treats regressions as progressions and vice versa when
1124 the first set (i.e. set A) of the revisions used in an A/B testing never appears in the original graph,
1125 and its latest commit time matches that of the second set, which appears in the original graph.
1127 Because the analysis results viewer compares results in the increasing row number, this results in
1128 B to be compared to A instead of A to be compared to B. Fixed the bug by preventing the wrong ordering
1129 to occur in _buildRowsForPointsAndTestGroups by always inserting a root set A before B when B appears
1130 and A doesn't appear in the original graph.
1132 * public/v3/components/analysis-results-viewer.js:
1133 (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Remember the succeeding root set B
1134 when creating an entry for root set A.
1135 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Fixed the bug. Also un-duplicated
1136 the code to create a new row.
1137 (AnalysisResultsViewer.RootSetInTestGroup): Now takes a succeeding root set. e.g. it's B for A and
1138 undefined for B in A/B testing.
1139 (AnalysisResultsViewer.RootSetInTestGroup.prototype.succeedingRootSet): Added.
1140 * public/v3/components/time-series-chart.js:
1141 (TimeSeriesChart.computeTimeGrid): Fixed the bug that we would end up showing 0 AM instead of dates
1142 when both dates and months change.
1144 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1146 Add unit tests for measurement-set.js and measurement-adapter.js
1147 https://bugs.webkit.org/show_bug.cgi?id=155673
1149 Reviewed by Daniel Bates.
1151 Add tests which were supposed to be added in r198462.
1153 * unit-tests/measurement-adaptor-tests.js: Added.
1154 * unit-tests/measurement-set-tests.js: Added.
1155 (assert.notReached): Added.
1156 (global.RemoteAPI.getJSON): Added.
1157 (global.RemoteAPI.getJSONWithStatus): Added. A mock.
1159 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1161 Add unit tests for measurement-set.js and measurement-adapter.js
1162 https://bugs.webkit.org/show_bug.cgi?id=155673
1164 Reviewed by Darin Adler.
1166 Added mocha unit tests for MeasurementSet and MeasurementAdapter classes along with the necessary
1167 refactoring to run these tests in node.
1169 getJSON and getJSONStatus are now under RemoteAPI so that unit tests can mock them.
1171 Removed the dependency on v2 UI's TimeSeries and Measurement class by adding a new implementation
1172 of TimeSeries in v3 and removing the dependency on Measurement in chart-pane-status-view.js with
1173 new helper methods on Build and CommitLog.
1175 Many js files now use 'use strict' (node doesn't support class syntax in non-strict mode) and
1176 module.exports to export symbols in node's require function.
1178 * public/v3/index.html:
1179 * public/v3/main.js:
1180 * public/v3/models/analysis-results.js:
1181 (AnalysisResults.fetch):
1182 * public/v3/models/analysis-task.js:
1183 (AnalysisTask.fetchAll):
1184 * public/v3/models/builder.js:
1186 (Build.prototype.builder): Added. Used by ChartPaneStatusView.
1187 (Build.prototype.buildNumber): Ditto.
1188 (Build.prototype.buildTime): Ditto.
1189 * public/v3/models/commit-log.js:
1190 (CommitLog.prototype.diff): Ditto.
1191 (CommitLog.fetchBetweenRevisions):
1192 * public/v3/models/data-model.js:
1193 (DataModelObject.cachedFetch):
1194 * public/v3/models/measurement-adaptor.js:
1195 (MeasurementAdaptor.prototype.applyToAnalysisResults): Renamed from adoptToAnalysisResults.
1196 (MeasurementAdaptor.prototype.applyTo): Renamed from adoptToSeries. Now shares a lot more
1197 code with applyToAnalysisResults. The code to set 'series' and 'seriesIndex' has been moved
1198 to TimeSeries.append. 'measurement' is no longer needed as this patch removes its only use
1199 in ChartPaneStatusView.
1200 * public/v3/models/measurement-cluster.js:
1201 (MeasurementCluster.prototype.addToSeries): Use TimeSeries.append instead of directly mutating
1203 * public/v3/models/measurement-set.js:
1204 (Array.prototype.includes): Added a polyfill for node.
1205 (MeasurementSet.prototype._fetchSecondaryClusters): Removed a bogus assertion. When fetchBetween
1206 is called with a mixture of clusters that have been fetched and not fetched, this assertion fails.
1207 (MeasurementSet.prototype._fetch):
1208 (TimeSeries.prototype.findById): Moved to time-series.js.
1209 (TimeSeries.prototype.dataBetweenPoints): Ditto.
1210 (TimeSeries.prototype.firstPoint): Ditto.
1211 (TimeSeries.prototype.fetchedTimeSeries): Moved the code to extend the last point to TimeSeries'
1213 * public/v3/models/repository.js:
1214 * public/v3/models/root-set.js:
1215 (MeasurementRootSet): Ignore repositories that had not been defined (e.g. it could be added after
1216 manifest.json had been downloaded but before a given root set is created for an A/B testing).
1217 * public/v3/models/time-series.js:
1218 (TimeSeries): Added.
1219 (TimeSeries.prototype.append): Added.
1220 (TimeSeries.prototype.extendToFuture): Added.
1221 (TimeSeries.prototype.firstPoint): Moved from measurement-set.js.
1222 (TimeSeries.prototype.lastPoint): Added.
1223 (TimeSeries.prototype.previousPoint): Added.
1224 (TimeSeries.prototype.nextPoint): Added.
1225 (TimeSeries.prototype.findPointByIndex): Added.
1226 (TimeSeries.prototype.findById): Moved from measurement-set.js.
1227 (TimeSeries.prototype.findPointAfterTime): Added.
1228 (TimeSeries.prototype.dataBetweenPoints): Moved from measurement-set.js.
1229 * public/v3/pages/chart-pane-status-view.js:
1230 (ChartPaneStatusView.prototype.render): Use newly added helper functions on Build.
1231 (ChartPaneStatusView.prototype._formatTime): Added.
1232 (ChartPaneStatusView.prototype.setCurrentRepository):
1233 (ChartPaneStatusView.prototype.computeChartStatusLabels): Rewrote the code using RootSet object on
1234 currentPoint and previousPoint instead of Measurement class from v2 UI. Also sort the results using
1235 sortByNamePreferringOnesWithURL.
1236 * public/v3/remote.js:
1237 (RemoteAPI.getJSON): Moved under RemoteAPI.
1238 (RemoteAPI.getJSONWithStatus): Ditto.
1240 (PrivilegedAPI.requestCSRFToken):
1242 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1244 Add unit tests for config.json and statistics.js
1245 https://bugs.webkit.org/show_bug.cgi?id=155626
1247 Reviewed by Darin Adler.
1249 Added mocha unit tests for statistics.js and validating config.json. For segmentations, I've extracted
1250 real data from our internal perf dashboard.
1252 Also fixed some bugs covered by these new tests.
1254 * public/shared/statistics.js:
1255 (Statistics.movingAverage): Fixed a bug that forwardWindowSize was never used.
1256 (Statistics.exponentialMovingAverage): Fixed the bug that the moving average starts at 0. It should
1257 start at the first value instead.
1258 (.splitIntoSegmentsUntilGoodEnough): Fixed the bug that we may try to segment a time series into
1259 more parts than there are data points. Clearly, that doesn't make any sense.
1260 (.findOptimalSegmentation): Renamed local variables so that they're more descriptive, and rewrote
1261 the debugging code was the old code was emitting some useless data. Also fixed the bug that the length
1262 of "segmentation" was off by one (we need segmentCount + 1 elements in the array sine we always
1263 include the start of the first segment = 0 and the end of the last segment = values.length).
1264 (.SampleVarianceUpperTriangularMatrix):
1265 (Statistics): Modernized the export code.
1267 * tools/js/config.js: Added.
1269 (Config.prototype.configFilePath): Added.
1270 (Config.prototype.value): Added.
1271 (Config.prototype.path): Added.
1272 * tools/js/database.js: Added.
1274 (Database.prototype.connect): Added.
1275 (Database.prototype.disconnect): Added.
1276 * unit-tests: Added.
1277 * unit-tests/checkconfig.js: Added. Validates config.json. This is useful while setting up
1278 a local instance of the perf dashboard.
1279 * unit-tests/statistics-tests.js: Added.
1280 (assert.almostEqual): Added. Asserts that two floating values are within a given significant digits.
1285 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1287 Fix a typo which was supposed to be fixed in r198351.
1289 * public/v3/pages/analysis-task-page.js:
1290 (AnalysisTaskPage.prototype.render):
1292 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1294 An analysis task should be closed if a progression cause is identified
1295 https://bugs.webkit.org/show_bug.cgi?id=155549
1297 Reviewed by Chris Dumez.
1299 Since a progression is desirable, we should close an analysis task once its cause is identified.
1301 Also fix some typos.
1303 * init-database.sql: Fixed a typo.
1304 * public/api/analysis-tasks.php:
1305 * public/v3/models/analysis-task.js:
1306 (AnalysisTask.prototype.dissociateBug): Renamed from dissociateBug.
1307 * public/v3/pages/analysis-task-page.js:
1308 (AnalysisTaskPage.prototype.render):
1309 (AnalysisTaskPage.prototype._dissociateBug): Renamed from _dissociateBug.
1310 (AnalysisTaskPage.prototype._dissociateCommit): Fixed the typo in the alert.
1312 2016-03-16 Ryosuke Niwa <rniwa@webkit.org>
1314 Analysis task page should allow specifying commits that caused or fixed a regression or a progression
1315 https://bugs.webkit.org/show_bug.cgi?id=155529
1317 Reviewed by Chris Dumez.
1319 Added the capability to associate revisions that caused or fixed a progression or a regression for which
1320 an analysis task was created. Added task_commits that stores this relationship and added the backend
1321 support to retrieve this table in /api/analysis-tasks and an privileged API to update this table at
1322 /privileged-api/associate-commit.
1324 Also extracted a new component, MutableListView, out of AnalysisTaskPage to render and manipulate a list
1325 of mutable items, and used it to render the list of associated bugs and commits. The view takes a list of
1326 kinds (e.g. repositories or bug trackers), and accepts a pair of a kind and arbitrary text as a new item
1329 * init-database.sql: Added task_commits table.
1331 * public/api/analysis-tasks.php:
1333 (fetch_associated_data_for_tasks): Renamed from fetch_and_push_bugs_to_tasks now that it also fetches
1334 the list of commits associated with each analysis task by calling CommitLogFetcher::fetch_for_tasks.
1335 Also fixe the bug that we were not taking
1336 (format_task): No longer sets 'category' since the computation of category now depends on the list of
1337 commits associated with this analysis task which aren't available until fetch_associated_data_for_tasks.
1338 (determine_category): Added. Categorize any analysis tasks with "fixes" commits as "closed" and "causes"
1339 commits as "identified".
1341 * public/include/commit-log-fetcher.php:
1342 (CommitLogFetcher::__construct): Remove the unused instance variable.
1343 (CommitLogFetcher::fetch_for_tasks): Added. Fetches all commits associated with a list of analysis tasks.
1344 Assumes the caller (fetch_associated_data_for_tasks) had setup "fixes" and "causes" fields on each task.
1346 * public/privileged-api/associate-commit.php: Added. Updates task_commits table to associate or disassociate
1347 a commit with an analysis task. When the specified analysis task and the specified commit are already
1348 associated, we simply update the table instead of adding a duplicating entry or error. For dissociation,
1349 the front-end specifies the commit ID.
1352 * public/v3/index.html:
1353 * public/v3/components/mutable-list-view.js: Added. Used by the list associated bugs and commits.
1354 (MutableListView): Added.
1355 (MutableListView.prototype.setList): Added.
1356 (MutableListView.prototype.setKindList): Added.
1357 (MutableListView.prototype.setAddCallback): Added. This callback is invoked when the user tries to add
1358 a new item to the list.
1359 (MutableListView.prototype.render): Added.
1360 (MutableListView.prototype._submitted): Added.
1361 (MutableListView.cssTemplate):
1362 (MutableListView.htmlTemplate):
1363 (MutableListItem): Added. RemovalLink could be a hyperlink or a callback and gets involved when the user
1364 tries to delete this item.
1365 (MutableListItem.prototype.content):
1367 * public/v3/models/analysis-task.js:
1368 (AnalysisTask): Added the support of the list of commits that fixed and caused changes.
1369 (AnalysisTask.prototype.updateSingleton): Ditto.
1370 (AnalysisTask.prototype.causes): Added.
1371 (AnalysisTask.prototype.fixes): Added.
1372 (AnalysisTask.prototype.associateCommit): Added. Use the API added at /privileged-api/associate-commit
1373 to associate a new commit with this analysis task. Each commit has either caused or fixed the change.
1374 (AnalysisTask.prototype.dissociateCommit): Added. Use the same API to disassociate each commit.
1375 (AnalysisTask._constructAnalysisTasksFromRawData): Find all commits associated with each analysis task.
1376 Because commit log objects use a fake ID fdue to /api/measurement-set not providing commit IDs, we must
1377 use CommitLog.findByRemoteId to find each commit instead of usual CommitLog.findById.
1378 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Added.
1380 * public/v3/models/build-request.js:
1381 (BuildRequest.prototype.hasFinished): Renamed from hasCompleted since it was confusing for this._status
1382 being "completed" wasn't a necessary condition for this function to return true.
1384 * public/v3/models/commit-log.js:
1385 (CommitLog): Added the static map for actual commit ID instead of a fake ID created in ensureSingleton.
1386 (CommitLog.prototype.remoteId): Added. Returns the real commit ID.
1387 (CommitLog.findByRemoteId): Added. Finds an CommitLog object using the real ID.
1389 * public/v3/models/test-group.js:
1390 (TestGroup.prototype.hasFinished): Renamed from hasCompleted to match the rename in BuildRequest.
1392 * public/v3/pages/analysis-task-page.js:
1393 (AnalysisTaskPage): Added lists for the commits that fixed and caused the change using MutableListView.
1394 Also adopted MutableListView for the list of associated bugs.
1395 (AnalysisTaskPage.prototype.render): Added the code to populate the newly added lists.
1396 (AnalysisTaskPage.prototype._makeCommitListItem): Added.
1397 (AnalysisTaskPage.prototype._associateBug): Now this is a callback from MutableListView.
1398 (AnalysisTaskPage.prototype._associateCommit): Added.
1399 (AnalysisTaskPage.prototype._dissociateCommit): Added.
1400 (AnalysisTaskPage.htmlTemplate):
1401 (AnalysisTaskPage.cssTemplate):
1403 * public/v3/remote.js:
1404 (getJSON): Spit out the entire responseText when JSON failed to parse to make debugging easier.
1406 2016-03-15 Ryosuke Niwa <rniwa@webkit.org>
1408 Extract the code to format commit logs into its own PHP file
1409 https://bugs.webkit.org/show_bug.cgi?id=155514
1411 Rubber-stamped by Chris Dumez.
1413 Extracted CommitLogFetcher out of /api/commits so that it could be used in analysis-tasks.php
1414 in the future to support associating cause/fix for each analysis task.
1416 * public/api/commits.php:
1417 * public/include/commit-log-fetcher.php: Added.
1419 (CommitLogFetcher::__construct): Added.
1420 (CommitLogFetcher::repository_id_from_name): Added.
1421 (CommitLogFetcher::fetch_between): Added.
1422 (CommitLogFetcher::fetch_oldest): Added.
1423 (CommitLogFetcher::fetch_latest): Added.
1424 (CommitLogFetcher::fetch_last_reported): Added.
1425 (CommitLogFetcher::fetch_revision): Added.
1426 (CommitLogFetcher::commit_for_revision): Added.
1427 (CommitLogFetcher::format_single_commit): Added.
1428 (CommitLogFetcher::format_commit): Added.
1430 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
1432 Build fix after r196870.
1434 * public/include/report-processor.php:
1436 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
1438 Add Size metric to perf dashboard
1439 https://bugs.webkit.org/show_bug.cgi?id=155266
1441 Reviewed by Chris Dumez.
1443 Added the "Size" metric and use bytes as its unit.
1445 * public/js/helper-classes.js:
1447 * public/v2/data.js:
1448 (RunsData.unitFromMetricName):
1450 2016-02-20 Ryosuke Niwa <rniwa@webkit.org>
1452 Add the support for universal slave password
1453 https://bugs.webkit.org/show_bug.cgi?id=154476
1455 Reviewed by David Kilzer.
1457 Added the support for universalSlavePassword.
1460 * public/include/report-processor.php:
1461 (ReportProcessor::process):
1462 (ReportProcessor::authenticate_and_construct_build_data): Extracted from process().
1464 2016-02-19 Ryosuke Niwa <rniwa@webkit.org>
1466 Analysis tasks page complains about missing repository but with a wrong name
1467 https://bugs.webkit.org/show_bug.cgi?id=154468
1469 Reviewed by Chris Dumez.
1471 Fixed the bug by using the right variable in the template literal.
1473 * public/v3/components/customizable-test-group-form.js:
1474 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use querySelector here since Chrome doesn't have
1475 getElementsByClassName on ShadowRoot.
1476 * public/v3/pages/analysis-task-page.js:
1477 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Use name which is the name of
1480 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1482 Revert an unintended change made in the previous commit.
1484 * init-database.sql:
1486 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1488 Perf dashboard should let user cancel pending A/B testing and hide failed ones
1489 https://bugs.webkit.org/show_bug.cgi?id=154433
1491 Reviewed by Chris Dumez.
1493 Added a button to hide a test group in the details view (the bottom table) in the analysis task page, and
1494 "Show hidden tests" link to show the hidden test groups on demand. When a test group is hidden, all pending
1495 requests in the group will also be canceled since a common scenario of using this feature is that the user
1496 had triggered an useless A/B testing; e.g. all builds will fail, wrong, etc... We can revisit and add the
1497 capability to just cancel the pending requests and leaving the group visible later if necessary.
1499 Run `ALTER TYPE build_request_status_type ADD VALUE 'canceled';` to add the new type.
1501 * init-database.sql: Added testgroup_hidden column to analysis_test_groups table and added 'canceled'
1502 as a value to build_request_status_type table.
1503 * public/api/test-groups.php:
1504 (format_test_group): Added 'hidden' field in the JSON result.
1505 * public/privileged-api/update-test-group.php:
1506 (main): Added the support for updating testgroup_hidden column. When this column is set to true, also
1507 cancel all pending build requests (by setting its request_status to 'canceled' which will be ignore by
1508 the syncing script).
1509 * public/v3/components/test-group-results-table.js:
1510 (TestGroupResultsTable.prototype.setTestGroup): Reset _renderedTestGroup here so that the next call to
1511 render() will update the table; e.g. when build requests' status change from 'Pending' to 'Canceled'.
1512 * public/v3/models/build-request.js:
1513 (BuildRequest.prototype.hasCompleted): A build request is considered complete/finished if it's canceled.
1514 (BuildRequest.prototype.hasPending): Added.
1515 (BuildRequest.prototype.statusLabel): Handle 'canceled' status.
1516 * public/v3/models/test-group.js:
1518 (TestGroup.prototype.updateSingleton): Added to update 'hidden' field.
1519 (TestGroup.prototype.isHidden): Added.
1520 (TestGroup.prototype.hasPending): Added.
1521 (TestGroup.prototype.hasPending): Added.
1522 (TestGroup.prototype.updateHiddenFlag): Added. Uses the privileged API to update testgroup_hidden column.
1523 The JSON API also updates the status of the 'pending' build requests in the group to 'canceled'.
1524 * public/v3/pages/analysis-task-page.js:
1525 (AnalysisTaskPage): Added _showHiddenTestGroups and _filteredTestGroups as instance variables.
1526 (AnalysisTaskPage.prototype._didFetchTestGroups):
1527 (AnalysisTaskPage.prototype._showAllTestGroups): Added.
1528 (AnalysisTaskPage.prototype._didUpdateTestGroupHiddenState): Extracted from _didFetchTestGroups.
1529 (AnalysisTaskPage.prototype._renderTestGroupList): Use the filtered list of test groups to show the list
1530 of test groups. When all test groups are shown, we would first show the hidden ones after the regular ones.
1531 (AnalysisTaskPage.prototype._createTestGroupListItem): Extracted from _renderTestGroupList.
1532 (AnalysisTaskPage.prototype._renderTestGroupDetails): Update the text inside the button to hide the test
1533 group. Also show a warning text that the pending requests will be canceled if there are any.
1534 (AnalysisTaskPage.prototype._hideCurrentTestGroup): Added.
1535 (AnalysisTaskPage.cssTemplate): Updated the style.
1537 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1539 The rows in the analysis results table should be expandable
1540 https://bugs.webkit.org/show_bug.cgi?id=154427
1542 Reviewed by Chris Dumez.
1544 Added "(Expand)" link between rows that have hidden points. Upon click it inserts the hidden rows.
1546 We insert around five rows at a time when there are hundreds of hidden points but we also avoid leaving
1547 behind expandable rows of less than two rows.
1549 Also fixed a bug in CustomizableTestGroupForm that getElementsById would throw in the shipping Safari
1550 because getElementsById doesn't exist on Element.prototype by using class name instead.
1552 * public/v3/components/analysis-results-viewer.js:
1553 (AnalysisResultsViewer):
1554 (AnalysisResultsViewer.prototype.setCurrentTestGroup): Removed superfluous call to render().
1555 (AnalysisResultsViewer.prototype.setPoints): Always show the start and the end points.
1556 (AnalysisResultsViewer.prototype.buildRowGroups):
1557 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Add an instance of ExpandableRow which
1558 shows a "(Expand)" link to show hidden rows here.
1559 (AnalysisResultsViewer.prototype._expandBetween): Added. Expands rows between two points.
1560 (AnalysisResultsViewer.cssTemplate): Added rules for "(Expand)" links.
1561 (AnalysisResultsViewer.ExpandableRow): Added.
1562 (AnalysisResultsViewer.ExpandableRow.prototype.resultContent): Added. Overrides what's in the results column.
1563 (AnalysisResultsViewer.ExpandableRow.prototype.heading): Added. Generates "(Expand)" link.
1565 * public/v3/components/customizable-test-group-form.js:
1566 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use getElementsByClassName instead of
1568 (CustomizableTestGroupForm.prototype._classForLabelAndRepository): Renamed from _idForLabelAndRepository.
1569 (CustomizableTestGroupForm._constructRevisionRadioButtons): Set class name instead of id.
1571 * public/v3/components/results-table.js:
1572 (ResultsTable.prototype.render): Don't generate radio buttons to select a row when root set is missing;
1573 e.g. for rows that show "(Expand)" links.
1575 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1577 Statistically significant A/B testing results should be color coded in details view
1578 https://bugs.webkit.org/show_bug.cgi?id=154414
1580 Reviewed by Chris Dumez.
1582 Color code the statistically significant comparisions in TestGroupResultsTable as done in the analysis
1585 * public/v3/components/customizable-test-group-form.js:
1586 (CustomizableTestGroupForm.cssTemplate): Build fix after r196768.
1587 * public/v3/components/test-group-results-table.js:
1588 (TestGroupResultsTable.prototype.buildRowGroups): Add the status as a class name.
1589 (TestGroupResultsTable.cssTemplate): Added styles to color-code statistically significant results.
1591 2016-02-17 Ryosuke Niwa <rniwa@webkit.org>
1593 v3 UI should allow custom revisions for A/B testing
1594 https://bugs.webkit.org/show_bug.cgi?id=154379
1596 Reviewed by Chris Dumez.
1598 Added the capability to customize revisions selected in the overview chart and the results viewer.
1600 Newly added CustomizableTestGroupForm is responsible for allowing users to modify the set of revisions in
1601 a new A/B testing group. Unlike TestGroupForm which doesn't know anything about which revisions are selected
1602 for each project/repository, CustomizableTestGroupForm is aware of the list of revisions used in each set.
1604 The list of revisions used in each set is represented by RootSet if users had not customized them, and
1605 CustomRootSet otherwise; the latter was added since regular RootSet object requires CommitLog and other
1606 DataModelObjects which are hard to create without corresponding database entries.
1608 * public/v3/components/customizable-test-group-form.js: Added.
1609 (CustomizableTestGroupForm): Added.
1610 (CustomizableTestGroupForm.prototype.setRootSetMap): Added.
1611 (CustomizableTestGroupForm.prototype._submitted): Overrides the superclass' method.
1612 (CustomizableTestGroupForm.prototype._customize): Ditto. Unlike TestGroupForm's callback, this class'
1613 callback passes in a root set map as the third argument.
1614 (CustomizableTestGroupForm.prototype._computeRootSetMap): Added. Returns this._rootSetMap, which is set by
1615 AnalysisTaskPage if user had not customized the root sets. Otherwise return a new map with CustomRootSet's.
1616 (CustomizableTestGroupForm.prototype.render): Added. Creates a table to allow customization of root sets.
1617 (CustomizableTestGroupForm._constructRevisionRadioButtons): Added.
1618 (CustomizableTestGroupForm._createRadioButton): Added.
1619 (CustomizableTestGroupForm.cssTemplate): Added.
1620 (CustomizableTestGroupForm.formContent): Added. This method is called by TestGroupForm.htmlTemplate.
1621 * public/v3/components/test-group-form.js:
1622 (TestGroupForm): Updated the various methods to not directly mutate DOM. Store the state in instance
1623 variables and update DOM in render() as done elsewhere.
1624 (TestGroupForm.prototype.setNeedsName): Deleted. We no longer need this flag since TestGroupForm which is
1625 used for retries never needs a name and CustomizableTestGroupForm which is used to create a new test group
1626 always requires a name.
1627 (TestGroupForm.prototype.setDisabled):
1628 (TestGroupForm.prototype.setLabel):
1629 (TestGroupForm.prototype.setRepetitionCount):
1630 (TestGroupForm.prototype.render): Added.
1631 (TestGroupForm.prototype._submitted): Moved the code to prevent the default action has been moved to the
1632 constructor since this method is overridden by CustomizableTestGroupForm.
1633 (TestGroupForm.cssTemplate): Added.
1634 (TestGroupForm.htmlTemplate):
1635 (TestGroupForm.formContent): Extracted from htmlTemplate.
1636 * public/v3/index.html:
1637 * public/v3/models/repository.js:
1638 (Repository.sortByNamePreferringOnesWithURL): Added.
1639 * public/v3/models/root-set.js:
1640 (RootSet.prototype.revisionForRepository): Added so that _createTestGroupAfterVerifyingRootSetList can retrieve
1641 the revision information from CustomRootSet without going through CommitLog objects since CustomRootSet doesn't
1642 have associated CommitLog objects.
1643 (CustomRootSet): Added. Used by CustomizableTestGroupForm to create a custom root map since regular RootSet
1644 requires CommitLog and other related objects which are hard to create without database entries.
1645 (CustomRootSet.prototype.setRevisionForRepository): Added.
1646 (CustomRootSet.prototype.repositories): Added.
1647 (CustomRootSet.prototype.revisionForRepository): Added.
1648 * public/v3/pages/analysis-task-page.js:
1650 (AnalysisTaskPage.prototype.render): Removed the reference to v2 UI since v3 UI is now strictly more powerful
1651 than v2 UI. Also update the root set maps in each form here.
1652 (AnalysisTaskPage.prototype._retryCurrentTestGroup): No longer takes unused name argument as it got removed
1654 (AnalysisTaskPage.prototype._chartSelectionDidChange): No longer updates the disabled-ness here since it's now
1655 done in render() via setRootSetMap().
1656 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Now takes rootSetMap as an argument.
1657 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): No longer updates the disabled-ness here
1658 since it's now done in render() via setRootSetMap().
1659 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Now takes rootSetMap as an argument.
1660 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Take a dictionary of root set labels
1661 such as A and B, which maps to a RootSet or a newly-added CustomRootSet.
1662 (AnalysisTaskPage.htmlTemplate): Use customizable-test-group-form for creating a new A/B testing group. Retry
1663 form will continue to use TestGroupForm since customizing revisions is non-sensical in retries.
1664 (AnalysisTaskPage.cssTemplate): Updated the style.
1666 2016-02-16 Ryosuke Niwa <rniwa@webkit.org>
1668 v3 UI has the capability to schedule an A/B testing in a specific range
1669 https://bugs.webkit.org/show_bug.cgi?id=154329
1671 Reviewed by Chris Dumez.
1673 Extended AnalysisTaskChartPane and ResultsTable so that users can select a range of points in either
1674 the overview chart pane and the results viewer table. Extracted TestGroupForm out of the analysis task
1675 page and used right below those two components in the analysis task page.
1677 * public/v3/components/results-table.js:
1679 (ResultsTable.prototype.setRangeSelectorLabels): Added.
1680 (ResultsTable.prototype.setRangeSelectorCallback): Added.
1681 (ResultsTable.prototype.selectedRange): Added.
1682 (ResultsTable.prototype._rangeSelectorClicked): Added.
1683 (ResultsTable.prototype.render): Generate radio boxes to select a range.
1685 * public/v3/components/test-group-form.js:
1687 (TestGroupForm.prototype.setStartCallback): Added.
1688 (TestGroupForm.prototype.setNeedsName): Added.
1689 (TestGroupForm.prototype.setDisabled): Added.
1690 (TestGroupForm.prototype.setLabel): Added.
1691 (TestGroupForm.prototype.setRepetitionCount): Added.
1692 (TestGroupForm.prototype._submitted): Added.
1693 (TestGroupForm.htmlTemplate): Extracted from AnalysisTaskPage.htmlTemplate.
1695 * public/v3/index.html:
1697 * public/v3/pages/analysis-task-page.js:
1698 (AnalysisTaskChartPane.prototype._mainSelectionDidChange): Added. Delegates the work to AnalysisTaskPage.
1699 (AnalysisTaskChartPane.prototype.selectedPoints): Added.
1701 (AnalysisTaskPage.prototype.title):
1702 (AnalysisTaskPage.prototype.render):
1703 (AnalysisTaskPage.prototype._renderTestGroupDetails): Use TestGroupForm's methods instead of mutating DOM.
1704 (AnalysisTaskPage.prototype._retryCurrentTestGroup):
1705 (AnalysisTaskPage.prototype._chartSelectionDidChange): Added.
1706 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Added.
1707 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): Added.
1708 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Added.
1709 (AnalysisTaskPage.prototype._createRetryNameForTestGroup):
1710 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Extracted from _retryCurrentTestGroup
1711 so that we can call it in _createNewTestGroupFromChart and _createNewTestGroupFromViewer.
1712 (AnalysisTaskPage.htmlTemplate):
1714 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
1716 Extract the code specific to v2 UI out of shared statistics.js
1717 https://bugs.webkit.org/show_bug.cgi?id=154277
1719 Reviewed by Chris Dumez.
1721 Extracted statistics-strategies.js out of statistics.js for v2 UI and detect-changes.js. The intent is to
1722 deprecate this file once we implement refined statistics tools in v3 UI and adopt it in detect-changes.js.
1724 * public/shared/statistics.js:
1725 (Statistics.movingAverage): Extracted from the "Simple Moving Average" strategy.
1726 (Statistics.cumultaiveMovingAverage): Extracted from the "Cumulative Moving Average" strategy.
1727 (Statistics.exponentialMovingAverage): Extracted from the "Exponential Moving Average" strategy.
1728 Use a temporary "movingAverage" to keep the last moving average instead of relying on the previous
1729 entry in "averages" array to avoid special casing an array of length 1 and starting the loop at i = 1.
1730 (Statistics.segmentTimeSeriesGreedyWithStudentsTTest): Extracted from "Segmentation: Recursive t-test"
1731 strategy. Don't create the list of averages to match segmentTimeSeriesByMaximizingSchwarzCriterion here.
1732 It's done in newly added averagesFromSegments.
1733 (Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Extracted from
1734 "Segmentation: Schwarz criterion" strategy.
1735 (.recursivelySplitIntoTwoSegmentsAtMaxTIfSignificantlyDifferent): Just store the start index to match
1737 (App.Pane.updateStatisticsTools):
1738 (App.Pane._computeMovingAverageAndOutliers):
1739 * public/v2/data.js:
1740 * public/v2/index.html:
1741 * public/v2/statistics-strategies.js: Added.
1742 (StatisticsStrategies.MovingAverageStrategies): Added.
1743 (averagesFromSegments): Extracted from "Segmentation: Schwarz criterion" strategy. Now used by both
1744 "Segmentation: Recursive t-test" and "Segmentation: Schwarz criterion" strategies.
1745 (StatisticsStrategies.EnvelopingStrategies): Moved from Statistics.EnvelopingStrategies.
1746 (StatisticsStrategies.TestRangeSelectionStrategies): Moved from Statistics.TestRangeSelectionStrategies.
1747 (createWesternElectricRule): Moved from statistics.js.
1748 (countValuesOnSameSide): Ditto.
1749 (StatisticsStrategies.executeStrategy): Moved from Statistics.executeStrategy.
1750 * tools/detect-changes.js:
1751 (computeRangesForTesting):
1753 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
1755 v1 UI and v2 UI should share statistics.js
1756 https://bugs.webkit.org/show_bug.cgi?id=154262
1758 Reviewed by Chris Dumez.
1760 Share statistics.js between v1 and v2 UI.
1762 * public/index.html:
1763 * public/js/shared.js: Deleted.
1764 * public/js/statistics.js: Removed.
1765 * public/shared: Added.
1766 * public/shared/statistics.js: Moved from Websites/perf.webkit.org/public/v2/js/statistics.js.
1767 * public/v2/index.html:
1768 * public/v2/js/statistics.js: Removed.
1769 * public/v3/index.html:
1770 * tools/detect-changes.js:
1772 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
1774 v3 UI sometimes shows same dates twice on the x-axis of time series charts
1775 https://bugs.webkit.org/show_bug.cgi?id=154210
1777 Reviewed by Chris Dumez.
1779 The bug was caused by the label generation code in TimeSeriesChart.computeTimeGrid never emitting hours.
1781 Use hours instead of dates as labels when the current time's date is same as the previous label's date.
1782 Always include dates before entering this mode to avoid just having hours as labels on the entire x-axis.
1784 * public/v3/components/time-series-chart.js:
1785 (TimeSeriesChart.prototype._renderXAxis): Slightly increase the "average" width of x-axis label.
1786 (TimeSeriesChart.computeTimeGrid): See above. Also assert that the number of labels we generate never
1787 exceeds maxLabels as a sanity check.
1788 (TimeSeriesChart._timeIterators): Added an iterator that increments by two hours for zoomed graphs.
1790 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
1792 v3 UI should show status and associated bugs on analysis task pages
1793 https://bugs.webkit.org/show_bug.cgi?id=154212
1795 Reviewed by Chris Dumez.
1797 Added the capability to see and modify the status and the list of associated of bugs on analysis task pages.
1799 Also added the list of related tasks, which are analysis tasks associated with the same bug or have
1800 overlapping time ranges with the same test metric but on a potentially different platform.
1802 In addition, categorize analysis tasks with the status of "no change" or "inconclusive" as "closed" as no
1803 further action can be taken (users can bring them back to non-closed state without any restrictions).
1805 * public/api/analysis-tasks.php:
1806 (format_task): Categorize 'unchanged' and 'inconclusive' analysis tasks as closed.
1808 * public/privileged-api/associate-bug.php:
1809 (main): Added shouldDelete as a new mechanism to disassociate a bug since v3 UI shares a single Bug object
1810 between multiple analysis tasks (as it should have been in the first place).
1812 * public/v3/components/chart-pane-base.js:
1814 (ChartPaneBase.prototype._fetchAnalysisTasks): Since each analysis task's change type (status/result) could
1815 change, we need to create annotation objects during each render() call.
1816 (ChartPaneBase.prototype.render):
1817 (ChartPaneBase.prototype._renderAnnotations): Extracted from ChartPaneBase.prototype._fetchAnalysisTasks to
1818 do that. I was afraid of the perf impact of this but it doesn't seem to be an issue in my testing.
1819 (ChartPaneBase.cssTemplate): Removed superfluous margins (moved to ChartPane.cssTemplate) around the charts
1820 since they are only useful in the charts page.
1822 * public/v3/models/analysis-task.js:
1824 (AnalysisTask.prototype.updateSingleton): Added a comment as to why object.result cannot be renamed to
1825 object.changeType in the JSON API.
1826 (AnalysisTask.prototype.updateName): Added.
1827 (AnalysisTask.prototype.updateChangeType): Added.
1828 (AnalysisTask.prototype._updateRemoteState): Added.
1829 (AnalysisTask.prototype.associateBug): Added.
1830 (AnalysisTask.prototype.disassociateBug): Added.
1831 (AnalysisTask.fetchRelatedTasks): Added. See above for the criteria of related-ness.
1833 * public/v3/pages/analysis-task-page.js:
1835 (AnalysisTaskPage.prototype.updateFromSerializedState):
1836 (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): Extracted from updateFromSerializedState.
1837 (AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks): Added.
1838 (AnalysisTaskPage.prototype.render): Render the list of associated bugs, the list of bug trackers (so that
1839 users can use it to associate with a new bug), and the list of related analysis tasks.
1840 (AnalysisTaskPage.prototype._renderTestGroupList): Extracted from render since it was getting too long.
1841 (AnalysisTaskPage.prototype._renderTestGroupDetails): Ditto.
1842 (AnalysisTaskPage.prototype._updateChangeType): Added.
1843 (AnalysisTaskPage.prototype._associateBug): Added.
1844 (AnalysisTaskPage.prototype._disassociateBug): Added.
1845 (AnalysisTaskPage.htmlTemplate): Added various elements to show and modify the status, associate bugs,
1846 and a list of related analysis tasks.
1847 (AnalysisTaskPage.cssTemplate): Added various styles for those form controls.
1849 * public/v3/pages/chart-pane.js:
1850 (ChartPane.cssTemplate): Moved the margins from ChartPaneBase.cssTemplate.
1852 2016-02-12 Ryosuke Niwa <rniwa@webkit.org>
1854 Perf dashboard should allow renaming analysis tasks and test groups
1855 https://bugs.webkit.org/show_bug.cgi?id=154200
1857 Reviewed by Chris Dumez.
1859 Allow editing names of analysis tasks and A/B testing groups in the v3 UI.
1861 Added the support for updating the name to the privileged API at /privileged-api/update-analysis-task
1862 and added a new prevailed API to update A/B testing groups at /privileged-api/update-test-group.
1864 * public/privileged-api/update-analysis-task.php: Added the support for renaming the analysis task.
1867 * public/privileged-api/update-test-group.php: Added. Supports updating the test group's name.
1870 * public/v3/components/editable-text.js: Added.
1871 (EditableText): Added. A new editable text label control. It looks like a text node with "(Edit)" link
1872 at the end which allow users to go into the "editing mode", which reveals an input element.
1873 The user can exit the editing mode by either moving the focus away from the control or clicking on
1874 "(Save)" at the end. It calls _updateCallback in the latter case.
1875 (EditableText.prototype.editedText): Returns the current value of the input element user.
1876 (EditableText.prototype.setText): Sets the label. This does not live-update the input element until
1877 the user exists the current editing mode and re-enters it.
1878 (EditableText.prototype.setStartedEditingCallback): Sets a callback which gets called when the user
1879 requested to enter the editing mode. Since EditableText relies on AnalysisTaskPage to render, this
1880 callback only exits to call EditableText.render() in AnalysisTask._didStartEditingTaskName.
1881 (EditableText.prototype.setUpdateCallback): Sets a callback which gets called when the user exits
1882 the editing mode by activating the "(Save)" link. This callback MUST return a promise upon resolution
1883 of which the control gets out of the editing mode. While the promise is in flight, the input element
1885 (EditableText.prototype.render): Updates various states of the elements. When _updatingPromise is not
1886 falsy, we make the input element readonly and show '(...)' on the link. Don't show the action link
1887 if the label is empty (e.g. analysis task or test group is still being fetched).
1888 (EditableText.prototype._didClick): Called when the user clicked on the action link. Enter the editing
1889 mode or save the edited label via _updateCallback.
1890 (EditableText.prototype._didBlur): Exit the editing mode without saving if the input element is not
1891 focused, there is no inflight promise returned by _updateCallback, and the action link "(Save)" does
1893 (EditableText.prototype._didUpdate): Called when exiting the editing mode.
1894 (EditableText.htmlTemplate):
1895 (EditableText.cssTemplate):
1897 * public/v3/index.html: Include newly added editable-text.js.
1899 * public/v3/models/analysis-task.js:
1900 (AnalysisTask.prototype.updateSingleton): Added.
1901 (AnalysisTask.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
1902 the analysis task from the sever.
1903 (AnalysisTask._constructAnalysisTasksFromRawData): Use ensureSingleton instead of manually calling
1904 findById since we need to update the name of the singleton object we found (via updateSingleton).
1906 * public/v3/models/bug.js:
1907 (Bug.ensureSingleton): Moved the code to compute the synthetic id from AnalysisTask's
1908 _constructAnalysisTasksFromRawData.
1909 (Bug.prototype.updateSingleton): Added. Just assert that nothing changes.
1911 * public/v3/models/build-request.js:
1912 (BuildRequest.prototype.updateSingleton): Added. Assert that the intrinsic values of a build request
1913 doesn't change and update status text, status url, and build id as they could change.
1915 * public/v3/models/commit-log.js:
1916 (CommitLog): Made the constructor argument conform to the convention of id, object pair so that we can
1917 use DataModelObject.ensureSingleton.
1918 (CommitLog.ensureSingleton):
1919 (CommitLog.prototype.updateSingleton): Extracted from CommitLog.ensureSingleton.
1921 * public/v3/models/data-model.js:
1922 (DataModelObject.ensureSingleton): Call newly added updateSingleton.
1923 (DataModelObject.prototype.updateSingleton):
1924 (LabeledObject): Removed the name map since it's never used (findByName is never called anywhere).
1925 (LabeledObject.prototype.updateSingleton): Added. Updates _name.
1926 (LabeledObject.findByName): Deleted.
1928 * public/v3/models/test-group.js:
1929 (TestGroup.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
1930 the test group from the sever.
1931 (TestGroup._createModelsFromFetchedTestGroups): Removed bogus code. A root set doesn't have a test
1932 group associated with it since multiple test groups can share a single root set (this property doesn't
1935 * public/v3/pages/analysis-task-page.js:
1936 (AnalysisTaskPage): Removed useless _taskId and added this._testGroupLabelMap and this._taskNameLabel.
1937 (AnalysisTaskPage.prototype.updateFromSerializedState): Cleanup.
1938 (AnalysisTaskPage.prototype._didFetchTask): Assert that this function is called exactly once.
1939 (AnalysisTaskPage.prototype.render): Use this._task.id() to show the v2 link. Use EditableText to show
1940 the names of the analysis task and the associated test groups. Hide the overview chart and the list of
1941 test groups (along with the retry/confirm button) when the analysis task failed to fetch. We always
1942 update the names of the analysis task and the associated test groups since they could be updated by
1944 (AnalysisTaskPage.prototype._didStartEditingTaskName): Added.
1945 (AnalysisTaskPage.prototype._updateTaskName): Added.
1946 (AnalysisTaskPage.prototype._updateTestGroupName): Added.
1947 (AnalysisTaskPage.htmlTemplate): Updated the style.
1949 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1951 Land the change that was supposed to be the part of r196463.
1953 * public/v3/pages/analysis-task-page.js:
1954 (AnalysisTaskPage.prototype._didFetchTestGroups): Select the latest test group by default.
1956 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1958 Refine v3 UI's analysis task page
1959 https://bugs.webkit.org/show_bug.cgi?id=154152
1961 Reviewed by Chris Dumez.
1963 This patch makes the following refinements to the analysis task page:
1964 - Always show the relative different of in-progress A/B testing.
1965 - Make the annotations (colored bars) in the chart open other analysis tasks.
1966 - Order the A/B testing groups in the reverse chronological order.
1967 - Select the time range corresponding to the current test group.
1969 * public/v3/components/analysis-results-viewer.js:
1970 (AnalysisResultsViewer.cssTemplate): Fixed the bug that pending and running testing groups are no longer
1971 colored after r196440. Use a slightly more opaque color for currently running groups compared to pending ones.
1973 * public/v3/components/chart-pane-base.js:
1974 (ChartPaneBase.prototype.setMainSelection): Added.
1975 (ChartPaneBase.prototype._openAnalysisTask): Moved the code from ChartPane._openAnalysisTask so that it can be
1976 reused in both AnalysisTaskChartPane and ChartPane (in charts page).
1977 (ChartPaneBase.prototype.router): Added. Overridden by each subclass.
1979 * public/v3/components/test-group-results-table.js:
1980 (TestGroupResultsTable.prototype.buildRowGroups): Always show the summary (relative difference of A to B) as
1981 long as there are some results in each set.
1983 * public/v3/models/test-group.js:
1984 (TestGroup.prototype.compareTestResults): Always set .label and .fullLabel with the relative change as long as
1985 there are some values. Keep using "pending" and "running" in .status since that would determine the color of
1986 stacking blocks representing those A/B testing groups.
1988 * public/v3/pages/analysis-task-page.js:
1989 (AnalysisTaskChartPane):
1990 (AnalysisTaskChartPane.prototype.setPage): Added.
1991 (AnalysisTaskChartPane.prototype.router): Added.
1993 (AnalysisTaskPage.prototype.render): Show the list of A/B testing groups in the reverse chronological order.
1994 Also set the main chart's selection to the time range of the current test group.
1996 * public/v3/pages/chart-pane.js:
1997 (ChartPane.prototype.router): Added.
1998 (ChartPane.prototype._openAnalysisTask): Moved to ChartPaneBase.prototype._openAnalysisTask.
2000 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
2002 Add a script to process backlogs created while perf dashboard was in the maintenance mode
2003 https://bugs.webkit.org/show_bug.cgi?id=154140
2005 Reviewed by Chris Dumez.
2007 Added a script to process the backlog JSONs created while the perf dashboard was put in the maintenance mode.
2008 It re-submits each JSON file to the perf dashboard using the same server config file used by syncing scripts.
2010 * public/include/report-processor.php:
2011 (TestRunsGenerator::test_value_list_to_values_by_iterations): Fixed a bug in the error message code. It was
2012 referencing an undeclared variable.
2013 * tools/process-maintenance-backlog.py: Added.
2015 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
2017 AnalysisResultsViewer never uses this._smallerIsBetter
2018 https://bugs.webkit.org/show_bug.cgi?id=154134
2020 Reviewed by Chris Dumez.
2022 Removed the unused instance variable _smallerIsBetter from AnalysisResultsViewer and TestGroupStackingBlock.
2024 * public/v3/components/analysis-results-viewer.js:
2025 (AnalysisResultsViewer): Removed the unused _smallerIsBetter.
2026 (AnalysisResultsViewer.prototype.setSmallerIsBetter): Deleted.
2027 (AnalysisResultsViewer.prototype.buildRowGroups):
2028 (AnalysisResultsViewer.TestGroupStackingBlock): Removed the unused _smallerIsBetter.
2029 * public/v3/pages/analysis-task-page.js:
2030 (AnalysisTaskPage.prototype._didFetchTask):
2032 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
2034 Build fix after r196440.
2036 * public/v3/models/test-group.js:
2037 (TestGroup.prototype.addBuildRequest): Clear the map instead of setting the property to null.
2039 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
2041 Perf dashboard should have UI to retry A/B testing
2042 https://bugs.webkit.org/show_bug.cgi?id=154090
2044 Reviewed by Chris Dumez.
2046 Added a button to re-try an existing A/B testing group with a custom repetition count. The same button functions
2047 as a way of confirming the progression/regression when there have been no A/B testing scheduled in the task.
2049 Also fixed the bug that A/B testing groups that have been waiting for other test groups will be shown as "running".
2051 * public/v3/components/results-table.js:
2052 (ResultsTable.cssTemplate): Don't pad the list of extra repositories when it's empty.
2054 * public/v3/components/test-group-results-table.js:
2055 (TestGroupResultsTable.prototype.buildRowGroups): Use TestGroup.labelForRootSet instead of manually
2056 computing the letter for each configuration set.
2058 * public/v3/models/build-request.js:
2059 (BuildRequest.prototype.hasStarted): Added.
2061 * public/v3/models/data-model.js:
2062 (DataModelObject.ensureSingleton): Added.
2063 (DataModelObject.cachedFetch): Added noCache option. This is used when re-fetching the test groups after
2066 * public/v3/models/measurement-cluster.js:
2067 (MeasurementCluster.prototype.startTime): Added.
2069 * public/v3/models/measurement-set.js:
2070 (MeasurementSet.prototype.hasFetchedRange): Added. Returns true only if there are no "holes" (cluster
2071 yet to be fetched) between the specified time range. This was added to fix a bug in AnalysisTaskPage's
2072 _didFetchMeasurement.
2074 * public/v3/models/test-group.js:
2075 (TestGroup): Added this._rootSetToLabel.
2076 (TestGroup.prototype.addBuildRequest): Reset this._rootSetToLabel along with this._requestedRootSets.
2077 (TestGroup.prototype.repetitionCount): Added. Returns the number of iterations executed per set. We assume that
2078 every root set in the test group shares a single repetition count.
2079 (TestGroup.prototype.requestedRootSets): Now populates this._rootSetToLabel for labelForRootSet.
2080 (TestGroup.prototype.labelForRootSet): Added.
2081 (TestGroup.prototype.hasStarted): Added.
2082 (TestGroup.prototype.compareTestResults): Use 'running' and 'pending' to differentiate test groups that are waiting
2083 for other groups to finish running from the ones that are actually running ('incomplete' before this patch).
2084 (TestGroup.fetchByTask):
2085 (TestGroup.createAndRefetchTestGroups): Added. Creates a new test group using the privileged-api/create-test-group
2086 and fetches the list of test groups for the specified analysis task.
2087 (TestGroup._createModelsFromFetchedTestGroups): Extracted from TestGroup.fetchByTask.
2089 * public/v3/pages/analysis-task-page.js:
2090 (AnalysisTaskPage): Initialize _renderedCurrentTestGroup to undefined so that we'd always can differentiate
2091 the initial call to AnalysisTaskPage.render and subsequent calls in which it's identical to _currentTestGroup.
2092 (AnalysisTaskPage.prototype._didFetchMeasurement): Fixed a bug that we don't exit early even when some
2093 clusters in between startPoint and endPoint are still being fetched via newly added hasFetchedRange.
2094 (AnalysisTaskPage.prototype.render): Update the default repetition count based on the current test group.
2095 Also update the label of the button to "Confirm the change" if there is no A/B testing in this task.
2096 (AnalysisTaskPage.prototype._retryCurrentTestGroup): Added. Re-triggers an existing A/B testing group or creates
2097 the A/B testing for the entire range of the analysis task.
2098 (AnalysisTaskPage.prototype._hasDuplicateTestGroupName): Added.
2099 (AnalysisTaskPage.prototype._createRetryNameForTestGroup): Added.
2100 (AnalysisTaskPage.htmlTemplate): Added form controls to re-trigger A/B testing.
2101 (AnalysisTaskPage.cssTemplate): Updated the style.
2103 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
2105 Removed the duplicated definition of ChartPaneBase.
2107 * public/v3/components/chart-pane-base.js:
2109 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
2111 Analysis task page on v3 UI should show charts
2112 https://bugs.webkit.org/show_bug.cgi?id=154057
2114 Reviewed by Chris Dumez.
2116 Extracted ChartPaneBase out of ChartPane and added an instance of its new subclass, AnalysisTaskChartPane,
2117 to the analysis task page. The main difference is that ChartPaneBase doesn't depend on the presence of
2118 this._chartsPage unlike ChartPane. It also doesn't have the header with toolbar (to show breakdown, etc...).
2120 * public/v3/components/base.js:
2121 (ComponentBase.prototype._constructShadowTree): Call htmlTemplate() and cssTemplate() with the right "this".
2123 * public/v3/components/chart-pane-base.js: Added.
2124 (ChartPaneBase): Extracted from ChartPane.
2125 (ChartPaneBase.prototype.configure): Extracted from the constructor. Separating this function allows the
2126 component to be instantiated inside a HTML template.
2127 (ChartPaneBase.prototype._fetchAnalysisTasks): Moved from ChartPane._fetchAnalysisTasks.
2128 (ChartPaneBase.prototype.platformId): Ditto.
2129 (ChartPaneBase.prototype.metricId): Ditto.
2130 (ChartPaneBase.prototype.setOverviewDomain): Ditto.
2131 (ChartPaneBase.prototype.setMainDomain): Ditto.
2132 (ChartPaneBase.prototype._overviewSelectionDidChange): Extracted from the constructor. This is overridden in
2133 ChartPane and unused in AnalysisTaskChartPane.
2134 (ChartPaneBase.prototype._mainSelectionDidChange): Extracted from ChartPane._mainSelectionDidChange.
2135 (ChartPaneBase.prototype._mainSelectionDidZoom): Extracted from ChartPane._mainSelectionDidZoom.
2136 (ChartPaneBase.prototype._indicatorDidChange): Extracted from ChartPane._indicatorDidChange.
2137 (ChartPaneBase.prototype._didFetchData): Moved from ChartPane._fetchAnalysisTasks.
2138 (ChartPaneBase.prototype._openAnalysisTask): Ditto.
2139 (ChartPaneBase.prototype._openCommitViewer): Ditto. Also fixed a bug that we don't show the spinner while
2140 waiting for the data to be fetched by calling this.render() here.
2141 (ChartPaneBase.prototype._keyup): Moved from ChartPane._keyup. Also fixed the bug that the revisions list
2142 doesn't update by calling this.render() here.
2143 (ChartPaneBase.prototype.render): Extracted from ChartPane.render.
2144 (ChartPaneBase.htmlTemplate): Extracted from ChartPane.htmlTemplate.
2145 (ChartPaneBase.paneHeaderTemplate): Added. This is overridden in ChartPane and unused in AnalysisTaskChartPane.
2146 (ChartPaneBase.cssTemplate): Extracted from ChartPane.htmlTemplate.
2148 * public/v3/components/chart-styles.js: Renamed from public/v3/pages/page-with-charts.js.
2149 (PageWithCharts): Renamed from PageWithCharts since it no longer extends PageWithHeading.
2150 (ChartStyles.createChartSourceList):
2152 * public/v3/components/commit-log-viewer.js:
2153 (CommitLogViewer.prototype.view): Set this._repository right away instead of waiting for the fetched data
2154 so that spinner will be shown while the data is being fetched.
2156 * public/v3/index.html:
2158 * public/v3/pages/analysis-task-page.js:
2159 (AnalysisTaskChartPane): Added extends ChartPaneBase.
2160 (AnalysisTaskPage): Added. this._chartPane.
2161 (AnalysisTaskPage.prototype._didFetchTask): Initialize this._chartPane with a domain.
2162 (AnalysisTaskPage.prototype.render): Render this._chartPane.
2163 (AnalysisTaskPage.htmlTemplate):
2165 * public/v3/pages/chart-pane-status-view.js:
2166 (ChartPaneStatusView): Removed the unused router from the argument list.
2167 (ChartPaneStatusView.prototype.pointsRangeForAnalysis): Renamed from analyzeData() since it was ambiguous.
2168 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Fixed the bug that we don't update the list
2169 of the revisions here.
2170 (ChartPaneStatusView.prototype.computeChartStatusLabels):
2172 * public/v3/pages/chart-pane.js:
2173 (ChartPane): Now extends ChartPaneBase.
2174 (ChartPane.prototype._overviewSelectionDidChange): Extracted from the constructor.
2175 (ChartPane.prototype._mainSelectionDidChange):
2176 (ChartPane.prototype._mainSelectionDidZoom):
2177 (ChartPane.prototype._indicatorDidChange):
2178 (ChartPane.prototype.render):
2179 (ChartPane.prototype._renderActionToolbar):
2180 (ChartPane.paneHeaderTemplate): Extracted from htmlTemplate.
2181 (ChartPane.cssTemplate):
2182 (ChartPane.overviewOptions.selection.onchange): Deleted.
2183 (ChartPane.prototype._fetchAnalysisTasks): Deleted.
2184 (ChartPane.prototype.platformId): Deleted.
2185 (ChartPane.prototype.metricId): Deleted.
2186 (ChartPane.prototype.setOverviewDomain): Deleted.
2187 (ChartPane.prototype.setMainDomain): Deleted.
2188 (ChartPane.prototype._openCommitViewer): Deleted.
2189 (ChartPane.prototype._didFetchData): Deleted.
2190 (ChartPane.prototype._keyup): Deleted.
2192 * public/v3/pages/charts-page.js:
2194 (ChartsPage.createDomainForAnalysisTask): Extracted by createDomainForAnalysisTask; used to set the domain
2195 of the charts in the analysis task page.
2196 (ChartsPage.createStateForAnalysisTask):
2198 * public/v3/pages/dashboard-page.js:
2200 (DashboardPage.prototype._createChartForCell):
2202 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
2204 Add the support for maintenance mode
2205 https://bugs.webkit.org/show_bug.cgi?id=154072
2207 Reviewed by Chris Dumez.
2209 Added the crude support for maintenance mode whereby which the reports are stored in the filesystem
2210 instead of the database.
2212 * config.json: Added maintenanceMode and maintenanceDirectory as well as forgotten siteTitle and
2213 remoteServer.httpdMutexDir.
2214 * public/api/report.php:
2215 (main): Don't connect to the database or modify database when maintenanceMode is set.
2216 * public/include/json-header.php:
2217 (ensure_privileged_api_data): Exit with InMaintenanceMode when maintenanceMode is set. This prevents
2218 privileged API such as creating analysis tasks and new A/B testing groups from modifying the database.
2220 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
2222 Analysis task page on v3 show progression as regressions
2223 https://bugs.webkit.org/show_bug.cgi?id=154045
2225 Reviewed by Chris Dumez.
2227 The bug was caused by TestGroup.compareTestResults referring to undefined _smallerIsBetter.
2228 Retrieve it from the associated metric object via the owner analysis task.
2230 * public/v3/models/test-group.js:
2232 2016-02-05 Ryosuke Niwa <rniwa@webkit.org>
2234 Testing with remote server cache is unusably slow
2235 https://bugs.webkit.org/show_bug.cgi?id=153928
2237 Reviewed by Chris Dumez.
2239 Don't use the single process mode of httpd as it's way too slow even for testing.
2240 Also we'll hit a null pointer crash (http://svn.apache.org/viewvc?view=revision&revision=1711479)
2242 Since httpd exits immediately when launched in multi-process mode, remote-cache-server.py (renamed from
2243 run-with-remote-server.py) now has "start" and "stop" commands to start/stop the Apache. Also added
2244 "reset" command to reset the cache for convenience.
2246 * Install.md: Updated the instruction.
2247 * config.json: Fixed a typo: httpdErro*r*Log.
2248 * tools/remote-cache-server.py: Copied from Websites/perf.webkit.org/tools/run-with-remote-server.py.
2249 Now takes one of the following commands: "start", "stop", and "reset".
2251 (start_httpd): Extracted from main.
2252 (stop_httpd): Added.
2253 * tools/remote-server-relay.conf: Removed redundant (duplicate) LoadModule's.
2254 * tools/run-with-remote-server.py: Removed.
2256 2016-02-04 Ryosuke Niwa <rniwa@webkit.org>
2258 Perf dashboard should have a script to setup database
2259 https://bugs.webkit.org/show_bug.cgi?id=153906
2261 Reviewed by Chris Dumez.
2263 Added tools/setup-database.py to setup the database. It retrieves the database name, username, password
2264 and initializes a database at the specified location.
2266 * Install.md: Updated instruction to setup postgres to use setup-database.py.
2267 * tools/setup-database.py: Added.
2269 (load_database_config):
2270 (determine_psql_dir):
2271 (start_or_stop_database):
2272 (execute_psql_command):
2274 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
2276 buildbot syncing scripts sometimes schedule more than one requests per builder
2277 https://bugs.webkit.org/show_bug.cgi?id=153047
2279 Reviewed by Chris Dumez.
2281 The bug was caused by the check for singularity of scheduledRequests being conducted per configuration
2282 instead of per builder. So if there were multiple test configurations (e.g. Speedometer and Octane) that
2283 both used the same builder, then we may end up scheduling both at once.
2285 Fixed the bug by sharing a single set to keep track of the scheduled requests for all configurations per
2288 * tools/sync-with-buildbot.py:
2289 (load_config): Share a set amongst test configurations for each builder.
2290 (find_request_updates): Instead of creating a new set for each configuration, reuse the existing sets to
2291 share a single set agmonst test configurations for each builder.
2293 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
2295 Analysis results viewer sometimes doesn't show the correct relative difference
2296 https://bugs.webkit.org/show_bug.cgi?id=152930
2298 Reviewed by Chris Dumez.
2300 The bug was caused by single A/B testing result associated with multiple rows when there are multiple data
2301 points with the same root set which matches that of an A/B testing.
2303 Fixed the bug by detecting such a case, and only associating each A/B testing result with the row created
2304 for the first matching point.
2306 * public/v3/components/analysis-results-viewer.js:
2307 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
2309 2016-01-08 Ryosuke Niwa <rniwa@webkit.org>
2311 Make v3 UI analysis task page is hard to understand
2312 https://bugs.webkit.org/show_bug.cgi?id=152917
2314 Reviewed by Antti Koivisto.
2316 Add a dark gray border around the selected block in the analysis results viewer instead of using darker
2317 shades since that looks as if they were bigger regression/progression.
2319 Explicitly show "Failed" as the label instead of omitting with "-" when all build requests in an A/B
2320 testing group fails.
2322 * public/v3/components/analysis-results-viewer.js:
2323 (AnalysisResultsViewer.cssTemplate): Tweaked the style to underline text in the hovered blocks and the
2324 selected blocks and show a dark gray border around the selected blocks.
2325 (AnalysisResultsViewer.TestGroupStackingBlock):
2326 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): Use this._title for title.
2327 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
2328 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForRootSet): Deleted.
2330 * public/v3/components/results-table.js:
2331 (ResultsTable.prototype.render):
2332 (ResultsTable.prototype._createRevisionListCells): Extracted from ResultsTable.prototype.render.
2333 (ResultsTable.cssTemplate): Tweaked the style.
2335 (ResultsTableRow.prototype.constructor): Added _labelForWholeRow to store the label for the entire row.
2336 This is used to show the comparison result of two root sets (e.g. A vs B).
2337 (ResultsTableRow.prototype.setLabelForWholeRow): Added.
2338 (ResultsTableRow.prototype.labelForWholeRow): Added.
2339 (ResultsTableRow.prototype.resultContent): Extracted from buildHeading. Creates a hyperlinked bar graph
2340 used for each A/B testing result.
2341 (ResultsTableRow.prototype.buildHeading): Deleted since we need to set colspan on the second table cell
2342 when we're creating a row with _labelForWholeRow.
2344 * public/v3/components/test-group-results-table.js:
2345 (TestGroupResultsTable.prototype.buildRowGroups): Added rows to show relative differences and statistical
2346 significance between root sets (e.g. A vs B).
2348 * public/v3/models/build-request.js:
2349 (BuildRequest.prototype.hasCompleted): Added.
2351 * public/v3/models/test-group.js:
2352 (TestGroup.prototype.compareTestResults): Extracted from AnalysisResultsViewer.TestGroupStackingBlock's
2353 _computeTestGroupStatus and generalized to be reused in TestGroupResultsTable.
2354 (TestGroup.prototype._valuesForRootSet): Moved from AnalysisResultsViewer.TestGroupStackingBlock.
2356 * public/v3/pages/analysis-task-page.js:
2357 (AnalysisTaskPage.cssTemplate): Tweaked the style.
2359 2016-01-07 Ryosuke Niwa <rniwa@webkit.org>
2361 Perf dashboard should automatically add aggregators
2362 https://bugs.webkit.org/show_bug.cgi?id=152818
2364 Reviewed by Chris Dumez.
2366 When an aggregator entry is missing in aggregators table, automatically insert it in /api/report.
2368 In a very early version of the perf dashboard, we had the ability to define a custom aggregator
2369 in an admin page. In practice, nobody used or needed this feature so we got rid of it even before
2370 the dashboard was landed into WebKit repository. This patch cleans up that mess.
2373 (main): Added the filtering capability.
2374 (TestEnvironment): Expose the config JSON in the test environment.
2376 * public/include/report-processor.php:
2377 (ReportProcessor): Renamed name_to_aggregator now that it only contains ID.
2378 (ReportProcessor::__construct): No longer fetches the aggregator table. An equivalent work is done
2379 in newly added ensure_aggregators.
2380 (ReportProcessor::process): Calls ensure_aggregators which populates name_to_aggregator_id.
2381 (ReportProcessor::ensure_aggregators): Added. Add the builtin aggregators: Arithmetic, Geometric,
2382 Harmonic, and Total.
2383 (TestRunsGenerator): Renamed name_to_aggregator now that it only contains ID.
2384 (TestRunsGenerator::__construct):
2385 (TestRunsGenerator::add_aggregated_metric): Don't include aggregator_definition here since it's
2386 never used now that all the aggregations are done natively in PHP.
2387 (TestRunsGenerator::$aggregators): Added. We don't include SquareSum since it's only used for
2388 computing run_square_sum_cache in test_runs table and it's useless elsewhere.
2389 (TestRunsGenerator::aggregate_values): Add a comment about that.
2391 * tests/api-report.js: Updated a test case to reflect the change.
2393 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2395 Perf dashboard JSON API should fail gracefully when postgres is down
2396 https://bugs.webkit.org/show_bug.cgi?id=152812
2398 Reviewed by Chris Dumez.
2400 Even though all JSON APIs returned DatabaseConnectionFailure as the status when Database::connect
2401 returned a falsy value, PHP was spitting out warnings and producing HTTP responses that cannot be
2402 parsed as a JSON when pg_connect failed.
2404 Fixed the bug by suppressing warning messages in pg_connect.
2406 * public/include/db.php:
2407 (Database::connect): Use '@' prefix to suppress warning messages.
2409 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2411 Perf dashboard should auto-generate manifest file when one is missing
2412 https://bugs.webkit.org/show_bug.cgi?id=152813
2414 Reviewed by Chris Dumez.
2416 When /data/manifest.json is missing, fall back to newly added /api/manifest instead of
2417 silently failing to show the UI. This will make the initial setup easier.
2419 * public/api/manifest.php: Added.
2421 * public/include/manifest.php:
2422 (Manifest::manifest): Added.
2423 * public/v3/main.js:
2425 (didFetchManifest): Extracted from fetchManifest.
2427 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2429 Commit another forgotten change, this time, for r194653.
2431 * public/v3/models/measurement-set.js:
2433 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2435 The sampling of time series on v3 UI is too aggressive
2436 https://bugs.webkit.org/show_bug.cgi?id=152804
2438 Reviewed by Chris Dumez.
2440 Fixed a bug that we were always halving the number of data points in _sampleTimeSeries
2441 and increased the number of data points allowed to make the sampling less aggressive.
2443 * public/v3/components/time-series-chart.js:
2444 (TimeSeriesChart.prototype._ensureSampledTimeSeries): Increase the number of maximum points
2445 to 2x the number of pixels divided by the radius of each point.
2446 (TimeSeriesChart.prototype._sampleTimeSeries.findMedian): Changed the semantics of endIndex
2447 to mean the index after the last point and renamed it to indexAfterEnd.
2448 (TimeSeriesChart.prototype._sampleTimeSeries): Fixed a bug that this code always coerced two
2449 data points into one sampled data point despite of the fact i and j are sufficiently apart
2450 since data[j].time - data[i].time > timePerSample by definition.
2452 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2454 Commit the forgotten change for r194651.
2456 * public/v3/pages/domain-control-toolbar.js:
2457 (DomainControlToolbar.prototype.setStartTime):
2459 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2461 The right hand side of main chart appears to be cut off as you zoom out on v3 UI
2462 https://bugs.webkit.org/show_bug.cgi?id=152778
2464 Reviewed by Antti Koivisto.
2466 Add a padding on x-axis after the end time to make the main chart more easily interactive.
2468 * public/v3/components/time-series-chart.js:
2469 (TimeSeriesChart.prototype._computeHorizontalRenderingMetrics):
2471 * public/v3/pages/page-with-charts.js:
2472 (PageWithCharts.mainChartOptions): Add a padding of 5px at the end of x-axis.
2474 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2476 v3 UI should use four sig-figs to label y-axis of the main charts
2477 https://bugs.webkit.org/show_bug.cgi?id=152779
2479 Reviewed by Antti Koivisto.
2481 Increase the number of significant figures used in the main charts to four as done in v2 UI.
2483 * public/v3/pages/chart-pane.js:
2484 (ChartPane.constructor): Create a formatter with four significant figures.
2485 * public/v3/pages/page-with-charts.js:
2486 (PageWithCharts.mainChartOptions): Increase the width of y-axis labels.
2488 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2490 v3 UI's time range slider is harder to use than that of v2 UI
2491 https://bugs.webkit.org/show_bug.cgi?id=152780
2493 Reviewed by Antti Koivisto.
2495 Improved the time range slider by using a cubic mapping to time range and providing a text field
2496 to directly edit the number of days to show.
2498 Now an user can enter the text mode to directly edit the number of days to show by clicking on
2499 the number of days (text field is always there with opacity=0).
2501 * public/v3/pages/charts-toolbar.js:
2502 (ChartsToolbar): Store the minimum and maximum number of days allowed. Also rename _inputElement
2503 to _slider and added a new type=number text field as _editor.
2504 (ChartsToolbar.prototype.render):
2505 (ChartsToolbar.prototype.setStartTime): Exit the text mode when the number of days is changed by
2506 an URL state transition (i.e. back/forward navigation).
2507 (ChartsToolbar.prototype._setInputElementValue): Added. Updates the values of _slider and _editor.
2508 (ChartsToolbar.prototype._enterTextMode): Added. Hide the elements used by the slider mode and
2509 show the text field.
2510 (ChartsToolbar.prototype._exitTextMode): Added. Does the opposite.
2511 (ChartsToolbar.prototype._sliderValueMayHaveChanged): Renamed from _inputValueMayHaveChanged.
2512 (ChartsToolbar.prototype._editorValueMayHaveChanged): Added. Similar to _sliderValueMayHaveChanged
2513 but also corrects the value of _editor if needed.
2514 (ChartsToolbar.prototype._callNumberOfDaysCallback): Extracted from _inputValueMayHaveChanged.
2515 Also fixed a bug that we didn't update the URL state when the change event was fired without
2516 modifying the effective number of days.
2517 (ChartsToolbar.cssTemplate): Tweaked the style to support the new mode. Also set a fixed width on
2518 the span showing the number of days in the slider mode.
2520 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2522 Zooming button is broken on v3 UI
2523 https://bugs.webkit.org/show_bug.cgi?id=152777
2525 Reviewed by Chris Dumez.
2527 Bring up the zoom button in z-index so that users can click it.
2529 * public/v3/components/interactive-time-series-chart.js:
2530 (InteractiveTimeSeriesChart.cssTemplate):
2532 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2534 v3 UI doesn't preserve the time range when charts page is opened from a dashboard
2535 https://bugs.webkit.org/show_bug.cgi?id=152776
2537 Reviewed by Chris Dumez.
2539 Fixed the bug by moving the construction of charts URL from DashboardPage.prototype.open to
2540 DashboardPage.prototype.render and re-rendering the entire page upon an URL state transition.
2542 * public/v3/pages/charts-page.js:
2543 (ChartsPage.createStateForDashboardItem): Takes the start time for the charts page.
2545 * public/v3/pages/dashboard-page.js:
2546 (DashboardPage.prototype.updateFromSerializedState): Merged _numberOfDaysDidChange and
2547 _updateChartsDomainFromToolbar into this function since they're not used elsewhere. Also re-render
2548 the entire page when transition between different number of days to show.
2549 (DashboardPage.prototype._numberOfDaysDidChange): Deleted.
2550 (DashboardPage.prototype._updateChartsDomainFromToolbar): Deleted.
2551 (DashboardPage.prototype.render): Construct URL for each charts here.
2552 (DashboardPage.prototype._createChartForCell): Don't construct URL here since this function is
2553 called once when the dashboard page is opened, and not when the time range is changed.
2555 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2557 Build fix for an old version of PHP after r194618.
2559 * public/api/measurement-set.php:
2561 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2563 A/B testing results should be visualized intuitively on v3 UI
2564 https://bugs.webkit.org/show_bug.cgi?id=152496
2566 Rubber-stamped by Chris Dumez.
2568 Add the "stacking block" view of A/B testing results to the analysis task page on v3 UI.
2570 The patch enhances JSON APIs at /api/analysis-task /api/measurement-set/ to reduce the number of
2571 HTTP requests, and adds two UI components: TestGroupResultsTable and AnalysisResultsViewer both
2572 of which inherits from an abstract superclass: ResultsTable.
2574 ResultsTable provides a tabular presentation of measured values in regular measurement sets and
2575 A/B testing results using groups of bar graphs created by BarGraphGroup. TestGroupResultsTable
2576 inherits from this class to display A/B testing configurations and the averaged results for each
2577 configuration, and AnalysisResultsViewer inherits from it to provide an intuitive visualization
2578 of the outcomes of all A/B testing results associated with a given analysis task.
2580 * public/api/analysis-tasks.php:
2581 (main): Add the capability to find the analysis task based on its build request.
2582 This allows /v3/#/analysis/task/?buildRequest=<id> to be hyperlinked on buildbot page.
2584 * public/api/measurement-set.php:
2585 (main): Removed the unused startTime and endTime, and added "analysisTask" to query parameters.
2586 (AnalysisResultsFetcher): Added. Used to fetch measured data associated with every build request
2587 on an analysis task.
2588 (AnalysisResultsFetcher::__construct):
2589 (AnalysisResultsFetcher::fetch): Unlike MeasurementSetFetcher, we fetch the list of commits and
2590 list of measurements separately since there will be a lot less builds and commits than measured
2591 data (since we're fetching measured values for all tests and their metrics).
2592 (AnalysisResultsFetcher::fetch_commits): Fetches commits.
2593 (AnalysisResultsFetcher::format_measurement): Like MeasurementSetFetcher::format_measurement but
2594 with config_type and config_metric since we're returning measured data for all metrics and test
2596 (AnalysisResultsFetcher::format_map): Similar to MeasurementSetFetcher::format_map.
2598 * public/v3/components/analysis-results-viewer.js: Added.
2599 (AnalysisResultsViewer): Added.
2600 (AnalysisResultsViewer.prototype.didUpdateResults): This callback is called by AnalysisTaskPage
2601 when A/B testing results become available.
2602 (AnalysisResultsViewer.prototype.render): Overrides ResultsTable's render to highlight the block
2603 representing the currently selected test group.
2605 (AnalysisResultsViewer.prototype.buildRowGroups): Creates a list of rows with "stacking blocks"
2606 that visualizes A/B testing results. The algorithm works as follows: 1. Create all table rows.
2607 2. Find which row is associated with each set in each test group. 3. Layout "blocks".
2609 (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Collects root sets from all data
2610 in the measurement set as well as A/B testing **requests** (results may contain more repositories
2611 than requested but they aren't interesting for the purpose of visualizing results for the entire
2614 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Create table rows. First,
2615 create table rows for measurement set points that have a matching test group (i.e. either set A
2616 or set B of an A/B testing uses the same root set as a point). Second, insert a new row for each
2617 root set in each test group which didn't find a matching measurement set point. There is a little
2618 subtlety that some A/B testing may specify revisions for a subset of repositories and/or some A/B
2619 testing results may appear as if it goes back in time with respect to other A/B testing results.
2620 For example, consider creating two A/B test groups for WebKit changes and OS changes separately.
2621 There could be no coherent linearization of those two A/B testing in which both WebKit and OS
2622 versions move forward.
2624 (AnalysisResultsViewer.RootSetInTestGroup): Added. Represents a pair (test group, root set) since
2625 a root set could be shared by multiple test groups.
2626 (AnalysisResultsViewer.TestGroupStackingBlock): Added. A stacked block representing a test group.
2627 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.addRowIndex): Associates a row number with
2628 either set A or set B.
2629 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): Creates a table cell
2631 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.isThin): Returns true if this test group
2632 has failed and this block should look "thin" without any label.
2633 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus): Computes the
2634 status for this test group.
2636 (AnalysisResultsViewer.TestGroupStackingGrid): Added. AnalysisResultsViewer uses this class to
2637 layout blocks representing test groups.
2638 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.insertBlockToColumn): Inserts a new block
2639 to layout. We keep all test groups doing the same A/B test next to each other.
2640 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.layout): Layouts each block / test group
2641 in the order they are created.
2642 (AnalysisResultsViewer.TestGroupStackingGrid.prototype._layoutBlock): Places the block in the
2643 left-most column that can accommodate it while avoiding columns of a different thin-ness. A column
2644 is thin if its A/B testing has failed, and not thin otherwise.
2645 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.createCellsForRow): Creates table cells for
2646 a given row. For each column, generate a table cell if we're in the first row and the first block
2647 starts in a later row, a block starts in the current row, or the last block ended in the previous
2648 row and the next block or the last row appears later.
2650 * public/v3/components/bar-graph-group.js: Added. A component for showing a group of bar graphs.
2651 (BarGraphGroup): Added. Creates a group of bar graphs with the same value range. It's used by
2652 AnalysisResultsViewer and ResultsTable to show bar graphs to compare values.
2653 (SingleBarGraph): A component created and collectively controlled by BarGraphGroup.
2655 * public/v3/components/results-table.js: Added.
2656 (ResultsTable): An abstract superclass for TestGroupResultsTable and AnalysisResultsViewer.
2658 (ResultsTable.prototype.render): Renders the table. 1. Call "buildRowGroups()" implemented by
2659 a subclass to obtain the list of rows. 2. Compute the list of repositories to show. 3. For each
2660 cell in the table, compute the number of rows to show the same value (for rowspan). 4. Render the
2661 table with an extra list of repositories if exists.
2663 (ResultsTable.prototype._computeRepositoryList): Compute the list of repositories to list
2664 revisions in the table. Omit repositories not present in any row or for which all rows have the
2665 same revision. In the latter case, include it in the extra repositories listed below the table.
2666 This minimizes the amount of redundant information presented to the user.
2668 (ResultsTableRow): Added. Represents a single row in the table. ResultsTable constructs necessary
2669 table cells to tabulate the associated root sets, and shows the associated result using a grouped
2670 bar graph. Additional columns are used by AnalysisResultsViewer to show stacked blocks for A/B
2673 * public/v3/components/test-group-results-table.js: Added.
2674 (TestGroupResultsTable):
2675 (TestGroupResultsTable.prototype.didUpdateResults):
2676 (TestGroupResultsTable.prototype.setTestGroup):
2677 (TestGroupResultsTable.prototype.heading):
2678 (TestGroupResultsTable.prototype.render):
2679 (TestGroupResultsTable.prototype.buildRowGroups):
2681 * public/v3/index.html:
2682 * public/v3/models/analysis-results.js: Added.
2683 (AnalysisResults): Added. Like MeasurementSet, this class represents a set of measured values
2684 associated with a given analysis task.
2685 (AnalysisResults.prototype.find): Returns a measured valued for a given build and metric.
2686 (AnalysisResults.prototype.add): Adds a new measured value. Used by AnalysisResults.fetch.
2687 (AnalysisResults.fetch): Fetches data and creates AnalysisResults for a given analysis task.
2689 * public/v3/models/analysis-task.js:
2690 (AnalysisTask.prototype.startMeasurementId): Added.
2691 (AnalysisTask.prototype.endMeasurementId): Added.
2692 (AnalysisTask.fetchByBuildRequestId): Added.
2693 (AnalysisTask._fetchSubset): Uses DataModelObject.cachedFetch.
2695 * public/v3/models/build-request.js: Added.
2696 (BuildRequest): Added. Represents a single A/B testing request associated with a test group.
2698 * public/v3/models/builder.js:
2699 (Build): Added. Represents a build associated with a given A/B testing result.
2701 * public/v3/models/commit-log.js:
2702 (CommitLog): Made this class inherit from DataModelObject.
2703 (CommitLog.ensureSingleton): Added. Finds the singleton object created for a given revision
2704 in the specified repository. This helps RootSet and other classes compare commits fast.
2705 (CommitLog.prototype.repository): Added.
2706 (CommitLog.fetchBetweenRevisions): Uses CommitLog.ensureSingleton.
2708 * public/v3/models/data-model.js:
2710 (DataModelObject.namedStaticMap): Added.
2711 (DataModelObject.ensureNamedStaticMap): Renamed from namedStaticMap instead of implicitly
2712 assuming that the non-static version always creates the map.
2713 (DataModelObject.prototype.namedStaticMap): Added.
2714 (DataModelObject.cachedFetch): Extracted from AnalysisTask._fetchSubset so that TestGroup's
2715 fetchByTask could also use it.
2718 * public/v3/models/measurement-adaptor.js: Added.
2719 (MeasurementAdaptor): Extracted from MeasurementCluster. This class is responsible for
2720 re-formatting the data received via /api/measurement-set JSON API inside the v3 UI.
2721 (MeasurementAdaptor.prototype.extractId): Added.
2722 (MeasurementAdaptor.prototype.adoptToAnalysisResults): Added. Used by AnalysisResults.
2723 (MeasurementAdaptor.aggregateAnalysisResults): Added. Used by TestGroupResultsTable to
2724 aggregate results for each test configuration; e.g. computing the average for set A.
2725 (MeasurementAdaptor.prototype.adoptToSeries): Extracted from MeasurementCluster.addToSeries.
2726 Added rootSet() to each point. This allows AnalysisResultsViewer to compare them against root
2727 sets associated with A/B testing results.
2728 (MeasurementAdaptor.computeConfidenceInterval): Moved from MeasurementCluster.
2730 * public/v3/models/measurement-cluster.js:
2731 (MeasurementCluster):
2732 (MeasurementCluster.prototype.addToSeries):
2734 * public/v3/models/repository.js:
2735 (Repository.prototype.hasUrlForRevision): Added.
2737 * public/v3/models/root-set.js: Added.
2738 (RootSet): Added. Represents a set of commits in measured results.
2739 (MeasurementRootSet): Added. Ditto for results associated with A/B testing.
2741 * public/v3/models/test-group.js: Added.
2742 (TestGroup): Added. Represents a A/B testing on analysis task.
2743 (TestGroup.prototype.createdAt): Added.
2744 (TestGroup.prototype.buildRequests): Returns the list of build requests associated with this
2746 (TestGroup.prototype.addBuildRequest): Added. Used by BuildRequest's constructor to associate
2747 itself with this group.
2748 (TestGroup.prototype.didSetResult): Added. Called by BuildRequest.setResult when measured
2749 values are fetched and associated with a build request in this group.
2751 * public/v3/models/test.js:
2754 * public/v3/pages/analysis-task-page.js:
2756 (AnalysisTaskPage.prototype.updateFromSerializedState): Fetch the analysis task, test groups
2757 associated with it, and all A/B testing results based on the task id or the build request id
2758 specified in the URL.
2759 (AnalysisTaskPage.prototype._didFetchTask): Added. Start fetching the measured data. This is
2760 the data on charts page for which this analysis task was created, not results of A/B testing.
2761 (AnalysisTaskPage.prototype._didFetchMeasurement): Added. Display the fetched data in a table
2762 inside AnalysisResultsViewer.
2763 (AnalysisTaskPage.prototype._didFetchTestGroups): Added. Display the list of A/B test groups
2764 as well as the results of the first A/B testing.
2765 (AnalysisTaskPage.prototype._didFetchAnalysisResults): Added.
2766 (AnalysisTaskPage.prototype._assignTestResultsIfPossible): Added. Once both the analysis task,
2767 A/B test groups as well as their results are fetched, update build requests in each test group
2769 (AnalysisTaskPage.prototype.render): Show the list of test groups and highlight the currently
2771 (AnalysisTaskPage.prototype._showTestGroup): Added. A callback used by AnalysisResultsViewer
2772 and TestGroupResultsTable to notify this class when the user selects a new test group.
2773 (AnalysisTaskPage.htmlTemplate): Updated the template.
2774 (AnalysisTaskPage.cssTemplate): Ditto.
2776 * public/v3/pages/charts-page.js:
2777 (ChartsPage.createStateForAnalysisTask): Added. Creates a URL state object for opening a chart
2778 associated with an analysis task.
2780 2015-12-22 Ryosuke Niwa <rniwa@webkit.org>
2782 Analysis task page is slow to load
2783 https://bugs.webkit.org/show_bug.cgi?id=152517
2785 Reviewed by Andreas Kling.
2787 The slowness comes from r194130 which made the JSON API at /api/analysis-tasks to report the start
2788 and the end of each analysis task. This query was adding ~2s to the total JSON generation time.
2790 Cache these values on analysis_task table since they never change once an analysis task is created.
2792 * init-database.sql: Added columns task_start_run_time and task_end_run_time to analysis_task table.
2793 Also added the missing drop statements at the top.
2795 * public/api/analysis-tasks.php:
2796 (fetch_and_push_bugs_to_tasks): Don't fetch the latest commit time of the start and the end.
2797 (format_task): Report task_start_run_time and task_end_run_time as startRunTime and endRunTime.
2799 * public/privileged-api/create-analysis-task.php:
2800 (main): Set start_run_time and end_run_time when creating an analysis task.
2801 (time_for_run): Added.
2803 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2805 v3 UI shouldn't open/close pane selector by mouseenter/leave
2806 https://bugs.webkit.org/show_bug.cgi?id=152399
2808 Reviewed by Andreas Kling.
2810 Removed the code to open and close the pane selector by mouseenter and mouseleave
2811 since multiple people have complained about the behavior.
2813 * public/v3/pages/charts-toolbar.js:
2814 (ChartsToolbar): Removed the event listeners.
2815 (ChartsToolbar.prototype._addPane): Don't close the pane selector when adding a new pane
2816 to better support the use case of adding multiple panes.
2817 (ChartsToolbar.cssTemplate): Tweaked CSS.
2819 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2821 Popover for analysis tasks shows up at the left edge of annotation bars in the v3 UI
2822 https://bugs.webkit.org/show_bug.cgi?id=152389
2824 Reviewed by Darin Adler.
2826 Compute the x coordinate of the popover from the center of each annotation bar.
2828 Also adjust the x coordinate to keep the popover within the charts.
2830 * public/v3/components/interactive-time-series-chart.js:
2831 (InteractiveTimeSeriesChart.prototype._renderChartContent):
2833 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2835 Dashboard charts should have uniform widths on v3 UI
2836 https://bugs.webkit.org/show_bug.cgi?id=152395
2838 Reviewed by Chris Dumez.
2840 Fix the bug by applying table-layout: fixed on the dashboard table.
2842 * public/v3/pages/dashboard-page.js:
2843 (DashboardPage.prototype.render): Added header-column as a class name to explicitly set the header column with.
2844 (DashboardPage.cssTemplate): Adjusted CSS accordingly.
2846 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2848 Closing a pane on v3 UI always closes the last pane
2849 https://bugs.webkit.org/show_bug.cgi?id=152388
2851 Reviewed by Chris Dumez.
2853 The bug was caused by closePane being called without arguments. (The first argument to bind is "this" value.)
2854 Fixed it by passing in "this" pane object to the first argument.
2856 * public/v3/pages/chart-pane.js:
2859 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2861 Perf Dashboard v3 UI doesn't show recent data points on v2 UI
2862 https://bugs.webkit.org/show_bug.cgi?id=152368
2864 Reviewed by Chris Dumez.
2866 The bug was caused by the last modified date in measurement set JSON being a string instead of a POSIX timestamp,
2867 which prevented the v3 UI from invalidating the cache. Specifically, the following boolean logic always evaluated
2868 to false because +data['lastModified'] was NaN in MeasurementSet.prototype._fetch (/v3/models/measurement-set.js):
2870 !clusterEndTime && useCache && +data['lastModified'] < self._lastModified
2872 Fixed the bug by calling Database::to_js_time on the last modified date fetched from the database.
2874 * public/api/measurement-set.php:
2875 (MeasurementSetFetcher::fetch_config_list): Convert the string returned by the database to a POSIX timestamp.
2876 * tests/api-measurement-set.js: Added a test to ensure the last modified date in JSON is numeric. Since the value
2877 of the last modified date depends on when tests run, we can't assert it to be a certain value.
2879 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2881 v3 UI should show and link the build number on charts page
2882 https://bugs.webkit.org/show_bug.cgi?id=152359
2884 Reviewed by Chris Dumez.
2886 Show the hyperlinked build number in the v3 UI.
2888 * public/v3/models/builder.js:
2889 (Builder): Renamed _buildURL to _buildUrlTemplate.
2890 (Builder.prototype.urlForBuild): Added.
2891 * public/v3/pages/chart-pane-status-view.js:
2892 (ChartPaneStatusView):
2893 (ChartPaneStatusView.prototype.render): Added the code to render hyperlinked build number when one is available.
2894 (ChartPaneStatusView.prototype.computeChartStatusLabels): Store currentPoint's measurement object as _buildInfo
2895 if the current point is set by an indicator (not by a selection).
2897 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2899 v3 dashboard doesn't stretch charts to fill the screen
2900 https://bugs.webkit.org/show_bug.cgi?id=152354
2902 Reviewed by Chris Dumez.
2904 The bug was caused by a workaround to avoid canvas stretching table cell too much.
2906 Fix the problem instead by making the canvas absolutely positioned inside the "time-series-chart" element
2907 so that it does not contribute to the intrinsic/natural width of the cell.
2909 * public/v3/components/time-series-chart.js:
2910 (TimeSeriesChart.prototype._ensureCanvas): Make the canvas absolutely positioned inside the shadow root.
2911 (TimeSeriesChart.prototype._updateCanvasSizeIfClientSizeChanged): Use the container element's size now that
2912 the canvas does not resize with it.
2913 * public/v3/pages/dashboard-page.js:
2914 (DashboardPage.cssTemplate): Updated the CSS so that the chart stretches all the way.
2916 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2918 The chart status on v3 UI sometimes show wrong revision ranges
2919 https://bugs.webkit.org/show_bug.cgi?id=152331
2921 Reviewed by Chris Dumez.
2923 The bug was caused by the status view not taking the data sampling that happens in TimeSeriesChart into account
2924 when finding the previous point. Take this into account by using InteractiveTimeSeries.currentPoint(-1) which
2925 finds the sampled data point immediately preceding the current point (at which the indicator is shown).
2927 * public/v3/components/chart-status-view.js:
2928 (ChartStatusView.prototype.updateStatusIfNeeded):
2930 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2932 Perf dashboard's cycler page should use v3 UI
2933 https://bugs.webkit.org/show_bug.cgi?id=152324
2935 Reviewed by Chris Dumez.
2937 Use the v3 UI in cycler.html after r194130.
2939 * public/cycler.html:
2940 * public/v3/index.html: Removed the reference to a non-existent platform-selector.js.
2942 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2944 Add v3 UI to perf dashboard
2945 https://bugs.webkit.org/show_bug.cgi?id=152311
2947 Reviewed by Chris Dumez.
2949 Add the third iteration of the perf dashboard UI. UI for viewing and modifying analysis tasks is coming soon.
2950 The v3 UI is focused on speed, and removes all third-party script dependencies including jQuery, d3, and Ember.
2951 Both the DOM-based UI and graphing are implemented manually.
2954 The entire app is structured using new component library implemented in components/base.js. Each component is
2955 an instance of a subclass of ComponentBase which owns a single DOM element. Each subclass may supply static
2956 methods named htmlTemplate and cssTemplate as the template for a component instance. ComponentBase automatically
2957 clones the templates inside the associated element (or its shadow root on the supported browsers). Each subclass
2958 must supply a method called "render()" which constructs and updates the DOM as needed.
2960 There is a special component called Page, which represents an entire page. Each Page is opened by PageRouter's
2961 "route()" function. Each subclass of Page supplies "open()" for initialization and "updateFromSerializedState()"
2962 for a hash URL transition.
2965 The key feature of the v3 UI is the split of time series into chunks called clusters (see r194120). On an internal
2966 instance of the dashboard, the v2 UI downloads 27MB of data whereas the same page loads only 3MB of data in the v3.
2967 The key logic for fetching time series in chunks is implemented by MeasurementSet in /v3/models/measurement-set.js.
2968 We first fetch the cached primary cluster (the cluster that contains the newest data) at:
2969 /data/measurement-set-<platform-id>-<metric-id>.json
2971 If that's outdated according to lastModified in manifest.json, then we immediately re-fetch the primary cluster at:
2972 /api/measurement-set/?platform=<platform-id>&metric=<metric-id>
2974 Once the up-to-date primary cluster is fetched, we fetch all "secondary" clusters. For each cluster being fetched,
2975 including the primary, we invoke registered callbacks.
2978 In addition, the v3 UI reduces the initial page load time by loading a single bundled JS file generated by
2979 tools/bundle-v3-scripts.py. index.html has a fallback to load all 44 JS files individually during development.
2981 * public/api/analysis-tasks.php:
2982 (fetch_and_push_bugs_to_tasks): Added the code to fetch start and end run times. This is necessary in V3 UI
2983 because no longer fetch the entire time series. See r194120 for the new measurement set JSON API.
2984 (format_task): Compute the category of an analysis task based on "result" value. This will be re-vamped once
2985 I add the UI for the analysis task page in v3.
2987 * public/include/json-header.php:
2988 (require_format): CamelCase the name.
2989 (require_match_one_of_values): Ditto.
2990 (validate_arguments): Renamed from require_existence_of and used in measurement-set.php landed in r194120.
2993 * public/v3/components: Added.
2995 * public/v3/components/base.js: Added.
2996 (ComponentBase): The base component class.
2997 (ComponentBase.prototype.element): Returns the DOM element associated with the DOM element.
2998 (ComponentBase.prototype.content): Returns the shadow root if one exists and the associated element otherwise.
2999 (ComponentBase.prototype.render): To be implemented by a subclass.
3000 (ComponentBase.prototype.renderReplace): A helper function to "render" DOM contents.
3001 (ComponentBase.prototype._constructShadowTree): Called inside the constructor to instantiate the templates.
3002 (ComponentBase.prototype._recursivelyReplaceUnknownElementsByComponents): Instantiates components referred by
3003 its element name inside the instantiated content.
3004 (ComponentBase.isElementInViewport): A helper function. Returns true if the element is in the viewport and it has
3005 non-zero width and height.
3006 (ComponentBase.defineElement): Defines a custom element that can be automatically instantiated from htmlTemplate.
3007 (ComponentBase.createElement): A helper function to create DOM tree to be used in "render()" method.
3008 (ComponentBase._addContentToElement): A helper for "createElement".
3009 (ComponentBase.createLink): A helper function to create a hyperlink or another clickable element (via callback).
3010 (ComponentBase.createActionHandler): A helper function to create an event listener that prevents the default action
3011 and stops the event propagation.
3013 * public/v3/components/button-base.js: Added.
3015 * public/v3/components/chart-status-view.js: Added.
3016 (ChartStatusView): A component that reports the current status of time-series-chart. It's subclasses by
3017 ChartPaneStatusView to provide additional information in the charts page's panes.
3019 * public/v3/components/close-button.js: Added.
3021 * public/v3/components/commit-log-viewer.js: Added.
3022 (CommitLogViewer): A component that lists commit revisions along with commit messages for a range of data points.
3024 * public/v3/components/interactive-time-series-chart.js: Added.
3025 (InteractiveTimeSeriesChart): A subclass of InteractiveTimeSeriesChart with interactivity (selection & indicator).
3026 Selection and indicator are mutually exclusive.
3028 * public/v3/components/pane-selector.js: Added.
3029 (PaneSelector): A component for selecting (platform, metric) pair to add in the charts page.
3031 * public/v3/components/spinner-icon.js: Added.
3033 * public/v3/components/time-series-chart.js: Added.
3034 (TimeSeriesChart): A canvas-based chart component without interactivity. It takes a source list and options as
3035 the constructor arguments. A source list is a list of measurement sets (measurement-set.js) with drawing options.
3036 This component fetches data via MeasurementSet.fetchBetween inside TimeSeriesChart.prototype.setDomain and
3037 progressively updates the charts as more data arrives. The canvas is updated on animation frame via rAF and all
3038 layout and rendering metrics are lazily computed in _layout. In addition, this component samples data before
3039 rendering the chart when there are more data points per pixel in _ensureSampledTimeSeries.
3041 * public/v3/index.html: Added. Loads bundled-scripts.js if it exists, or individual script files otherwise.
3043 * public/v3/instrumentation.js: Added. This class is used to gather runtime statistics of v3 UI. (It measures
3044 the performance of the perf dashboard UI).
3046 * public/v3/main.js: Added. Bootstraps the app.
3050 * public/v3/models: Added.
3051 * public/v3/models/analysis-task.js: Added.
3052 * public/v3/models/bug-tracker.js: Added.
3053 * public/v3/models/bug.js: Added.
3054 * public/v3/models/builder.js: Added.
3055 * public/v3/models/commit-log.js: Added.
3056 * public/v3/models/data-model.js: Added.
3057 (DataModelObject): The base class for various data objects that correspond to database tables. It supplies static
3058 hash map to find entries by id as well as other keys.
3059 (LabeledObject): A subclass of DataModelObject with the capability to find an object via its name.
3061 * public/v3/models/measurement-cluster.js: Added.
3062 (MeasurementCluster): Represents a single cluster or a chunk of data in a measurement set.
3064 * public/v3/models/measurement-set.js: Added.
3065 (MeasurementSet): Represents a measurement set.
3066 (MeasurementSet.findSet): Returns the singleton set given (metric, platform). We use singleton to avoid issuing
3067 multiple HTTP requests for the same JSON when there are multiple TimeSeriesChart that show the same graph (e.g. on
3068 charts page with overview and main charts).
3069 (MeasurementSet.prototype.findClusters): Finds the list of clusters to fetch in a given time range.
3070 (MeasurementSet.prototype.fetchBetween): Fetch clusters for a given time range and calls callback whenever new data
3071 arrives. The number of callbacks depends on the how many clusters need to be newly fetched.
3072 (MeasurementSet.prototype._fetchSecondaryClusters): Fetches non-primary (non-latest) clusters.
3073 (MeasurementSet.prototype._fetch): Issues a HTTP request to fetch a cluster.
3074 (MeasurementSet.prototype._didFetchJSON): Called when a cluster is fetched.
3075 (MeasurementSet.prototype._failedToFetchJSON): Called when the fetching of a cluster has failed.
3076 (MeasurementSet.prototype._invokeCallbacks): Invokes callbacks upon an approval of a new cluster.
3077 (MeasurementSet.prototype._addFetchedCluster): Adds the newly fetched cluster in the order.
3078 (MeasurementSet.prototype.fetchedTimeSeries): Returns a time series that contains data from all clusters that have
3080 (TimeSeries.prototype.findById): Additions to TimeSeries defined in /v2/data.js.
3081 (TimeSeries.prototype.dataBetweenPoints): Ditto.
3082 (TimeSeries.prototype.firstPoint): Ditto.
3084 * public/v3/models/metric.js: Added.
3085 * public/v3/models/platform.js: Added.
3086 * public/v3/models/repository.js: Added.
3087 * public/v3/models/test.js: Added.
3089 * public/v3/pages: Added.
3090 * public/v3/pages/analysis-category-page.js: Added. The "Analysis" page that lists the analysis tasks.
3091 * public/v3/pages/analysis-category-toolbar.js: Added. The toolbar to filter analysis tasks based on its category
3092 (unconfirmed, bisecting, identified, closed) and a keyword.
3094 * public/v3/pages/analysis-task-page.js: Added. Not implemented yet. It just has the hyperlink to the v2 UI.
3096 * public/v3/pages/chart-pane-status-view.js: Added.
3097 (ChartPaneStatusView): A subclass of ChartStatusView used in the charts page. In addition to the current value,
3098 comparison to baseline/target, it shows the list of repository revisions (e.g. WebKit revision, OS version).
3100 * public/v3/pages/chart-pane.js: Added.
3101 (ChartPane): A component a pane in the charts page. Each pane has the overview chart and the main chart. The zooming
3102 is synced across all panes in the charts page.
3104 * public/v3/pages/charts-page.js: Added. Charts page.
3105 * public/v3/pages/charts-toolbar.js: Added. The toolbar to set the number of days to show. This affects the overview
3106 chart's domain in each pane.
3108 * public/v3/pages/create-analysis-task-page.js: Added.
3109 (CreateAnalysisTaskPage): A page that gets shown momentarily while creating a new analysis task.
3111 * public/v3/pages/dashboard-page.js: Added. A dashboard page.
3112 * public/v3/pages/dashboard-toolbar.js: Added. Its toolbar with buttons to select the number of days to show.
3113 * public/v3/pages/domain-control-toolbar.js: Added. An abstract superclass of charts and dashboard toolbars.
3115 * public/v3/pages/heading.js: Added. A component for displaying the header and toolbar, if exists, on each page.
3116 * public/v3/pages/page-router.js: Added. This class is responsible for updating the URL hashes as well as opening
3117 and updating each page when the hash changes (via back/forward navigation).
3118 * public/v3/pages/page-with-charts.js: Added. An abstract subclass of page used by dashboards and charts page.
3119 Supplies helper functions for creating TimeSeriesChart options.
3120 * public/v3/pages/page-with-heading.js: Added. An abstract subclass of page that uses the heading component.
3121 * public/v3/pages/page.js: Added. The Page component.
3122 * public/v3/pages/toolbar.js: Added. An abstract toolbar component.
3124 * public/v3/remote.js: Added.
3125 (getJSON): Fetches JSON from the remote server.
3126 (getJSONWithStatus): Ditto. Rejects the response if the status is not "OK".
3127 (PrivilegedAPI.sendRequest): Posts a HTTP request to a privileged API in /privileged-api/.
3128 (PrivilegedAPI.requestCSRFToken): Creates a new CSRF token to request a privileged API post.
3130 * tools/bundle-v3-scripts.py: Added.
3131 (main): Bundles js files together and minifies them by jsmin.py for the v3 UI. Without this script, we're forced to
3132 download 44 JS files or making each JS file contain multiple classes.
3134 * tools/jsmin.py: Copied from WebInspector / JavaScriptCore code.
3136 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
3138 Fix v2 UI after r194093.
3140 * public/v2/data.js:
3142 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
3144 Add /api/measurement-set for v3 UI
3145 https://bugs.webkit.org/show_bug.cgi?id=152312
3147 Rubber-stamped by Chris Dumez.
3149 The new API JSON allows the front end to fetch measured data in chunks called a "cluster" as specified
3150 in config.json for each measurement set specified by the pair of a platform and a metric.
3152 When the front end needs measured data in a given time range (t_0, t_1) for a measurement set, it first
3153 fetches the primary cluster by /api/measurement-set/?platform=<platform-id>&metric=<metric-id>.
3154 The primary cluster is the last cluster in the set (returning the first cluster here is not useful
3155 since we don't typically show very old data), and provides the information needed to fetch other clusters.
3157 Fetching the primary cluster also creates JSON files at:
3158 /data/measurement-set-<platform-id>-<metric-id>-<cluster-end-time>.json
3159 to allow latency free access for secondary clusters. The front end code can also fetch the cache of
3160 the primary cluster at: /data/measurement-set-<platform-id>-<metric-id>.json.
3162 Because the front end code has to behave as if all data is fetched, each cluster contains one data point
3163 immediately before the first data point and one immediately after the last data point. This avoids having
3164 to fetch multiple empty clusters for manually specified baseline data. To support this behavior, we generate
3165 all clusters for a given measurement set at once when the primary cluster is requested.
3167 Furthermore, all measurement sets are divided at the same time into clusters so that the boundary of clusters
3168 won't shift as more data are reported to the server.