1 2016-04-11 Ryosuke Niwa <rniwa@webkit.org>
3 New syncing script sometimes schedules a build request on a wrong builder
4 https://bugs.webkit.org/show_bug.cgi?id=156489
6 Reviewed by Stephanie Lewis.
8 The bug was caused by _scheduleNextRequestInGroupIfSlaveIsAvailable scheduling the next build request on
9 any available syncer regardless of whether the request is the first one in the test group or not because
10 BuildRequest.order was returning a string instead of a number.
12 Also fixed a bug that BuildbotTriggerable.syncOnce was re-ordering test groups by their id's instead of
13 respecting the order in which the perf dashboard returned.
15 * public/v3/models/build-request.js:
16 (BuildRequest.prototype.order): Force the order to be a number.
17 * server-tests/api-build-requests-tests.js: Assert the order as numbers.
18 * server-tests/resources/mock-data.js:
19 (MockData.addAnotherMockTestGroup): Changed the test group id to 601, which is after the first mock data.
20 The old number was masking a bug in BuildbotTriggerable that it was re-ordering test groups by their id's
21 instead of using the order set forth by the perf dashboard.
22 (MockData.mockTestSyncConfigWithSingleBuilder):
23 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for scheduling two build requests in
24 a single call to syncOnce. Each build request should be scheduled on the same builder as the previous build
25 requests in the same test group.
26 * tools/js/buildbot-triggerable.js:
27 (BuildbotTriggerable.prototype.syncOnce): Order test groups by groupOrder, which is the index at which first
28 build request in the group appeared.
29 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Don't re-order build requests
30 as they're already sorted on the server side.
31 (BuildbotTriggerable._testGroupMapForBuildRequests): Added groupOrder to test group info
33 2016-04-09 Ryosuke Niwa <rniwa@webkit.org>
35 Build fix. Don't treat a build number 0 as a pending build.
37 * tools/js/buildbot-syncer.js:
38 (BuildbotBuildEntry.prototype.isPending):
40 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
42 Escape builder names in url* and pathFor* methods of BuildbotSyncer
43 https://bugs.webkit.org/show_bug.cgi?id=156427
45 Reviewed by Darin Adler.
47 The build fix in r199251 breaks other usage of RemoteAPI. Fix it properly by escaping builder names in
48 various methods of BuildbotSyncer.
50 Also fixed a typo in the logging and a bug that the new syncing script never updated "scheduled" to "running".
52 * server-tests/resources/mock-data.js:
53 (MockData.mockTestSyncConfigWithTwoBuilders): Renamed "some-builder-2" to "some builder 2" to test the
54 new escaping behavior in tools-buildbot-triggerable-tests.js and buildbot-syncer-tests.js.
56 * server-tests/tools-buildbot-triggerable-tests.js: Added tests for status url, and added a new test case
57 for updating "scheduled" to "running".
59 * tools/js/buildbot-syncer.js:
60 (BuildbotBuildEntry.buildRequestStatusIfUpdateIsNeeded): Update the status to "running" when the request's
61 status is "scheduled" and the buildbot's build is currently in progress.
62 (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Escape the builder name.
63 (BuildbotSyncer.prototype.pathForBuildJSON): Ditto.
64 (BuildbotSyncer.prototype.pathForForceBuild): Ditto.
65 (BuildbotSyncer.prototype.url): Ditto.
66 (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
68 * tools/js/buildbot-triggerable.js:
69 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers):
70 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Fixed a typo. We are
71 scheduling new build requests, not syncing them.
73 (RemoteAPI.sendHttpRequest): Reverted r199251.
74 * unit-tests/buildbot-syncer-tests.js:
76 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
78 Build fix. We need to escape the path or http.request would fail.
82 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
84 Fix various bugs in the new syncing script
85 https://bugs.webkit.org/show_bug.cgi?id=156393
87 Reviewed by Darin Adler.
89 * server-tests/resources/common-operations.js: Added. This file was supposed to be added in r199191.
90 (addBuilderForReport):
92 (connectToDatabaseInEveryTest):
94 * tools/js/buildbot-triggerable.js:
95 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Don't log every time we pull from buildbot
96 builder as this dramatically increases the amount of log we generate.
97 * tools/js/parse-arguments.js:
98 (parseArguments): Fixed a typo. This should be parseArgument*s*, not parseArgument.
100 (RemoteAPI.prototype.url): Fixed a bug that portSuffix wasn't being expanded in the template literal.
101 (RemoteAPI.prototype.configure): Added more validations with nice error messages.
102 (RemoteAPI.prototype.sendHttpRequest): Falling back to port 80 isn't right when scheme is https. Compute
103 the right port in configure instead based on the scheme.
104 * tools/sync-buildbot.js:
105 (syncLoop): Fixed the bug that syncing multiple times fail because Manifest.fetch() create new Platform
106 and Test objects. This results in various references in BuildRequest objects to get outdated. Fixing this
107 properly in Manifest.fetch() because we do need to "forget" about some tests and platforms in some cases.
108 For now, delete all v3 model objects and start over in each syncing cycle.
109 * unit-tests/tools-js-remote-tests.js: Added. Unit tests for the aforementioned changes to RemoteAPI.
111 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
113 sync-buildbot.js doesn't mark disappeared builds as failed
114 https://bugs.webkit.org/show_bug.cgi?id=156386
116 Reviewed by Chris Dumez.
118 Fix a bug that new syncing script doesn't mark builds that it scheduled but doesn't appear when queried
119 by buildbot's JSON API. These are builds that got canceled by humans (e.g. buildbot was restarted, data
120 loss, pending build was canceled, etc...)
122 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case.
123 * tools/js/buildbot-triggerable.js:
124 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added a set of build requests we've matched
125 against BuildbotBuildEntry's. Mark build requests that didn't have any entry but supposed to be in either
126 'scheduled' or 'running' status as failed.
128 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
130 A/B testing bots should prioritize user created test groups
131 https://bugs.webkit.org/show_bug.cgi?id=156375
133 Reviewed by Chris Dumez.
135 Order build requests preferring user created ones over ones automatically created by detect-changes.js.
137 Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new
138 build request on a builder/slave even when we had previously scheduled another build request.
140 * public/include/build-requests-fetcher.php:
141 (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on
142 author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js.
143 Since we're using ascending order, this would put user created test groups first.
144 * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case
145 for testing that build requests for an user created test group shows up first.
146 * server-tests/resources/mock-data.js:
147 (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name.
148 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests
149 for an user created test group shows up first.
150 * tools/js/buildbot-syncer.js:
151 (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already
152 scheduled new build requests. Don't schedule more requests on these slaves.
153 (BuildbotSyncer.prototype.scheduleRequest):
154 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null
155 when slaveList is not specified) to _slavesWithNewRequests.
156 (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request
157 we have previously scheduled should be included in one of the entires now.
158 * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug.
159 (sampleiOSConfig): Added a second slave for new test cases.
161 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
163 Migrate legacy perf dashboard tests to mocha.js based tests
164 https://bugs.webkit.org/show_bug.cgi?id=156335
166 Reviewed by Chris Dumez.
168 Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise
169 for most of asynchronous operations, refactored the tests to use Promises as well, and added more
170 assertions where appropriate.
172 Also consolidated common helper functions into server-tests/resources/common-operations.js.
173 Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were
174 taking an array of reports while others were taking a single report. New shared implementation in
175 common-operations.js now takes a single report.
177 Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout.
178 Most of tests are passing under 100ms on my computer so 1s should be plenty still.
180 * run-tests.js: Removed.
181 * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js.
182 (reportsForDifferentPlatforms):
183 * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js.
184 (.addBuilder): Moved to common-operations.js.
185 * server-tests/api-build-requests-tests.js:
186 * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps.
187 * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js.
188 (.queryPlatformAndMetric):
190 * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js.
191 * server-tests/api-report-tests.js: Moved from tests/api-report.js.
194 (.reportWithSameSubtestName):
195 * server-tests/resources/common-operations.js: Added.
196 (addBuilderForReport): Extracted from tests.
197 (addSlaveForReport): Ditto.
198 (connectToDatabaseInEveryTest): Added.
199 (submitReport): Extracted from admin-platforms-tests.js.
200 * server-tests/resources/test-server.js:
201 (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start
202 its own Apache instance (that would certainly will fail).
203 * server-tests/tools-buildbot-triggerable-tests.js:
205 * tools/js/database.js:
206 (Database.prototype.selectAll): Added.
207 (Database.prototype.selectFirstRow): Added.
208 (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments.
210 2016-04-05 Ryosuke Niwa <rniwa@webkit.org>
212 New buildbot syncing scripts that supports multiple builders and slaves
213 https://bugs.webkit.org/show_bug.cgi?id=156269
215 Reviewed by Chris Dumez.
217 Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves.
218 The old python script (sync-with-buildbot.py) could only support a single builder and slave
219 for each platform, test pair.
221 The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added
222 throughout the codebase and tests have been refactored.
224 BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible
225 for syncing everything on each builder (on a buildbot).
227 Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored
228 test helpers and mocks as needed.
230 * public/v3/models/build-request.js:
231 (BuildRequest.prototype.status): Added.
232 (BuildRequest.prototype.isScheduled): Added.
233 * public/v3/models/metric.js:
234 (Metric.prototype.fullName): Added.
235 * public/v3/models/platform.js:
236 (Platform): Added the map based on platform name.
237 (Platform.findByName): Added.
238 * public/v3/models/test.js:
239 (Test.topLevelTests):
240 (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would
241 find the test whose name is "B" which has a parent test named "A".
242 (Test.prototype.fullName): Added.
243 * server-tests/api-build-requests-tests.js:
244 (addMockData): Moved to resources/mock-data.js.
245 (addAnotherMockTestGroup): Ditto.
246 * server-tests/resources/mock-data.js: Added.
247 (MockData.resetV3Models): Added.
248 (MockData.addMockData): Moved from api-build-requests-tests.js.
249 (MockData.addAnotherMockTestGroup): Ditto.
250 (MockData.mockTestSyncConfigWithSingleBuilder): Added.
251 (MockData.mockTestSyncConfigWithTwoBuilders): Added.
252 (MockData.pendingBuild): Added.
253 (MockData.runningBuild): Added.
254 (MockData.finishedBuild): Added.
255 * server-tests/resources/test-server.js:
257 (TestServer.prototype.remoteAPI):
258 (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit.
259 (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever.
260 (TestServer.prototype._waitForPid): Increase the timeout.
261 (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards.
262 * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce.
264 (MockLogger.prototype.log): Added.
265 (MockLogger.prototype.error): Added.
266 * tools/detect-changes.js:
267 (parseArgument): Moved to js/parse-arguments.js.
268 * tools/js/buildbot-syncer.js:
269 (BuildbotBuildEntry):
270 (BuildbotBuildEntry.prototype.syncer): Added.
271 (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status
272 for a build request (of the matching build request ID) if it needs to be updated in the server.
273 (BuildbotSyncer): This class
274 (BuildbotSyncer.prototype.addTestConfiguration): Added.
275 (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations.
276 (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on
278 (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request.
279 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for
280 the specified build request on the first slave that's available.
281 (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object.
282 Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it.
283 (BuildbotSyncer.prototype._pullRecentBuilds):
284 (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now
285 only returns the path instead of the full URL since RemoteAPI takes a path, not full URL.
286 (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON.
287 (BuildbotSyncer.prototype.pathForForceBuild): Added.
288 (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL.
289 (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
290 (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test
291 configurations associated with it, find the one matching for this request.
292 (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it.
293 (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of
294 slave names present on this builder.
295 * tools/js/buildbot-triggerable.js: Added.
296 (BuildbotTriggerable): Added.
297 (BuildbotTriggerable.prototype.name): Added.
298 (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls
299 existing build requests from the perf dashboard, pulls buildbot for pending and running/completed
300 builds on each builder (represented by each syncer), schedules build requests on buildbot if there
301 is any builder/slave available, and updates the status of build requests in the database.
302 (BuildbotTriggerable.prototype._validateRequests): Added.
303 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added.
304 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added.
305 (BuildbotTriggerable._testGroupMapForBuildRequests): Added.
306 * tools/js/database.js:
307 * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js.
309 * tools/js/remote.js:
310 (RemoteAPI): Now optionally takes the server configuration.
311 (RemoteAPI.prototype.url): Added.
312 (RemoteAPI.prototype.getJSON): Removed the code for specifying request content.
313 (RemoteAPI.prototype.getJSONWithStatus): Ditto.
314 (RemoteAPI.prototype.postJSON): Added.
315 (RemoteAPI.prototype.postFormUrlencodedData): Added.
316 (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth.
317 * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host.
318 * tools/sync-buildbot.js: Added.
319 (main): Added. Parse the arguments and start the loop.
321 * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as
322 scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed.
324 (smallConfiguration): Added.
325 (smallPendingBuild): Added.
326 (smallInProgressBuild): Added.
327 (smallFinishedBuild): Added.
328 (createSampleBuildRequest): Create a unique build request for each platform.
329 (samplePendingBuild): Optionally specify build time and slave name.
330 (sampleInProgressBuild): Optionally specify slave name.
331 (sampleFinishedBuild): Ditto.
332 * unit-tests/resources/mock-remote-api.js:
333 (assert.notReached.assert.notReached):
334 (MockRemoteAPI.url): Added.
335 (MockRemoteAPI.postFormUrlencodedData): Added.
336 (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus.
337 (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we
338 need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI.
339 (MockRemoteAPI.inject):
340 (MockRemoteAPI.reset): Added.
342 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
344 Simplify API of Test model by removing Test.setParentTest
345 https://bugs.webkit.org/show_bug.cgi?id=156055
347 Reviewed by Joseph Pecoraro.
349 Removed Test.setParentTest. Keep track of the child-parent relationship using the static map instead.
351 Now each test only stores parent's id and uses the ID static map in Test.parentTest().
353 * public/v3/models/manifest.js:
354 (Manifest._didFetchManifest.buildObjectsFromIdMap): Removed the code to create the map of child-parent
355 relationship and call setParentTest.
356 * public/v3/models/test.js:
357 (Test): Updated a static map by the name of "childTestMap" to store itself. We should probably sort
358 child tests using some fixed criteria in the future instead of relying on the creation order but
359 preserve the old code's ordering for now.
360 (Test.prototype.parentTest): Look up the static map by the parent test's id.
361 (Test.prototype.onlyContainsSingleMetric):
362 (Test.prototype.setParentTest): Deleted.
363 (Test.prototype.childTests): Look up the child test map.
365 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
367 BuildRequest should have associated platform and test
368 https://bugs.webkit.org/show_bug.cgi?id=156054
370 Reviewed by Joseph Pecoraro.
372 Added methods to retrieve the platform and the test associated with a build request with tests.
374 * public/v3/models/build-request.js:
376 (BuildRequest.prototype.platform): Added.
377 (BuildRequest.prototype.test): Added.
378 * server-tests/api-build-requests-tests.js:
379 * server-tests/api-manifest.js: Fixed a typo. This tests /api/manifest, not /api/build-requests.
380 * unit-tests/buildbot-syncer-tests.js:
381 (.createSampleBuildRequest): Now takes Platform and Test objects to avoid hitting assertions in
382 BuildRequest's constructor.
384 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
386 BuildRequest should have a method to fetch all in-progress and pending requests for a triggerable
387 https://bugs.webkit.org/show_bug.cgi?id=156008
389 Reviewed by Darin Adler.
391 Add a method to BuildRequest that fetches all pending and in-progress requests for a triggerable.
393 Now, new syncing scripts must be able to figure out the build slave the first build requests in
394 a given test group had used in order to schedule subsequent build requests in the test group.
396 For this purpose, /api/build-requests has been modified to return all build requests whose test
397 group had not finished yet. A test group is finished if all build requests in the test group had
398 finished (completed, failed, or canceled).
400 * public/include/build-requests-fetcher.php:
401 (BuildRequestFetcher::fetch_incomplete_requests_for_triggerable): Return all build requests in test
402 groups that have not been finished.
403 * public/v3/models/build-request.js:
405 (BuildRequest.prototype.testGroupId): Added.
406 (BuildRequest.prototype.isPending): Renamed from hasPending to fix a bad grammar.
407 (BuildRequest.fetchForTriggerable): Added.
408 (BuildRequest.constructBuildRequestsFromData): Extracted from _createModelsFromFetchedTestGroups in
410 * public/v3/models/manifest.js:
411 (Manifest.fetch): Use the full path from root so that it works in server tests.
412 * public/v3/models/test-group.js:
413 (TestGroup.hasPending):
414 (TestGroup._createModelsFromFetchedTestGroups):
415 * server-tests/api-build-requests-tests.js: Added tests to ensure all build requests for a test group
416 is present in the response returned by /api/build-requests iff any build request in the group had not
419 (.addAnotherMockTestGroup): Added.
420 * unit-tests/test-groups-tests.js:
422 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
424 Make dependency injection in unit tests more explicit
425 https://bugs.webkit.org/show_bug.cgi?id=156006
427 Reviewed by Joseph Pecoraro.
429 Make the dependency injection of model objects in unit tests explicit so that server tests that create
430 "real" model objects won't create these mock objects. Now each test that uses mock model objects would call
431 MockModels.inject() to inject before / beforeEach and access each object using a property on MockModels
432 instead of them being implicitly defined on the global object.
434 Similarly, MockRemoteAPI now only replaces global.RemoteAPI during each test so that server tests can use
435 real RemoteAPI to access the test Apache server.
437 * unit-tests/analysis-task-tests.js:
438 * unit-tests/buildbot-syncer-tests.js:
439 (createSampleBuildRequest):
440 * unit-tests/measurement-adaptor-tests.js:
441 * unit-tests/measurement-set-tests.js:
442 * unit-tests/resources/mock-remote-api.js:
443 (MockRemoteAPI.getJSONWithStatus):
444 (MockRemoteAPI.inject): Added. Override RemoteAPI on the global object during each test.
445 * unit-tests/resources/mock-v3-models.js:
446 (MockModels.inject): Added. Create mock model objects before each test, and clear all static maps of
447 various v3 model classes (to remove all singleton objects for those model classes).
448 * unit-tests/test-groups-tests.js:
450 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
452 BuildbotSyncer should be able to fetch JSON from buildbot
453 https://bugs.webkit.org/show_bug.cgi?id=155921
455 Reviewed by Joseph Pecoraro.
457 Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot
458 with lots of unit tests as this has historically been a source of subtle bugs in the old script.
460 New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that
461 the state of some builds may change between each HTTP request. In the old script, we fetched the list
462 of the pending builds, and requested -1, -2, etc... builds for N times. But between each request,
463 a pending build may start running or an in-progress build finish and shift the offset by one. The new
464 script avoids this problem by first requesting all pending builds, then all in-progress and finished
465 builds in a single HTTP request. The results are then merged so that entries for in-progress and
466 finished builds would override the entries for pending builds if they overlap.
468 Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes
469 the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js).
471 * server-tests/api-build-requests-tests.js:
472 * server-tests/api-manifest.js:
473 * tools/js/buildbot-syncer.js:
474 (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as
475 we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished
476 builds as 'currentStep' is always defined but null in those builds.
477 (BuildbotBuildEntry.prototype.buildNumber): Added.
478 (BuildbotBuildEntry.prototype.isPending): Added.
479 (BuildbotBuildEntry.prototype.hasFinished): Added.
480 (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds.
481 (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds.
482 (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added.
483 (BuildbotSyncer.prototype.urlForBuildJSON): Added.
484 (BuildbotSyncer.prototype.url): Added.
485 (BuildbotSyncer.prototype.urlForBuildNumber): Added.
486 * tools/js/remote.js:
487 (RemoteAPI.prototype.getJSON): Renamed from fetchJSON.
488 (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus.
489 * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node.
490 * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot
491 (samplePendingBuild):
492 (sampleInProgressBuild): Added.
493 (sampleFinishedBuild): Added.
494 * unit-tests/resources/mock-remote-api.js:
495 (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus.
497 2016-03-24 Ryosuke Niwa <rniwa@webkit.org>
499 Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code
500 https://bugs.webkit.org/show_bug.cgi?id=155863
502 Reviewed by Joseph Pecoraro.
504 Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability
505 added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed
506 /admin/regenerate-manifest since it has been superseded by /api/manifest.
508 This patch also extracts manifest.js out of main.js so that it could be used and tested without the
511 * public/admin/regenerate-manifest.php: Deleted.
512 * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with
513 a trailing backslash.
514 * public/include/manifest.php:
515 (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories.
516 * public/v3/index.html:
519 * public/v3/models/bug-tracker.js:
520 (BugTracker.prototype.newBugUrl): Added.
521 (BugTracker.prototype.repositories): Added.
522 * public/v3/models/manifest.js: Added. Extracted from main.js.
523 (Manifest.fetch): Moved from main.js' fetchManifest.
524 (Manifest._didFetchManifest): Moved from main.js' didFetchManifest.
525 * public/v3/models/platform.js:
526 (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of
527 the same name. This is tested by the newly added test cases.
528 * server-tests/api-build-requests-tests.js:
529 * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js
530 with additional assertions for v3 UI model objects.
531 * server-tests/resources/test-server.js:
532 (TestServer.prototype.start):
533 (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API.
534 Also no longer takes dataDirectory as an argument since it's always the same.
535 (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data.
536 (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests.
537 (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an
538 unintended side effect of slowing down unit tests even through they don't need Postgres or Apache.
539 * tests/admin-regenerate-manifest.js: Removed.
540 * tools/js/database.js:
541 * tools/js/v3-models.js:
543 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
545 Add mocha server tests for /api/build-requests
546 https://bugs.webkit.org/show_bug.cgi?id=155831
548 Reviewed by Chris Dumez.
550 Added the new mocha.js based server-tests for /api/build-requests. The new harness automatically:
551 - starts a new Apache instance
552 - switches the database during testing via setting an environmental variable
553 - backups and restores public/data directory during testing
555 As a result, developer no longer has to manually setup Apache, edit config.json manually to use
556 a testing database, or run /api/manifest.php to re-generate the manifest file after testing.
558 This patch also makes ID resolution optional on /api/build-requests so that v3 model based syncing
559 scripts can re-use the same code as the v3 UI to process the JSON. tools/sync-with-buildbot.py has
560 been modified to use this option (useLegacyIdResolution).
562 * config.json: Added configurations for the test httpd server.
563 * init-database.sql: Don't error when tables and types don't exist (when database is empty).
564 * public/api/build-requests.php:
565 (main): Made the ID resolution optional with useLegacyIdResolution. Also removed "updates" from the
566 results JSON since it's never used.
567 * public/include/build-requests-fetcher.php:
568 (BuildRequestsFetcher::__construct):
569 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Fixed the bug that we would include the same
570 commit multiple times for each root set.
571 * public/include/db.php:
572 (config): If present, use ORG_WEBKIT_PERF_CONFIG_PATH instead of Websites/perf.webkit.org/config.json.
573 * server-tests: Added.
574 * server-tests/api-build-requests-tests.js: Added. Tests for /api/build-requests.
576 * server-tests/resources: Added.
577 * server-tests/resources/test-server.conf: Added. Apache configuration file for testing.
578 * server-tests/resources/test-server.js: Added.
580 (TestSever.prototype.start): Added.
581 (TestSever.prototype.stop): Added.
582 (TestSever.prototype.remoteAPI): Added. Configures RemoteAPI to be used with the test sever.
583 (TestSever.prototype.database): Added. Returns Database configured to use the test database.
584 (TestSever.prototype._constructTestConfig): Creates config.json for testing. The file is generated by
585 _start and db.php's config() reads it from the environmental variable: ORG_WEBKIT_PERF_CONFIG_PATH.
586 (TestSever.prototype._ensureDataDirectory): Renames public/data to public/original-data if exists,
587 and creates a new empty public/data.
588 (TestSever.prototype._restoreDataDirectory): Deletes public/data and renames public/original-data
590 (TestSever.prototype._ensureTestDatabase): Drops the test database if exists and creates a new one.
591 (TestSever.prototype.initDatabase): Run init-database.sql to start each test with a consistent state.
592 (TestSever.prototype._executePgsqlCommand): Executes a postgres command line tool such as psql.
593 (TestSever.prototype._determinePgsqlDirectory): Finds the directory that contains psql.
594 (TestSever.prototype._startApache): Starts an Apache instance for testing.
595 (TestSever.prototype._stopApache): Stops the Apache instance for testing.
596 (TestSever.prototype._waitForPid): Waits for the Apache pid file to appear or disappear.
597 (before): Start the test server at the beginning.
598 (beforeEach): Re-initialize all tables before each test.
599 (after): Stop the test server at the end.
600 * tools/js/config.js:
601 (Config.prototype.path):
602 (Config.prototype.serverRoot): Added. The path to Websites/perf.webkit.org/public/.
603 (Config.prototype.pathFromRoot): Added. Resolves a path from Websites/perf.webkit.org.
604 * tools/js/database.js:
605 (Database): Now optionally takes the database name to use a different database during testing.
606 (Database.prototype.connect):
607 (Database.prototype.query): Added.
608 (Database.prototype.insert): Added.
609 (tableToPrefixMap): Maps table name to its prefix. Used by Database.insert.
610 * tools/js/remote.js: Added.
611 (RemoteAPI): Added. This is node.js equivalent of RemoteAPI in public/v3/remote.js.
612 (RemoteAPI.prototype.configure): Added.
613 (RemoteAPI.prototype.fetchJSON): Added.
614 (RemoteAPI.prototype.fetchJSONWithStatus): Added.
615 (RemoteAPI.prototype.sendHttpRequest): Added.
616 * tools/sync-with-buildbot.py:
617 (main): Use useLegacyIdResolution as this script relies on the legacy behavior.
618 * unit-tests/checkconfig.js: pg was never directly used in this test.
620 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
622 Delete a file that was supposed to be removed in r198614 for real.
624 * unit-tests/resources/v3-models.js: Removed.
626 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
628 Add a model for parsing buildbot JSON with unit tests
629 https://bugs.webkit.org/show_bug.cgi?id=155814
631 Reviewed by Joseph Pecoraro.
633 Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests.
634 They will be used in the new syncing scripts to improve A/B testing.
636 * public/v3/models/build-request.js:
638 * tools/js/buildbot-syncer.js: Added.
639 (BuildbotBuildEntry): Added.
640 (BuildbotBuildEntry.prototype.slaveName): Added.
641 (BuildbotBuildEntry.prototype.buildRequestId): Added.
642 (BuildbotBuildEntry.prototype.isInProgress): Added.
643 (BuildbotSyncer): Added.
644 (BuildbotSyncer.prototype.testPath): Added.
645 (BuildbotSyncer.prototype.builderName): Added.
646 (BuildbotSyncer.prototype.platformName): Added.
647 (BuildbotSyncer.prototype.fetchPendingRequests): Added.
648 (BuildbotSyncer.prototype._propertiesForBuildRequest): Added.
649 (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added.
650 (BuildbotSyncer._loadConfig): Added.
651 (BuildbotSyncer._validateAndMergeConfig): Added.
652 (BuildbotSyncer._validateAndMergeProperties): Added.
653 * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js.
654 (beforeEach): Deleted since this only defined inside mocha.
655 * unit-tests/analysis-task-tests.js:
656 * unit-tests/buildbot-syncer-tests.js: Added.
658 (createSampleBuildRequest):
659 (.smallConfiguration):
660 * unit-tests/measurement-adaptor-tests.js:
661 * unit-tests/measurement-set-tests.js:
662 * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js.
664 * unit-tests/test-groups-tests.js:
667 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
669 Add unit tests for test-group.js
670 https://bugs.webkit.org/show_bug.cgi?id=155781
672 Reviewed by Joseph Pecoraro.
674 Added unit tests for test-group.js that would have caught regressions fixed in r198503.
676 * public/v3/components/chart-pane-base.js:
677 (ChartPaneBase.prototype._renderAnnotations): Added a forgotten break statement.
678 * public/v3/models/build-request.js:
679 (BuildRequest.prototype.setResult):
681 * public/v3/models/test-group.js:
682 * unit-tests/measurement-set-tests.js: Use ./resources/v3-models.js to reduce the code duplication.
683 * unit-tests/resources/v3-models.js: Import more stuff from v3 models.
685 * unit-tests/test-groups-tests.js: Added. Added some unit tests for TestGroup.
687 (.testGroupWithStatusList):
689 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
695 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
697 Commit log viewer repaints too frequently after r198499
698 https://bugs.webkit.org/show_bug.cgi?id=155732
700 Reviewed by Joseph Pecoraro.
702 The bug was caused by InteractiveTimeSeriesChart invoking onchange callback whenever mouse moved even
703 if the current point didn't change. Fixed the bug by avoiding the work if the indicator hadn't changed
704 and avoiding work in the commit log viewer when the requested repository and the revision range were
705 the same as those of the last request.
707 * public/v3/components/commit-log-viewer.js:
709 (CommitLogViewer.prototype.currentRepository): Exit early when repository and the revision range are
710 identical to the one we already have to avoid repaints and issuing multiple network requests.
711 * public/v3/components/interactive-time-series-chart.js:
712 (InteractiveTimeSeriesChart.prototype._mouseMove): Don't invoke _notifyIndicatorChanged if the current
713 indicator hadn't changed.
714 * public/v3/pages/chart-pane.js:
715 (ChartPane.prototype._indicatorDidChange): Fixed the bug that unlocking the indicator wouldn't update
716 the URL. We need to check whether the lock state had changed. The old condition was also redundant
717 since _mainChartIndicatorWasLocked is always identically equal to isLocked per the prior assignment.
719 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
721 Fix A/B testing after r198503.
723 * public/include/build-requests-fetcher.php:
725 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
727 Analysis task page is broken after r198479
728 https://bugs.webkit.org/show_bug.cgi?id=155735
730 Rubber-stamped by Chris Dumez.
732 * public/api/measurement-set.php:
733 (AnalysisResultsFetcher::fetch_commits): We need to emit the commit ID as done for regular data.
734 * public/include/build-requests-fetcher.php:
735 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Ditto. Don't use a fake ID after r198479.
736 * public/v3/models/commit-log.js:
737 (CommitLog): Assert that all commit log IDs are integers to catch regressions like this in future.
738 * public/v3/models/root-set.js:
739 (RootSet): Don't resolve Repository here as doing so would modify the shared "root" entry in the JSON
740 we fetched, and subsequent construction of RootSet would fail since this line would blow up trying to
741 find the repository with "[object]" as the ID.
742 * public/v3/models/test-group.js:
743 (TestGroup._createModelsFromFetchedTestGroups): Resolve Repository here.
745 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
747 v3 UI sometimes don't update the list of revisions on the commit log viewer
748 https://bugs.webkit.org/show_bug.cgi?id=155729
750 Rubber-stamped by Chris Dumez.
752 Fixed multiple bugs that were affecting the list of blame range and commit logs for the range weren't
753 updated in some cases on v3 UI. Also, the commit log viewer state is now a part of the URL state so
754 opening and closing the commit log viewer will persist across page loads.
756 Also fixed a regression from r198479 that Test object can't be created for a top level test.
758 * public/v3/components/chart-pane-base.js:
759 (ChartPaneBase.prototype.configure):
760 (ChartPaneBase.prototype._mainSelectionDidChange): Fixed the bug that the list of blame range nor the
761 commit log viewer don't get updated when the selected range changes.
762 (ChartPaneBase.prototype._indicatorDidChange):
763 (ChartPaneBase.prototype._didFetchData):
764 (ChartPaneBase.prototype._updateStatus): Extracted from _indicatorDidChange and _didFetchData.
765 (ChartPaneBase.prototype._requestOpeningCommitViewer): Renamed from _openCommitViewer.
767 * public/v3/components/chart-status-view.js:
768 (ChartStatusView.prototype.updateStatusIfNeeded): Fixed the bug that the blame range doesn't get set
769 on the initial page load when the selection range is set but the chart data hadn't been fetched yet.
771 * public/v3/components/commit-log-viewer.js:
772 (CommitLogViewer.prototype.view): Fixed the bug that we don't clear out the old list of commits while
773 loading the next set of commits to show as it looked as if the list was never updated.
774 (CommitLogViewer.prototype.render): Fixed the bug that the view always show the last repository name
775 even if there were nothing being fetched or commits to show.
777 * public/v3/components/pane-selector.js:
778 (PaneSelector.prototype.focus): Removed superfluous call to console.log.
780 * public/v3/models/data-model.js:
781 (DataModelObject.listForStaticMap): Generalized the code for all to fix the bug in Test.
782 (DataModelObject.all):
784 * public/v3/models/test.js:
785 (Test): Fixed the bug that this code was relying on the static map to be an array.
786 (Test.topLevelTests): Use newly added listForStaticMap to convert the dictionary to an array.
788 * public/v3/pages/chart-pane-status-view.js:
789 (ChartPaneStatusView): Always initialize _usedRevisionRange as a triple to simplify code elsewhere.
790 (ChartPaneStatusView.prototype.render): Invoke _revisionCallback when user clicks on a repository
791 expansion mark (>>). Also fixed click handler from the row since this made selecting revision range
792 on the view cumbersome. Now user has to explicitly click on the expansion mark (>>).
793 (ChartPaneStatusView.prototype._setRevisionRange): Now takes shouldNotify, from, and to as arguments
794 as this function must not invoke_revisionCallback inside _updateRevisionListForNewCurrentRepository.
795 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Use newly added setCurrentRepository
796 instead of manually invoking setCurrentRepository and updateRevisionListWithNotification.
797 (ChartPaneStatusView.prototype.setCurrentRepository): Fixed the bug that we weren't updating the
799 (ChartPaneStatusView.prototype.updateRevisionList): Renamed from updateRevisionListWithNotification
800 since we no longer call _revisionCallback. In general, callbacks are only meant to communicate user
801 initiated actions, and not program induced updates like this API so this was a bad pattern anyway.
802 ChartPane now explicitly updates the commit log viewer instead of relying on this function calling
803 _requestOpeningCommitViewer implicitly.
804 (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Extracted from
805 updateRevisionListWithNotification so that setCurrentRepository can also call this function.
807 * public/v3/pages/chart-pane.js:
808 (ChartPane.prototype._requestOpeningCommitViewer): Overrides ChartPaneBase's method. Open the same
809 repository in other panes via ChartsPage.setOpenRepository.
810 (ChartPane.prototype.setOpenRepository): This method is called when the user selected a repository in
811 another pane. Open the same repository in this pane if it wasn't already open.
813 * public/v3/pages/charts-page.js:
814 (ChartsPage): Added this._currentRepositoryId.
815 (ChartsPage.prototype.serializeState): Serialize _currentRepositoryId.
816 (ChartsPage.prototype.updateFromSerializedState): Set the commit log viewer's
817 (ChartsPage.prototype.setOpenRepository): Added.
819 * tests/api-measurement-set.js: Fixed a test after r198479.
821 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
823 V3 Perf Dashboard should automatically select initial range when creating a new task
824 https://bugs.webkit.org/show_bug.cgi?id=155677
826 Reviewed by Joseph Pecoraro.
828 Select the entire range of points for which the analysis task is created by default so that creating
829 a test group to confirm the regression / progression is easy.
831 * public/v3/pages/analysis-task-page.js:
832 (AnalysisTaskPage): Added a boolean flag which indicates the user had modified main chart's selection.
833 * public/v3/pages/analysis-task-page.js:
834 (AnalysisTaskPage.prototype.render): Set the main chart's selection to the entire range of points in
835 the analysis task if the user had never modified selection.
836 (AnalysisTaskPage.prototype._chartSelectionDidChange): This callback is invoked only when the user had
837 modified the selection so set _selectionWasModifiedByUser true here unconditionally.
839 2016-03-19 Ryosuke Niwa <rniwa@webkit.org>
841 Associated commits don't immediately show up on an analysis task page
842 https://bugs.webkit.org/show_bug.cgi?id=155692
844 Reviewed by Darin Adler.
846 The bug was caused by resolveCommits in AnalysisTask._constructAnalysisTasksFromRawData not being
847 able to find the matching commit log if the commit log had been created by the charts which don't
848 set the remote identifiers on each CommitLog objects.
850 Fixed the bug by modifying /api/measurement-set to include the commit ID, and making CommitLog
851 use the real database ID as its ID instead of a fake ID we create from repository and revision.
853 Also added a bunch of Mocha unit tests for AnalysisTask.fetchAll.
855 * public/api/measurement-set.php:
856 (MeasurementSetFetcher::execute_query): Fetch commit_id.
857 (MeasurementSetFetcher::format_run): Use pass-by-reference to avoid making a copy of the row.
858 (MeasurementSetFetcher::parse_revisions_array): Include commit_id as the first item in the result.
859 * public/v3/instrumentation.js:
860 * public/v3/models/analysis-task.js:
861 (AnalysisTask): Fixed a bug that _buildRequestCount and _finishedBuildRequestCount could be kept
862 as strings and hasPendingRequests() could return a wrong result because it would perform string
863 inequality instead of numerical inequality.
864 (AnalysisTask.prototype.updateSingleton): Ditto.
865 (AnalysisTask.prototype.dissociateCommit):
866 (AnalysisTask._constructAnalysisTasksFromRawData):
867 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Use findById now that CommitLog
868 objects all use the same id as the database id.
869 * public/v3/models/commit-log.js:
871 (CommitLog.prototype.remoteId): Deleted since we no longer create a fake id for commit logs for
873 (CommitLog.findByRemoteId): Deleted.
874 (CommitLog.ensureSingleton): Deleted.
875 (CommitLog.fetchBetweenRevisions):
877 * public/v3/models/data-model.js:
878 (DataModelObject.clearStaticMap): Added to aid unit testing.
879 (DataModelObject.ensureNamedStaticMap): Fixed a typo. Each map is a dictionary, not an array.
880 * public/v3/models/metric.js:
881 * public/v3/models/platform.js:
882 * public/v3/models/root-set.js:
883 (RootSet): Updated per the interface change in CommitLog.ensureSingleton.
884 (MeasurementRootSet): Updated per /api/measurement-set change. Use the first value as the id.
885 * public/v3/models/test.js:
886 * unit-tests/analysis-task-tests.js: Added.
887 (sampleAnalysisTask):
888 (measurementCluster):
889 * unit-tests/checkconfig.js: Added some assertion message to help aid diagnosing the failure.
890 * unit-tests/measurement-adaptor-tests.js: Updated the sample data per the API change in
891 /api/measurement-set and also added assertions for commit log ids.
892 * unit-tests/measurement-set-tests.js:
894 * unit-tests/resources: Added.
895 * unit-tests/resources/mock-remote-api.js: Added. Extracted from measurement-set-tests.js to be
896 used in analysis-task-tests.js.
897 (assert.notReached.assert.notReached):
898 (global.RemoteAPI.getJSON):
899 (global.RemoteAPI.getJSONWithStatus):
901 * unit-tests/resources/v3-models.js: Added. Extracted from measurement-set-tests.js to be used in
902 analysis-task-tests.js and added more imports as needed.
906 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
908 Build fix after r198464.
910 * public/v3/components/analysis-results-viewer.js:
911 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
913 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
915 Build fix after r198234.
917 * public/api/commits.php:
918 (main): Typo: fetch_latest_reported -> fetch_last_reported.
919 * public/include/commit-log-fetcher.php:
920 (CommitLogFetcher::format_single_commit): commits should be an array.
922 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
924 Perf Dashboard v3 confuses better and worse on A/B task page
925 https://bugs.webkit.org/show_bug.cgi?id=155675
926 <rdar://problem/25208723>
928 Reviewed by Joseph Pecoraro.
930 The analysis results viewer on v3 UI sometimes treats regressions as progressions and vice versa when
931 the first set (i.e. set A) of the revisions used in an A/B testing never appears in the original graph,
932 and its latest commit time matches that of the second set, which appears in the original graph.
934 Because the analysis results viewer compares results in the increasing row number, this results in
935 B to be compared to A instead of A to be compared to B. Fixed the bug by preventing the wrong ordering
936 to occur in _buildRowsForPointsAndTestGroups by always inserting a root set A before B when B appears
937 and A doesn't appear in the original graph.
939 * public/v3/components/analysis-results-viewer.js:
940 (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Remember the succeeding root set B
941 when creating an entry for root set A.
942 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Fixed the bug. Also un-duplicated
943 the code to create a new row.
944 (AnalysisResultsViewer.RootSetInTestGroup): Now takes a succeeding root set. e.g. it's B for A and
945 undefined for B in A/B testing.
946 (AnalysisResultsViewer.RootSetInTestGroup.prototype.succeedingRootSet): Added.
947 * public/v3/components/time-series-chart.js:
948 (TimeSeriesChart.computeTimeGrid): Fixed the bug that we would end up showing 0 AM instead of dates
949 when both dates and months change.
951 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
953 Add unit tests for measurement-set.js and measurement-adapter.js
954 https://bugs.webkit.org/show_bug.cgi?id=155673
956 Reviewed by Daniel Bates.
958 Add tests which were supposed to be added in r198462.
960 * unit-tests/measurement-adaptor-tests.js: Added.
961 * unit-tests/measurement-set-tests.js: Added.
962 (assert.notReached): Added.
963 (global.RemoteAPI.getJSON): Added.
964 (global.RemoteAPI.getJSONWithStatus): Added. A mock.
966 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
968 Add unit tests for measurement-set.js and measurement-adapter.js
969 https://bugs.webkit.org/show_bug.cgi?id=155673
971 Reviewed by Darin Adler.
973 Added mocha unit tests for MeasurementSet and MeasurementAdapter classes along with the necessary
974 refactoring to run these tests in node.
976 getJSON and getJSONStatus are now under RemoteAPI so that unit tests can mock them.
978 Removed the dependency on v2 UI's TimeSeries and Measurement class by adding a new implementation
979 of TimeSeries in v3 and removing the dependency on Measurement in chart-pane-status-view.js with
980 new helper methods on Build and CommitLog.
982 Many js files now use 'use strict' (node doesn't support class syntax in non-strict mode) and
983 module.exports to export symbols in node's require function.
985 * public/v3/index.html:
987 * public/v3/models/analysis-results.js:
988 (AnalysisResults.fetch):
989 * public/v3/models/analysis-task.js:
990 (AnalysisTask.fetchAll):
991 * public/v3/models/builder.js:
993 (Build.prototype.builder): Added. Used by ChartPaneStatusView.
994 (Build.prototype.buildNumber): Ditto.
995 (Build.prototype.buildTime): Ditto.
996 * public/v3/models/commit-log.js:
997 (CommitLog.prototype.diff): Ditto.
998 (CommitLog.fetchBetweenRevisions):
999 * public/v3/models/data-model.js:
1000 (DataModelObject.cachedFetch):
1001 * public/v3/models/measurement-adaptor.js:
1002 (MeasurementAdaptor.prototype.applyToAnalysisResults): Renamed from adoptToAnalysisResults.
1003 (MeasurementAdaptor.prototype.applyTo): Renamed from adoptToSeries. Now shares a lot more
1004 code with applyToAnalysisResults. The code to set 'series' and 'seriesIndex' has been moved
1005 to TimeSeries.append. 'measurement' is no longer needed as this patch removes its only use
1006 in ChartPaneStatusView.
1007 * public/v3/models/measurement-cluster.js:
1008 (MeasurementCluster.prototype.addToSeries): Use TimeSeries.append instead of directly mutating
1010 * public/v3/models/measurement-set.js:
1011 (Array.prototype.includes): Added a polyfill for node.
1012 (MeasurementSet.prototype._fetchSecondaryClusters): Removed a bogus assertion. When fetchBetween
1013 is called with a mixture of clusters that have been fetched and not fetched, this assertion fails.
1014 (MeasurementSet.prototype._fetch):
1015 (TimeSeries.prototype.findById): Moved to time-series.js.
1016 (TimeSeries.prototype.dataBetweenPoints): Ditto.
1017 (TimeSeries.prototype.firstPoint): Ditto.
1018 (TimeSeries.prototype.fetchedTimeSeries): Moved the code to extend the last point to TimeSeries'
1020 * public/v3/models/repository.js:
1021 * public/v3/models/root-set.js:
1022 (MeasurementRootSet): Ignore repositories that had not been defined (e.g. it could be added after
1023 manifest.json had been downloaded but before a given root set is created for an A/B testing).
1024 * public/v3/models/time-series.js:
1025 (TimeSeries): Added.
1026 (TimeSeries.prototype.append): Added.
1027 (TimeSeries.prototype.extendToFuture): Added.
1028 (TimeSeries.prototype.firstPoint): Moved from measurement-set.js.
1029 (TimeSeries.prototype.lastPoint): Added.
1030 (TimeSeries.prototype.previousPoint): Added.
1031 (TimeSeries.prototype.nextPoint): Added.
1032 (TimeSeries.prototype.findPointByIndex): Added.
1033 (TimeSeries.prototype.findById): Moved from measurement-set.js.
1034 (TimeSeries.prototype.findPointAfterTime): Added.
1035 (TimeSeries.prototype.dataBetweenPoints): Moved from measurement-set.js.
1036 * public/v3/pages/chart-pane-status-view.js:
1037 (ChartPaneStatusView.prototype.render): Use newly added helper functions on Build.
1038 (ChartPaneStatusView.prototype._formatTime): Added.
1039 (ChartPaneStatusView.prototype.setCurrentRepository):
1040 (ChartPaneStatusView.prototype.computeChartStatusLabels): Rewrote the code using RootSet object on
1041 currentPoint and previousPoint instead of Measurement class from v2 UI. Also sort the results using
1042 sortByNamePreferringOnesWithURL.
1043 * public/v3/remote.js:
1044 (RemoteAPI.getJSON): Moved under RemoteAPI.
1045 (RemoteAPI.getJSONWithStatus): Ditto.
1047 (PrivilegedAPI.requestCSRFToken):
1049 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1051 Add unit tests for config.json and statistics.js
1052 https://bugs.webkit.org/show_bug.cgi?id=155626
1054 Reviewed by Darin Adler.
1056 Added mocha unit tests for statistics.js and validating config.json. For segmentations, I've extracted
1057 real data from our internal perf dashboard.
1059 Also fixed some bugs covered by these new tests.
1061 * public/shared/statistics.js:
1062 (Statistics.movingAverage): Fixed a bug that forwardWindowSize was never used.
1063 (Statistics.exponentialMovingAverage): Fixed the bug that the moving average starts at 0. It should
1064 start at the first value instead.
1065 (.splitIntoSegmentsUntilGoodEnough): Fixed the bug that we may try to segment a time series into
1066 more parts than there are data points. Clearly, that doesn't make any sense.
1067 (.findOptimalSegmentation): Renamed local variables so that they're more descriptive, and rewrote
1068 the debugging code was the old code was emitting some useless data. Also fixed the bug that the length
1069 of "segmentation" was off by one (we need segmentCount + 1 elements in the array sine we always
1070 include the start of the first segment = 0 and the end of the last segment = values.length).
1071 (.SampleVarianceUpperTriangularMatrix):
1072 (Statistics): Modernized the export code.
1074 * tools/js/config.js: Added.
1076 (Config.prototype.configFilePath): Added.
1077 (Config.prototype.value): Added.
1078 (Config.prototype.path): Added.
1079 * tools/js/database.js: Added.
1081 (Database.prototype.connect): Added.
1082 (Database.prototype.disconnect): Added.
1083 * unit-tests: Added.
1084 * unit-tests/checkconfig.js: Added. Validates config.json. This is useful while setting up
1085 a local instance of the perf dashboard.
1086 * unit-tests/statistics-tests.js: Added.
1087 (assert.almostEqual): Added. Asserts that two floating values are within a given significant digits.
1092 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1094 Fix a typo which was supposed to be fixed in r198351.
1096 * public/v3/pages/analysis-task-page.js:
1097 (AnalysisTaskPage.prototype.render):
1099 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1101 An analysis task should be closed if a progression cause is identified
1102 https://bugs.webkit.org/show_bug.cgi?id=155549
1104 Reviewed by Chris Dumez.
1106 Since a progression is desirable, we should close an analysis task once its cause is identified.
1108 Also fix some typos.
1110 * init-database.sql: Fixed a typo.
1111 * public/api/analysis-tasks.php:
1112 * public/v3/models/analysis-task.js:
1113 (AnalysisTask.prototype.dissociateBug): Renamed from dissociateBug.
1114 * public/v3/pages/analysis-task-page.js:
1115 (AnalysisTaskPage.prototype.render):
1116 (AnalysisTaskPage.prototype._dissociateBug): Renamed from _dissociateBug.
1117 (AnalysisTaskPage.prototype._dissociateCommit): Fixed the typo in the alert.
1119 2016-03-16 Ryosuke Niwa <rniwa@webkit.org>
1121 Analysis task page should allow specifying commits that caused or fixed a regression or a progression
1122 https://bugs.webkit.org/show_bug.cgi?id=155529
1124 Reviewed by Chris Dumez.
1126 Added the capability to associate revisions that caused or fixed a progression or a regression for which
1127 an analysis task was created. Added task_commits that stores this relationship and added the backend
1128 support to retrieve this table in /api/analysis-tasks and an privileged API to update this table at
1129 /privileged-api/associate-commit.
1131 Also extracted a new component, MutableListView, out of AnalysisTaskPage to render and manipulate a list
1132 of mutable items, and used it to render the list of associated bugs and commits. The view takes a list of
1133 kinds (e.g. repositories or bug trackers), and accepts a pair of a kind and arbitrary text as a new item
1136 * init-database.sql: Added task_commits table.
1138 * public/api/analysis-tasks.php:
1140 (fetch_associated_data_for_tasks): Renamed from fetch_and_push_bugs_to_tasks now that it also fetches
1141 the list of commits associated with each analysis task by calling CommitLogFetcher::fetch_for_tasks.
1142 Also fixe the bug that we were not taking
1143 (format_task): No longer sets 'category' since the computation of category now depends on the list of
1144 commits associated with this analysis task which aren't available until fetch_associated_data_for_tasks.
1145 (determine_category): Added. Categorize any analysis tasks with "fixes" commits as "closed" and "causes"
1146 commits as "identified".
1148 * public/include/commit-log-fetcher.php:
1149 (CommitLogFetcher::__construct): Remove the unused instance variable.
1150 (CommitLogFetcher::fetch_for_tasks): Added. Fetches all commits associated with a list of analysis tasks.
1151 Assumes the caller (fetch_associated_data_for_tasks) had setup "fixes" and "causes" fields on each task.
1153 * public/privileged-api/associate-commit.php: Added. Updates task_commits table to associate or disassociate
1154 a commit with an analysis task. When the specified analysis task and the specified commit are already
1155 associated, we simply update the table instead of adding a duplicating entry or error. For dissociation,
1156 the front-end specifies the commit ID.
1159 * public/v3/index.html:
1160 * public/v3/components/mutable-list-view.js: Added. Used by the list associated bugs and commits.
1161 (MutableListView): Added.
1162 (MutableListView.prototype.setList): Added.
1163 (MutableListView.prototype.setKindList): Added.
1164 (MutableListView.prototype.setAddCallback): Added. This callback is invoked when the user tries to add
1165 a new item to the list.
1166 (MutableListView.prototype.render): Added.
1167 (MutableListView.prototype._submitted): Added.
1168 (MutableListView.cssTemplate):
1169 (MutableListView.htmlTemplate):
1170 (MutableListItem): Added. RemovalLink could be a hyperlink or a callback and gets involved when the user
1171 tries to delete this item.
1172 (MutableListItem.prototype.content):
1174 * public/v3/models/analysis-task.js:
1175 (AnalysisTask): Added the support of the list of commits that fixed and caused changes.
1176 (AnalysisTask.prototype.updateSingleton): Ditto.
1177 (AnalysisTask.prototype.causes): Added.
1178 (AnalysisTask.prototype.fixes): Added.
1179 (AnalysisTask.prototype.associateCommit): Added. Use the API added at /privileged-api/associate-commit
1180 to associate a new commit with this analysis task. Each commit has either caused or fixed the change.
1181 (AnalysisTask.prototype.dissociateCommit): Added. Use the same API to disassociate each commit.
1182 (AnalysisTask._constructAnalysisTasksFromRawData): Find all commits associated with each analysis task.
1183 Because commit log objects use a fake ID fdue to /api/measurement-set not providing commit IDs, we must
1184 use CommitLog.findByRemoteId to find each commit instead of usual CommitLog.findById.
1185 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Added.
1187 * public/v3/models/build-request.js:
1188 (BuildRequest.prototype.hasFinished): Renamed from hasCompleted since it was confusing for this._status
1189 being "completed" wasn't a necessary condition for this function to return true.
1191 * public/v3/models/commit-log.js:
1192 (CommitLog): Added the static map for actual commit ID instead of a fake ID created in ensureSingleton.
1193 (CommitLog.prototype.remoteId): Added. Returns the real commit ID.
1194 (CommitLog.findByRemoteId): Added. Finds an CommitLog object using the real ID.
1196 * public/v3/models/test-group.js:
1197 (TestGroup.prototype.hasFinished): Renamed from hasCompleted to match the rename in BuildRequest.
1199 * public/v3/pages/analysis-task-page.js:
1200 (AnalysisTaskPage): Added lists for the commits that fixed and caused the change using MutableListView.
1201 Also adopted MutableListView for the list of associated bugs.
1202 (AnalysisTaskPage.prototype.render): Added the code to populate the newly added lists.
1203 (AnalysisTaskPage.prototype._makeCommitListItem): Added.
1204 (AnalysisTaskPage.prototype._associateBug): Now this is a callback from MutableListView.
1205 (AnalysisTaskPage.prototype._associateCommit): Added.
1206 (AnalysisTaskPage.prototype._dissociateCommit): Added.
1207 (AnalysisTaskPage.htmlTemplate):
1208 (AnalysisTaskPage.cssTemplate):
1210 * public/v3/remote.js:
1211 (getJSON): Spit out the entire responseText when JSON failed to parse to make debugging easier.
1213 2016-03-15 Ryosuke Niwa <rniwa@webkit.org>
1215 Extract the code to format commit logs into its own PHP file
1216 https://bugs.webkit.org/show_bug.cgi?id=155514
1218 Rubber-stamped by Chris Dumez.
1220 Extracted CommitLogFetcher out of /api/commits so that it could be used in analysis-tasks.php
1221 in the future to support associating cause/fix for each analysis task.
1223 * public/api/commits.php:
1224 * public/include/commit-log-fetcher.php: Added.
1226 (CommitLogFetcher::__construct): Added.
1227 (CommitLogFetcher::repository_id_from_name): Added.
1228 (CommitLogFetcher::fetch_between): Added.
1229 (CommitLogFetcher::fetch_oldest): Added.
1230 (CommitLogFetcher::fetch_latest): Added.
1231 (CommitLogFetcher::fetch_last_reported): Added.
1232 (CommitLogFetcher::fetch_revision): Added.
1233 (CommitLogFetcher::commit_for_revision): Added.
1234 (CommitLogFetcher::format_single_commit): Added.
1235 (CommitLogFetcher::format_commit): Added.
1237 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
1239 Build fix after r196870.
1241 * public/include/report-processor.php:
1243 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
1245 Add Size metric to perf dashboard
1246 https://bugs.webkit.org/show_bug.cgi?id=155266
1248 Reviewed by Chris Dumez.
1250 Added the "Size" metric and use bytes as its unit.
1252 * public/js/helper-classes.js:
1254 * public/v2/data.js:
1255 (RunsData.unitFromMetricName):
1257 2016-02-20 Ryosuke Niwa <rniwa@webkit.org>
1259 Add the support for universal slave password
1260 https://bugs.webkit.org/show_bug.cgi?id=154476
1262 Reviewed by David Kilzer.
1264 Added the support for universalSlavePassword.
1267 * public/include/report-processor.php:
1268 (ReportProcessor::process):
1269 (ReportProcessor::authenticate_and_construct_build_data): Extracted from process().
1271 2016-02-19 Ryosuke Niwa <rniwa@webkit.org>
1273 Analysis tasks page complains about missing repository but with a wrong name
1274 https://bugs.webkit.org/show_bug.cgi?id=154468
1276 Reviewed by Chris Dumez.
1278 Fixed the bug by using the right variable in the template literal.
1280 * public/v3/components/customizable-test-group-form.js:
1281 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use querySelector here since Chrome doesn't have
1282 getElementsByClassName on ShadowRoot.
1283 * public/v3/pages/analysis-task-page.js:
1284 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Use name which is the name of
1287 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1289 Revert an unintended change made in the previous commit.
1291 * init-database.sql:
1293 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1295 Perf dashboard should let user cancel pending A/B testing and hide failed ones
1296 https://bugs.webkit.org/show_bug.cgi?id=154433
1298 Reviewed by Chris Dumez.
1300 Added a button to hide a test group in the details view (the bottom table) in the analysis task page, and
1301 "Show hidden tests" link to show the hidden test groups on demand. When a test group is hidden, all pending
1302 requests in the group will also be canceled since a common scenario of using this feature is that the user
1303 had triggered an useless A/B testing; e.g. all builds will fail, wrong, etc... We can revisit and add the
1304 capability to just cancel the pending requests and leaving the group visible later if necessary.
1306 Run `ALTER TYPE build_request_status_type ADD VALUE 'canceled';` to add the new type.
1308 * init-database.sql: Added testgroup_hidden column to analysis_test_groups table and added 'canceled'
1309 as a value to build_request_status_type table.
1310 * public/api/test-groups.php:
1311 (format_test_group): Added 'hidden' field in the JSON result.
1312 * public/privileged-api/update-test-group.php:
1313 (main): Added the support for updating testgroup_hidden column. When this column is set to true, also
1314 cancel all pending build requests (by setting its request_status to 'canceled' which will be ignore by
1315 the syncing script).
1316 * public/v3/components/test-group-results-table.js:
1317 (TestGroupResultsTable.prototype.setTestGroup): Reset _renderedTestGroup here so that the next call to
1318 render() will update the table; e.g. when build requests' status change from 'Pending' to 'Canceled'.
1319 * public/v3/models/build-request.js:
1320 (BuildRequest.prototype.hasCompleted): A build request is considered complete/finished if it's canceled.
1321 (BuildRequest.prototype.hasPending): Added.
1322 (BuildRequest.prototype.statusLabel): Handle 'canceled' status.
1323 * public/v3/models/test-group.js:
1325 (TestGroup.prototype.updateSingleton): Added to update 'hidden' field.
1326 (TestGroup.prototype.isHidden): Added.
1327 (TestGroup.prototype.hasPending): Added.
1328 (TestGroup.prototype.hasPending): Added.
1329 (TestGroup.prototype.updateHiddenFlag): Added. Uses the privileged API to update testgroup_hidden column.
1330 The JSON API also updates the status of the 'pending' build requests in the group to 'canceled'.
1331 * public/v3/pages/analysis-task-page.js:
1332 (AnalysisTaskPage): Added _showHiddenTestGroups and _filteredTestGroups as instance variables.
1333 (AnalysisTaskPage.prototype._didFetchTestGroups):
1334 (AnalysisTaskPage.prototype._showAllTestGroups): Added.
1335 (AnalysisTaskPage.prototype._didUpdateTestGroupHiddenState): Extracted from _didFetchTestGroups.
1336 (AnalysisTaskPage.prototype._renderTestGroupList): Use the filtered list of test groups to show the list
1337 of test groups. When all test groups are shown, we would first show the hidden ones after the regular ones.
1338 (AnalysisTaskPage.prototype._createTestGroupListItem): Extracted from _renderTestGroupList.
1339 (AnalysisTaskPage.prototype._renderTestGroupDetails): Update the text inside the button to hide the test
1340 group. Also show a warning text that the pending requests will be canceled if there are any.
1341 (AnalysisTaskPage.prototype._hideCurrentTestGroup): Added.
1342 (AnalysisTaskPage.cssTemplate): Updated the style.
1344 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1346 The rows in the analysis results table should be expandable
1347 https://bugs.webkit.org/show_bug.cgi?id=154427
1349 Reviewed by Chris Dumez.
1351 Added "(Expand)" link between rows that have hidden points. Upon click it inserts the hidden rows.
1353 We insert around five rows at a time when there are hundreds of hidden points but we also avoid leaving
1354 behind expandable rows of less than two rows.
1356 Also fixed a bug in CustomizableTestGroupForm that getElementsById would throw in the shipping Safari
1357 because getElementsById doesn't exist on Element.prototype by using class name instead.
1359 * public/v3/components/analysis-results-viewer.js:
1360 (AnalysisResultsViewer):
1361 (AnalysisResultsViewer.prototype.setCurrentTestGroup): Removed superfluous call to render().
1362 (AnalysisResultsViewer.prototype.setPoints): Always show the start and the end points.
1363 (AnalysisResultsViewer.prototype.buildRowGroups):
1364 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Add an instance of ExpandableRow which
1365 shows a "(Expand)" link to show hidden rows here.
1366 (AnalysisResultsViewer.prototype._expandBetween): Added. Expands rows between two points.
1367 (AnalysisResultsViewer.cssTemplate): Added rules for "(Expand)" links.
1368 (AnalysisResultsViewer.ExpandableRow): Added.
1369 (AnalysisResultsViewer.ExpandableRow.prototype.resultContent): Added. Overrides what's in the results column.
1370 (AnalysisResultsViewer.ExpandableRow.prototype.heading): Added. Generates "(Expand)" link.
1372 * public/v3/components/customizable-test-group-form.js:
1373 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use getElementsByClassName instead of
1375 (CustomizableTestGroupForm.prototype._classForLabelAndRepository): Renamed from _idForLabelAndRepository.
1376 (CustomizableTestGroupForm._constructRevisionRadioButtons): Set class name instead of id.
1378 * public/v3/components/results-table.js:
1379 (ResultsTable.prototype.render): Don't generate radio buttons to select a row when root set is missing;
1380 e.g. for rows that show "(Expand)" links.
1382 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
1384 Statistically significant A/B testing results should be color coded in details view
1385 https://bugs.webkit.org/show_bug.cgi?id=154414
1387 Reviewed by Chris Dumez.
1389 Color code the statistically significant comparisions in TestGroupResultsTable as done in the analysis
1392 * public/v3/components/customizable-test-group-form.js:
1393 (CustomizableTestGroupForm.cssTemplate): Build fix after r196768.
1394 * public/v3/components/test-group-results-table.js:
1395 (TestGroupResultsTable.prototype.buildRowGroups): Add the status as a class name.
1396 (TestGroupResultsTable.cssTemplate): Added styles to color-code statistically significant results.
1398 2016-02-17 Ryosuke Niwa <rniwa@webkit.org>
1400 v3 UI should allow custom revisions for A/B testing
1401 https://bugs.webkit.org/show_bug.cgi?id=154379
1403 Reviewed by Chris Dumez.
1405 Added the capability to customize revisions selected in the overview chart and the results viewer.
1407 Newly added CustomizableTestGroupForm is responsible for allowing users to modify the set of revisions in
1408 a new A/B testing group. Unlike TestGroupForm which doesn't know anything about which revisions are selected
1409 for each project/repository, CustomizableTestGroupForm is aware of the list of revisions used in each set.
1411 The list of revisions used in each set is represented by RootSet if users had not customized them, and
1412 CustomRootSet otherwise; the latter was added since regular RootSet object requires CommitLog and other
1413 DataModelObjects which are hard to create without corresponding database entries.
1415 * public/v3/components/customizable-test-group-form.js: Added.
1416 (CustomizableTestGroupForm): Added.
1417 (CustomizableTestGroupForm.prototype.setRootSetMap): Added.
1418 (CustomizableTestGroupForm.prototype._submitted): Overrides the superclass' method.
1419 (CustomizableTestGroupForm.prototype._customize): Ditto. Unlike TestGroupForm's callback, this class'
1420 callback passes in a root set map as the third argument.
1421 (CustomizableTestGroupForm.prototype._computeRootSetMap): Added. Returns this._rootSetMap, which is set by
1422 AnalysisTaskPage if user had not customized the root sets. Otherwise return a new map with CustomRootSet's.
1423 (CustomizableTestGroupForm.prototype.render): Added. Creates a table to allow customization of root sets.
1424 (CustomizableTestGroupForm._constructRevisionRadioButtons): Added.
1425 (CustomizableTestGroupForm._createRadioButton): Added.
1426 (CustomizableTestGroupForm.cssTemplate): Added.
1427 (CustomizableTestGroupForm.formContent): Added. This method is called by TestGroupForm.htmlTemplate.
1428 * public/v3/components/test-group-form.js:
1429 (TestGroupForm): Updated the various methods to not directly mutate DOM. Store the state in instance
1430 variables and update DOM in render() as done elsewhere.
1431 (TestGroupForm.prototype.setNeedsName): Deleted. We no longer need this flag since TestGroupForm which is
1432 used for retries never needs a name and CustomizableTestGroupForm which is used to create a new test group
1433 always requires a name.
1434 (TestGroupForm.prototype.setDisabled):
1435 (TestGroupForm.prototype.setLabel):
1436 (TestGroupForm.prototype.setRepetitionCount):
1437 (TestGroupForm.prototype.render): Added.
1438 (TestGroupForm.prototype._submitted): Moved the code to prevent the default action has been moved to the
1439 constructor since this method is overridden by CustomizableTestGroupForm.
1440 (TestGroupForm.cssTemplate): Added.
1441 (TestGroupForm.htmlTemplate):
1442 (TestGroupForm.formContent): Extracted from htmlTemplate.
1443 * public/v3/index.html:
1444 * public/v3/models/repository.js:
1445 (Repository.sortByNamePreferringOnesWithURL): Added.
1446 * public/v3/models/root-set.js:
1447 (RootSet.prototype.revisionForRepository): Added so that _createTestGroupAfterVerifyingRootSetList can retrieve
1448 the revision information from CustomRootSet without going through CommitLog objects since CustomRootSet doesn't
1449 have associated CommitLog objects.
1450 (CustomRootSet): Added. Used by CustomizableTestGroupForm to create a custom root map since regular RootSet
1451 requires CommitLog and other related objects which are hard to create without database entries.
1452 (CustomRootSet.prototype.setRevisionForRepository): Added.
1453 (CustomRootSet.prototype.repositories): Added.
1454 (CustomRootSet.prototype.revisionForRepository): Added.
1455 * public/v3/pages/analysis-task-page.js:
1457 (AnalysisTaskPage.prototype.render): Removed the reference to v2 UI since v3 UI is now strictly more powerful
1458 than v2 UI. Also update the root set maps in each form here.
1459 (AnalysisTaskPage.prototype._retryCurrentTestGroup): No longer takes unused name argument as it got removed
1461 (AnalysisTaskPage.prototype._chartSelectionDidChange): No longer updates the disabled-ness here since it's now
1462 done in render() via setRootSetMap().
1463 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Now takes rootSetMap as an argument.
1464 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): No longer updates the disabled-ness here
1465 since it's now done in render() via setRootSetMap().
1466 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Now takes rootSetMap as an argument.
1467 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Take a dictionary of root set labels
1468 such as A and B, which maps to a RootSet or a newly-added CustomRootSet.
1469 (AnalysisTaskPage.htmlTemplate): Use customizable-test-group-form for creating a new A/B testing group. Retry
1470 form will continue to use TestGroupForm since customizing revisions is non-sensical in retries.
1471 (AnalysisTaskPage.cssTemplate): Updated the style.
1473 2016-02-16 Ryosuke Niwa <rniwa@webkit.org>
1475 v3 UI has the capability to schedule an A/B testing in a specific range
1476 https://bugs.webkit.org/show_bug.cgi?id=154329
1478 Reviewed by Chris Dumez.
1480 Extended AnalysisTaskChartPane and ResultsTable so that users can select a range of points in either
1481 the overview chart pane and the results viewer table. Extracted TestGroupForm out of the analysis task
1482 page and used right below those two components in the analysis task page.
1484 * public/v3/components/results-table.js:
1486 (ResultsTable.prototype.setRangeSelectorLabels): Added.
1487 (ResultsTable.prototype.setRangeSelectorCallback): Added.
1488 (ResultsTable.prototype.selectedRange): Added.
1489 (ResultsTable.prototype._rangeSelectorClicked): Added.
1490 (ResultsTable.prototype.render): Generate radio boxes to select a range.
1492 * public/v3/components/test-group-form.js:
1494 (TestGroupForm.prototype.setStartCallback): Added.
1495 (TestGroupForm.prototype.setNeedsName): Added.
1496 (TestGroupForm.prototype.setDisabled): Added.
1497 (TestGroupForm.prototype.setLabel): Added.
1498 (TestGroupForm.prototype.setRepetitionCount): Added.
1499 (TestGroupForm.prototype._submitted): Added.
1500 (TestGroupForm.htmlTemplate): Extracted from AnalysisTaskPage.htmlTemplate.
1502 * public/v3/index.html:
1504 * public/v3/pages/analysis-task-page.js:
1505 (AnalysisTaskChartPane.prototype._mainSelectionDidChange): Added. Delegates the work to AnalysisTaskPage.
1506 (AnalysisTaskChartPane.prototype.selectedPoints): Added.
1508 (AnalysisTaskPage.prototype.title):
1509 (AnalysisTaskPage.prototype.render):
1510 (AnalysisTaskPage.prototype._renderTestGroupDetails): Use TestGroupForm's methods instead of mutating DOM.
1511 (AnalysisTaskPage.prototype._retryCurrentTestGroup):
1512 (AnalysisTaskPage.prototype._chartSelectionDidChange): Added.
1513 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Added.
1514 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): Added.
1515 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Added.
1516 (AnalysisTaskPage.prototype._createRetryNameForTestGroup):
1517 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Extracted from _retryCurrentTestGroup
1518 so that we can call it in _createNewTestGroupFromChart and _createNewTestGroupFromViewer.
1519 (AnalysisTaskPage.htmlTemplate):
1521 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
1523 Extract the code specific to v2 UI out of shared statistics.js
1524 https://bugs.webkit.org/show_bug.cgi?id=154277
1526 Reviewed by Chris Dumez.
1528 Extracted statistics-strategies.js out of statistics.js for v2 UI and detect-changes.js. The intent is to
1529 deprecate this file once we implement refined statistics tools in v3 UI and adopt it in detect-changes.js.
1531 * public/shared/statistics.js:
1532 (Statistics.movingAverage): Extracted from the "Simple Moving Average" strategy.
1533 (Statistics.cumultaiveMovingAverage): Extracted from the "Cumulative Moving Average" strategy.
1534 (Statistics.exponentialMovingAverage): Extracted from the "Exponential Moving Average" strategy.
1535 Use a temporary "movingAverage" to keep the last moving average instead of relying on the previous
1536 entry in "averages" array to avoid special casing an array of length 1 and starting the loop at i = 1.
1537 (Statistics.segmentTimeSeriesGreedyWithStudentsTTest): Extracted from "Segmentation: Recursive t-test"
1538 strategy. Don't create the list of averages to match segmentTimeSeriesByMaximizingSchwarzCriterion here.
1539 It's done in newly added averagesFromSegments.
1540 (Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Extracted from
1541 "Segmentation: Schwarz criterion" strategy.
1542 (.recursivelySplitIntoTwoSegmentsAtMaxTIfSignificantlyDifferent): Just store the start index to match
1544 (App.Pane.updateStatisticsTools):
1545 (App.Pane._computeMovingAverageAndOutliers):
1546 * public/v2/data.js:
1547 * public/v2/index.html:
1548 * public/v2/statistics-strategies.js: Added.
1549 (StatisticsStrategies.MovingAverageStrategies): Added.
1550 (averagesFromSegments): Extracted from "Segmentation: Schwarz criterion" strategy. Now used by both
1551 "Segmentation: Recursive t-test" and "Segmentation: Schwarz criterion" strategies.
1552 (StatisticsStrategies.EnvelopingStrategies): Moved from Statistics.EnvelopingStrategies.
1553 (StatisticsStrategies.TestRangeSelectionStrategies): Moved from Statistics.TestRangeSelectionStrategies.
1554 (createWesternElectricRule): Moved from statistics.js.
1555 (countValuesOnSameSide): Ditto.
1556 (StatisticsStrategies.executeStrategy): Moved from Statistics.executeStrategy.
1557 * tools/detect-changes.js:
1558 (computeRangesForTesting):
1560 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
1562 v1 UI and v2 UI should share statistics.js
1563 https://bugs.webkit.org/show_bug.cgi?id=154262
1565 Reviewed by Chris Dumez.
1567 Share statistics.js between v1 and v2 UI.
1569 * public/index.html:
1570 * public/js/shared.js: Deleted.
1571 * public/js/statistics.js: Removed.
1572 * public/shared: Added.
1573 * public/shared/statistics.js: Moved from Websites/perf.webkit.org/public/v2/js/statistics.js.
1574 * public/v2/index.html:
1575 * public/v2/js/statistics.js: Removed.
1576 * public/v3/index.html:
1577 * tools/detect-changes.js:
1579 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
1581 v3 UI sometimes shows same dates twice on the x-axis of time series charts
1582 https://bugs.webkit.org/show_bug.cgi?id=154210
1584 Reviewed by Chris Dumez.
1586 The bug was caused by the label generation code in TimeSeriesChart.computeTimeGrid never emitting hours.
1588 Use hours instead of dates as labels when the current time's date is same as the previous label's date.
1589 Always include dates before entering this mode to avoid just having hours as labels on the entire x-axis.
1591 * public/v3/components/time-series-chart.js:
1592 (TimeSeriesChart.prototype._renderXAxis): Slightly increase the "average" width of x-axis label.
1593 (TimeSeriesChart.computeTimeGrid): See above. Also assert that the number of labels we generate never
1594 exceeds maxLabels as a sanity check.
1595 (TimeSeriesChart._timeIterators): Added an iterator that increments by two hours for zoomed graphs.
1597 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
1599 v3 UI should show status and associated bugs on analysis task pages
1600 https://bugs.webkit.org/show_bug.cgi?id=154212
1602 Reviewed by Chris Dumez.
1604 Added the capability to see and modify the status and the list of associated of bugs on analysis task pages.
1606 Also added the list of related tasks, which are analysis tasks associated with the same bug or have
1607 overlapping time ranges with the same test metric but on a potentially different platform.
1609 In addition, categorize analysis tasks with the status of "no change" or "inconclusive" as "closed" as no
1610 further action can be taken (users can bring them back to non-closed state without any restrictions).
1612 * public/api/analysis-tasks.php:
1613 (format_task): Categorize 'unchanged' and 'inconclusive' analysis tasks as closed.
1615 * public/privileged-api/associate-bug.php:
1616 (main): Added shouldDelete as a new mechanism to disassociate a bug since v3 UI shares a single Bug object
1617 between multiple analysis tasks (as it should have been in the first place).
1619 * public/v3/components/chart-pane-base.js:
1621 (ChartPaneBase.prototype._fetchAnalysisTasks): Since each analysis task's change type (status/result) could
1622 change, we need to create annotation objects during each render() call.
1623 (ChartPaneBase.prototype.render):
1624 (ChartPaneBase.prototype._renderAnnotations): Extracted from ChartPaneBase.prototype._fetchAnalysisTasks to
1625 do that. I was afraid of the perf impact of this but it doesn't seem to be an issue in my testing.
1626 (ChartPaneBase.cssTemplate): Removed superfluous margins (moved to ChartPane.cssTemplate) around the charts
1627 since they are only useful in the charts page.
1629 * public/v3/models/analysis-task.js:
1631 (AnalysisTask.prototype.updateSingleton): Added a comment as to why object.result cannot be renamed to
1632 object.changeType in the JSON API.
1633 (AnalysisTask.prototype.updateName): Added.
1634 (AnalysisTask.prototype.updateChangeType): Added.
1635 (AnalysisTask.prototype._updateRemoteState): Added.
1636 (AnalysisTask.prototype.associateBug): Added.
1637 (AnalysisTask.prototype.disassociateBug): Added.
1638 (AnalysisTask.fetchRelatedTasks): Added. See above for the criteria of related-ness.
1640 * public/v3/pages/analysis-task-page.js:
1642 (AnalysisTaskPage.prototype.updateFromSerializedState):
1643 (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): Extracted from updateFromSerializedState.
1644 (AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks): Added.
1645 (AnalysisTaskPage.prototype.render): Render the list of associated bugs, the list of bug trackers (so that
1646 users can use it to associate with a new bug), and the list of related analysis tasks.
1647 (AnalysisTaskPage.prototype._renderTestGroupList): Extracted from render since it was getting too long.
1648 (AnalysisTaskPage.prototype._renderTestGroupDetails): Ditto.
1649 (AnalysisTaskPage.prototype._updateChangeType): Added.
1650 (AnalysisTaskPage.prototype._associateBug): Added.
1651 (AnalysisTaskPage.prototype._disassociateBug): Added.
1652 (AnalysisTaskPage.htmlTemplate): Added various elements to show and modify the status, associate bugs,
1653 and a list of related analysis tasks.
1654 (AnalysisTaskPage.cssTemplate): Added various styles for those form controls.
1656 * public/v3/pages/chart-pane.js:
1657 (ChartPane.cssTemplate): Moved the margins from ChartPaneBase.cssTemplate.
1659 2016-02-12 Ryosuke Niwa <rniwa@webkit.org>
1661 Perf dashboard should allow renaming analysis tasks and test groups
1662 https://bugs.webkit.org/show_bug.cgi?id=154200
1664 Reviewed by Chris Dumez.
1666 Allow editing names of analysis tasks and A/B testing groups in the v3 UI.
1668 Added the support for updating the name to the privileged API at /privileged-api/update-analysis-task
1669 and added a new prevailed API to update A/B testing groups at /privileged-api/update-test-group.
1671 * public/privileged-api/update-analysis-task.php: Added the support for renaming the analysis task.
1674 * public/privileged-api/update-test-group.php: Added. Supports updating the test group's name.
1677 * public/v3/components/editable-text.js: Added.
1678 (EditableText): Added. A new editable text label control. It looks like a text node with "(Edit)" link
1679 at the end which allow users to go into the "editing mode", which reveals an input element.
1680 The user can exit the editing mode by either moving the focus away from the control or clicking on
1681 "(Save)" at the end. It calls _updateCallback in the latter case.
1682 (EditableText.prototype.editedText): Returns the current value of the input element user.
1683 (EditableText.prototype.setText): Sets the label. This does not live-update the input element until
1684 the user exists the current editing mode and re-enters it.
1685 (EditableText.prototype.setStartedEditingCallback): Sets a callback which gets called when the user
1686 requested to enter the editing mode. Since EditableText relies on AnalysisTaskPage to render, this
1687 callback only exits to call EditableText.render() in AnalysisTask._didStartEditingTaskName.
1688 (EditableText.prototype.setUpdateCallback): Sets a callback which gets called when the user exits
1689 the editing mode by activating the "(Save)" link. This callback MUST return a promise upon resolution
1690 of which the control gets out of the editing mode. While the promise is in flight, the input element
1692 (EditableText.prototype.render): Updates various states of the elements. When _updatingPromise is not
1693 falsy, we make the input element readonly and show '(...)' on the link. Don't show the action link
1694 if the label is empty (e.g. analysis task or test group is still being fetched).
1695 (EditableText.prototype._didClick): Called when the user clicked on the action link. Enter the editing
1696 mode or save the edited label via _updateCallback.
1697 (EditableText.prototype._didBlur): Exit the editing mode without saving if the input element is not
1698 focused, there is no inflight promise returned by _updateCallback, and the action link "(Save)" does
1700 (EditableText.prototype._didUpdate): Called when exiting the editing mode.
1701 (EditableText.htmlTemplate):
1702 (EditableText.cssTemplate):
1704 * public/v3/index.html: Include newly added editable-text.js.
1706 * public/v3/models/analysis-task.js:
1707 (AnalysisTask.prototype.updateSingleton): Added.
1708 (AnalysisTask.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
1709 the analysis task from the sever.
1710 (AnalysisTask._constructAnalysisTasksFromRawData): Use ensureSingleton instead of manually calling
1711 findById since we need to update the name of the singleton object we found (via updateSingleton).
1713 * public/v3/models/bug.js:
1714 (Bug.ensureSingleton): Moved the code to compute the synthetic id from AnalysisTask's
1715 _constructAnalysisTasksFromRawData.
1716 (Bug.prototype.updateSingleton): Added. Just assert that nothing changes.
1718 * public/v3/models/build-request.js:
1719 (BuildRequest.prototype.updateSingleton): Added. Assert that the intrinsic values of a build request
1720 doesn't change and update status text, status url, and build id as they could change.
1722 * public/v3/models/commit-log.js:
1723 (CommitLog): Made the constructor argument conform to the convention of id, object pair so that we can
1724 use DataModelObject.ensureSingleton.
1725 (CommitLog.ensureSingleton):
1726 (CommitLog.prototype.updateSingleton): Extracted from CommitLog.ensureSingleton.
1728 * public/v3/models/data-model.js:
1729 (DataModelObject.ensureSingleton): Call newly added updateSingleton.
1730 (DataModelObject.prototype.updateSingleton):
1731 (LabeledObject): Removed the name map since it's never used (findByName is never called anywhere).
1732 (LabeledObject.prototype.updateSingleton): Added. Updates _name.
1733 (LabeledObject.findByName): Deleted.
1735 * public/v3/models/test-group.js:
1736 (TestGroup.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
1737 the test group from the sever.
1738 (TestGroup._createModelsFromFetchedTestGroups): Removed bogus code. A root set doesn't have a test
1739 group associated with it since multiple test groups can share a single root set (this property doesn't
1742 * public/v3/pages/analysis-task-page.js:
1743 (AnalysisTaskPage): Removed useless _taskId and added this._testGroupLabelMap and this._taskNameLabel.
1744 (AnalysisTaskPage.prototype.updateFromSerializedState): Cleanup.
1745 (AnalysisTaskPage.prototype._didFetchTask): Assert that this function is called exactly once.
1746 (AnalysisTaskPage.prototype.render): Use this._task.id() to show the v2 link. Use EditableText to show
1747 the names of the analysis task and the associated test groups. Hide the overview chart and the list of
1748 test groups (along with the retry/confirm button) when the analysis task failed to fetch. We always
1749 update the names of the analysis task and the associated test groups since they could be updated by
1751 (AnalysisTaskPage.prototype._didStartEditingTaskName): Added.
1752 (AnalysisTaskPage.prototype._updateTaskName): Added.
1753 (AnalysisTaskPage.prototype._updateTestGroupName): Added.
1754 (AnalysisTaskPage.htmlTemplate): Updated the style.
1756 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1758 Land the change that was supposed to be the part of r196463.
1760 * public/v3/pages/analysis-task-page.js:
1761 (AnalysisTaskPage.prototype._didFetchTestGroups): Select the latest test group by default.
1763 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1765 Refine v3 UI's analysis task page
1766 https://bugs.webkit.org/show_bug.cgi?id=154152
1768 Reviewed by Chris Dumez.
1770 This patch makes the following refinements to the analysis task page:
1771 - Always show the relative different of in-progress A/B testing.
1772 - Make the annotations (colored bars) in the chart open other analysis tasks.
1773 - Order the A/B testing groups in the reverse chronological order.
1774 - Select the time range corresponding to the current test group.
1776 * public/v3/components/analysis-results-viewer.js:
1777 (AnalysisResultsViewer.cssTemplate): Fixed the bug that pending and running testing groups are no longer
1778 colored after r196440. Use a slightly more opaque color for currently running groups compared to pending ones.
1780 * public/v3/components/chart-pane-base.js:
1781 (ChartPaneBase.prototype.setMainSelection): Added.
1782 (ChartPaneBase.prototype._openAnalysisTask): Moved the code from ChartPane._openAnalysisTask so that it can be
1783 reused in both AnalysisTaskChartPane and ChartPane (in charts page).
1784 (ChartPaneBase.prototype.router): Added. Overridden by each subclass.
1786 * public/v3/components/test-group-results-table.js:
1787 (TestGroupResultsTable.prototype.buildRowGroups): Always show the summary (relative difference of A to B) as
1788 long as there are some results in each set.
1790 * public/v3/models/test-group.js:
1791 (TestGroup.prototype.compareTestResults): Always set .label and .fullLabel with the relative change as long as
1792 there are some values. Keep using "pending" and "running" in .status since that would determine the color of
1793 stacking blocks representing those A/B testing groups.
1795 * public/v3/pages/analysis-task-page.js:
1796 (AnalysisTaskChartPane):
1797 (AnalysisTaskChartPane.prototype.setPage): Added.
1798 (AnalysisTaskChartPane.prototype.router): Added.
1800 (AnalysisTaskPage.prototype.render): Show the list of A/B testing groups in the reverse chronological order.
1801 Also set the main chart's selection to the time range of the current test group.
1803 * public/v3/pages/chart-pane.js:
1804 (ChartPane.prototype.router): Added.
1805 (ChartPane.prototype._openAnalysisTask): Moved to ChartPaneBase.prototype._openAnalysisTask.
1807 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1809 Add a script to process backlogs created while perf dashboard was in the maintenance mode
1810 https://bugs.webkit.org/show_bug.cgi?id=154140
1812 Reviewed by Chris Dumez.
1814 Added a script to process the backlog JSONs created while the perf dashboard was put in the maintenance mode.
1815 It re-submits each JSON file to the perf dashboard using the same server config file used by syncing scripts.
1817 * public/include/report-processor.php:
1818 (TestRunsGenerator::test_value_list_to_values_by_iterations): Fixed a bug in the error message code. It was
1819 referencing an undeclared variable.
1820 * tools/process-maintenance-backlog.py: Added.
1822 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1824 AnalysisResultsViewer never uses this._smallerIsBetter
1825 https://bugs.webkit.org/show_bug.cgi?id=154134
1827 Reviewed by Chris Dumez.
1829 Removed the unused instance variable _smallerIsBetter from AnalysisResultsViewer and TestGroupStackingBlock.
1831 * public/v3/components/analysis-results-viewer.js:
1832 (AnalysisResultsViewer): Removed the unused _smallerIsBetter.
1833 (AnalysisResultsViewer.prototype.setSmallerIsBetter): Deleted.
1834 (AnalysisResultsViewer.prototype.buildRowGroups):
1835 (AnalysisResultsViewer.TestGroupStackingBlock): Removed the unused _smallerIsBetter.
1836 * public/v3/pages/analysis-task-page.js:
1837 (AnalysisTaskPage.prototype._didFetchTask):
1839 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
1841 Build fix after r196440.
1843 * public/v3/models/test-group.js:
1844 (TestGroup.prototype.addBuildRequest): Clear the map instead of setting the property to null.
1846 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
1848 Perf dashboard should have UI to retry A/B testing
1849 https://bugs.webkit.org/show_bug.cgi?id=154090
1851 Reviewed by Chris Dumez.
1853 Added a button to re-try an existing A/B testing group with a custom repetition count. The same button functions
1854 as a way of confirming the progression/regression when there have been no A/B testing scheduled in the task.
1856 Also fixed the bug that A/B testing groups that have been waiting for other test groups will be shown as "running".
1858 * public/v3/components/results-table.js:
1859 (ResultsTable.cssTemplate): Don't pad the list of extra repositories when it's empty.
1861 * public/v3/components/test-group-results-table.js:
1862 (TestGroupResultsTable.prototype.buildRowGroups): Use TestGroup.labelForRootSet instead of manually
1863 computing the letter for each configuration set.
1865 * public/v3/models/build-request.js:
1866 (BuildRequest.prototype.hasStarted): Added.
1868 * public/v3/models/data-model.js:
1869 (DataModelObject.ensureSingleton): Added.
1870 (DataModelObject.cachedFetch): Added noCache option. This is used when re-fetching the test groups after
1873 * public/v3/models/measurement-cluster.js:
1874 (MeasurementCluster.prototype.startTime): Added.
1876 * public/v3/models/measurement-set.js:
1877 (MeasurementSet.prototype.hasFetchedRange): Added. Returns true only if there are no "holes" (cluster
1878 yet to be fetched) between the specified time range. This was added to fix a bug in AnalysisTaskPage's
1879 _didFetchMeasurement.
1881 * public/v3/models/test-group.js:
1882 (TestGroup): Added this._rootSetToLabel.
1883 (TestGroup.prototype.addBuildRequest): Reset this._rootSetToLabel along with this._requestedRootSets.
1884 (TestGroup.prototype.repetitionCount): Added. Returns the number of iterations executed per set. We assume that
1885 every root set in the test group shares a single repetition count.
1886 (TestGroup.prototype.requestedRootSets): Now populates this._rootSetToLabel for labelForRootSet.
1887 (TestGroup.prototype.labelForRootSet): Added.
1888 (TestGroup.prototype.hasStarted): Added.
1889 (TestGroup.prototype.compareTestResults): Use 'running' and 'pending' to differentiate test groups that are waiting
1890 for other groups to finish running from the ones that are actually running ('incomplete' before this patch).
1891 (TestGroup.fetchByTask):
1892 (TestGroup.createAndRefetchTestGroups): Added. Creates a new test group using the privileged-api/create-test-group
1893 and fetches the list of test groups for the specified analysis task.
1894 (TestGroup._createModelsFromFetchedTestGroups): Extracted from TestGroup.fetchByTask.
1896 * public/v3/pages/analysis-task-page.js:
1897 (AnalysisTaskPage): Initialize _renderedCurrentTestGroup to undefined so that we'd always can differentiate
1898 the initial call to AnalysisTaskPage.render and subsequent calls in which it's identical to _currentTestGroup.
1899 (AnalysisTaskPage.prototype._didFetchMeasurement): Fixed a bug that we don't exit early even when some
1900 clusters in between startPoint and endPoint are still being fetched via newly added hasFetchedRange.
1901 (AnalysisTaskPage.prototype.render): Update the default repetition count based on the current test group.
1902 Also update the label of the button to "Confirm the change" if there is no A/B testing in this task.
1903 (AnalysisTaskPage.prototype._retryCurrentTestGroup): Added. Re-triggers an existing A/B testing group or creates
1904 the A/B testing for the entire range of the analysis task.
1905 (AnalysisTaskPage.prototype._hasDuplicateTestGroupName): Added.
1906 (AnalysisTaskPage.prototype._createRetryNameForTestGroup): Added.
1907 (AnalysisTaskPage.htmlTemplate): Added form controls to re-trigger A/B testing.
1908 (AnalysisTaskPage.cssTemplate): Updated the style.
1910 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
1912 Removed the duplicated definition of ChartPaneBase.
1914 * public/v3/components/chart-pane-base.js:
1916 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
1918 Analysis task page on v3 UI should show charts
1919 https://bugs.webkit.org/show_bug.cgi?id=154057
1921 Reviewed by Chris Dumez.
1923 Extracted ChartPaneBase out of ChartPane and added an instance of its new subclass, AnalysisTaskChartPane,
1924 to the analysis task page. The main difference is that ChartPaneBase doesn't depend on the presence of
1925 this._chartsPage unlike ChartPane. It also doesn't have the header with toolbar (to show breakdown, etc...).
1927 * public/v3/components/base.js:
1928 (ComponentBase.prototype._constructShadowTree): Call htmlTemplate() and cssTemplate() with the right "this".
1930 * public/v3/components/chart-pane-base.js: Added.
1931 (ChartPaneBase): Extracted from ChartPane.
1932 (ChartPaneBase.prototype.configure): Extracted from the constructor. Separating this function allows the
1933 component to be instantiated inside a HTML template.
1934 (ChartPaneBase.prototype._fetchAnalysisTasks): Moved from ChartPane._fetchAnalysisTasks.
1935 (ChartPaneBase.prototype.platformId): Ditto.
1936 (ChartPaneBase.prototype.metricId): Ditto.
1937 (ChartPaneBase.prototype.setOverviewDomain): Ditto.
1938 (ChartPaneBase.prototype.setMainDomain): Ditto.
1939 (ChartPaneBase.prototype._overviewSelectionDidChange): Extracted from the constructor. This is overridden in
1940 ChartPane and unused in AnalysisTaskChartPane.
1941 (ChartPaneBase.prototype._mainSelectionDidChange): Extracted from ChartPane._mainSelectionDidChange.
1942 (ChartPaneBase.prototype._mainSelectionDidZoom): Extracted from ChartPane._mainSelectionDidZoom.
1943 (ChartPaneBase.prototype._indicatorDidChange): Extracted from ChartPane._indicatorDidChange.
1944 (ChartPaneBase.prototype._didFetchData): Moved from ChartPane._fetchAnalysisTasks.
1945 (ChartPaneBase.prototype._openAnalysisTask): Ditto.
1946 (ChartPaneBase.prototype._openCommitViewer): Ditto. Also fixed a bug that we don't show the spinner while
1947 waiting for the data to be fetched by calling this.render() here.
1948 (ChartPaneBase.prototype._keyup): Moved from ChartPane._keyup. Also fixed the bug that the revisions list
1949 doesn't update by calling this.render() here.
1950 (ChartPaneBase.prototype.render): Extracted from ChartPane.render.
1951 (ChartPaneBase.htmlTemplate): Extracted from ChartPane.htmlTemplate.
1952 (ChartPaneBase.paneHeaderTemplate): Added. This is overridden in ChartPane and unused in AnalysisTaskChartPane.
1953 (ChartPaneBase.cssTemplate): Extracted from ChartPane.htmlTemplate.
1955 * public/v3/components/chart-styles.js: Renamed from public/v3/pages/page-with-charts.js.
1956 (PageWithCharts): Renamed from PageWithCharts since it no longer extends PageWithHeading.
1957 (ChartStyles.createChartSourceList):
1959 * public/v3/components/commit-log-viewer.js:
1960 (CommitLogViewer.prototype.view): Set this._repository right away instead of waiting for the fetched data
1961 so that spinner will be shown while the data is being fetched.
1963 * public/v3/index.html:
1965 * public/v3/pages/analysis-task-page.js:
1966 (AnalysisTaskChartPane): Added extends ChartPaneBase.
1967 (AnalysisTaskPage): Added. this._chartPane.
1968 (AnalysisTaskPage.prototype._didFetchTask): Initialize this._chartPane with a domain.
1969 (AnalysisTaskPage.prototype.render): Render this._chartPane.
1970 (AnalysisTaskPage.htmlTemplate):
1972 * public/v3/pages/chart-pane-status-view.js:
1973 (ChartPaneStatusView): Removed the unused router from the argument list.
1974 (ChartPaneStatusView.prototype.pointsRangeForAnalysis): Renamed from analyzeData() since it was ambiguous.
1975 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Fixed the bug that we don't update the list
1976 of the revisions here.
1977 (ChartPaneStatusView.prototype.computeChartStatusLabels):
1979 * public/v3/pages/chart-pane.js:
1980 (ChartPane): Now extends ChartPaneBase.
1981 (ChartPane.prototype._overviewSelectionDidChange): Extracted from the constructor.
1982 (ChartPane.prototype._mainSelectionDidChange):
1983 (ChartPane.prototype._mainSelectionDidZoom):
1984 (ChartPane.prototype._indicatorDidChange):
1985 (ChartPane.prototype.render):
1986 (ChartPane.prototype._renderActionToolbar):
1987 (ChartPane.paneHeaderTemplate): Extracted from htmlTemplate.
1988 (ChartPane.cssTemplate):
1989 (ChartPane.overviewOptions.selection.onchange): Deleted.
1990 (ChartPane.prototype._fetchAnalysisTasks): Deleted.
1991 (ChartPane.prototype.platformId): Deleted.
1992 (ChartPane.prototype.metricId): Deleted.
1993 (ChartPane.prototype.setOverviewDomain): Deleted.
1994 (ChartPane.prototype.setMainDomain): Deleted.
1995 (ChartPane.prototype._openCommitViewer): Deleted.
1996 (ChartPane.prototype._didFetchData): Deleted.
1997 (ChartPane.prototype._keyup): Deleted.
1999 * public/v3/pages/charts-page.js:
2001 (ChartsPage.createDomainForAnalysisTask): Extracted by createDomainForAnalysisTask; used to set the domain
2002 of the charts in the analysis task page.
2003 (ChartsPage.createStateForAnalysisTask):
2005 * public/v3/pages/dashboard-page.js:
2007 (DashboardPage.prototype._createChartForCell):
2009 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
2011 Add the support for maintenance mode
2012 https://bugs.webkit.org/show_bug.cgi?id=154072
2014 Reviewed by Chris Dumez.
2016 Added the crude support for maintenance mode whereby which the reports are stored in the filesystem
2017 instead of the database.
2019 * config.json: Added maintenanceMode and maintenanceDirectory as well as forgotten siteTitle and
2020 remoteServer.httpdMutexDir.
2021 * public/api/report.php:
2022 (main): Don't connect to the database or modify database when maintenanceMode is set.
2023 * public/include/json-header.php:
2024 (ensure_privileged_api_data): Exit with InMaintenanceMode when maintenanceMode is set. This prevents
2025 privileged API such as creating analysis tasks and new A/B testing groups from modifying the database.
2027 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
2029 Analysis task page on v3 show progression as regressions
2030 https://bugs.webkit.org/show_bug.cgi?id=154045
2032 Reviewed by Chris Dumez.
2034 The bug was caused by TestGroup.compareTestResults referring to undefined _smallerIsBetter.
2035 Retrieve it from the associated metric object via the owner analysis task.
2037 * public/v3/models/test-group.js:
2039 2016-02-05 Ryosuke Niwa <rniwa@webkit.org>
2041 Testing with remote server cache is unusably slow
2042 https://bugs.webkit.org/show_bug.cgi?id=153928
2044 Reviewed by Chris Dumez.
2046 Don't use the single process mode of httpd as it's way too slow even for testing.
2047 Also we'll hit a null pointer crash (http://svn.apache.org/viewvc?view=revision&revision=1711479)
2049 Since httpd exits immediately when launched in multi-process mode, remote-cache-server.py (renamed from
2050 run-with-remote-server.py) now has "start" and "stop" commands to start/stop the Apache. Also added
2051 "reset" command to reset the cache for convenience.
2053 * Install.md: Updated the instruction.
2054 * config.json: Fixed a typo: httpdErro*r*Log.
2055 * tools/remote-cache-server.py: Copied from Websites/perf.webkit.org/tools/run-with-remote-server.py.
2056 Now takes one of the following commands: "start", "stop", and "reset".
2058 (start_httpd): Extracted from main.
2059 (stop_httpd): Added.
2060 * tools/remote-server-relay.conf: Removed redundant (duplicate) LoadModule's.
2061 * tools/run-with-remote-server.py: Removed.
2063 2016-02-04 Ryosuke Niwa <rniwa@webkit.org>
2065 Perf dashboard should have a script to setup database
2066 https://bugs.webkit.org/show_bug.cgi?id=153906
2068 Reviewed by Chris Dumez.
2070 Added tools/setup-database.py to setup the database. It retrieves the database name, username, password
2071 and initializes a database at the specified location.
2073 * Install.md: Updated instruction to setup postgres to use setup-database.py.
2074 * tools/setup-database.py: Added.
2076 (load_database_config):
2077 (determine_psql_dir):
2078 (start_or_stop_database):
2079 (execute_psql_command):
2081 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
2083 buildbot syncing scripts sometimes schedule more than one requests per builder
2084 https://bugs.webkit.org/show_bug.cgi?id=153047
2086 Reviewed by Chris Dumez.
2088 The bug was caused by the check for singularity of scheduledRequests being conducted per configuration
2089 instead of per builder. So if there were multiple test configurations (e.g. Speedometer and Octane) that
2090 both used the same builder, then we may end up scheduling both at once.
2092 Fixed the bug by sharing a single set to keep track of the scheduled requests for all configurations per
2095 * tools/sync-with-buildbot.py:
2096 (load_config): Share a set amongst test configurations for each builder.
2097 (find_request_updates): Instead of creating a new set for each configuration, reuse the existing sets to
2098 share a single set agmonst test configurations for each builder.
2100 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
2102 Analysis results viewer sometimes doesn't show the correct relative difference
2103 https://bugs.webkit.org/show_bug.cgi?id=152930
2105 Reviewed by Chris Dumez.
2107 The bug was caused by single A/B testing result associated with multiple rows when there are multiple data
2108 points with the same root set which matches that of an A/B testing.
2110 Fixed the bug by detecting such a case, and only associating each A/B testing result with the row created
2111 for the first matching point.
2113 * public/v3/components/analysis-results-viewer.js:
2114 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
2116 2016-01-08 Ryosuke Niwa <rniwa@webkit.org>
2118 Make v3 UI analysis task page is hard to understand
2119 https://bugs.webkit.org/show_bug.cgi?id=152917
2121 Reviewed by Antti Koivisto.
2123 Add a dark gray border around the selected block in the analysis results viewer instead of using darker
2124 shades since that looks as if they were bigger regression/progression.
2126 Explicitly show "Failed" as the label instead of omitting with "-" when all build requests in an A/B
2127 testing group fails.
2129 * public/v3/components/analysis-results-viewer.js:
2130 (AnalysisResultsViewer.cssTemplate): Tweaked the style to underline text in the hovered blocks and the
2131 selected blocks and show a dark gray border around the selected blocks.
2132 (AnalysisResultsViewer.TestGroupStackingBlock):
2133 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): Use this._title for title.
2134 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
2135 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForRootSet): Deleted.
2137 * public/v3/components/results-table.js:
2138 (ResultsTable.prototype.render):
2139 (ResultsTable.prototype._createRevisionListCells): Extracted from ResultsTable.prototype.render.
2140 (ResultsTable.cssTemplate): Tweaked the style.
2142 (ResultsTableRow.prototype.constructor): Added _labelForWholeRow to store the label for the entire row.
2143 This is used to show the comparison result of two root sets (e.g. A vs B).
2144 (ResultsTableRow.prototype.setLabelForWholeRow): Added.
2145 (ResultsTableRow.prototype.labelForWholeRow): Added.
2146 (ResultsTableRow.prototype.resultContent): Extracted from buildHeading. Creates a hyperlinked bar graph
2147 used for each A/B testing result.
2148 (ResultsTableRow.prototype.buildHeading): Deleted since we need to set colspan on the second table cell
2149 when we're creating a row with _labelForWholeRow.
2151 * public/v3/components/test-group-results-table.js:
2152 (TestGroupResultsTable.prototype.buildRowGroups): Added rows to show relative differences and statistical
2153 significance between root sets (e.g. A vs B).
2155 * public/v3/models/build-request.js:
2156 (BuildRequest.prototype.hasCompleted): Added.
2158 * public/v3/models/test-group.js:
2159 (TestGroup.prototype.compareTestResults): Extracted from AnalysisResultsViewer.TestGroupStackingBlock's
2160 _computeTestGroupStatus and generalized to be reused in TestGroupResultsTable.
2161 (TestGroup.prototype._valuesForRootSet): Moved from AnalysisResultsViewer.TestGroupStackingBlock.
2163 * public/v3/pages/analysis-task-page.js:
2164 (AnalysisTaskPage.cssTemplate): Tweaked the style.
2166 2016-01-07 Ryosuke Niwa <rniwa@webkit.org>
2168 Perf dashboard should automatically add aggregators
2169 https://bugs.webkit.org/show_bug.cgi?id=152818
2171 Reviewed by Chris Dumez.
2173 When an aggregator entry is missing in aggregators table, automatically insert it in /api/report.
2175 In a very early version of the perf dashboard, we had the ability to define a custom aggregator
2176 in an admin page. In practice, nobody used or needed this feature so we got rid of it even before
2177 the dashboard was landed into WebKit repository. This patch cleans up that mess.
2180 (main): Added the filtering capability.
2181 (TestEnvironment): Expose the config JSON in the test environment.
2183 * public/include/report-processor.php:
2184 (ReportProcessor): Renamed name_to_aggregator now that it only contains ID.
2185 (ReportProcessor::__construct): No longer fetches the aggregator table. An equivalent work is done
2186 in newly added ensure_aggregators.
2187 (ReportProcessor::process): Calls ensure_aggregators which populates name_to_aggregator_id.
2188 (ReportProcessor::ensure_aggregators): Added. Add the builtin aggregators: Arithmetic, Geometric,
2189 Harmonic, and Total.
2190 (TestRunsGenerator): Renamed name_to_aggregator now that it only contains ID.
2191 (TestRunsGenerator::__construct):
2192 (TestRunsGenerator::add_aggregated_metric): Don't include aggregator_definition here since it's
2193 never used now that all the aggregations are done natively in PHP.
2194 (TestRunsGenerator::$aggregators): Added. We don't include SquareSum since it's only used for
2195 computing run_square_sum_cache in test_runs table and it's useless elsewhere.
2196 (TestRunsGenerator::aggregate_values): Add a comment about that.
2198 * tests/api-report.js: Updated a test case to reflect the change.
2200 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2202 Perf dashboard JSON API should fail gracefully when postgres is down
2203 https://bugs.webkit.org/show_bug.cgi?id=152812
2205 Reviewed by Chris Dumez.
2207 Even though all JSON APIs returned DatabaseConnectionFailure as the status when Database::connect
2208 returned a falsy value, PHP was spitting out warnings and producing HTTP responses that cannot be
2209 parsed as a JSON when pg_connect failed.
2211 Fixed the bug by suppressing warning messages in pg_connect.
2213 * public/include/db.php:
2214 (Database::connect): Use '@' prefix to suppress warning messages.
2216 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2218 Perf dashboard should auto-generate manifest file when one is missing
2219 https://bugs.webkit.org/show_bug.cgi?id=152813
2221 Reviewed by Chris Dumez.
2223 When /data/manifest.json is missing, fall back to newly added /api/manifest instead of
2224 silently failing to show the UI. This will make the initial setup easier.
2226 * public/api/manifest.php: Added.
2228 * public/include/manifest.php:
2229 (Manifest::manifest): Added.
2230 * public/v3/main.js:
2232 (didFetchManifest): Extracted from fetchManifest.
2234 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2236 Commit another forgotten change, this time, for r194653.
2238 * public/v3/models/measurement-set.js:
2240 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2242 The sampling of time series on v3 UI is too aggressive
2243 https://bugs.webkit.org/show_bug.cgi?id=152804
2245 Reviewed by Chris Dumez.
2247 Fixed a bug that we were always halving the number of data points in _sampleTimeSeries
2248 and increased the number of data points allowed to make the sampling less aggressive.
2250 * public/v3/components/time-series-chart.js:
2251 (TimeSeriesChart.prototype._ensureSampledTimeSeries): Increase the number of maximum points
2252 to 2x the number of pixels divided by the radius of each point.
2253 (TimeSeriesChart.prototype._sampleTimeSeries.findMedian): Changed the semantics of endIndex
2254 to mean the index after the last point and renamed it to indexAfterEnd.
2255 (TimeSeriesChart.prototype._sampleTimeSeries): Fixed a bug that this code always coerced two
2256 data points into one sampled data point despite of the fact i and j are sufficiently apart
2257 since data[j].time - data[i].time > timePerSample by definition.
2259 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2261 Commit the forgotten change for r194651.
2263 * public/v3/pages/domain-control-toolbar.js:
2264 (DomainControlToolbar.prototype.setStartTime):
2266 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2268 The right hand side of main chart appears to be cut off as you zoom out on v3 UI
2269 https://bugs.webkit.org/show_bug.cgi?id=152778
2271 Reviewed by Antti Koivisto.
2273 Add a padding on x-axis after the end time to make the main chart more easily interactive.
2275 * public/v3/components/time-series-chart.js:
2276 (TimeSeriesChart.prototype._computeHorizontalRenderingMetrics):
2278 * public/v3/pages/page-with-charts.js:
2279 (PageWithCharts.mainChartOptions): Add a padding of 5px at the end of x-axis.
2281 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2283 v3 UI should use four sig-figs to label y-axis of the main charts
2284 https://bugs.webkit.org/show_bug.cgi?id=152779
2286 Reviewed by Antti Koivisto.
2288 Increase the number of significant figures used in the main charts to four as done in v2 UI.
2290 * public/v3/pages/chart-pane.js:
2291 (ChartPane.constructor): Create a formatter with four significant figures.
2292 * public/v3/pages/page-with-charts.js:
2293 (PageWithCharts.mainChartOptions): Increase the width of y-axis labels.
2295 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2297 v3 UI's time range slider is harder to use than that of v2 UI
2298 https://bugs.webkit.org/show_bug.cgi?id=152780
2300 Reviewed by Antti Koivisto.
2302 Improved the time range slider by using a cubic mapping to time range and providing a text field
2303 to directly edit the number of days to show.
2305 Now an user can enter the text mode to directly edit the number of days to show by clicking on
2306 the number of days (text field is always there with opacity=0).
2308 * public/v3/pages/charts-toolbar.js:
2309 (ChartsToolbar): Store the minimum and maximum number of days allowed. Also rename _inputElement
2310 to _slider and added a new type=number text field as _editor.
2311 (ChartsToolbar.prototype.render):
2312 (ChartsToolbar.prototype.setStartTime): Exit the text mode when the number of days is changed by
2313 an URL state transition (i.e. back/forward navigation).
2314 (ChartsToolbar.prototype._setInputElementValue): Added. Updates the values of _slider and _editor.
2315 (ChartsToolbar.prototype._enterTextMode): Added. Hide the elements used by the slider mode and
2316 show the text field.
2317 (ChartsToolbar.prototype._exitTextMode): Added. Does the opposite.
2318 (ChartsToolbar.prototype._sliderValueMayHaveChanged): Renamed from _inputValueMayHaveChanged.
2319 (ChartsToolbar.prototype._editorValueMayHaveChanged): Added. Similar to _sliderValueMayHaveChanged
2320 but also corrects the value of _editor if needed.
2321 (ChartsToolbar.prototype._callNumberOfDaysCallback): Extracted from _inputValueMayHaveChanged.
2322 Also fixed a bug that we didn't update the URL state when the change event was fired without
2323 modifying the effective number of days.
2324 (ChartsToolbar.cssTemplate): Tweaked the style to support the new mode. Also set a fixed width on
2325 the span showing the number of days in the slider mode.
2327 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2329 Zooming button is broken on v3 UI
2330 https://bugs.webkit.org/show_bug.cgi?id=152777
2332 Reviewed by Chris Dumez.
2334 Bring up the zoom button in z-index so that users can click it.
2336 * public/v3/components/interactive-time-series-chart.js:
2337 (InteractiveTimeSeriesChart.cssTemplate):
2339 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2341 v3 UI doesn't preserve the time range when charts page is opened from a dashboard
2342 https://bugs.webkit.org/show_bug.cgi?id=152776
2344 Reviewed by Chris Dumez.
2346 Fixed the bug by moving the construction of charts URL from DashboardPage.prototype.open to
2347 DashboardPage.prototype.render and re-rendering the entire page upon an URL state transition.
2349 * public/v3/pages/charts-page.js:
2350 (ChartsPage.createStateForDashboardItem): Takes the start time for the charts page.
2352 * public/v3/pages/dashboard-page.js:
2353 (DashboardPage.prototype.updateFromSerializedState): Merged _numberOfDaysDidChange and
2354 _updateChartsDomainFromToolbar into this function since they're not used elsewhere. Also re-render
2355 the entire page when transition between different number of days to show.
2356 (DashboardPage.prototype._numberOfDaysDidChange): Deleted.
2357 (DashboardPage.prototype._updateChartsDomainFromToolbar): Deleted.
2358 (DashboardPage.prototype.render): Construct URL for each charts here.
2359 (DashboardPage.prototype._createChartForCell): Don't construct URL here since this function is
2360 called once when the dashboard page is opened, and not when the time range is changed.
2362 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2364 Build fix for an old version of PHP after r194618.
2366 * public/api/measurement-set.php:
2368 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
2370 A/B testing results should be visualized intuitively on v3 UI
2371 https://bugs.webkit.org/show_bug.cgi?id=152496
2373 Rubber-stamped by Chris Dumez.
2375 Add the "stacking block" view of A/B testing results to the analysis task page on v3 UI.
2377 The patch enhances JSON APIs at /api/analysis-task /api/measurement-set/ to reduce the number of
2378 HTTP requests, and adds two UI components: TestGroupResultsTable and AnalysisResultsViewer both
2379 of which inherits from an abstract superclass: ResultsTable.
2381 ResultsTable provides a tabular presentation of measured values in regular measurement sets and
2382 A/B testing results using groups of bar graphs created by BarGraphGroup. TestGroupResultsTable
2383 inherits from this class to display A/B testing configurations and the averaged results for each
2384 configuration, and AnalysisResultsViewer inherits from it to provide an intuitive visualization
2385 of the outcomes of all A/B testing results associated with a given analysis task.
2387 * public/api/analysis-tasks.php:
2388 (main): Add the capability to find the analysis task based on its build request.
2389 This allows /v3/#/analysis/task/?buildRequest=<id> to be hyperlinked on buildbot page.
2391 * public/api/measurement-set.php:
2392 (main): Removed the unused startTime and endTime, and added "analysisTask" to query parameters.
2393 (AnalysisResultsFetcher): Added. Used to fetch measured data associated with every build request
2394 on an analysis task.
2395 (AnalysisResultsFetcher::__construct):
2396 (AnalysisResultsFetcher::fetch): Unlike MeasurementSetFetcher, we fetch the list of commits and
2397 list of measurements separately since there will be a lot less builds and commits than measured
2398 data (since we're fetching measured values for all tests and their metrics).
2399 (AnalysisResultsFetcher::fetch_commits): Fetches commits.
2400 (AnalysisResultsFetcher::format_measurement): Like MeasurementSetFetcher::format_measurement but
2401 with config_type and config_metric since we're returning measured data for all metrics and test
2403 (AnalysisResultsFetcher::format_map): Similar to MeasurementSetFetcher::format_map.
2405 * public/v3/components/analysis-results-viewer.js: Added.
2406 (AnalysisResultsViewer): Added.
2407 (AnalysisResultsViewer.prototype.didUpdateResults): This callback is called by AnalysisTaskPage
2408 when A/B testing results become available.
2409 (AnalysisResultsViewer.prototype.render): Overrides ResultsTable's render to highlight the block
2410 representing the currently selected test group.
2412 (AnalysisResultsViewer.prototype.buildRowGroups): Creates a list of rows with "stacking blocks"
2413 that visualizes A/B testing results. The algorithm works as follows: 1. Create all table rows.
2414 2. Find which row is associated with each set in each test group. 3. Layout "blocks".
2416 (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Collects root sets from all data
2417 in the measurement set as well as A/B testing **requests** (results may contain more repositories
2418 than requested but they aren't interesting for the purpose of visualizing results for the entire
2421 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Create table rows. First,
2422 create table rows for measurement set points that have a matching test group (i.e. either set A
2423 or set B of an A/B testing uses the same root set as a point). Second, insert a new row for each
2424 root set in each test group which didn't find a matching measurement set point. There is a little
2425 subtlety that some A/B testing may specify revisions for a subset of repositories and/or some A/B
2426 testing results may appear as if it goes back in time with respect to other A/B testing results.
2427 For example, consider creating two A/B test groups for WebKit changes and OS changes separately.
2428 There could be no coherent linearization of those two A/B testing in which both WebKit and OS
2429 versions move forward.
2431 (AnalysisResultsViewer.RootSetInTestGroup): Added. Represents a pair (test group, root set) since
2432 a root set could be shared by multiple test groups.
2433 (AnalysisResultsViewer.TestGroupStackingBlock): Added. A stacked block representing a test group.
2434 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.addRowIndex): Associates a row number with
2435 either set A or set B.
2436 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): Creates a table cell
2438 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.isThin): Returns true if this test group
2439 has failed and this block should look "thin" without any label.
2440 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus): Computes the
2441 status for this test group.
2443 (AnalysisResultsViewer.TestGroupStackingGrid): Added. AnalysisResultsViewer uses this class to
2444 layout blocks representing test groups.
2445 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.insertBlockToColumn): Inserts a new block
2446 to layout. We keep all test groups doing the same A/B test next to each other.
2447 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.layout): Layouts each block / test group
2448 in the order they are created.
2449 (AnalysisResultsViewer.TestGroupStackingGrid.prototype._layoutBlock): Places the block in the
2450 left-most column that can accommodate it while avoiding columns of a different thin-ness. A column
2451 is thin if its A/B testing has failed, and not thin otherwise.
2452 (AnalysisResultsViewer.TestGroupStackingGrid.prototype.createCellsForRow): Creates table cells for
2453 a given row. For each column, generate a table cell if we're in the first row and the first block
2454 starts in a later row, a block starts in the current row, or the last block ended in the previous
2455 row and the next block or the last row appears later.
2457 * public/v3/components/bar-graph-group.js: Added. A component for showing a group of bar graphs.
2458 (BarGraphGroup): Added. Creates a group of bar graphs with the same value range. It's used by
2459 AnalysisResultsViewer and ResultsTable to show bar graphs to compare values.
2460 (SingleBarGraph): A component created and collectively controlled by BarGraphGroup.
2462 * public/v3/components/results-table.js: Added.
2463 (ResultsTable): An abstract superclass for TestGroupResultsTable and AnalysisResultsViewer.
2465 (ResultsTable.prototype.render): Renders the table. 1. Call "buildRowGroups()" implemented by
2466 a subclass to obtain the list of rows. 2. Compute the list of repositories to show. 3. For each
2467 cell in the table, compute the number of rows to show the same value (for rowspan). 4. Render the
2468 table with an extra list of repositories if exists.
2470 (ResultsTable.prototype._computeRepositoryList): Compute the list of repositories to list
2471 revisions in the table. Omit repositories not present in any row or for which all rows have the
2472 same revision. In the latter case, include it in the extra repositories listed below the table.
2473 This minimizes the amount of redundant information presented to the user.
2475 (ResultsTableRow): Added. Represents a single row in the table. ResultsTable constructs necessary
2476 table cells to tabulate the associated root sets, and shows the associated result using a grouped
2477 bar graph. Additional columns are used by AnalysisResultsViewer to show stacked blocks for A/B
2480 * public/v3/components/test-group-results-table.js: Added.
2481 (TestGroupResultsTable):
2482 (TestGroupResultsTable.prototype.didUpdateResults):
2483 (TestGroupResultsTable.prototype.setTestGroup):
2484 (TestGroupResultsTable.prototype.heading):
2485 (TestGroupResultsTable.prototype.render):
2486 (TestGroupResultsTable.prototype.buildRowGroups):
2488 * public/v3/index.html:
2489 * public/v3/models/analysis-results.js: Added.
2490 (AnalysisResults): Added. Like MeasurementSet, this class represents a set of measured values
2491 associated with a given analysis task.
2492 (AnalysisResults.prototype.find): Returns a measured valued for a given build and metric.
2493 (AnalysisResults.prototype.add): Adds a new measured value. Used by AnalysisResults.fetch.
2494 (AnalysisResults.fetch): Fetches data and creates AnalysisResults for a given analysis task.
2496 * public/v3/models/analysis-task.js:
2497 (AnalysisTask.prototype.startMeasurementId): Added.
2498 (AnalysisTask.prototype.endMeasurementId): Added.
2499 (AnalysisTask.fetchByBuildRequestId): Added.
2500 (AnalysisTask._fetchSubset): Uses DataModelObject.cachedFetch.
2502 * public/v3/models/build-request.js: Added.
2503 (BuildRequest): Added. Represents a single A/B testing request associated with a test group.
2505 * public/v3/models/builder.js:
2506 (Build): Added. Represents a build associated with a given A/B testing result.
2508 * public/v3/models/commit-log.js:
2509 (CommitLog): Made this class inherit from DataModelObject.
2510 (CommitLog.ensureSingleton): Added. Finds the singleton object created for a given revision
2511 in the specified repository. This helps RootSet and other classes compare commits fast.
2512 (CommitLog.prototype.repository): Added.
2513 (CommitLog.fetchBetweenRevisions): Uses CommitLog.ensureSingleton.
2515 * public/v3/models/data-model.js:
2517 (DataModelObject.namedStaticMap): Added.
2518 (DataModelObject.ensureNamedStaticMap): Renamed from namedStaticMap instead of implicitly
2519 assuming that the non-static version always creates the map.
2520 (DataModelObject.prototype.namedStaticMap): Added.
2521 (DataModelObject.cachedFetch): Extracted from AnalysisTask._fetchSubset so that TestGroup's
2522 fetchByTask could also use it.
2525 * public/v3/models/measurement-adaptor.js: Added.
2526 (MeasurementAdaptor): Extracted from MeasurementCluster. This class is responsible for
2527 re-formatting the data received via /api/measurement-set JSON API inside the v3 UI.
2528 (MeasurementAdaptor.prototype.extractId): Added.
2529 (MeasurementAdaptor.prototype.adoptToAnalysisResults): Added. Used by AnalysisResults.
2530 (MeasurementAdaptor.aggregateAnalysisResults): Added. Used by TestGroupResultsTable to
2531 aggregate results for each test configuration; e.g. computing the average for set A.
2532 (MeasurementAdaptor.prototype.adoptToSeries): Extracted from MeasurementCluster.addToSeries.
2533 Added rootSet() to each point. This allows AnalysisResultsViewer to compare them against root
2534 sets associated with A/B testing results.
2535 (MeasurementAdaptor.computeConfidenceInterval): Moved from MeasurementCluster.
2537 * public/v3/models/measurement-cluster.js:
2538 (MeasurementCluster):
2539 (MeasurementCluster.prototype.addToSeries):
2541 * public/v3/models/repository.js:
2542 (Repository.prototype.hasUrlForRevision): Added.
2544 * public/v3/models/root-set.js: Added.
2545 (RootSet): Added. Represents a set of commits in measured results.
2546 (MeasurementRootSet): Added. Ditto for results associated with A/B testing.
2548 * public/v3/models/test-group.js: Added.
2549 (TestGroup): Added. Represents a A/B testing on analysis task.
2550 (TestGroup.prototype.createdAt): Added.
2551 (TestGroup.prototype.buildRequests): Returns the list of build requests associated with this
2553 (TestGroup.prototype.addBuildRequest): Added. Used by BuildRequest's constructor to associate
2554 itself with this group.
2555 (TestGroup.prototype.didSetResult): Added. Called by BuildRequest.setResult when measured
2556 values are fetched and associated with a build request in this group.
2558 * public/v3/models/test.js:
2561 * public/v3/pages/analysis-task-page.js:
2563 (AnalysisTaskPage.prototype.updateFromSerializedState): Fetch the analysis task, test groups
2564 associated with it, and all A/B testing results based on the task id or the build request id
2565 specified in the URL.
2566 (AnalysisTaskPage.prototype._didFetchTask): Added. Start fetching the measured data. This is
2567 the data on charts page for which this analysis task was created, not results of A/B testing.
2568 (AnalysisTaskPage.prototype._didFetchMeasurement): Added. Display the fetched data in a table
2569 inside AnalysisResultsViewer.
2570 (AnalysisTaskPage.prototype._didFetchTestGroups): Added. Display the list of A/B test groups
2571 as well as the results of the first A/B testing.
2572 (AnalysisTaskPage.prototype._didFetchAnalysisResults): Added.
2573 (AnalysisTaskPage.prototype._assignTestResultsIfPossible): Added. Once both the analysis task,
2574 A/B test groups as well as their results are fetched, update build requests in each test group
2576 (AnalysisTaskPage.prototype.render): Show the list of test groups and highlight the currently
2578 (AnalysisTaskPage.prototype._showTestGroup): Added. A callback used by AnalysisResultsViewer
2579 and TestGroupResultsTable to notify this class when the user selects a new test group.
2580 (AnalysisTaskPage.htmlTemplate): Updated the template.
2581 (AnalysisTaskPage.cssTemplate): Ditto.
2583 * public/v3/pages/charts-page.js:
2584 (ChartsPage.createStateForAnalysisTask): Added. Creates a URL state object for opening a chart
2585 associated with an analysis task.
2587 2015-12-22 Ryosuke Niwa <rniwa@webkit.org>
2589 Analysis task page is slow to load
2590 https://bugs.webkit.org/show_bug.cgi?id=152517
2592 Reviewed by Andreas Kling.
2594 The slowness comes from r194130 which made the JSON API at /api/analysis-tasks to report the start
2595 and the end of each analysis task. This query was adding ~2s to the total JSON generation time.
2597 Cache these values on analysis_task table since they never change once an analysis task is created.
2599 * init-database.sql: Added columns task_start_run_time and task_end_run_time to analysis_task table.
2600 Also added the missing drop statements at the top.
2602 * public/api/analysis-tasks.php:
2603 (fetch_and_push_bugs_to_tasks): Don't fetch the latest commit time of the start and the end.
2604 (format_task): Report task_start_run_time and task_end_run_time as startRunTime and endRunTime.
2606 * public/privileged-api/create-analysis-task.php:
2607 (main): Set start_run_time and end_run_time when creating an analysis task.
2608 (time_for_run): Added.
2610 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2612 v3 UI shouldn't open/close pane selector by mouseenter/leave
2613 https://bugs.webkit.org/show_bug.cgi?id=152399
2615 Reviewed by Andreas Kling.
2617 Removed the code to open and close the pane selector by mouseenter and mouseleave
2618 since multiple people have complained about the behavior.
2620 * public/v3/pages/charts-toolbar.js:
2621 (ChartsToolbar): Removed the event listeners.
2622 (ChartsToolbar.prototype._addPane): Don't close the pane selector when adding a new pane
2623 to better support the use case of adding multiple panes.
2624 (ChartsToolbar.cssTemplate): Tweaked CSS.
2626 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2628 Popover for analysis tasks shows up at the left edge of annotation bars in the v3 UI
2629 https://bugs.webkit.org/show_bug.cgi?id=152389
2631 Reviewed by Darin Adler.
2633 Compute the x coordinate of the popover from the center of each annotation bar.
2635 Also adjust the x coordinate to keep the popover within the charts.
2637 * public/v3/components/interactive-time-series-chart.js:
2638 (InteractiveTimeSeriesChart.prototype._renderChartContent):
2640 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2642 Dashboard charts should have uniform widths on v3 UI
2643 https://bugs.webkit.org/show_bug.cgi?id=152395
2645 Reviewed by Chris Dumez.
2647 Fix the bug by applying table-layout: fixed on the dashboard table.
2649 * public/v3/pages/dashboard-page.js:
2650 (DashboardPage.prototype.render): Added header-column as a class name to explicitly set the header column with.
2651 (DashboardPage.cssTemplate): Adjusted CSS accordingly.
2653 2015-12-17 Ryosuke Niwa <rniwa@webkit.org>
2655 Closing a pane on v3 UI always closes the last pane
2656 https://bugs.webkit.org/show_bug.cgi?id=152388
2658 Reviewed by Chris Dumez.
2660 The bug was caused by closePane being called without arguments. (The first argument to bind is "this" value.)
2661 Fixed it by passing in "this" pane object to the first argument.
2663 * public/v3/pages/chart-pane.js:
2666 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2668 Perf Dashboard v3 UI doesn't show recent data points on v2 UI
2669 https://bugs.webkit.org/show_bug.cgi?id=152368
2671 Reviewed by Chris Dumez.
2673 The bug was caused by the last modified date in measurement set JSON being a string instead of a POSIX timestamp,
2674 which prevented the v3 UI from invalidating the cache. Specifically, the following boolean logic always evaluated
2675 to false because +data['lastModified'] was NaN in MeasurementSet.prototype._fetch (/v3/models/measurement-set.js):
2677 !clusterEndTime && useCache && +data['lastModified'] < self._lastModified
2679 Fixed the bug by calling Database::to_js_time on the last modified date fetched from the database.
2681 * public/api/measurement-set.php:
2682 (MeasurementSetFetcher::fetch_config_list): Convert the string returned by the database to a POSIX timestamp.
2683 * tests/api-measurement-set.js: Added a test to ensure the last modified date in JSON is numeric. Since the value
2684 of the last modified date depends on when tests run, we can't assert it to be a certain value.
2686 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2688 v3 UI should show and link the build number on charts page
2689 https://bugs.webkit.org/show_bug.cgi?id=152359
2691 Reviewed by Chris Dumez.
2693 Show the hyperlinked build number in the v3 UI.
2695 * public/v3/models/builder.js:
2696 (Builder): Renamed _buildURL to _buildUrlTemplate.
2697 (Builder.prototype.urlForBuild): Added.
2698 * public/v3/pages/chart-pane-status-view.js:
2699 (ChartPaneStatusView):
2700 (ChartPaneStatusView.prototype.render): Added the code to render hyperlinked build number when one is available.
2701 (ChartPaneStatusView.prototype.computeChartStatusLabels): Store currentPoint's measurement object as _buildInfo
2702 if the current point is set by an indicator (not by a selection).
2704 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2706 v3 dashboard doesn't stretch charts to fill the screen
2707 https://bugs.webkit.org/show_bug.cgi?id=152354
2709 Reviewed by Chris Dumez.
2711 The bug was caused by a workaround to avoid canvas stretching table cell too much.
2713 Fix the problem instead by making the canvas absolutely positioned inside the "time-series-chart" element
2714 so that it does not contribute to the intrinsic/natural width of the cell.
2716 * public/v3/components/time-series-chart.js:
2717 (TimeSeriesChart.prototype._ensureCanvas): Make the canvas absolutely positioned inside the shadow root.
2718 (TimeSeriesChart.prototype._updateCanvasSizeIfClientSizeChanged): Use the container element's size now that
2719 the canvas does not resize with it.
2720 * public/v3/pages/dashboard-page.js:
2721 (DashboardPage.cssTemplate): Updated the CSS so that the chart stretches all the way.
2723 2015-12-16 Ryosuke Niwa <rniwa@webkit.org>
2725 The chart status on v3 UI sometimes show wrong revision ranges
2726 https://bugs.webkit.org/show_bug.cgi?id=152331
2728 Reviewed by Chris Dumez.
2730 The bug was caused by the status view not taking the data sampling that happens in TimeSeriesChart into account
2731 when finding the previous point. Take this into account by using InteractiveTimeSeries.currentPoint(-1) which
2732 finds the sampled data point immediately preceding the current point (at which the indicator is shown).
2734 * public/v3/components/chart-status-view.js:
2735 (ChartStatusView.prototype.updateStatusIfNeeded):
2737 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2739 Perf dashboard's cycler page should use v3 UI
2740 https://bugs.webkit.org/show_bug.cgi?id=152324
2742 Reviewed by Chris Dumez.
2744 Use the v3 UI in cycler.html after r194130.
2746 * public/cycler.html:
2747 * public/v3/index.html: Removed the reference to a non-existent platform-selector.js.
2749 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2751 Add v3 UI to perf dashboard
2752 https://bugs.webkit.org/show_bug.cgi?id=152311
2754 Reviewed by Chris Dumez.
2756 Add the third iteration of the perf dashboard UI. UI for viewing and modifying analysis tasks is coming soon.
2757 The v3 UI is focused on speed, and removes all third-party script dependencies including jQuery, d3, and Ember.
2758 Both the DOM-based UI and graphing are implemented manually.
2761 The entire app is structured using new component library implemented in components/base.js. Each component is
2762 an instance of a subclass of ComponentBase which owns a single DOM element. Each subclass may supply static
2763 methods named htmlTemplate and cssTemplate as the template for a component instance. ComponentBase automatically
2764 clones the templates inside the associated element (or its shadow root on the supported browsers). Each subclass
2765 must supply a method called "render()" which constructs and updates the DOM as needed.
2767 There is a special component called Page, which represents an entire page. Each Page is opened by PageRouter's
2768 "route()" function. Each subclass of Page supplies "open()" for initialization and "updateFromSerializedState()"
2769 for a hash URL transition.
2772 The key feature of the v3 UI is the split of time series into chunks called clusters (see r194120). On an internal
2773 instance of the dashboard, the v2 UI downloads 27MB of data whereas the same page loads only 3MB of data in the v3.
2774 The key logic for fetching time series in chunks is implemented by MeasurementSet in /v3/models/measurement-set.js.
2775 We first fetch the cached primary cluster (the cluster that contains the newest data) at:
2776 /data/measurement-set-<platform-id>-<metric-id>.json
2778 If that's outdated according to lastModified in manifest.json, then we immediately re-fetch the primary cluster at:
2779 /api/measurement-set/?platform=<platform-id>&metric=<metric-id>
2781 Once the up-to-date primary cluster is fetched, we fetch all "secondary" clusters. For each cluster being fetched,
2782 including the primary, we invoke registered callbacks.
2785 In addition, the v3 UI reduces the initial page load time by loading a single bundled JS file generated by
2786 tools/bundle-v3-scripts.py. index.html has a fallback to load all 44 JS files individually during development.
2788 * public/api/analysis-tasks.php:
2789 (fetch_and_push_bugs_to_tasks): Added the code to fetch start and end run times. This is necessary in V3 UI
2790 because no longer fetch the entire time series. See r194120 for the new measurement set JSON API.
2791 (format_task): Compute the category of an analysis task based on "result" value. This will be re-vamped once
2792 I add the UI for the analysis task page in v3.
2794 * public/include/json-header.php:
2795 (require_format): CamelCase the name.
2796 (require_match_one_of_values): Ditto.
2797 (validate_arguments): Renamed from require_existence_of and used in measurement-set.php landed in r194120.
2800 * public/v3/components: Added.
2802 * public/v3/components/base.js: Added.
2803 (ComponentBase): The base component class.
2804 (ComponentBase.prototype.element): Returns the DOM element associated with the DOM element.
2805 (ComponentBase.prototype.content): Returns the shadow root if one exists and the associated element otherwise.
2806 (ComponentBase.prototype.render): To be implemented by a subclass.
2807 (ComponentBase.prototype.renderReplace): A helper function to "render" DOM contents.
2808 (ComponentBase.prototype._constructShadowTree): Called inside the constructor to instantiate the templates.
2809 (ComponentBase.prototype._recursivelyReplaceUnknownElementsByComponents): Instantiates components referred by
2810 its element name inside the instantiated content.
2811 (ComponentBase.isElementInViewport): A helper function. Returns true if the element is in the viewport and it has
2812 non-zero width and height.
2813 (ComponentBase.defineElement): Defines a custom element that can be automatically instantiated from htmlTemplate.
2814 (ComponentBase.createElement): A helper function to create DOM tree to be used in "render()" method.
2815 (ComponentBase._addContentToElement): A helper for "createElement".
2816 (ComponentBase.createLink): A helper function to create a hyperlink or another clickable element (via callback).
2817 (ComponentBase.createActionHandler): A helper function to create an event listener that prevents the default action
2818 and stops the event propagation.
2820 * public/v3/components/button-base.js: Added.
2822 * public/v3/components/chart-status-view.js: Added.
2823 (ChartStatusView): A component that reports the current status of time-series-chart. It's subclasses by
2824 ChartPaneStatusView to provide additional information in the charts page's panes.
2826 * public/v3/components/close-button.js: Added.
2828 * public/v3/components/commit-log-viewer.js: Added.
2829 (CommitLogViewer): A component that lists commit revisions along with commit messages for a range of data points.
2831 * public/v3/components/interactive-time-series-chart.js: Added.
2832 (InteractiveTimeSeriesChart): A subclass of InteractiveTimeSeriesChart with interactivity (selection & indicator).
2833 Selection and indicator are mutually exclusive.
2835 * public/v3/components/pane-selector.js: Added.
2836 (PaneSelector): A component for selecting (platform, metric) pair to add in the charts page.
2838 * public/v3/components/spinner-icon.js: Added.
2840 * public/v3/components/time-series-chart.js: Added.
2841 (TimeSeriesChart): A canvas-based chart component without interactivity. It takes a source list and options as
2842 the constructor arguments. A source list is a list of measurement sets (measurement-set.js) with drawing options.
2843 This component fetches data via MeasurementSet.fetchBetween inside TimeSeriesChart.prototype.setDomain and
2844 progressively updates the charts as more data arrives. The canvas is updated on animation frame via rAF and all
2845 layout and rendering metrics are lazily computed in _layout. In addition, this component samples data before
2846 rendering the chart when there are more data points per pixel in _ensureSampledTimeSeries.
2848 * public/v3/index.html: Added. Loads bundled-scripts.js if it exists, or individual script files otherwise.
2850 * public/v3/instrumentation.js: Added. This class is used to gather runtime statistics of v3 UI. (It measures
2851 the performance of the perf dashboard UI).
2853 * public/v3/main.js: Added. Bootstraps the app.
2857 * public/v3/models: Added.
2858 * public/v3/models/analysis-task.js: Added.
2859 * public/v3/models/bug-tracker.js: Added.
2860 * public/v3/models/bug.js: Added.
2861 * public/v3/models/builder.js: Added.
2862 * public/v3/models/commit-log.js: Added.
2863 * public/v3/models/data-model.js: Added.
2864 (DataModelObject): The base class for various data objects that correspond to database tables. It supplies static
2865 hash map to find entries by id as well as other keys.
2866 (LabeledObject): A subclass of DataModelObject with the capability to find an object via its name.
2868 * public/v3/models/measurement-cluster.js: Added.
2869 (MeasurementCluster): Represents a single cluster or a chunk of data in a measurement set.
2871 * public/v3/models/measurement-set.js: Added.
2872 (MeasurementSet): Represents a measurement set.
2873 (MeasurementSet.findSet): Returns the singleton set given (metric, platform). We use singleton to avoid issuing
2874 multiple HTTP requests for the same JSON when there are multiple TimeSeriesChart that show the same graph (e.g. on
2875 charts page with overview and main charts).
2876 (MeasurementSet.prototype.findClusters): Finds the list of clusters to fetch in a given time range.
2877 (MeasurementSet.prototype.fetchBetween): Fetch clusters for a given time range and calls callback whenever new data
2878 arrives. The number of callbacks depends on the how many clusters need to be newly fetched.
2879 (MeasurementSet.prototype._fetchSecondaryClusters): Fetches non-primary (non-latest) clusters.
2880 (MeasurementSet.prototype._fetch): Issues a HTTP request to fetch a cluster.
2881 (MeasurementSet.prototype._didFetchJSON): Called when a cluster is fetched.
2882 (MeasurementSet.prototype._failedToFetchJSON): Called when the fetching of a cluster has failed.
2883 (MeasurementSet.prototype._invokeCallbacks): Invokes callbacks upon an approval of a new cluster.
2884 (MeasurementSet.prototype._addFetchedCluster): Adds the newly fetched cluster in the order.
2885 (MeasurementSet.prototype.fetchedTimeSeries): Returns a time series that contains data from all clusters that have
2887 (TimeSeries.prototype.findById): Additions to TimeSeries defined in /v2/data.js.
2888 (TimeSeries.prototype.dataBetweenPoints): Ditto.
2889 (TimeSeries.prototype.firstPoint): Ditto.
2891 * public/v3/models/metric.js: Added.
2892 * public/v3/models/platform.js: Added.
2893 * public/v3/models/repository.js: Added.
2894 * public/v3/models/test.js: Added.
2896 * public/v3/pages: Added.
2897 * public/v3/pages/analysis-category-page.js: Added. The "Analysis" page that lists the analysis tasks.
2898 * public/v3/pages/analysis-category-toolbar.js: Added. The toolbar to filter analysis tasks based on its category
2899 (unconfirmed, bisecting, identified, closed) and a keyword.
2901 * public/v3/pages/analysis-task-page.js: Added. Not implemented yet. It just has the hyperlink to the v2 UI.
2903 * public/v3/pages/chart-pane-status-view.js: Added.
2904 (ChartPaneStatusView): A subclass of ChartStatusView used in the charts page. In addition to the current value,
2905 comparison to baseline/target, it shows the list of repository revisions (e.g. WebKit revision, OS version).
2907 * public/v3/pages/chart-pane.js: Added.
2908 (ChartPane): A component a pane in the charts page. Each pane has the overview chart and the main chart. The zooming
2909 is synced across all panes in the charts page.
2911 * public/v3/pages/charts-page.js: Added. Charts page.
2912 * public/v3/pages/charts-toolbar.js: Added. The toolbar to set the number of days to show. This affects the overview
2913 chart's domain in each pane.
2915 * public/v3/pages/create-analysis-task-page.js: Added.
2916 (CreateAnalysisTaskPage): A page that gets shown momentarily while creating a new analysis task.
2918 * public/v3/pages/dashboard-page.js: Added. A dashboard page.
2919 * public/v3/pages/dashboard-toolbar.js: Added. Its toolbar with buttons to select the number of days to show.
2920 * public/v3/pages/domain-control-toolbar.js: Added. An abstract superclass of charts and dashboard toolbars.
2922 * public/v3/pages/heading.js: Added. A component for displaying the header and toolbar, if exists, on each page.
2923 * public/v3/pages/page-router.js: Added. This class is responsible for updating the URL hashes as well as opening
2924 and updating each page when the hash changes (via back/forward navigation).
2925 * public/v3/pages/page-with-charts.js: Added. An abstract subclass of page used by dashboards and charts page.
2926 Supplies helper functions for creating TimeSeriesChart options.
2927 * public/v3/pages/page-with-heading.js: Added. An abstract subclass of page that uses the heading component.
2928 * public/v3/pages/page.js: Added. The Page component.
2929 * public/v3/pages/toolbar.js: Added. An abstract toolbar component.
2931 * public/v3/remote.js: Added.
2932 (getJSON): Fetches JSON from the remote server.
2933 (getJSONWithStatus): Ditto. Rejects the response if the status is not "OK".
2934 (PrivilegedAPI.sendRequest): Posts a HTTP request to a privileged API in /privileged-api/.
2935 (PrivilegedAPI.requestCSRFToken): Creates a new CSRF token to request a privileged API post.
2937 * tools/bundle-v3-scripts.py: Added.
2938 (main): Bundles js files together and minifies them by jsmin.py for the v3 UI. Without this script, we're forced to
2939 download 44 JS files or making each JS file contain multiple classes.
2941 * tools/jsmin.py: Copied from WebInspector / JavaScriptCore code.
2943 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2945 Fix v2 UI after r194093.
2947 * public/v2/data.js:
2949 2015-12-15 Ryosuke Niwa <rniwa@webkit.org>
2951 Add /api/measurement-set for v3 UI
2952 https://bugs.webkit.org/show_bug.cgi?id=152312
2954 Rubber-stamped by Chris Dumez.
2956 The new API JSON allows the front end to fetch measured data in chunks called a "cluster" as specified
2957 in config.json for each measurement set specified by the pair of a platform and a metric.
2959 When the front end needs measured data in a given time range (t_0, t_1) for a measurement set, it first
2960 fetches the primary cluster by /api/measurement-set/?platform=<platform-id>&metric=<metric-id>.
2961 The primary cluster is the last cluster in the set (returning the first cluster here is not useful
2962 since we don't typically show very old data), and provides the information needed to fetch other clusters.
2964 Fetching the primary cluster also creates JSON files at:
2965 /data/measurement-set-<platform-id>-<metric-id>-<cluster-end-time>.json
2966 to allow latency free access for secondary clusters. The front end code can also fetch the cache of
2967 the primary cluster at: /data/measurement-set-<platform-id>-<metric-id>.json.
2969 Because the front end code has to behave as if all data is fetched, each cluster contains one data point
2970 immediately before the first data point and one immediately after the last data point. This avoids having
2971 to fetch multiple empty clusters for manually specified baseline data. To support this behavior, we generate
2972 all clusters for a given measurement set at once when the primary cluster is requested.
2974 Furthermore, all measurement sets are divided at the same time into clusters so that the boundary of clusters
2975 won't shift as more data are reported to the server.
2977 * config.json: Added clusterStart and clusterSize as options.
2978 * public/api/measurement-set.php: Added.
2980 (MeasurementSetFetcher::__construct):
2981 (MeasurementSetFetcher::fetch_config_list): Finds configurations that belongs to this (platform, metric) pair.
2982 (MeasurementSetFetcher::at_end): Returns true if we've reached the end of all clusters for this set.
2983 (MeasurementSetFetcher::fetch_next_cluster): Generates the JSON data for the next cluster. We generate clusters
2984 in increasing chronological order (the oldest first and the newest last).
2985 (MeasurementSetFetcher::execute_query): Executes the main query.
2986 (MeasurementSetFetcher::format_map): Returns the mapping of a measurement field to an array index. This removes
2987 the need to have key names for each measurement and reduces the JSON size by ~10%.
2988 (MeasurementSetFetcher::format_run): Creates an array that contains data for a single measurement. The order
2989 matches that of keys in format_map.
2990 (MeasurementSetFetcher::parse_revisions_array): Added. Copied from runs.php.
2991 * tests/api-measurement-set.js: Added. Added tests for /api/measurement-set.
2993 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
2995 Using fake timestamp in OS version make some results invisible
2996 https://bugs.webkit.org/show_bug.cgi?id=152289
2998 Reviewed by Stephanie Lewis.
3000 Fix various bugs after r194088.
3002 * public/api/commits.php:
3003 (format_commit): Include the commit order.
3004 * public/v2/data.js:
3005 (CommitLogs._cacheConsecutiveCommits): Sort by commit order when commit time is missing.
3006 * tools/pull-os-versions.py:
3007 (OSBuildFetcher._assign_order): Use integer instead of fake time for commit order.
3008 (available_builds_from_command): Exit early when an exception is thrown.
3010 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
3012 Fix a typo in the previous commit.
3014 * public/include/report-processor.php:
3016 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
3018 Build fix after r192965. Suppress a warning about log being referred to as a closure variable.
3020 * public/include/report-processor.php:
3022 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
3024 Using fake timestamp in OS version make some results invisible
3025 https://bugs.webkit.org/show_bug.cgi?id=152289
3027 Reviewed by Stephanie Lewis.
3029 Added commit_order column to explicitly order OS versions. This fixes the bug whereby which
3030 baseline results reported with only OS versions are shown with x coordinate set to 10 years ago.
3032 To migrate the existing database, run:
3033 ALTER TABLE commits ADD COLUMN commit_order integer;
3034 CREATE INDEX commit_order_index ON commits(commit_order);
3036 Then for each repository $1,
3037 UPDATE commits SET (commit_time, commit_order) = (NULL, CAST(EXTRACT(epoch from commit_time) as integer))
3038 WHERE commit_repository = $1;
3041 * init-database.sql: Added the column.
3042 * public/api/commits.php:
3043 (fetch_commits_between): Use commit_order to order commits when commit_time is missing.
3044 * public/api/report-commits.php:
3045 (main): Set commit_order.
3046 * tools/pull-os-versions.py:
3047 (OSBuildFetcher.fetch_and_report_new_builds):
3048 (OSBuildFetcher._assign_order): Renamed from _assign_fake_timestamps. Set the order instead of a fake timestmap.
3050 2015-12-14 Ryosuke Niwa <rniwa@webkit.org>
3052 Perf dashboard can't merge when the destination platform is missing baseline/target
3053 https://bugs.webkit.org/show_bug.cgi?id=152286
3055 Reviewed by Stephanie Lewis.
3057 The bug was caused by the query to migrate test configurations to new platform checking
3058 configuration type and metric separately; that is, it assumes the configuration exists
3059 only if either the same type or the same metric exists in the destination.
3061 Fixed the bug by checking both conditions simultaneously for each configuration.
3063 * public/admin/platforms.php:
3064 * tests/admin-platforms.js: Added a test.
3066 2015-12-11 Ryosuke Niwa <rniwa@webkit.org>
3068 Perf dashboard's buildbot sync config JSON duplicates too much information
3069 https://bugs.webkit.org/show_bug.cgi?id=152196
3071 Reviewed by Stephanie Lewis.
3073 Added shared, per-builder, and per-test (called type) configurations.
3075 * tools/sync-with-buildbot.py:
3077 (load_config.merge):
3079 2015-12-02 Ryosuke Niwa <rniwa@webkit.org>
3081 Perf dashboard should avoid overflow during geometric mean computation
3082 https://bugs.webkit.org/show_bug.cgi?id=151773
3084 Reviewed by Chris Dumez.
3086 * public/include/report-processor.php:
3088 2015-11-30 Ryosuke Niwa <rniwa@webkit.org>
3090 Perf dashboard should extend baseline and target to the future
3091 https://bugs.webkit.org/show_bug.cgi?id=151511
3093 Reviewed by Darin Adler.
3095 * public/v2/data.js:
3096 (RunsData.prototype.timeSeriesByCommitTime): Added extendToFuture as an argument.
3097 (RunsData.prototype.timeSeriesByBuildTime): Ditto.
3098 (RunsData.prototype._timeSeriesByTimeInternal): Ditto.
3099 (TimeSeries): Add a new point to the end if extendToFuture is set and the series is not empty.
3100 * public/v2/manifest.js:
3101 (App.Manifest._formatFetchedData): Set extendToFuture to true for baselines and targets.
3103 2015-11-30 Ryosuke Niwa <rniwa@webkit.org>
3105 Perf dashboard should always show comparison to baseline and target even if one is missing
3106 https://bugs.webkit.org/show_bug.cgi?id=151510
3108 Reviewed by Darin Adler.
3110 Show the comparison status against the baseline when baseline is present but target is missing.
3112 To make the code more readable, this patch splits the logic into three cases:
3113 1. Both baseline and target are present
3114 2. Only baseline is present
3115 3. Only target is present
3117 Also extracted a helper function to construct the label.
3120 (.labelForDiff): Added.
3121 (App.Pane.computeStatus):
3123 2015-11-23 Commit Queue <commit-queue@webkit.org>
3125 Unreviewed, rolling out r192716 and r192717.
3126 https://bugs.webkit.org/show_bug.cgi?id=151582
3128 The patch was incorrect. We always need at least one data
3129 point in each configuration (Requested by rniwa on #webkit).
3131 Reverted changesets:
3133 "Perf dashboard's should not include results more than 366
3135 https://bugs.webkit.org/show_bug.cgi?id=151529
3136 http://trac.webkit.org/changeset/192716
3138 "Build fix for old version of PHP."
3139 http://trac.webkit.org/changeset/192717
3141 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3143 Build fix for old version of PHP.
3145 * public/api/runs.php:
3147 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3149 Perf dashboard's should not include results more than 366 days old in JSON
3150 https://bugs.webkit.org/show_bug.cgi?id=151529
3152 Reviewed by Timothy Hatcher.
3154 Don't return results more than 366 days old in /api/runs/ JSON API.
3155 This is a ~5% runtime improvement and reduces the JSON file size by 20-50% in the internal perf dashboard.
3157 * public/api/runs.php:
3158 (main): Added the support for "?noResults" to avoid echoing results. This is useful for debugging.
3159 Also instantiate RunsGenerator before issuing the query to find all configurations so that the runtime cost
3160 of doing so will be included in elapsedTime.
3161 (RunsGenerator::fetch_runs): Skip a row when its build and commit times are more than 366 days old.
3162 (RunsGenerator::format_run): Takes build_time and revisions as arguments since fetch_runs uses them now.
3163 (RunsGenerator::parse_revisions_array): Compute the max of commit times.
3165 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3167 Remove chartPointRadius from interactive chart component
3168 https://bugs.webkit.org/show_bug.cgi?id=151480
3170 Reviewed by Darin Adler.
3172 Replaced the parameter by CSS rules.
3174 * public/v2/chart-pane.css:
3176 (.chart .dot.foreground):
3177 (.chart .highlight):
3179 * public/v2/index.html:
3180 * public/v2/interactive-chart.js:
3181 (App.InteractiveChartComponent.Ember.Component.extend._constructGraphIfPossible):
3182 (App.InteractiveChartComponent.Ember.Component.extend._highlightedItemsChanged):
3184 2015-11-20 Ryosuke Niwa <rniwa@webkit.org>
3186 Perf dashboard's runs API uses more than 128MB of memory
3187 https://bugs.webkit.org/show_bug.cgi?id=151478
3189 Reviewed by Andreas Kling.
3191 Don't fetch all query results at once to avoid using twice as much memory as needed.
3192 Use iterative API to format each result at a time.
3194 This change is also a 5% runtime performance gain.
3196 * public/api/runs.php:
3197 (RunsGenerator::__construct): Takes a Database instance instead of a list of configurations. The latter is
3198 no longer needed as we pass in each configuration type explicitly to fetch_runs.
3199 (RunsGenerator::fetch_runs): Renamed from add_runs since it now executes the database query via execute_query.
3200 Also moved the logic to compute the last modified time here.
3201 (RunsGenerator::execute_query): Moved from fetch_runs_for_config. Use Database::query instead of query_and_fetch_all.
3202 (RunsGeneratorForTestGroup):
3203 (RunsGeneratorForTestGroup::__construct):
3204 (RunsGeneratorForTestGroup::execute_query): Moved from fetch_runs_for_config_and_test_group.
3206 * public/include/db.php:
3207 (generate_data_file): Lock the file to avoid corruption.
3209 2015-11-19 Ryosuke Niwa <rniwa@webkit.org>
3211 Perf dashboard always fetches charts JSON twice
3212 https://bugs.webkit.org/show_bug.cgi?id=151483
3214 Reviewed by Andreas Kling.
3216 Only re-generate "runs" JSON via /api/runs/ when the cache doesn't exist in /data/ or the cached JSON is
3217 obsolete (shouldRefetch is set true) or corrupt (the second closure).
3222 2015-11-18 Ryosuke Niwa <rniwa@webkit.org>
3224 Internal perf dashboard takes forever to load
3225 https://bugs.webkit.org/show_bug.cgi?id=151430
3227 Rubber-stamped by Antti Koivisto.
3229 Fix a few performance problems with the perf dashboard v2 UI.
3232 (App.DashboardRow._createPane): Set "inDashboard" to true.
3233 (App.Pane._fetch): Immediately show the cached chart instead of waiting for the refetched data which invokes
3234 a PHP JSON API. Also don't fetch the analysis tasks when the chart is shown in the dashboard since we don't
3235 show annotate charts in the dashboard.
3237 2015-10-15 Ryosuke Niwa <rniwa@webkit.org>
3239 Unreviewed fix of a test after r190687.
3241 * tests/admin-regenerate-manifest.js:
3243 2015-10-12 Ryosuke Niwa <rniwa@webkit.org>
3245 Perf dashboard tools shouldn't require server credentials in multiple configuration files
3246 https://bugs.webkit.org/show_bug.cgi?id=149994
3248 Reviewed by Chris Dumez.
3250 Made detect-changes.js and pull-svn.py pull username and passwords from the server config JSON to reduce
3251 the number of JSON files that need to include credentials.
3253 Also made each script reload the server config after sleep to allow dynamic credential updates.
3255 In addition, change the server config JSON's format to include scheme, host, and port numbers separately
3256 instead of a url since detect-changes.js needs each value separately.
3258 This reduces the number of JSONs with credentials to two for our internal dashboard.
3260 * tools/detect-changes.js:
3261 (main): Added a property argument parsing. Now takes --server-config-json, --change-detection-config-json,
3262 and --seconds-to-sleep like other scripts.
3263 (parseArgument): Added.
3264 (fetchManifestAndAnalyzeData): Reload the server config JSON.
3265 (loadServerConfig): Added. Set settings.perfserver and settings.slave from the server config JSON. Also
3266 add settings.perfserver.host to match the old format.
3267 (configurationsForTesting): Fixed a bug that we throw an exception when a dashboard contains an empty cell.
3269 * tools/pull-os-versions.py:
3270 (main): Use load_server_config after each sleep.
3272 * tools/pull-svn.py:
3273 (main): Use load_server_config after each sleep.
3274 (fetch_commits_and_submit): Use the perf dashboard's auth as subversion credential when useServerAuth is set.
3276 * tools/sync-with-buildbot.py:
3277 (main): Use load_server_config after each sleep.
3280 (load_server_config): Extracted from python scripts. Computes server's url from scheme, host, and port number
3281 to match the old format python scripts except.
3283 2015-10-11 Ryosuke Niwa <rniwa@webkit.org>
3285 Build fix after r190817. Now that pull-os-versions store fake timestamps, we need to bypass timestamp
3286 checks for OS versions when bots try to report new results. Otherwise, we fail to process the reports
3287 with a MismatchingCommitTime error.
3289 * public/include/report-processor.php:
3290 (ReportProcessor::resolve_build_id):
3292 2015-10-08 Ryosuke Niwa <rniwa@webkit.org>
3294 Perf dashboard erroneously shows an old OS build in A/B testing range
3295 https://bugs.webkit.org/show_bug.cgi?id=149942
3297 Reviewed by Darin Adler.
3299 Ordering OS builds lexicologically turned out be a bad idea since 15A25 falls between 15A242 and 15A251.
3300 Use a fake/synthetic timestamp to force the commonly understood total order instead.
3302 Refactored pull-os-versions.py to share the server config JSON with other scripts. Also made the script
3303 support pulling multiple sources; e.g. both OS X and iOS.
3305 Also removed superfluous feature to submit results in chunks. The perf dashboard can handle thousands of
3306 revisions being submitted at once just fine.
3308 * public/api/commits.php:
3309 (main): A partial revert of r185574 since we no longer need to order builds lexicologically.
3311 * tools/pull-os-versions.py:
3312 (main): Takes --os-config-json, --server-config-json, and --seconds-to-sleep as arguments instead of
3313 a single --config argument to share the server config JSON with other scripts.
3314 (OSBuildFetcher): Extracted out of main. This class is instantiated for each OS kind (e.g. OS X).
3315 (OSBuildFetcher.__init__): Added.
3316 (OSBuildFetcher._fetch_available_builds): Extracted out of main. Fetches available builds from a website
3318 (OSBuildFetcher.fetch_and_report_new_builds): Extracted out of main. Submits the fetched builds after
3319 filtering out the ones we've already reported.
3320 (OSBuildFetcher._assign_fake_timestamps): Creates a fake timestamp to establish a total order amongst each
3321 OS X / iOS style build number such as 12A3456b.
3323 2015-10-08 Ryosuke Niwa <rniwa@webkit.org>
3325 pull-svn.py fails to sync revisions when SVN credentials is not setup
3326 https://bugs.webkit.org/show_bug.cgi?id=149941
3328 Reviewed by Chris Dumez.
3330 Added the support for specifying subversion credentials.
3332 Also added the support for pulling from multiple subversion servers. Subversion servers are specified
3333 in a JSON configuration file specified by --svn-config formatted as follows:
3338 "url": "http://svn.webkit.org/repository/webkit",
3339 "username": "webkitten",
3340 "password": "webkitten's password",
3341 "trustCertificate": true,
3342 "accountNameFinderScript":
3343 ["python", "/Volumes/Data/WebKit/Tools/Scripts/webkit-patch", "find-users"]
3348 In addition, refactored it to use the shared server config JSON for the dashboard access.
3350 * tools/pull-svn.py:
3351 (main): Now takes --svn-config-json, --server-config-json, --seconds-to-sleep and --max-fetch-count
3352 as required options instead of seven unnamed arguments.
3353 (fetch_commits_and_submit): Extracted from main. Fetches at most max_fetch_count new revisions from
3354 the subversion server, and submits them in accordance with server_config.
3355 (fetch_commit_and_resolve_author): Now takes a single repository dictionary instead of two separate
3356 arguments for name and URL to pass down the repository's authentication info to fetch_commit.
3357 (fetch_commit): Ditto. Add appropriate arguments when username and passwords are specified.
3358 (resolve_author_name_from_account): Use a list argument instead of a single string argument now that
3359 the argument comes from a JSON instead of sys.argv.
3361 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3363 Unreviewed race condition fix. Exit early when xScale or yScale is not defined.
3365 * public/v2/interactive-chart.js:
3366 (App.InteractiveChartComponent._updateRangeBarRects):
3368 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3370 Add a page that cycles through v2 dashboards
3371 https://bugs.webkit.org/show_bug.cgi?id=149907
3373 Reviewed by Chris Dumez.
3375 Add cycler.html that goes through each dashboard on v2 UI.
3377 This allows the dashboards to be cycled through on a TV screen.
3379 * public/cycler.html: Added.
3380 (loadURLAt): Appends a new iframe to load the next URL (i is the index of the dashboard to be shown)
3381 at the end of body. We don't immediately show the new iframe since it might take a while to load.
3382 (showNewFrameIfLoaded): Remove the current iframe and show the next iframe if the next dashboard has
3383 finished loading. We can't rely on DOMContentLoaded or load events because we use asynchronous XHR to
3384 load each chart's data. Instead, wait until some chart becomes available or fails to load and none of
3385 charts are still in progress to be shown.
3387 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3389 Allow custom revisions to be specified in A/B testing
3390 https://bugs.webkit.org/show_bug.cgi?id=149905
3392 Reviewed by Chris Dumez.
3394 Allow custom revision number on each "repository" when creating a test group.
3396 * public/v2/app.css:
3397 (form .analysis-group [name=customValue]): Added.
3400 (App.AnalysisTaskController._createConfiguration): Added "Custom" as a revision option.
3401 Also added point labels such as (point 3) on "None" for when some points are missing revision info.
3402 (App.AnalysisTaskController._labelForPoints): Extracted from _createConfiguration.
3403 (App.AnalysisTaskController.actions.createTestGroup): Respect the custom revision number when custom
3404 revision option is selected.
3406 * public/v2/index.html: Added a text field for specifying a custom revision number.
3408 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3410 Make the site name configurable in perf dashboard
3411 https://bugs.webkit.org/show_bug.cgi?id=149894
3413 Reviewed by Chris Dumez.
3415 Added "siteTitle" as a new configuration key to specify the site name.
3417 * public/include/db.php:
3418 (config): Now takes the default value as an argument.
3419 * public/include/manifest.php:
3420 (ManifestGenerator::generate): Include siteTitle in the manifest.
3421 * public/index.html: Update the title and the heading when the manifest is loaded.
3422 * public/v2/index.html: Use App.Manifest.siteTitle as the heading. document.title needs to be updated manually.
3423 * public/v2/manifest.js:
3424 (App.MetricSerializer.normalizePayload): Update document.title and App.Manifest.siteTitle.
3426 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3428 Perf dashboard doesn't show analysis tasks anchored at outliers
3429 https://bugs.webkit.org/show_bug.cgi?id=149870
3431 Reviewed by Chris Dumez.
3433 The bug was caused by the computation of start and end times of analysis tasks being dependent on
3434 time series provided to the interactive chart component even though they are already filtered.
3436 Since the interactive chart component shouldn't be messing with the underlying data models, moved
3437 the code to compute start and end times to App.Pane, to where it belongs, and made the moved code use
3438 the unfiltered time series newly exposed on ChartData.
3440 Also fixed a bug in fetch-from-remote.php which resulted in Ember endlessly fetching same JSON files.
3442 * public/admin/fetch-from-remote.php:
3443 (.): Use the full request URI for HTTP requests and caching. Otherwise, we're going to mix up caches
3444 and Ember can start hanging browsers (took me three hours to debug this).
3447 (App.Pane._showOutlierChanged): Added. Resets chartData when showOutlier flag has been changed.
3448 (App.Pane.fetchAnalyticRanges): The old code wasn't filtering analysis tasks by platforms and metrics
3449 at all since it relied on the server-side REST API to do the filtering, which I haven't implemented yet.
3450 Filter the results manually instead.
3451 (App.Pane.ranges): Moved the logic to compute startTime and endTime here from InteractiveChartComponent.
3452 (App.PaneController.toggleShowOutlier): Now that App.Pane responds to showOutlier changes, we don't
3453 need to call a private method on it.
3454 (App.AnalysisTaskController._chartDataChanged): When end points are not found, try showing outliers.
3455 This will cause chartData to be modified so just exit early and wait for getting called again.
3457 * public/v2/interactive-chart.js:
3458 (App.InteractiveChartComponent._rangesChanged): The code to compute start and end time has been moved
3461 * public/v2/manifest.js:
3462 (App.Manifest._formatFetchedData): Added unfiltered time series as new properties as they are now used
3463 to compute the end points of analysis tasks when their end points are outliers.
3465 2015-10-07 Ryosuke Niwa <rniwa@webkit.org>
3467 Unreviewed. Fix a typo in r190645.
3469 * public/include/db.php:
3471 2015-10-06 Ryosuke Niwa <rniwa@webkit.org>
3473 V2 UI shouldn't sort dashboards lexicologically
3474 https://bugs.webkit.org/show_bug.cgi?id=149856
3476 Reviewed by Chris Dumez.
3478 Don't sort the dashboards by name in App.Manifest.
3481 (App.IndexRoute.beforeModel): Don't transition to "undefined" (string) dashboard.
3482 * public/v2/manifest.js:
3483 (App.Manifest.._fetchedManifest):
3485 2015-10-06 Ryosuke Niwa <rniwa@webkit.org>
3487 V2 UI fails to show the data for the very first point in charts
3488 https://bugs.webkit.org/show_bug.cgi?id=149857
3490 Reviewed by Chris Dumez.
3492 The bug was caused by seriesBetweenPoints returning null for when point.seriesIndex is 0.
3493 Explicitly check the type of this property instead.
3495 * public/v2/data.js:
3496 (TimeSeries.prototype.seriesBetweenPoints):
3498 2015-10-06 Ryosuke Niwa <rniwa@webkit.org>
3500 Perf dashboard should have the capability to test local UI with production data
3501 https://bugs.webkit.org/show_bug.cgi?id=149834
3503 Reviewed by Chris Dumez.
3505 Added tools/run-with-remote-server.py which runs a local httpd server and pulls data from a remote server.
3507 * Install.md: Added the instruction on how to use the script. Also updated the remaining instructions
3509 * config.json: Added remote server configurations.
3510 * public/admin/fetch-from-remote.php: Added. This script fetches JSON from the remote server specified in
3511 config.json and caches the results in the location specified as "cacheDirectory" in config.json.
3514 * public/include/db.php:
3515 (config_path): Extracted from generate_data_file.
3516 (generate_data_file):
3517 * tools/remote-server-relay.conf: Added. Apache 2.4 configuration file for a local http server launched by
3518 run-with-remote-server.py.
3519 * tools/run-with-remote-server.py: Added. Launches Apache with the right set of directives.
3521 (abspath_from_root):
3523 2015-07-13 Ryosuke Niwa <rniwa@webkit.org>
3527 * public/js/helper-classes.js:
3529 2015-06-27 Ryosuke Niwa <rniwa@webkit.org>
3531 build-requests should use conform to JSON API format
3532 https://bugs.webkit.org/show_bug.cgi?id=146375
3534 Reviewed by Stephanie Lewis.
3536 Instead of returning single dictionary that maps root set id to a dictionary of repository names
3537 to revisions, timestamps, simply return root sets and roots "rows" or "objects" as defined in
3538 JSON API (http://jsonapi.org/). This API change makes it easier to resolve the bug 146374 and
3539 matches what we do in /api/test-groups.
3541 Also add the support for /api/build-requests/?id=<id> to fetch the build request with <id>.
3542 This is useful for debugging purposes.
3544 * public/api/build-requests.php:
3545 (main): Added the support for $_GET['id']. Also return "rootSets" and "roots".
3546 (update_builds): Extracted from main.
3548 * public/include/build-requests-fetcher.php:
3549 (BuildRequestFetcher::fetch_request): Added. Used for /api/build-requests/?id=<id>.
3550 (BuildRequestFetcher::results_internal): Always call fetch_roots_for_set_if_needed.
3551 (BuildRequestFetcher::fetch_roots_for_set_if_needed): Renamed from fetch_roots_for_set.
3552 Moved the logic to exit early when the root set had already been fetched here.
3554 * public/v2/analysis.js:
3555 (App.TestGroup._fetchTestResults): Fixed the bug that test groups without any successful results
3558 * tools/pull-os-versions.py:
3560 (setup_auth): Moved to util.py
3562 * tools/sync-with-buildbot.py:
3563 (main): Replaced a bunch of perf dashboard related options by --server-config-json.
3564 (update_and_fetch_build_requests): No longer takes build_request_auth since that's now taken care
3566 (organize_root_sets_by_id_and_repository_names): Added. Builds the old rootsSets directory based
3567 on "roots" and "rootSets" dictionaries returned by /api/build-requests.
3568 (config_for_request): Fixed a bug that the script blows up when the build request is missing
3569 the repository specified in the configuration. This tolerance is necessary when a new repository
3570 dependency is added but we want to run A/B tests for old builds without the dependency.
3571 (fetch_json): No longer takes auth.
3574 (setup_auth): Moved from pull-os-versions.py to be shared with sync-with-buildbot.py.
3576 2015-06-23 Ryosuke Niwa <rniwa@webkit.org>
3578 Build fix. A/B testing is broken when continuous builders report revisions out of order.
3581 (App.AnalysisTaskController.Ember.Controller.extend.):
3583 2015-06-22 Ryosuke Niwa <rniwa@webkit.org>
3585 A/B testing results should be shown even if they were submitted to different platforms
3586 https://bugs.webkit.org/show_bug.cgi?id=146219
3588 Reviewed by Andreas Kling.
3590 Fetch A/B testing results regardless of the platform to which results are submitted
3591 by providing the platform ID to which the results were submitted for each test group.
3593 * public/api/test-groups.php:
3594 (main): Include the platform id in the test groups.
3595 * public/v2/analysis.js:
3596 (App.TestGroup._fetchTestResults): Fetch results from the platform associated with the group.
3598 2015-06-19 Csaba Osztrogonác <ossy@webkit.org>
3600 Remove unnecessary svn:executable flags
3601 https://bugs.webkit.org/show_bug.cgi?id=146107
3603 Reviewed by Alexey Proskuryakov.
3605 * public/js/helper-classes.js: Removed property svn:executable.
3606 * public/js/jquery.flot.plugins.js: Removed property svn:executable.
3607 * public/v2/app.css: Removed property svn:executable.
3608 * public/v2/app.js: Removed property svn:executable.
3609 * public/v2/chart-pane.css: Removed property svn:executable.
3610 * public/v2/data.js: Removed property svn:executable.
3611 * public/v2/index.html: Removed property svn:executable.
3612 * public/v2/js/d3/LICENSE: Removed property svn:executable.
3613 * public/v2/js/d3/d3.js: Removed property svn:executable.
3614 * public/v2/js/d3/d3.min.js: Removed property svn:executable.
3615 * public/v2/js/ember-data.js: Removed property svn:executable.
3616 * public/v2/js/ember.js: Removed property svn:executable.
3617 * public/v2/js/handlebars.js: Removed property svn:executable.
3618 * public/v2/js/jquery.min.js: Removed property svn:executable.
3619 * public/v2/js/statistics.js: Removed property svn:executable.
3620 * public/v2/manifest.js: Removed property svn:executable.
3621 * public/v2/popup.js: Removed property svn:executable.
3623 2015-06-17 Ryosuke Niwa <rniwa@webkit.org>
3625 Reading the list of analysis tasks is extremely slow
3626 https://bugs.webkit.org/show_bug.cgi?id=146086
3628 Reviewed by Darin Adler.
3630 The bug was caused by Ember data requesting manifest.js hundreds of times.
3631 Fetch it ahead of time in each route instead.
3634 (App.AnalysisRoute.model):
3635 (App.AnalysisTaskRoute.model):
3637 2015-06-17 Ryosuke Niwa <rniwa@webkit.org>
3639 Update ReadMe.md and Install.md per database changes
3640 https://bugs.webkit.org/show_bug.cgi?id=146076
3642 Reviewed by Darin Adler.
3649 2015-06-17 Ryosuke Niwa <rniwa@webkit.org>
3651 Increase the popup dismissal time from 100ms to 500ms
3652 https://bugs.webkit.org/show_bug.cgi?id=146077
3654 Rubber-stamped by Andreas Kling.
3656 * public/v2/popup.js:
3657 (App.PopupView.scheduleHiding):
3659 2015-06-16 Ryosuke Niwa <rniwa@webkit.org>
3661 v2 UI should have buttons to breakdown a test
3662 https://bugs.webkit.org/show_bug.cgi?id=146010
3664 Reviewed by Chris Dumez.
3666 Added buttons beneath each chart pane to add "alternative panes". By default, it shows every platform
3667 as well as "Breakdown" to add all subtests' metrics.
3669 Also removed the metric submenu from tests that had exactly one metric. When a test only measures Time
3670 for example, we make the test itself clickable instead of showing a submenu that only contains one item.
3673 (App.ChartsController.addAlternativePanes): Added.
3674 (App.TestProxyForPopup.children): Calls _updateChildren and returns this._children.
3675 (App.TestProxyForPopup.actionName): Added.
3676 (App.TestProxyForPopup.actionArgument): Added.
3677 (App.TestProxyForPopup._updateChildren): Extracted from children. Now also sets _actionName and
3678 _actionArgument in the case there was exactly one metric so that showing submenu is unnecessary.
3679 (App.PaneController.alternativePanes): Added. Returns the list of alternative panes. The platform list
3680 excludes ones that don't have this metric (e.g. iOS doesn't have desktop PLT results) as well as ones
3681 that are already present in the list of panes.
3682 * public/v2/chart-pane.css: Added CSS rules for alternative pane buttons beneath the chart panes.
3683 * public/v2/index.html:
3684 * public/v2/manifest.js:
3685 (App.Metric.childMetrics): Added.
3687 2015-06-15 Ryosuke Niwa <rniwa@webkit.org>
3689 Build fix after r185574.
3692 (set get App.Pane.Ember.Object.extend.):
3694 2015-06-15 Ryosuke Niwa <rniwa@webkit.org>
3698 * tools/pull-os-versions.py:
3701 2015-06-15 Ryosuke Niwa <rniwa@webkit.org>
3703 Perf dashboard should be able to list iOS versions as well as OS X versions
3704 https://bugs.webkit.org/show_bug.cgi?id=146003