1 2017-09-06 Aakash Jain <aakash_jain@apple.com>
3 Add initSyncers method in BuildbotTriggerable
4 https://bugs.webkit.org/show_bug.cgi?id=176125
6 Reviewed by Ryosuke Niwa.
8 * tools/sync-buildbot.js:
9 (syncLoop): Use initSyncers() which returns a promise. Modified to handle the promise.
10 * tools/js/buildbot-triggerable.js:
11 (BuildbotTriggerable): Invokes initSyncers() appropriately.
12 (BuildbotTriggerable.prototype.initSyncers): Returns a promise which initialize all the syncers.
13 * server-tests/tools-buildbot-triggerable-tests.js: Updated tests to handle initSyncers().
14 * server-tests/tools-sync-buildbot-integration-tests.js: Ditto.
16 2017-09-05 Ryosuke Niwa <rniwa@webkit.org>
18 Add a button to show two weeks of data to perf dashboard
19 https://bugs.webkit.org/show_bug.cgi?id=176438
21 Reviewed by Saam Barati.
23 Add "2W" button to show 14 days of data on dashboard pages.
25 * public/v3/pages/dashboard-toolbar.js:
28 2017-08-29 Ryosuke Niwa <rniwa@webkit.org>
30 Build fix. OS X "revision" can have a space.
32 * public/include/commit-log-fetcher.php:
34 2017-08-29 Ryosuke Niwa <rniwa@webkit.org>
36 Make it possible to specify A/B testing revision with a partial hash
37 https://bugs.webkit.org/show_bug.cgi?id=176047
39 Rubber-stamped by Chris Dumez.
41 Added the support for specifying a partial hash in A/B testing instead of the full hash.
43 * public/include/commit-log-fetcher.php:
44 (CommitLogFetcher::find_commit_id_by_revision): Extracted from associate-commit.php.
45 * public/privileged-api/associate-commit.php:
47 * public/privileged-api/create-test-group.php:
48 (main): Use find_commit_id_by_revision here to support scheduling an A/B testing with a partial hash.
49 * server-tests/privileged-api-create-test-group-tests.js:
50 (createAnalysisTask): Make it possible to customize revision string in some test cases.
51 * server-tests/resources/test-server.js:
52 (TestServer.prototype._stopApache): Fixed the bug that cleanup step always fails whenever the test file
55 2017-08-26 Ryosuke Niwa <rniwa@webkit.org>
57 Build fix. Creating trying a test group no longer updates the page.
59 * public/v3/models/test-group.js:
60 (TestGroup.createWithCustomConfiguration): Added the missing ignoreCache=true.
62 2017-08-21 Dewei Zhu <dewei_zhu@apple.com>
64 Performance Dashboard should be compatible with PHP 7.
65 https://bugs.webkit.org/show_bug.cgi?id=175813
67 Reviewed by Ryosuke Niwa.
69 Use `file_get_contents('php://input')` instead of '$HTTP_RAW_POST_DATA'.
70 Update test harness script to load right php module in httpd.
72 * ReadMe.md: JSON example format fix.
73 * public/api/report-commits.php: Stop using '$HTTP_RAW_POST_DATA'.
74 * public/api/report.php: Stop using '$HTTP_RAW_POST_DATA'.
75 * public/api/update-triggerable.php: Stop using '$HTTP_RAW_POST_DATA'.
76 * public/include/json-header.php: Stop using '$HTTP_RAW_POST_DATA'.
77 * public/include/report-processor.php: Stop using '$HTTP_RAW_POST_DATA'.
78 * server-tests/resources/test-server.conf: Load php5 or php7 module conditionally.
79 * server-tests/resources/test-server.js: Pass PHP version info while launching httpd.
80 (TestServer.prototype._startApache):
81 * tools/remote-cache-server.py: Pass PHP version info while launching httpd.
83 * tools/remote-server-relay.conf: Load php5 or php7 module conditionally.
84 * tools/sync-buildbot.js:
85 (syncLoop.const.makeTriggerable):
88 2017-08-17 Ryosuke Niwa <rniwa@webkit.org>
90 Number each section in ReadMe.md and add more clarifications
91 https://bugs.webkit.org/show_bug.cgi?id=175687
93 Rubber-stamped by Joseph Pecoraro.
95 Numbered each section and added more clarifications per issues Aakash encountered.
99 2017-08-17 Ryosuke Niwa <rniwa@webkit.org>
101 Build fix. Make the test work with the latest versions of node modules.
103 * server-tests/privileged-api-upload-file-tests.js:
105 2017-07-27 Ryosuke Niwa <rniwa@webkit.org>
107 Build fix. Fixed a typo. task.id() isn't a thing in this function.
109 * public/v3/models/test-group.js:
110 (TestGroup.createWithCustomConfiguration):
112 2017-07-11 Ryosuke Niwa <rniwa@webkit.org>
116 * public/v3/components/chart-pane-base.js:
117 (ChartPaneBase.prototype._updateCommitLogViewer):
119 2017-07-11 Ryosuke Niwa <rniwa@webkit.org>
121 Build fix. It looks like the code here is racy.
123 * public/v3/components/chart-pane-base.js:
124 (ChartPaneBase.prototype.configure):
125 (ChartPaneBase.prototype.setOpenRepository):
127 2017-07-11 Ryosuke Niwa <rniwa@webkit.org>
129 Show the roots built by perf try bots on results page
130 https://bugs.webkit.org/show_bug.cgi?id=174305
132 Reviewed by Joseph Pecoraro.
134 Show build products created by a perf try bots so that we can download them for local testing.
136 * public/v3/components/test-group-revision-table.js:
137 (TestGroupRevisionTable.prototype._renderTable): Find the set of repositories for which a patch is applied.
138 Show build products for all commit sets for such a repository since when WebKit is built with a patch in
139 one configuration, the other configuration also needs to be built for consistency.
140 (TestGroupRevisionTable.prototype._buildCommitCell): Added the hyperlink for build products.
141 (TestGroupRevisionTable.prototype._buildFileInfo): Takes a string to override the file's label. Since all
142 build products made by bots tend to have the same filename, we show the label of "Build product" instead.
143 (TestGroupRevisionTable.prototype._mergeCellsWithSameCommitsAcrossRows): Fixed a bug that any entry with
144 a patch wasn't getting merged since it was comparing against the result commit set, which does not contain
145 the patch (only requested commit set contains a patch).
147 2017-07-10 Ryosuke Niwa <rniwa@webkit.org>
149 Address Antti's review comment.
151 * public/v3/models/analysis-results.js:
152 (AnalysisResults.prototype.containsTest):
154 2017-07-10 Ryosuke Niwa <rniwa@webkit.org>
156 A/B testing results page show results for the top-level tests instead of the one being analyzed
157 https://bugs.webkit.org/show_bug.cgi?id=174304
159 Reviewed by Antti Koivisto.
161 When a specific subtest is analyzed (e.g. Images subtest of MotionMark), then TestGroupResultsViewer
162 should expand and highlight that specific subtest instead of simply showing the top-level test's score.
163 This is especially misleading since AnalysisResultsViewer (stacking bars for each test group) uses
164 the score of the specific subtest being analyzed.
166 Fixed the bug by passing in the metric associated with the analysis task from AnalysisTaskPage to
167 TestGroupResultsViewer via AnalysisTaskTestGroupPane. Also made TestGroupResultsViewer.setAnalysisResults
168 auto-expand the tests that are ancestors of the specified metric. Without that, the test won't be shown
169 to the user until the ancestor tests are expanded by the user.
171 Also fixed the bug that we were always listing sub-tests regardless of whether they have results or not.
172 Since tests tend to change over time, we shouldn't show a test if it doesn't have any results associated.
174 * public/v3/components/test-group-results-viewer.js:
175 (TestGroupResultsViewer.prototype.setAnalysisResults): Expand the ancestor tests of the metric.
176 (TestGroupResultsViewer.prototype._buildRowsForTest): Exit early if this test doesn't have any results.
177 * public/v3/models/analysis-results.js:
178 (AnalysisResults.prototype.containsTest): Added.
179 * public/v3/pages/analysis-task-page.js:
180 (AnalysisTaskTestGroupPane.prototype.setAnalysisResults): Takes a metric to pass it to the results viewer.
181 (AnalysisTaskPage.prototype._assignTestResultsIfPossible):
183 2017-07-06 Ryosuke Niwa <rniwa@webkit.org>
185 Safari 10.1 fails to upload a patch on perf try bots page
186 https://bugs.webkit.org/show_bug.cgi?id=174214
188 Reviewed by Chris Dumez.
190 Added the workaround to make the analysis task page work on Safari 10.1
192 * public/v3/components/instant-file-uploader.js:
193 (InstantFileUploader.prototype._uploadFiles): Convert files to an array since for-of doesn't work otherwise on Safari 10.1.
194 * public/v3/models/uploaded-file.js:
195 (UploadedFile._computeSHA256Hash): Fallback to crypto.webkitSubtle since crypto.subtle isn't available on Safari 10.1 or 11.
197 2017-07-03 Ryosuke Niwa <rniwa@webkit.org>
199 Fix a typo pointed out by Andreas Kling.
201 * public/v3/components/instant-file-uploader.js:
202 (InstantFileUploader.prototype._uploadFiles):
203 * public/v3/models/uploaded-file.js:
204 (UploadedFile.fetchUploadedFileWithIdenticalHash): Renamed from fetchUnloadedFileWithIdenticalHash.
206 2017-07-03 Ryosuke Niwa <rniwa@webkit.org>
208 Add an admin page to manage uploaded files
209 https://bugs.webkit.org/show_bug.cgi?id=174089
211 Reviewed by Andreas Kling.
213 Add an admin page to see the disk usage per user as well as the total, and to prune any zombie files (ones marked
214 as deleted but aren't actually deleted in the filesystem).
216 * public/admin/files.php: Added.
217 (format_size): Added.
218 * public/include/admin-header.php:
220 2017-07-03 Ryosuke Niwa <rniwa@webkit.org>
222 Roots uploaded by bots don't get author specified properly
223 https://bugs.webkit.org/show_bug.cgi?id=174087
225 Reviewed by Andreas Kling.
227 When a root file is uploaded from the bot, we manually specify the remote user to upload_file_in_transaction.
228 However, this was getting ignored by create_uploaded_file_from_form_data since it was always calling
229 remote_user_name to get the user name off of $_SERVER.
231 Fixed the bug by passing in the user name from upload_file_in_transaction to create_uploaded_file_from_form_data.
233 * public/include/uploaded-file-helpers.php:
234 (create_uploaded_file_from_form_data): Take the remote user as an argument instead of calling remote_user_name.
235 (upload_file_in_transaction):
236 * server-tests/api-upload-root-tests.js: Updated an existing test cases to make sure root files' author is set.
237 (createTestGroupWihPatch): Manually override the author of a test group for testing.
239 2017-07-03 Ryosuke Niwa <rniwa@webkit.org>
241 Prune unused uploaded files when the file quota is reached
242 https://bugs.webkit.org/show_bug.cgi?id=174086
244 Reviewed by Andreas Kling.
246 Made /privileged-api/uploaded-file and /api/upload-root automatically delete old uploaded files when
247 uploading a new file results in the file quota to be exceeded. Also added the notion of the total quota
248 to avoid running out of a disk when there are hundreds of users each uploading near their quota.
250 * config.json: Added a sample total disk quota of 100GB.
251 * public/include/uploaded-file-helpers.php:
252 (query_file_usage_for_user): Renamed from query_total_file_size.
253 (query_total_file_usage): Added.
254 (upload_file_in_transaction):
255 (delete_file): Added.
256 (prune_old_files): Added.
257 * server-tests/privileged-api-upload-file-tests.js: Added tests for deleting old uploaded files as well as
258 tests for the total quota.
259 * server-tests/resources/test-server.js:
260 (TestServer.prototype.testConfig): Added uploadTotalQuotaInMB to the test configuration.
262 2017-06-29 Ryosuke Niwa <rniwa@webkit.org>
264 UploadedFile should include the file extension in its url
265 https://bugs.webkit.org/show_bug.cgi?id=174009
267 Reviewed by Chris Dumez.
269 Some command line tools such as darwinup use the file extension to determine the file type.
270 Include the file extension in the URL of an uploaded file to make it work with these tools.
272 * public/include/uploaded-file-helpers.php:
273 (format_uploaded_file): Include the file extension.
274 * public/v3/models/uploaded-file.js:
276 (UploadedFile.prototype.url): Return the URL with hthe file extension specified. /api/uploaded-file
277 already supports having the file extension specified.
278 * server-tests/tools-sync-buildbot-integration-tests.js: Updated test cases.
279 * unit-tests/buildbot-syncer-tests.js: Ditto.
281 2017-05-31 Ryosuke Niwa <rniwa@webkit.org>
283 Don't shouldn't create a request to build a patch if there is no patch to build
284 https://bugs.webkit.org/show_bug.cgi?id=172791
286 Reviewed by Chris Dumez.
288 When a commit set doesn't have a patch specified, don't create a request to build. For example, when we're comparing
289 WebKit in the system to WebKit with a patch, there is nothing to build for the first commit set.
291 However, when conducting an A/B testing, it's advisible to compare WebKit built with and without a patch on a single
292 machine with the same version of Xcode, etc... For this reason, we still create a request to build for a commit set
293 if there is another commit set with a patch which uses the same repository group.
295 * public/privileged-api/create-test-group.php:
296 (main): Fixed the bug. Only create a build request to build if there is a matching repository group with a patch.
297 * server-tests/privileged-api-create-test-group-tests.js: Added a test case.
299 2017-05-31 Ryosuke Niwa <rniwa@webkit.org>
301 Allow sync-buildbot.js to set a buildbot property only when patches are built
302 https://bugs.webkit.org/show_bug.cgi?id=172743
304 Rubber-stamped by Chris Dumez.
306 Added the ability to specify a buildbot property only when there are build requests to build a patch.
308 * tools/js/buildbot-syncer.js:
309 (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group.
310 (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto.
311 (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property.
312 For the condition type of "built", we check if there was any other
313 (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional.
315 * tools/js/buildbot-triggerable.js:
316 (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that
317 belong to the same test group.
318 (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto.
320 * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch.
321 Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest,
322 and scheduleRequestInGroupIfAvailable.
323 (createSampleBuildRequestWithPatch): Added.
325 * unit-tests/resources/mock-v3-models.js:
326 (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing.
328 2017-05-30 Ryosuke Niwa <rniwa@webkit.org>
330 sync-builedbot.js fails to schedule the second request to test with a patch
331 https://bugs.webkit.org/show_bug.cgi?id=172701
333 Reviewed by Antti Koivisto.
335 The bug was caused by an assertion failure in BuildbotTriggerable's _pullBuildbotOnAllSyncers failing to
336 take into account that for a test group with a patch could be associated with two syncers, one to build
337 a patch and another to run tests. Fixed the bug by differentiating the two types of syncers by buildSyncer
338 and testSyncer per test group.
340 * server-tests/tools-sync-buildbot-integration-tests.js: Extended a test case so that it would hit the
341 assertion without the fix.
343 * tools/js/buildbot-triggerable.js:
344 (BuildbotTriggerable.prototype.syncOnce): Use the right kind of the syncer to schedule a build or a test.
345 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Associate a given syncer based on the kind of
346 the build request it processed, and assert accordingly.
348 2017-05-29 Ryosuke Niwa <rniwa@webkit.org>
350 Fix UI glitches with a custom analysis test group with a patch
351 https://bugs.webkit.org/show_bug.cgi?id=172694
353 Reviewed by Sam Weinig.
355 Fix the following UI glitches with perf try bots:
356 - Retrying an A/B testing with a patch fails.
357 - A patch specified in an test group does not get specified in the configurator.
358 - Drag & dropping a patch doesn't work.
359 - Results for custom analysis tasks don't get shown.
361 * public/api/test-groups.php:
362 (main): Fix a bug that test group's platform does not match that of the request'ed platform. Since each test
363 group is associated with platform, just use that instead of querying test_configurations. This resulted in
364 the configurator not being able to find a triggerable in some cases.
366 * public/v3/components/custom-analysis-task-configurator.js:
367 (CustomAnalysisTaskConfigurator):
368 (CustomAnalysisTaskConfigurator.prototype.setCommitSets): Add patches in the commit set.
369 (CustomAnalysisTaskConfigurator.prototype._setUploadedFilesToUploader): Now clears the exiting uploaded files
370 Also renamed from _setUploadedFilesIfEmpty.
371 (CustomAnalysisTaskConfigurator.prototype._setPatchFiles): Added.
372 (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): We no longer update the list of roots
373 for the comparsion when a new root is added to the baseline.
374 (CustomAnalysisTaskConfigurator.prototype._configureComparison): Copy over the list of patches and roots when
375 starting to configure the comparsion.
377 * public/v3/components/instant-file-uploader.js:
378 (InstantFileUploader.prototype.clear): Added.
379 (InstantFileUploader.prototype.didConstructShadowTree): Added event handlers for dragover & drop events to
380 allow specifying a patch and root using drag & drop. Unfortunately, this still doesn't work in WebKit due to
381 a bug in our shadow DOM implementation.
382 (InstantFileUploader.prototype._didFileInputChange):
383 (InstantFileUploader.prototype._uploadFiles): Extracted from _didFileInputChange.
385 * public/v3/pages/analysis-task-page.js:
386 (AnalysisTaskTestGroupPane.prototype.setAnalysisResults): No longer takes metric.
387 (AnalysisTaskTestGroupPane.cssTemplate): Removed unused rules. Also disallow flexing on the list of test groups
388 to avoid the name of a test froup from overflowing on top of the results pane.
389 (AnalysisTaskPage.prototype._assignTestResultsIfPossible): Set setAnalysisResults even when metric is not set
390 as is the case for a custom analysis task.
391 (AnalysisTaskPage.prototype._retryCurrentTestGroup): Use createWithCustomConfiguration to allow retrying of
392 an A/B testing with a patch in a custom analysis task.
393 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingCommitSetList):
395 2017-05-26 Ryosuke Niwa <rniwa@webkit.org>
397 Show patches applied in each A/B testing build requests
398 https://bugs.webkit.org/show_bug.cgi?id=172636
400 Reviewed by Antti Koivisto.
402 List patches applied along side revisions inn the list of revisions for an A/B tesing build requests if there
403 are any patches applied.
405 * public/v3/components/test-group-revision-table.js:
406 (TestGroupRevisionTable.prototype._renderTable): Indicate which request is to build a patch and which one is
408 (TestGroupRevisionTable.prototype._buildCommitCell): Include the patch file's information when there is one.
409 We need to use the requested commit set instead of the one reported by testers or builders since they don't
410 include patch or root information.
411 (TestGroupRevisionTable.prototype._buildCustomRootsCell):
412 (TestGroupRevisionTable.prototype._buildFileInfo): Extracted from _buildCustomRootsCell.
414 2017-05-26 Ryosuke Niwa <rniwa@webkit.org>
416 The queue page is broke when there is a custom analysis task
417 https://bugs.webkit.org/show_bug.cgi?id=172631
419 Reviewed by Antti Koivisto.
421 Fix the bug that we were always assuming each build request to have a test associated.
423 * public/v3/models/test-group.js:
424 (TestGroup.createAndRefetchTestGroups): Fixed the bug that we were referring to a non-existent variable task.
425 * public/v3/pages/build-request-queue-page.js:
426 (BuildRequestQueuePage.prototype._constructBuildRequestTable): Fixed the bug. Collect every request in the group
427 and then find the first test request's test name. Make it clear that we're waiting for a build as needed.
429 2017-05-25 Ryosuke Niwa <rniwa@webkit.org>
431 Syncing script shouldn't schedule a build request when there is a build from another test group in progress
432 https://bugs.webkit.org/show_bug.cgi?id=172577
433 <rdar://problem/32395049>
435 Reviewed by Chris Dumez.
437 When a buildbot master gets restarted while there is an in-progress build and a pending build, the master will
438 re-schedule the currently running build, and this can result in multiple build requests from different test
439 groups being scheduled simultaneously.
441 sync-buildbot.js was supposed to recover from this state by only processing build requests from one test group
442 at a time and eventually come back to a state where only a single test group is running per buildbot slave.
444 We had a test for this particular case but it wasn't testing what it claimed to test. Rewriten the test case
445 and fixed the bug by explicitly checking this condition and treating it as if there is a pending build already
446 scheduled in the builder in this case.
448 * public/api/test-groups.php:
449 (main): Fixed a regression from r217397. Return the platform ID of the first request when none of the requets
450 have been processed yet or all of them had failed.
451 * server-tests/tools-buildbot-triggerable-tests.js: Rewritten a test case intended to cover this bug.
452 (.assertRequestAndResolve): Added.
453 * tools/js/buildbot-syncer.js:
454 (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Fixed the bug. Avoid scheduling a new request on
455 this syncer if there is a build in progress for a test group different from that of the new request. Reuse the
456 code we had to deal with a pending build for this purpose.
458 2017-05-24 Ryosuke Niwa <rniwa@webkit.org>
460 Opening an analysis task from the queue page is broken
461 https://bugs.webkit.org/show_bug.cgi?id=172559
462 <rdar://problem/32389708>
464 Rubber-stamped by Chris Dumez.
466 Fix the bug that opening the analysis task page from the queue page results in multiple assertion failures
467 as well as the list of test groups in the analysis task page not getting updated.
469 * public/v3/models/build-request.js:
470 (BuildRequest.prototype.updateSingleton): Because /api/build-requests/ do not include test groups, it's
471 possible for testGroup to be dynamically updated upon loading an analysis task page. Update _testGroup in
472 such instances instead of asserting that it doesn't happen.
474 * public/v3/models/data-model.js:
475 (DataModelObject.cachedFetch): Because various code to create model objects from the result of a JSON API
476 modify the fetched content in irreversible manner, e.g. `object.platform = Platform.findById(object.platform)`
477 we must return a fresh new content each time even if the result had been cached.
479 * public/v3/models/test-group.js:
480 (TestGroup.prototype.platform): Return this._platform as that's not available.
482 * public/v3/pages/analysis-task-page.js:
484 (AnalysisTaskPage.prototype._resetVariables): Extracted from the constructor.
485 (AnalysisTaskPage.prototype.updateFromSerializedState): Reset all instance variables when opening a new
486 analysis task page. This would avoid showing the stale result even when fetching new test groups had failed.
488 * unit-tests/test-groups-tests.js: Added a test case for fetching the same test group twice. This used to hit
489 a problem in BuildRequest.constructBuildRequestsFromData which overrode platform property of each raw content
490 with a Platform model object because in the case of a cached fetch, we end up trying to look up the platform
491 again using the result of stringifying the Platform object instead of the platform ID included in the original
493 (sampleTestGroup): Added "platform" as included in the JSON API's response now.
495 2017-05-24 Ryosuke Niwa <rniwa@webkit.org>
497 The commit log viewer can overlap the analysis results viewer
498 https://bugs.webkit.org/show_bug.cgi?id=172534
500 Rubber-stamped by Chris Dumez.
502 Allocate the padding on the right for the commit log viewer, and add a horizontal scrollbar
503 to the analysis results viewer instead of letting it expand beneath the commit log viewer.
505 * public/v3/pages/analysis-task-page.js:
506 (AnalysisTaskResultsPane.htmlTemplate):
507 (AnalysisTaskResultsPane.cssTemplate):
509 2017-05-24 Ryosuke Niwa <rniwa@webkit.org>
511 Sycning script build fix after r217378.
513 * tools/sync-buildbot.js:
516 2017-05-23 Ryosuke Niwa <rniwa@webkit.org>
518 Add the support for perf try bots to sync-buildbot.js
519 https://bugs.webkit.org/show_bug.cgi?id=172529
521 Rubber-stamped by Chris Dumez.
523 Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot.
525 Change the buildbot property format in the syncing script's configuration again to use a dictionary
526 with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots,
527 and simplified the structure of the configuration by always having "types" and "builders", and
528 make each entry in "configurations" refer to a list of types, platforms, and builders.
530 Since now there are build requests to build patches and run tests, "configurations" has been renamed to
531 "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations"
532 specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot
533 properties for testing is now specified as "testProperties" and ones for building a patch is specified
534 in newly introduced "buildProperties".
536 * public/api/build-requests.php:
537 (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed
538 since there is no way to run tests without a successful build.
540 * public/api/update-triggerable.php:
541 (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was
542 the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js.
544 * public/v3/models/build-request.js:
545 (BuildRequest.prototype.hasCompleted): Added.
547 * public/v3/models/manifest.js:
548 (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and
549 syncLoop in tools/sync-buildbot.js
550 (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually
551 reset V3 models in syncLoop.
553 * public/v3/models/uploaded-file.js:
554 (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path.
556 * public/v3/remote.js:
557 (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL.
559 * server-tests/api-update-triggerable-tests.js:
560 (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call
561 Manifest.fetch instead.
563 * server-tests/resources/mock-data.js:
564 (MockData.resetV3Models): Calls Manifest.reset().
565 (MockData.addMockConfiguration): Extracted from addMockData.
566 (MockData.addMockData): Updated per the format change.
567 (MockData.mockTestSyncConfigWithSingleBuilder): Ditto.
568 (MockData.mockTestSyncConfigWithTwoBuilders): Ditto.
569 (MockData.runningBuild): Make buildNumber specifiable.
570 (MockData.finishedBuild): Ditto.
572 * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change.
573 Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a
574 repository group that which accepts a patch and not take roots.
576 * server-tests/tools-sync-buildbot-integration-tests.js: Added.
577 (createTriggerable): Added.
578 (createTestGroupWihPatch): Added.
580 (.assertAndResolveRequest): Added.
581 (.assertTestBuildHasFailed): Added.
583 * tools/js/buildbot-syncer.js:
584 (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder
585 is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed
586 _testConfigurations to _configurations.
587 (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't
588 been set or it's a tester.
589 (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder.
590 (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder.
591 (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this
592 syncer is a builder. Otherwise returns [].
593 (BuildbotSyncer.prototype.isTester): Added.
594 (BuildbotSyncer.prototype.matchesConfiguration):
595 (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format.
596 (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations.
597 (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry,
598 creates the list of configurations per builder and platform.
599 (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision,
600 roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial
601 explosion in the number of things that can go wrong. Also parse buildProperties optionally.
602 (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of
603 buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved
604 type such as "revision" and "patch".
605 (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types",
606 "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms.
608 * tools/js/buildbot-triggerable.js:
609 (BuildbotTriggerable.prototype.syncOnce):
610 (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not
611 associated with any test.
612 (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to
613 build a patch which has not been completed (pending, scheduled, running, or failed). Since all
614 requests to build a patch has a negative order, those requests should all show up at the beginning.
615 (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when
616 scheduling the first request to build a patch or the first request to run a test. The first request
617 to run a test will always have order of 0, so it's a sufficient condition to find such a request.
618 On the other hand, the first request to build a patch can have a negative order number so we must
619 explicitly check if it's the first item in the ordered list of requests in the test group.
621 * tools/remote-server-relay.log: Added.
623 * tools/sync-buildbot.js:
624 (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so
625 that Triggerable and related objects we have in the memory may not reflect what we just synced to
626 the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that.
628 * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test
629 exception messages explicitly since allowing any exception was resulting in some tests passing a
630 result of unrelated parsing error being thrown, etc...
631 (sampleiOSConfig): Updated per the format change.
632 (sampleiOSConfigWithExpansions): Ditto.
633 (smallConfiguration): Ditto.
635 2017-05-22 Dewei Zhu <dewei_zhu@apple.com>
637 Fix the bug that sometimes analysis task results pane is missing.
638 https://bugs.webkit.org/show_bug.cgi?id=172404
640 Reviewed by Ryosuke Niwa.
642 AnalysisTaskPage._didFetchTask and AnalaysisTaskPage._fetchRelatedInfoForTaskId should be called in order.
643 The race between those two functions causes the analysis task results pane sometimes missing.
645 * public/v3/components/analysis-results-viewer.js:
646 (AnalysisResultsViewer.prototype.render): Fix the bug in r217173 that commitSet can be undefined.
647 * public/v3/pages/analysis-task-page.js:
648 (AnalysisTaskPage.prototype.updateFromSerializedState): Use arrow function to get rid of self variable.
649 Use `const` instead of var for constant variable. And call _didFetchTask before calling _fetchRelatedInfoForTaskId.
650 (AnalysisTaskPage.prototype._renderTaskNameAndStatus):
651 (AnalysisTaskPage.cssTemplate):
653 2017-05-19 Ryosuke Niwa <rniwa@webkit.org>
655 Add a commit log viewer next to the analysis results viewer
656 https://bugs.webkit.org/show_bug.cgi?id=172399
658 Reviewed by Chris Dumez.
660 Add a commit log viewer next to the analysis results viewer, which visualizes the A/B testing results.
662 Also linkify the revisions in the table that shows the status of each A/B testing job,
663 and allow the prefix of "r" when associating a Subversion revision.
665 Finally, Fixed a bug that the list of commits associated with the analysis task were not re-rendered
666 when the list was updated by the user.
668 * public/v3/components/analysis-results-viewer.js:
669 (AnalysisResultsViewer): Added _selectorRadioButtonList as an instance variable. It's a list of radio
670 buttons to select a configuration (A/B) with a commit set. It's added to update the checked status of
671 radio buttons upon changing the currently selected test group.
672 (AnalysisResultsViewer.prototype.setTestGroups): Update the selected range to that of the currently
674 (AnalysisResultsViewer.prototype.render): Fill _selectorRadioButtonList with radio buttons.
676 * public/v3/components/commit-log-viewer.js:
677 (CommitLogViewer): Added _showRepositoryName as an instance variable.
678 (CommitLogViewer.prototype.setShowRepositoryName): Added.
679 (CommitLogViewer.prototype.render): Hide the repository name when _showRepositoryName is false. This
680 is used in the newly added commit log viewer for the analysis results since we're showing a select
681 element with all the names of repositories above this component.
683 * public/v3/components/test-group-revision-table.js:
684 (TestGroupRevisionTable.prototype._buildCommitCell): Linkify the revisions if possible.
686 * public/v3/models/analysis-task.js:
687 (AnalysisTask.prototype.associateCommit): Strip "r" at the beginning for a Subversion like r12345
688 since that's the format we use to show to the user. This makes copy & paste easier.
690 * public/v3/pages/analysis-task-page.js:
691 (AnalysisTaskResultsPane): Added a bunch of new instance variables to show and update the commit log
692 viewer next to the analysis results viewer.
693 (AnalysisTaskResultsPane.prototype.setPoints): Create the list of repositories to show details.
694 (AnalysisTaskResultsPane.prototype.didConstructShadowTree): Re-render when the current selected test
695 group changes since that may have updated the selected range for A/B testing. Also re-render when
696 a new repository is selected to show details.
697 (AnalysisTaskResultsPane.prototype.render): Update the list of repositories and the commit log viewer.
698 (AnalysisTaskResultsPane.prototype._renderRepositoryList): Renders the list of repositories.
699 (AnalysisTaskResultsPane.prototype._updateCommitViewer): Updates the commit log viewer given the range
700 selected in the analysis results viewer.
701 (AnalysisTaskResultsPane.htmlTemplate): Updated the template.
702 (AnalysisTaskResultsPane.cssTemplate): Ditto.
703 (AnalysisTaskTestGroupPane.cssTemplate): Add a little space between the list of results and the table
704 of A/B testing jobs with revisions.
705 (AnalysisTaskPage.prototype.render): Fixed the bug that the list of commits associated with the task
706 is not updated when the list changes the task or the start point never changed when the list of commits
707 associated with the task changed. Make the lazily evaluated function compare the actual list of commits
708 so that it will invoke _renderCauseAndFixes when the list changes.
709 (AnalysisTaskPage.prototype._renderCauseAndFixes): Now renders a specific list.
711 2017-05-16 Ryosuke Niwa <rniwa@webkit.org>
713 Another build fix. Added a missing null check.
715 * public/v3/components/custom-analysis-task-configurator.js:
716 (CustomAnalysisTaskConfigurator.prototype._setUploadedFilesIfEmpty):
718 2017-05-14 Ryosuke Niwa <rniwa@webkit.org>
720 Build fix. Added a missing null check.
722 * public/v3/pages/analysis-task-page.js:
723 (AnalysisTaskConfiguratorPane.prototype.setTestGroups):
725 2017-05-11 Ryosuke Niwa <rniwa@webkit.org>
727 Remove the code for old syncing script configuration in BuildbotSyncer
728 https://bugs.webkit.org/show_bug.cgi?id=171963
730 Reviewed by Chris Dumez.
732 Removed the code for specifying {"root": ~}, {"rootOptions": [~]}, and {"rootsExcluding": [~]} in buildbot
733 properties in the syncing script's configurations since they are no longer used after r215061.
735 Also removed the support for using "arguments" as an alias to "properties", and updated the tests accordingly.
737 * tools/js/buildbot-syncer.js:
738 (BuildbotSyncer._parseRepositoryGroup): Removed the unused code.
739 (BuildbotSyncer._validateAndMergeConfig): Just allow string values in properties.
740 (BuildbotSyncer._validateAndMergeProperties): Deleted.
742 * unit-tests/buildbot-syncer-tests.js:
743 (sampleiOSConfig): Use "properties" instead of "arguments" to specify the buildbot properties.
744 (sampleiOSConfigWithExpansions): Ditto.
746 2017-05-10 Ryosuke Niwa <rniwa@webkit.org>
748 Another build fix after r215633 to make the bar graphs render even when the confidence intervals aren't available.
750 * public/v3/components/bar-graph-group.js:
751 (BarGraphGroup.prototype._computeRange):
753 2017-05-10 Ryosuke Niwa <rniwa@webkit.org>
755 Build fix after r215633.
757 * public/v3/models/test-group.js:
758 (TestGroup.prototype._computeRequestedCommitSets):
759 (TestGroup.prototype.requestsForCommitSet):
761 2017-05-10 Ryosuke Niwa <rniwa@webkit.org>
763 Add API to upload a patched build for a custom A/B testing
764 https://bugs.webkit.org/show_bug.cgi?id=171956
766 Reviewed by Chris Dumez.
768 Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set.
770 Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code
771 with /api/upload-root.php.
773 * public/api/upload-root.php: Added.
775 (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with.
776 A root can be associated with multiple repositories and there fore commit set items; e.g. if a software
777 is built from multiple repositories and there is a patch associated with one of them, the built product
778 must be associated with all those repositories.
780 * public/include/build-requests-fetcher.php:
781 (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one.
783 * public/include/json-header.php:
784 (validate_arguments): Added the support for validating json string.
785 (verify_slave): Return the slave ID found.
787 * public/include/uploaded-file-helpers.php:
788 (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root.
789 (query_total_file_size): Ditto.
790 (create_uploaded_file_from_form_data): Ditto.
791 (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction.
793 * public/privileged-api/upload-file.php:
796 * public/v3/models/build-request.js:
797 (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item.
799 * public/v3/models/commit-set.js:
800 (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables.
801 (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after
802 its creation. After this patch, each item can be newly associated with a root so we must update its
803 _repositoryToRootMap and _allRootFiles. For simplicity, we update all states.
804 (CommitSet.prototype._updateFromObject): Extracted from the constructor.
805 (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches.
806 (CommitSet.prototype.rootForRepository): Added.
807 (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to
808 _repositoryToCommitMap, and added a check for _repositoryToRootMap.
810 * public/v3/models/test-group.js:
811 (TestGroup.prototype.task): Added.
812 (TestGroup.createWithTask):
813 (TestGroup.createWithCustomConfiguration):
814 (TestGroup.createAndRefetchTestGroups):
815 (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache.
816 (TestGroup.findAllByTask): Added.
817 (TestGroup.fetchForTask): Renamed from fetchByTask.
819 * public/v3/pages/analysis-task-page.js:
820 (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId):
822 * server-tests/api-build-requests-tests.js:
824 * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root.
826 (addSlaveAndCreateRootFile): Added.
827 (createTestGroupWihPatch): Added.
829 * server-tests/privileged-api-create-test-group-tests.js:
831 * server-tests/resources/mock-data.js:
832 (MockData.sharedRepositoryId): Added.
833 (MockData.addMockData): Added "Shared" repository along with commits.
835 2017-05-10 Ryosuke Niwa <rniwa@webkit.org>
837 Rename server-tests/api-update-triggerable.js to server-tests/api-update-triggerable-tests.js
838 https://bugs.webkit.org/show_bug.cgi?id=171905
840 Reviewed by Chris Dumez.
842 * server-tests/api-update-triggerable-tests.js: Renamed from server-tests/api-update-triggerable.js.
844 2017-04-30 Ryosuke Niwa <rniwa@webkit.org>
846 Add the support for scheduling a A/B testing with a patch.
847 https://bugs.webkit.org/show_bug.cgi?id=171209
849 Reviewed by Chris Dumez.
851 Added the support for creating a custom test group with a patch applied.
853 First, each repository in a repository group has a boolean indicating whether a given repository can have
854 a patch applied or not. When any configuration in a test group contains a patch, we create build requests
855 without a test specified in order to "build" those patches. These build requests have negative order numbers
856 to differentiate them from regular build requests. We can't simply build ones with patches since there could
857 be differences in SDK, build options, etc... when patches are applied.
859 The JSON format for commit sets returned by /api/build-requests have been changed from using an array of
860 commit IDs to an array of dictionaries indicate commit and acceptsPatch boolean. /api/update-triggerable now
861 uses a dictionary with two keys: repository and acceptsPatch to specify a set of repositories associated with
862 a repository group, and /privileged-api-create-test-group uses a dictionary with two keys: revision and patch
863 instead of a revision string to specify commit sets.
865 Furthermore, the syncing script's configuration have been updated to use a dictionary of repository names to
866 an options dictionary instead of an array of repositories names. For now, the only supported option is
867 acceptsPatch but will be extended when we add the support for rolling back system components.
868 e.g. {"WebKit": {acceptsPatch: true}, "macOS": {}} instead of ["WebKit", "macOS"]
870 On the UI side, InstantFileUploader has been changed to accept only one file by default, and added a new method
871 allowMultipleFiles() to allow multiple files to be selected for custom roots. Also replaced the input element
872 with type=file by a button with a custom label to show labels such as "Apply a patch" or "Add a new root"
873 instead of the generic label like "choose a file".
876 * init-database.sql: Added trigrepo_accepts_patch to triggerable_repositories to indicate whether a given
877 repository can have a patch applied or not. Made request_test optional in build_requests for when a build
878 request is created to build patches. Such a build request have a negative request_order. Updated the related
879 constraints accordingly.
881 * public/admin/triggerables.php: Added the support for updating whether a given repository can have a patch
882 applied in each repository group. Only show the repositories in the repository group for this purpose since
883 there is no way to accept a patch on a repository without it being a part of the group.
884 (generate_repository_form): Now takes the markup for checkboxes instead of generating one itself.
885 (generate_repository_checkboxes): Now takes an array of repositories to generate checkboxes. The checkbox is
886 shown when the repository ID exists as a key in this array, and is checked when its value is true. The new
887 capability to skip repositories not in the array is used to hide repositories not associated with the group
888 in the list of checkboxes to indicate a repository accepts a patch.
890 * public/api/update-triggerable.php:
891 (main): Now updates the description and acceptsRoots states of each repository group, and sets acceptsPatch
892 boolean for each repository in the group if set in the update.
893 (validate_repository_groups): Use a reference to $repository_groups in order to set repository_id_list, which
894 contains an array of repository IDs to find the existing repository group that matches the set via
895 RepositoryGroupFinder's find_by_repositories. Also added a various validations for acceptsRoots, a dictionary
896 specifying repository and acceptsPatch.
898 * public/include/build-requests-fetcher.php:
899 (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Instead of returning an array of commit IDs as
900 "commits", it now returns an array of dictionaries with "commit" and "patch" keys specifying the commit ID
901 and the patch file's ID respectively as "revisionItems".
902 (BuildRequestsFetcher::add_uploaded_file): Added. Extracted from fetch_commits_for_set_if_needed. Used to
903 add either a patch file or a custom root file in the list of uploaded files in the result.
905 * public/include/manifest-generator.php:
906 (fetch_triggerables): Each element in repository group's "repositories" field is now an array of dictionaries
907 with "repository" and "acceptsPatch" as keys.
909 * public/include/repository-group-finder.php:
910 (RepositoryGroupFinder::__construct): Added a map for boolean indicating whether a given repository group
911 allows a patch on a repository. Used in /privileged-api/create-test-group.
912 (RepositoryGroupFinder::accepts_patch): Added.
913 (RepositoryGroupFinder::populate_map): Build up the map for acceptsPatch boolean per repository per group.
915 * public/privileged-api/create-test-group.php:
916 (main): Fixed a bug that we were not explicitly checking for a duplicate test group name (with a test). Create
917 build requests to "build" patches if there is any patch file specified.
918 (commit_sets_from_revision_sets): Updated to take a dictionary with "revision" and "patch" as keys to specify
919 a revision and a patch if any instead of just a revision string for each repository. Also validate that each
920 repository is allowed to have a patch once the repository group has been found for the set of repositories.
921 (ensure_commit_sets):
923 * public/v3/components/custom-analysis-task-configurator.js:
924 (CustomAnalysisTaskConfigurator): Added _patchUploaders as an instance variable, which is a dictionary of
925 configuration names to a map of InstantFileUploader's used to upload a patch. Also renamed _fileUploaders to
926 _customRootUploaders for clarity.
927 (CustomAnalysisTaskConfigurator.prototype.setCommitSets):
928 (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree.createRootUploader): Added.
929 (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree):
930 (CustomAnalysisTaskConfigurator.prototype._ensurePatchUploader): Added. Creates an instant file uploader for
931 patches. We only allow a single patch per repository.
932 (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Include a patch in the commit set as needed.
933 (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Show the patch file uploader for repositories
934 which can have patches in the current repository group.
935 (CustomAnalysisTaskConfigurator.cssTemplate): Show borders between every rows instead of just between tbody's
936 now that each row can have a patch file uploader.
938 * public/v3/components/instant-file-uploader.js:
939 (InstantFileUploader): Added _fileInput and _allowMultipleFiles as instance variables. We now show a button
940 in the UI instead of an input with type=file. _fileInput is a hidden input with type=file used inside a click
941 event of the button to let the user pick a file.
942 (InstantFileUploader.prototype.allowMultipleFiles): Added. Allows this instance to accept multiple files.
943 (InstantFileUploader.prototype.didConstructShadowTree): Synthetically click on the hidden input element when
944 the newly added button element is clicked to open the browser's file picker.
945 (InstantFileUploader.prototype.render): Hide the button to add a file if this instance can only select one file
946 and there is already some file being uploaded in this instance.
947 (InstantFileUploader.htmlTemplate): Replaced the input element with type=file with a button. Its label comes
948 from the default slot content.
950 * public/v3/models/build-request.js:
951 (BuildRequest): Made the test optional.
952 (BuildRequest.prototype.isBuild): Returns true if this is a build request for building a patch.
953 (BuildRequest.prototype.isTest): Returns true if this is a build request for running tests.
954 (BuildRequest.constructBuildRequestsFromData): Create each commit log here instead of relying on CommitSet's
955 constructor to construct its commit logs. Also updated per the replacement of an array of commit IDs by
956 an array of dictionaries with commit and patch properties.
958 * public/v3/models/commit-set.js:
959 (CommitSet): Made _repositoryToCommitMap a real Map object. Also added _repositoryToPatchMap. Also got rid of
960 the code to instantiate commit logs since that's now done in BuildRequest.constructBuildRequestsFromData.
961 (CommitSet.prototype.commitForRepository):
962 (CommitSet.prototype.revisionForRepository):
963 (CommitSet.prototype.patchForRepository): Added.
964 (CommitSet.prototype.latestCommitTime): Modernized the code.
965 (CommitSet.prototype.equals): Modernized the code. Also added the check for patches.
966 (MeasurementCommitSet): Updated per the change to make _repositoryToCommitMap a real Map.
967 (CustomCommitSet.prototype.setRevisionForRepository):
968 (CustomCommitSet.prototype.equals): Added the check for patches.
969 (CustomCommitSet.prototype.revisionForRepository):
970 (CustomCommitSet.prototype.patchForRepository): Added.
972 * public/v3/models/manifest.js:
973 (Manifest._didFetchManifest): Updated per the replacement of an array of commit IDs by an array of dictionaries
974 with commit and patch properties.
976 * public/v3/models/repository.js:
977 (Repository.prototype.ownerId): Renamed from owner for clarity.
979 * public/v3/models/test-group.js:
980 (TestGroup): Modernized the code by using LazilyEvaluatedFunction. Removed _requestsAreInOrder since it's not
981 necessary anymore with LazilyEvaluatedFunction.
982 (TestGroup.prototype.addBuildRequest):
983 (TestGroup.prototype.test): Use the last build request's test since the first few requests could be requests to
985 (TestGroup.prototype.platform): Ditto.
986 (TestGroup.prototype._lastRequest): Added.
987 (TestGroup.prototype._orderedBuildRequests): Added.
988 (TestGroup.prototype.repetitionCount): Only count the build requests for testing (skipping any requests to
990 (TestGroup.prototype.requestedCommitSets): Simply call _computeRequestedCommitSetsLazily.
991 (TestGroup.prototype._computeRequestedCommitSets): Extracted from requestedCommitSets.
992 (TestGroup.prototype.requestsForCommitSet):
993 (TestGroup.prototype.labelForCommitSet): Rewritten. Just compute the label here instead of relying on
994 _commitSetToLabel since requestedSets is always of the length two at the moment.
995 (TestGroup._revisionSetsFromCommitSets): Specify both the revision and the patch in the revision set.
997 * public/v3/models/triggerable.js:
998 (TriggerableRepositoryGroup): Added _patchAcceptingSet as an instance variable. Use
999 sortByNamePreferringOnesWithURL to sort repositories instead of simple sortByName.
1000 (TriggerableRepositoryGroup.prototype.accepts): Added checks for the custom roots and patches.
1001 (TriggerableRepositoryGroup.prototype.acceptsPatchForRepository): Added.
1003 * server-tests/api-build-requests-tests.js: Updated the test cases per the replacement of an array of commit
1004 IDs by an array of dictionaries with commit and patch properties.
1006 * server-tests/api-manifest-tests.js: Updated the test case per the name of Repository's owner to ownerId.
1008 * server-tests/api-update-triggerable.js: Updated the test case per the name of Repository's owner to ownerId,
1009 and added a test case for updating whether a given repository group allows custom roots as well as patches
1010 on repositories via /api/update-triggerable.
1011 (.updateWithOSXRepositoryGroup): Updated the sample syncing script configuration per the format change.
1012 (.refetchManifest): Added.
1014 * server-tests/privileged-api-create-test-group-tests.js: Updated per the syncing script configuration format
1015 change. Also added a test for creating a test group with a duplicate name, which is expected to fail with
1016 DuplicateTestGroupName, and creating a test group with a patch both when it's allowed and when it's not allowed
1017 in the matching repository group.
1018 (.addTriggerableAndCreateTask): Updated per the format change.
1020 * server-tests/resources/mock-data.js:
1021 (MockData.addEmptyTriggerable): Added a metric and its configuration to make it appear in the manifest file.
1022 The new test case in api-update-triggerable.js requires this.
1023 (MockData.mockTestSyncConfigWithSingleBuilder): Updated per the syncing script configuration format change.
1024 (MockData.mockTestSyncConfigWithTwoBuilders): Ditto.
1026 * server-tests/tools-buildbot-triggerable-tests.js: Removed the useless assertions about test configurations,
1027 and added assertions about custom roots and patches in the test case for updateTriggerables.
1029 * tools/js/buildbot-syncer.js:
1030 (BuildbotSyncer._parseRepositoryGroup): Made each assertion explicitly refer to the specific repository group
1031 to make it more user friendly. Now each repository group uses a dictionary of repository names to its options
1032 in the syncing script configurations. When parsed, we insert it as an array of dictionaries with repository ID
1033 and acceptsPatch boolean specified separately since this is the format /api/update-triggerable expects.
1035 * tools/js/buildbot-triggerable.js:
1036 (BuildbotTriggerable.prototype.updateTriggerable):
1038 * unit-tests/build-request-tests.js:
1039 (sampleBuildRequestData): Updated per the commit sets format change in /api/build-requests.
1041 * unit-tests/buildbot-syncer-tests.js: Updated the existing tests per various format changes and added a couple
1042 of new test cases for the syncing script's configuration validation.
1044 (smallConfiguration):
1045 (createSampleBuildRequest):
1047 * unit-tests/resources/mock-v3-models.js:
1048 (MockModels.inject): Updated per the repository group format change.
1050 * unit-tests/test-groups-tests.js:
1051 (sampleTestGroup): Updated per the commit sets format change in /api/build-requests.
1053 2017-04-21 Ryosuke Niwa <rniwa@webkit.org>
1055 Rename commit_set_relationships to commit_set_items
1056 https://bugs.webkit.org/show_bug.cgi?id=171143
1058 Reviewed by Joseph Pecoraro.
1060 Renamed commit_set_relationships to commit_set_items. Also added commitset_patch_file in the preparation to add
1061 the support for applying patches in custom test groups. To migrate an existing database, run:
1065 ALTER TABLE commit_set_relationships RENAME TO commit_set_items;
1066 ALTER TABLE commit_set_items ADD COLUMN commitset_patch_file integer REFERENCES uploaded_files;
1067 ALTER TABLE commit_set_items ADD CONSTRAINT commitset_with_patch_must_have_commit
1068 CHECK (commitset_patch_file IS NULL OR commitset_commit IS NOT NULL);
1072 * init-database.sql:
1073 * public/include/build-requests-fetcher.php:
1074 * public/privileged-api/create-test-group.php:
1075 * server-tests/resources/mock-data.js:
1076 (MockData.addMockData):
1077 (MockData.addMockTestGroupWithGitWebKit):
1078 * tools/js/database.js:
1080 2017-04-21 Ryosuke Niwa <rniwa@webkit.org>
1082 Add the support for creating a custom test group in the analysis task page
1084 Make it possible to create more custom test groups in the analysis task page
1085 https://bugs.webkit.org/show_bug.cgi?id=171138
1087 Rubber-stamped by Chris Dumez.
1089 Extracted CustomConfigurationTestGroupForm out of CreateAnalysisTaskPage and added it to AnalysisTaskPage inside
1090 AnalysisTaskConfiguratorPane. This allows configuration of a new test group within a custom analysis task.
1092 * public/privileged-api/create-test-group.php:
1093 (main): Fixed the bug that the triggerable wasn't resolved when creating a test group in a custom analysis task.
1095 * public/v3/components/custom-analysis-task-configurator.js:
1096 (CustomAnalysisTaskConfigurator.prototype.selectTests): Added. Used by CustomConfigurationTestGroupForm's
1098 (CustomAnalysisTaskConfigurator.prototype.selectPlatform): Ditto.
1099 (CustomAnalysisTaskConfigurator.prototype.setCommitSets): Ditto.
1100 (CustomAnalysisTaskConfigurator.prototype._setUploadedFilesIfEmpty): Added.
1101 (CustomAnalysisTaskConfigurator.prototype._revisionMapFromCommitSet): Added.
1102 (CustomAnalysisTaskConfigurator.prototype.render): Update the currently selected platforms and tests now that
1103 they can be set externally via selectTests and selectPlatform.
1104 (CustomAnalysisTaskConfigurator.prototype._renderTriggerableTests): Return the result of _renderRadioButtonList
1105 so that the caller can update the currently selected tests without having to reconstruct the list.
1106 (CustomAnalysisTaskConfigurator.prototype._renderTriggerablePlatforms): Ditto.
1107 (CustomAnalysisTaskConfigurator.prototype._renderRadioButtonList): Renamed from _buildCheckboxList. Now returns
1108 a function which updates the currently selected items. We still pretend that multiple items can be selected to
1109 make it future-proof.
1111 * public/v3/components/custom-configuration-test-group-form.js: Added.
1112 (CustomConfigurationTestGroupForm): Added. Inherits from TestGroupForm. Extracted from CreateAnalysisTaskPage.
1113 (CustomConfigurationTestGroupForm.prototype.setHasTask): Added.
1114 (CustomConfigurationTestGroupForm.prototype.hasCommitSets): Added.
1115 (CustomConfigurationTestGroupForm.prototype.setConfigurations): Added. Used by AnalysisTaskConfiguratorPane to
1116 set the default configuration to what the latest test group used.
1117 (CustomConfigurationTestGroupForm.prototype.startTesting): Added. Dispatches "startTesting" action with
1118 platform, test, taskName in addition to what CustomizedTestGroupForm emits.
1119 (CustomConfigurationTestGroupForm.prototype.didConstructShadowTree): Added.
1120 (CustomConfigurationTestGroupForm.prototype.render): Added.
1121 (CustomConfigurationTestGroupForm.prototype._updateTestGroupName): Added.
1122 (CustomConfigurationTestGroupForm.cssTemplate): Added.
1123 (CustomConfigurationTestGroupForm.htmlTemplate): Added.
1125 * public/v3/components/test-group-form.js:
1126 (TestGroupForm.cssTemplate): Make the form display: block.
1128 * public/v3/index.html:
1130 * public/v3/models/test-group.js:
1131 (TestGroup.prototype.test): Added.
1132 (TestGroup.prototype.platform): Added.
1133 (TestGroup.createWithCustomConfiguration): Added. Creates a custom test group with an existing analysis task.
1135 * public/v3/models/uploaded-file.js:
1136 (UploadedFile): Fixed a bug that _deletedAt was set to a Date object even when object.deletedAt is null.
1138 * public/v3/pages/analysis-task-page.js:
1139 (AnalysisTaskConfiguratorPane): Added.
1140 (AnalysisTaskConfiguratorPane.prototype.didConstructShadowTree): Added. Dispatch createCustomTestGroup action
1141 in turn when receiving startTesting from CustomConfigurationTestGroupForm.
1142 (AnalysisTaskConfiguratorPane.prototype.setTestGroups): Added.
1143 (AnalysisTaskConfiguratorPane.prototype.render): Added.
1144 (AnalysisTaskConfiguratorPane.htmlTemplate): Added. We override this instead of formContent to display the
1145 "Start" button at the end instead of at the beginnning.
1146 (AnalysisTaskConfiguratorPane.cssTemplate): Added.
1147 (AnalysisTaskPage.prototype.didConstructShadowTree): Listen to createCustomTestGroup.
1148 (AnalysisTaskPage.prototype.render): Hide AnalysisTaskConfiguratorPane when the analysis task is not custom.
1149 (AnalysisTaskPage.prototype._showTestGroup): Let AnalysisTaskConfiguratorPane know of the current test group
1150 so that it can update the default configuration if the user hasn't modified yet.
1151 (AnalysisTaskPage.prototype._createCustomTestGroup): Added.
1153 * public/v3/pages/create-analysis-task-page.js:
1154 (CreateAnalysisTaskPage.prototype.didConstructShadowTree):
1155 (CreateAnalysisTaskPage.prototype._createAnalysisTaskWithGroup):
1156 (CreateAnalysisTaskPage.prototype.render):
1157 (CreateAnalysisTaskPage.prototype._renderMessage):
1158 (CreateAnalysisTaskPage.htmlTemplate):
1159 (CreateAnalysisTaskPage.cssTemplate):
1161 * server-tests/privileged-api-create-test-group-tests.js: Added a test case for creating a custom test group for
1162 an existing analysis task.
1164 * server-tests/resources/mock-data.js:
1165 (MockData.otherPlatformId): Added.
1166 (MockData.addMockData): Added a test configuration for otherPlatformId.
1168 2017-04-21 Ryosuke Niwa <rniwa@webkit.org>
1170 Make it possible to view results for sub tests and metrics in A/B testing
1171 https://bugs.webkit.org/show_bug.cgi?id=170975
1173 Reviewed by Chris Dumez.
1175 Replaced TestGroupResultsTable, which was a single table that presented the test results with a set of revisions
1176 each build request used, with TestGroupResultsViewer and TestGroupRevisionTable. TestGroupResultsViewer provides
1177 an UI to look the results of sub-tests and sub-metrics and TestGroupRevisionTable provides an UI to display
1178 the set of revisions each build request used. TestGroupRevisionTable can also show the list of custom roots now
1179 that we've added UI to schedule an analysis task with a custom test group.
1181 This patch extends BarGraphGroup to show multiple bars per SingleBarGraph using a canvas with bars indicating
1182 their mean and confidence interval.
1184 * browser-tests/index.html:
1185 (ChartTest.importChartScripts): Include lazily-evaluated-function.js now that Test model object uses
1186 LazilyEvaluatedFunction.
1188 * public/v3/components/analysis-results-viewer.js:
1189 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForCommitSet):
1190 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
1192 * public/v3/components/bar-graph-group.js:
1193 (BarGraphGroup): No longer takes formatter. Added _computeRangeLazily and _showLabels as instance variables.
1194 (BarGraphGroup.prototype.addBar): Now takes a list of values, their labels, mean, confidence interval, and
1195 the colors of bar graphs shown for each value and the mean indicator.
1196 (BarGraphGroup.prototype.showLabels): Added.
1197 (BarGraphGroup.prototype.setShowLabels): Added.
1198 (BarGraphGroup.prototype.range): Added.
1199 (BarGraphGroup.prototype._computeRange): Renamed from updateGroupRendering. Now returns the range instead off
1200 setting it to each bar, and each SingleBarGraph's render function uses the value via BarGraphGroup's range.
1201 (BarGraph): Renamed from SingleBarGraph. Added various arguments introduced in addBar, and now stores various
1202 lazily evaluated functions used for rendering.
1203 (BarGraph.prototype.render): Rewritten to use canvas to draw bar graphs and show a label when group's
1204 showLabels() returns true.
1205 (BarGraph.prototype._resizeCanvas): Added.
1206 (BarGraph.prototype._renderCanvas): Added.
1207 (BarGraph.prototype._renderLabels): Added. We align the top of each label to the middle of each bar and shift it
1208 back up by half the height of the label (0.4rem) using margin-top in css.
1209 (BarGraph.htmlTemplate): Uses a canvas now.
1210 (BarGraph.cssTemplate):
1212 * public/v3/components/results-table.js:
1213 (ResultsTable.prototype.renderTable): Updated per code changes to BarGraphGroup.
1214 (ResultsTableRow.prototype.resultContent): Ditto.
1216 * public/v3/components/test-group-results-table.js: Removed.
1217 * public/v3/components/test-group-results-viewer.js: Added.
1218 (TestGroupResultsViewer): Added. Shows a list of test results with bar graphs with mean and confidence interval
1219 indicators. The results of sub tests and metrics can be expanded via "(Breakdown)" link shown below each test.
1220 (TestGroupResultsViewer.prototype.setTestGroup): Added.
1221 (TestGroupResultsViewer.prototype.setAnalysisResults): Added.
1222 (TestGroupResultsViewer.prototype.render): Added.
1223 (TestGroupResultsViewer.prototype._renderResultsTable): Compute the depth of the test tree we show, and construct
1224 the header rows. Each sub test is "indented" by a new column.
1225 (TestGroupResultsViewer.prototype._buildRowForTest): Added. Build rows for metrics of the given test. Expand the
1226 list of its child tests if it's in expandedTests. Otherwise add a link to "Breakdown" if it has any child tests.
1227 (TestGroupResultsViewer.prototype._buildRowForMetric): Added. Builds rows of table cells to show the results for
1228 the given metric for each configuration.
1229 (TestGroupResultsViewer.prototype._buildRowForMetric.createConfigurationRow): Added. A helper to build cells for
1230 a given configuration represented by a requested commit set.
1231 (TestGroupResultsViewer.prototype._buildValueMap): Added. Creates a mappting between a requested commit set, and
1232 the list of values, mean, etc... associated with the results for the commit set.
1233 (TestGroupResultsViewer.prototype._buildEmptyCells): Added. A helper to create empty cells to indent sub tests.
1234 (TestGroupResultsViewer.prototype._expandCurrentMetrics): Added. Highlights the current metrics and renders the
1235 label for each bar in the results.
1236 (TestGroupResultsViewer.htmlTemplate): Added.
1237 (TestGroupResultsViewer.cssTemplate): Added.
1239 * public/v3/components/test-group-revision-table.js: Added.
1240 (TestGroupRevisionTable): Added. Renders the list of revisions requested for each test configuration as well as
1241 ones used in actual testing, and additional repositories being reported (e.g. repositories for helper scripts).
1242 (TestGroupRevisionTable.prototype.setTestGroup): Added.
1243 (TestGroupRevisionTable.prototype.setAnalysisResults): Added.
1244 (TestGroupRevisionTable.prototype.render): Added.
1245 (TestGroupRevisionTable.prototype._renderTable): Added. The basic algorithm here is to first create a row entry
1246 object for each build request, merge cells that use the same revision of the same repository, and then render
1248 (TestGroupRevisionTable.prototype._buildCommitCell): Added.
1249 (TestGroupRevisionTable.prototype._buildCustomRootsCell): Added.
1250 (TestGroupRevisionTable.prototype._mergeCellsWithSameCommitsAcrossRows): Added. Compute rowspan for each cell
1251 by traversing the rows that use the same revision per repository, and store it in rowCountByRepository while
1252 adding the repository to each succeeding row's repositoriesToSkip.
1253 (TestGroupRevisionTable.htmlTemplate): Added.
1254 (TestGroupRevisionTable.cssTemplate): Added.
1256 * public/v3/index.html:
1257 * public/v3/models/analysis-results.js:
1258 (AnalysisResults): Added _metricIds and _lazilyComputedHighestTests as instance variables.
1259 (AnalysisResults.prototype.findResult): Renamed from find.
1260 (AnalysisResults.prototype.highestTests): Added.
1261 (AnalysisResults.prototype._computeHighestTests): Added. Finds the root tests for this analysis result.
1262 (AnalysisResults.prototype.add): Update _metricIds.
1263 (AnalysisResults.prototype.commitSetForRequest): Added. Returns the reported commit set for the build request.
1264 This commit set contains the set of revisions reported to /api/report by A/B testers.
1265 (AnalysisResultsView.prototype.resultForRequest): Renamed from resultForBuildId.
1267 * public/v3/models/metric.js:
1268 (Metric.prototype.relativeName): Added. Computes the relative name given the test/metric path. This function is
1269 used to determine the label for each test/metric in TestGroupResultsViewer.
1270 (Metric.prototype.aggregatorLabel): Extracted from label.
1271 (Metric.prototype.label):
1272 (Metric.makeFormatter): Added the default value of false to alwaysShowSign.
1274 * public/v3/models/test-group.js:
1275 (TestGroup.prototype.compareTestResults): Now takes a metric instead of retrieving it from the analysis task
1276 since a custom analysis task may not have a metric associated with it.
1278 * public/v3/models/test.js:
1279 (Test): Added _computePathLazily as an instance variable.
1280 (Test.prototype.path): Lazily computes the path now that this function can be called on the same test for many
1281 times in TestGroupResultsViewer while computing relative names of tests and metrics.
1282 (Test.prototype._computePath): Extracted path.
1283 (Test.prototype.fullName): Modernized the code.
1284 (Test.prototype.relativeName): Added.
1286 * public/v3/models/uploaded-file.js:
1288 (UploadedFile.prototype.deletedAt): Added.
1289 (UploadedFile.prototype.label): Added.
1290 (UploadedFile.prototype.url): Added.
1292 * public/v3/pages/analysis-task-page.js:
1293 (AnalysisTaskTestGroupPane.prototype.setTestGroups):
1294 (AnalysisTaskTestGroupPane.prototype.setAnalysisResults): Replaced setAnalysisResultsView. Now takes an
1295 analysisResults instead of its view.
1296 (AnalysisTaskTestGroupPane.prototype.render): No longer enqueues the results table and the retry form to render
1297 since the results table no longer exists, and the retry form re-renders itself as needed.
1298 (AnalysisTaskTestGroupPane.htmlTemplate): Now uses test-group-results-viewer and test-group-revision-table
1299 instead of test-group-results-table, which has been removed.
1300 (AnalysisTaskTestGroupPane.cssTemplate):
1301 (AnalysisTaskPage.prototype._assignTestResultsIfPossible):
1303 * public/v3/pages/create-analysis-task-page.js:
1304 (CreateAnalysisTaskPage.prototype._createAnalysisTaskWithGroup): Removed superflous console.log's.
1306 * tools/js/v3-models.js: Import LazilyEvaluatedFunction now that it's used in the Test model.
1308 * unit-tests/test-model-tests.js: Added.
1310 2017-04-19 Ryosuke Niwa <rniwa@webkit.org>
1312 Another build fix after r215061. Clear TriggerableRepositoryGroup's static map in each iteration.
1314 * tools/sync-buildbot.js:
1317 2017-04-18 Ryosuke Niwa <rniwa@webkit.org>
1319 Build fix after r215061.
1321 There was a mismatch between the format updateTriggerable and /api/update-triggerable were using.
1322 Namely, each repository group was assumed to contain a name field in /api/update-triggerable
1323 but updateTriggerable was not including that at all.
1325 We didn't catch this because the test for updateTriggerable also used the wrong format :(
1327 * server-tests/tools-buildbot-triggerable-tests.js:
1328 * tools/js/buildbot-triggerable.js:
1329 (BuildbotTriggerable.prototype.updateTriggerable):
1331 2017-04-14 Dewei Zhu <dewei_zhu@apple.com>
1333 Add sub-commit UI in commit log viewer.
1334 https://bugs.webkit.org/show_bug.cgi?id=170379
1336 Reviewed by Ryosuke Niwa.
1338 Add an API to return sub-commits for a given commit.
1339 Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits.
1340 Add 'ownsSubCommits' info in 'api/commits' return values.
1341 Extend 'api/manifest' to include whether a repositories owns other repositories.
1342 Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits.
1343 Add unit tests for those new features.
1345 * browser-tests/commit-log-viewer-tests.js: Updated test cases.
1346 * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit.
1347 * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits.
1348 * public/v3/components/expand-collapse-button.js: Added.
1349 (ExpandCollapseButton):
1350 (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event.
1351 (ExpandCollapseButton.sizeFactor):
1352 (ExpandCollapseButton.buttonContent):
1353 (ExpandCollapseButton.cssTemplate):
1354 * public/v3/components/commit-log-viewer.js:
1355 (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits.
1356 (CommitLogViewer.cssTemplate):
1357 * public/v3/components/sub-commit-viewer.js: Added.
1358 (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.`
1359 (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event.
1360 (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked.
1361 (SubCommitViewer.prototype.render): Render sub-commit view based on the state.
1362 (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries.
1363 (SubCommitViewer.htmlTemplate):
1364 (SubCommitViewer.cssTemplate):
1365 * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'.
1366 * public/v3/models/commit-log.js:
1367 (CommitLog): Added '_subCommits'.
1368 (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well.
1369 (CommitLog.prototype.ownsSubCommits):
1370 (CommitLog.prototype.subCommits): Added. Returns sub-commits.
1371 (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before.
1372 (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits.
1373 (CommitLog.diffSubCommits): Added. Finds difference between two given commits.
1374 (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change.
1375 (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change.
1376 (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'.
1377 * public/v3/models/repository.js:
1379 (Repository.prototype.owner): Returns the owner id.
1380 (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository.
1381 * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter.
1382 * server-tests/api-manifest-tests.js: Added a test.
1383 * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'.
1384 * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'.
1386 2017-04-11 Ryosuke Niwa <rniwa@webkit.org>
1388 Retrying an A/B testing does not set the repetition count in some cases
1389 https://bugs.webkit.org/show_bug.cgi?id=170695
1391 Reviewed by Joseph Pecoraro.
1393 When selecting an existing A/B test group, the analysis task page automatically sets the repetition count
1394 of its retry to be that of the original test group. However, this information wasn't being passed correctly
1395 to the code that actually created a test group. As a result, the retried test group's repetition count does
1396 not match that of the original group or the number shown to the user on UI.
1398 Fixed the bug by updating this._repetitionCount in setRepetitionCount.
1400 * browser-tests/index.html:
1401 * browser-tests/test-group-form-tests.js: Added. Added tests.
1402 (.createTestGroupFormWithContext): Added.
1403 * public/v3/components/test-group-form.js:
1404 (TestGroupForm.prototype.setRepetitionCount):
1405 (TestGroupForm.formContent):
1408 2017-04-10 Ryosuke Niwa <rniwa@webkit.org>
1410 Add the UI for scheduling a A/B testing with a custom root
1411 https://bugs.webkit.org/show_bug.cgi?id=170622
1413 Reviewed by Anders Carlsson.
1415 This patch adds the support for creating a new analysis task with a custom darwinup roots. A follow up patch
1416 would update the syncing script to schedule such an A/B testing job to a buildbot instance.
1419 * ReadMe.md: Updated instructions for backing up and restoring the database so that it's easier to replace
1420 the file path for the backup.
1422 * init-database.sql: Make task_platform and task_metric optional in each analysis task. Also added a column
1423 to store the root file in commit_set_relationships.
1425 * public/api/build-requests.php:
1426 (main): Include the uploaded files.
1428 * public/api/commits.php:
1429 (main): Added the support for querying the latest commits for a given platform. This is used in a new page
1430 to create a custom analysis task to autofill the latest revisions for a given platform.
1432 * public/api/test-groups.php:
1433 (main): Include the uploaded files.
1435 * public/include/build-requests-fetcher.php:
1436 (BuildRequestsFetcher::__construct): Added a list of uploaded_files and a map from its id.
1437 (BuildRequestsFetcher::uploaded_files): Added.
1438 (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Added the support for including custom roots' id in
1439 each commit set, and inserting its meta data in the list of uplaoded files.
1441 * public/include/commit-log-fetcher.php:
1442 (CommitLogFetcher::fetch_latest_for_platform): Added. Finds the latest commit for a given platform. Ideally,
1443 we should be finding the latest commit for a given platform, but this is very slow so instead find the commit
1444 of the latest build for a given platform.
1446 * public/privileged-api/create-test-group.php:
1447 (main): Added the support for creating an analysis task along with a group.
1448 (commit_sets_from_revision_sets): Added the support for custom roots. Verify the specified uploaded file exists
1449 and include it in commit_set_relationships. Because commits and upload files are stored in a different column
1450 in commit_set_relationships, this function now stores the information for each row of commit_set_relationships
1451 except the commit set ID, which is unknown until the set is created, instead of a commit ID.
1452 (ensure_commit_sets): Made the each entry in a commit set a row instead of a commit ID as done. As this format
1453 is only by v2 UI and detect-changes.js, we don't add the support for specifying custom roots here.
1455 * public/privileged-api/upload-file.php:
1456 (main): Fixed a typo. Also added one more error check.
1458 * public/v3/components/custom-analysis-task-configurator.js: Added. The UI for selecting a test, a platform,
1459 and a set of revisions, as well as custom roots for a custom A/B testing job. The first set of revision with
1460 custom roots is referred as "baseline", and the second configuration is referred as "comparison" in this class.
1461 (CustomAnalysisTaskConfigurator):
1462 (CustomAnalysisTaskConfigurator.prototype.tests): Added.
1463 (CustomAnalysisTaskConfigurator.prototype.platform): Added.
1464 (CustomAnalysisTaskConfigurator.prototype.commitSets): Added. Returns a pair of baseline and comparsion if both
1465 have been configured by the user.
1466 (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): Added.
1467 (CustomAnalysisTaskConfigurator.prototype._configureComparison): Added. Called when the user is to configu the
1468 "comparison" configuration.
1469 (CustomAnalysisTaskConfigurator.prototype.render): Added.
1470 (CustomAnalysisTaskConfigurator.prototype._renderTriggerableTests): Added. Renders the list of top-level tests
1471 that can be scheduled by a triggerable.
1472 (CustomAnalysisTaskConfigurator.prototype._renderTriggerablePlatforms): Added. Renders the list of platforms
1473 that can be schedule with the currently selected list of tests by a triggerable. Note that the current UI only
1474 lets the user select a single test but the intent is to allow multiple tests to be selected in the near future.
1475 (CustomAnalysisTaskConfigurator.prototype._buildCheckboxList): Added. Creates a list of radio boxes to select
1476 an item with a callback for each. It automatically sets "selected" class on the selected item. It's used to
1477 render both the list of tests and platforms.
1478 (CustomAnalysisTaskConfigurator.prototype._updateTriggerable): Added. Finds the triggerable for a given list of
1479 tests and platforms. Returns an error when some tests belong to another triggearalbe.
1480 (CustomAnalysisTaskConfigurator.prototype._updateRepositoryGroups): Added. Finds a repository group to use when
1481 the current triggerable has changed. We try to use the repository group of the same name if there is any, and
1482 defaults to the first repository group if there is none. This allows the set of repositories to be specified to
1483 more or less persist across different triggerables. For example, if iOS platforms and Mac platforms use two
1484 distinct triggerables , and both triggerables have two repository groups: one that only specify the OS and the
1485 other that specifies both teh OS and WebKit revision, then this code allows the choice the user had made to
1486 specify either just the OS or the OS and WebKit will be preserved when the user switches from an iOS platform
1488 (CustomAnalysisTaskConfigurator.prototype._updateCommitSetMap): Added. Create a commit set map, the format that
1489 TestGroup.createWithTask accepts given "baseline" and "comparison" commit sets. Pretend "comparison" is not set
1490 if two sets are identical since it makes no sense to schedule an A/B testing job when A and B are identical.
1491 (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Added. Creates a commit set using the revisions
1492 and the csutom roots the user had specified.
1493 (CustomAnalysisTaskConfigurator.prototype._renderRepositoryPanes): Added. Renders the pane to specify revisions
1494 and custom roots for "baseline" and "comparison".
1495 (CustomAnalysisTaskConfigurator.prototype._renderBaselineRevisionTable): Added.
1496 (CustomAnalysisTaskConfigurator.prototype._renderComparisonRevisionTable): Added.
1497 (CustomAnalysisTaskConfigurator.prototype._optionalRepositoryList): Added.
1498 (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Added. Creates a table for specifying revisions
1499 and custom roots along with a list of repository groups to pick. The set of repositories and custom roots are
1500 shown at the all if all repository groups require them. Otherwise, they are grouped at the bottom as optional.
1501 (CustomAnalysisTaskConfigurator.prototype._buildRepositoryGroupList): Added.
1502 (CustomAnalysisTaskConfigurator.prototype._selectRepositoryGroup): Added.
1503 (CustomAnalysisTaskConfigurator.prototype._buildRevisionInput): Added. Creates an input element to specify
1504 a revision for a given repository. Autofills it with the latest commit for the currently selected platform if
1505 the user had not modified the field by the time the revisions are fetched.
1506 (CustomAnalysisTaskConfigurator.htmlTemplate): Added.
1507 (CustomAnalysisTaskConfigurator.cssTemplate): Added.
1509 * public/v3/components/instant-file-uploader.js: Added. A form to upload a custom darwinup root in "baseline"
1510 or "comparison" configurations of CustomAnalysisTaskConfigurator. It's "instant" because it auto-detects when a
1511 file to be uploaded had already been uploaded elsewhere by checking its SHA-256 hash.
1512 (InstantFileUploader):
1513 (InstantFileUploader.prototype.hasFileToUpload): Added.
1514 (InstantFileUploader.prototype.uploadedFiles): Added.
1515 (InstantFileUploader.prototype.addUploadedFile): Added. It's called on the uploader for "comparison"
1516 configuration when the uploader for "baseline" configuration dipsatches "uploadedFile" action to automatically
1517 mirror the newly uploaded custom root to "comparision" configuration.
1518 (InstantFileUploader.prototype.didConstructShadowTree): Added.
1519 (InstantFileUploader.prototype.render): Added.
1520 (InstantFileUploader.prototype._renderUploadedFiles): Added. Renders the list of the uploaded files.
1521 (InstantFileUploader.prototype._renderPreuploadFiles): Added. Renders the list of the files to be uploaded with
1523 (InstantFileUploader.prototype._updateUploadStatus): Added. Updates the progress bar for uploading the file.
1524 (InstantFileUploader.prototype._formatUploadError): Added.
1525 (InstantFileUploader.prototype._didFileInputChange): Added. Called when the user picks a file to uploaded on
1526 the input element. Fetch the meta data for the uploaded file with the same SHA-256 hash if there is any, and
1527 start uploading the file if there isn't one.
1528 (InstantFileUploader.prototype._removeUploadedFile): Added.
1529 (InstantFileUploader.prototype._didUploadFile): Added. Move a file from the list of files to be uploaded to
1530 the list of uploaded files.
1531 (InstantFileUploader.htmlTemplate): Added.
1532 (InstantFileUploader.cssTemplate): Added.
1534 * public/v3/index.html:
1536 * public/v3/models/analysis-task.js:
1537 (AnalysisTask): Made platform and metric optional as it is now.
1538 (AnalysisTask.findByPlatformAndMetric): Skip analysis tasks without a platform or a metric.
1539 (AnalysisTask.prototype.isCustom): Added. Returns true for a custom analysis task.
1540 (AnalysisTask.fetchRelatedTasks): Skip custom analysis tasks.
1541 (AnalysisTask._constructAnalysisTasksFromRawData): Construct analysis tasks even if they were missing a metric
1542 or a platform instead of silently skipping them.
1544 * public/v3/models/build-request.js:
1545 (BuildRequest.constructBuildRequestsFromData): Construct uploaded file objects returned by /api/build-requests.
1547 * public/v3/models/commit-log.js:
1548 (CommitLog.fetchLatestCommitForPlatform): Added.
1550 * public/v3/models/commit-set.js:
1551 (CommitSet): Added this._customRoots.
1552 (CommitSet.prototype.customRoots): Returns this._customRoots.
1553 (CommitSet.prototype.equals): Returns false when the set of custom roots are not equal.
1554 (CommitSet.areCustomRootsEqual): Added.
1556 (CustomCommitSet.prototype.equals): Added.
1557 (CustomCommitSet.prototype.customRoots): Added.
1558 (CustomCommitSet.prototype.addCustomRoot): Added.
1560 * public/v3/models/manifest.js:
1561 (Manifest._didFetchManifest): Store fileUploadSizeLimit in the manifest as UploadedFile.fileUploadSizeLimit.
1562 This allows a file size check in the client size instead of uploading it to the server and receiving an error.
1564 * public/v3/models/metric.js:
1565 (Metric.formatTime): Moved from ChartPaneStatusView to be also used by InstantFileUploader._renderUploadedFiles.
1567 * public/v3/models/test-group.js:
1568 (TestGroup.prototype.createWithTask): Added.
1569 (TestGroup.prototype.createAndRefetchTestGroups):
1570 (TestGroup.prototype._revisionSetsFromCommitSets): Added. Extracted from createAndRefetchTestGroups.
1571 (TestGroup.prototype._fetchTestGroupsForTask): Added. Extracted from createAndRefetchTestGroups.
1573 * public/v3/models/triggerable.js:
1574 (Triggerable.triggerablePlatformsForTests): Added.
1575 (Triggerable.sortByNamePreferringSmallerRepositories): Added.
1577 * public/v3/models/uploaded-file.js:
1578 (UploadedFile.prototype.createdAt): Added.
1579 (UploadedFile.prototype.filename): Added.
1580 (UploadedFile.prototype.author): Added.
1581 (UploadedFile.prototype.size): Added.
1582 (UploadedFile.uploadFile): Added a client-side check for the file size using UploadedFile.fileUploadSizeLimit.
1583 (UploadedFile.fetchUnloadedFileWithIdenticalHash): Ditto. Also fixed a bug that 404 was resulting in a rejected
1584 promise instead of a resolved promise with null.
1586 * public/v3/pages/analysis-category-page.js:
1587 (AnalysisCategoryPage.prototype._reconstructTaskList): Modernized the code. Added the support for platform and
1588 metric being null for some analysis tasks.
1590 * public/v3/pages/analysis-task-page.js:
1591 (AnalysisTaskPage.prototype._didFetchTask): Don't fetch the measurement set or create a chart for custom tasks.
1592 (AnalysisTaskPage.prototype.render): Don't display the charts or the stacking table for custom tasks.
1593 (AnalysisTaskPage.prototype._renderTaskNameAndStatus): Don't try to show the full test name for custom tasks
1594 since it's not associated with exactly one pair.
1596 * public/v3/pages/chart-pane-status-view.js:
1597 (ChartPaneStatusView.prototype._renderBuildRevisionTable):
1598 (ChartPaneStatusView.prototype._formatTime): Moved to Metric.formatTime.
1600 * public/v3/pages/chart-pane.js:
1601 (ChartPane.prototype._analyzeRange): Set inProgress to true to hide CustomAnalysisTaskConfigurator in
1602 CreateAnalysisTaskPage when creating a non-custom analysis task for a specific range.
1604 * public/v3/pages/create-analysis-task-page.js:
1605 (CreateAnalysisTaskPage): This page now shows CustomAnalysisTaskConfigurator by default, and lets a user create
1606 a custom analysis task by picking a test, a platform, and a set of revisions and custom darwinup roots.
1607 (CreateAnalysisTaskPage.prototype.updateFromSerializedState): Show a message when inProgress is set. This is
1608 the old behavior of this page.
1609 (CreateAnalysisTaskPage.prototype.didConstructShadowTree): Added.
1610 (CreateAnalysisTaskPage.prototype._createAnalysisTaskWithGroup): Added.
1611 (CreateAnalysisTaskPage.prototype.render):
1612 (CreateAnalysisTaskPage.prototype._renderMessage): Added. Hides CustomAnalysisTaskConfigurator and the select
1613 element to specify the numebr of iterations when a message is set.
1614 (CreateAnalysisTaskPage.htmlTemplate):
1615 (CreateAnalysisTaskPage.cssTemplate):
1617 * public/v3/pages/page-router.js:
1618 (PageRouter.prototype.route): Always enqueue the page to re-render when the route has changed.
1620 * server-tests/api-build-requests-tests.js: Updated test cases now that the response contains a list of
1621 uploaded files associated with build requests.
1623 * server-tests/privileged-api-create-test-group-tests.js: Added test cases for creating a custom analysis task
1624 and a test group with custom roots.
1626 * server-tests/resources/mock-data.js:
1627 (MockData.addMockData): Updated the mock data to satisfy new constraint on analysis-tasks table.
1629 * tools/js/remote.js: Include global.FormData from form-data.js.
1631 * unit-tests/build-request-tests.js:
1632 (sampleBuildRequestData): Updated the mock response.
1633 * unit-tests/buildbot-syncer-tests.js:
1634 (createSampleBuildRequest): Ditto.
1635 * unit-tests/test-groups-tests.js:
1636 (sampleTestGroup): Ditto.
1638 2017-04-10 Commit Queue <commit-queue@webkit.org>
1640 Unreviewed, rolling out r215202.
1641 https://bugs.webkit.org/show_bug.cgi?id=170694
1643 Committed incorrectly (Requested by rniwa on #webkit).
1647 "Add the UI for scheduling a A/B testing with a custom root"
1648 https://bugs.webkit.org/show_bug.cgi?id=170622
1649 http://trac.webkit.org/changeset/215202
1651 2017-04-10 Ryosuke Niwa <rniwa@webkit.org>
1653 Add the UI for scheduling a A/B testing with a custom root
1654 https://bugs.webkit.org/show_bug.cgi?id=170622
1656 Reviewed by Anders Carlsson.
1658 This patch adds the support for creating a new analysis task with a custom darwinup roots. A follow up patch
1659 would update the syncing script to schedule such an A/B testing job to a buildbot instance.
1662 * ReadMe.md: Updated instructions for backing up and restoring the database so that it's easier to replace
1663 the file path for the backup.
1665 * init-database.sql: Make task_platform and task_metric optional in each analysis task. Also added a column
1666 to store the root file in commit_set_relationships.
1668 * public/api/build-requests.php:
1669 (main): Include the uploaded files.
1671 * public/api/commits.php:
1672 (main): Added the support for querying the latest commits for a given platform. This is used in a new page
1673 to create a custom analysis task to autofill the latest revisions for a given platform.
1675 * public/api/test-groups.php:
1676 (main): Include the uploaded files.
1678 * public/include/build-requests-fetcher.php:
1679 (BuildRequestsFetcher::__construct): Added a list of uploaded_files and a map from its id.
1680 (BuildRequestsFetcher::uploaded_files): Added.
1681 (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Added the support for including custom roots' id in
1682 each commit set, and inserting its meta data in the list of uplaoded files.
1684 * public/include/commit-log-fetcher.php:
1685 (CommitLogFetcher::fetch_latest_for_platform): Added. Finds the latest commit for a given platform. Ideally,
1686 we should be finding the latest commit for a given platform, but this is very slow so instead find the commit
1687 of the latest build for a given platform.
1689 * public/privileged-api/create-test-group.php:
1690 (main): Added the support for creating an analysis task along with a group.
1691 (commit_sets_from_revision_sets): Added the support for custom roots. Verify the specified uploaded file exists
1692 and include it in commit_set_relationships. Because commits and upload files are stored in a different column
1693 in commit_set_relationships, this function now stores the information for each row of commit_set_relationships
1694 except the commit set ID, which is unknown until the set is created, instead of a commit ID.
1695 (ensure_commit_sets): Made the each entry in a commit set a row instead of a commit ID as done. As this format
1696 is only by v2 UI and detect-changes.js, we don't add the support for specifying custom roots here.
1698 * public/privileged-api/upload-file.php:
1699 (main): Fixed a typo. Also added one more error check.
1701 * public/v3/components/custom-analysis-task-configurator.js: Added. The UI for selecting a test, a platform,
1702 and a set of revisions, as well as custom roots for a custom A/B testing job. The first set of revision with
1703 custom roots is referred as "baseline", and the second configuration is referred as "comparison" in this class.
1704 (CustomAnalysisTaskConfigurator):
1705 (CustomAnalysisTaskConfigurator.prototype.tests): Added.
1706 (CustomAnalysisTaskConfigurator.prototype.platform): Added.
1707 (CustomAnalysisTaskConfigurator.prototype.commitSets): Added. Returns a pair of baseline and comparsion if both
1708 have been configured by the user.
1709 (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): Added.
1710 (CustomAnalysisTaskConfigurator.prototype._configureComparison): Added. Called when the user is to configu the
1711 "comparison" configuration.
1712 (CustomAnalysisTaskConfigurator.prototype.render): Added.
1713 (CustomAnalysisTaskConfigurator.prototype._renderTriggerableTests): Added. Renders the list of top-level tests
1714 that can be scheduled by a triggerable.
1715 (CustomAnalysisTaskConfigurator.prototype._renderTriggerablePlatforms): Added. Renders the list of platforms
1716 that can be schedule with the currently selected list of tests by a triggerable. Note that the current UI only
1717 lets the user select a single test but the intent is to allow multiple tests to be selected in the near future.
1718 (CustomAnalysisTaskConfigurator.prototype._buildCheckboxList): Added. Creates a list of radio boxes to select
1719 an item with a callback for each. It automatically sets "selected" class on the selected item. It's used to
1720 render both the list of tests and platforms.
1721 (CustomAnalysisTaskConfigurator.prototype._updateTriggerable): Added. Finds the triggerable for a given list of
1722 tests and platforms. Returns an error when some tests belong to another triggearalbe.
1723 (CustomAnalysisTaskConfigurator.prototype._updateRepositoryGroups): Added. Finds a repository group to use when
1724 the current triggerable has changed. We try to use the repository group of the same name if there is any, and
1725 defaults to the first repository group if there is none. This allows the set of repositories to be specified to
1726 more or less persist across different triggerables. For example, if iOS platforms and Mac platforms use two
1727 distinct triggerables , and both triggerables have two repository groups: one that only specify the OS and the
1728 other that specifies both teh OS and WebKit revision, then this code allows the choice the user had made to
1729 specify either just the OS or the OS and WebKit will be preserved when the user switches from an iOS platform
1731 (CustomAnalysisTaskConfigurator.prototype._updateCommitSetMap): Added. Create a commit set map, the format that
1732 TestGroup.createWithTask accepts given "baseline" and "comparison" commit sets. Pretend "comparison" is not set
1733 if two sets are identical since it makes no sense to schedule an A/B testing job when A and B are identical.
1734 (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Added. Creates a commit set using the revisions
1735 and the csutom roots the user had specified.
1736 (CustomAnalysisTaskConfigurator.prototype._renderRepositoryPanes): Added. Renders the pane to specify revisions
1737 and custom roots for "baseline" and "comparison".
1738 (CustomAnalysisTaskConfigurator.prototype._renderBaselineRevisionTable): Added.
1739 (CustomAnalysisTaskConfigurator.prototype._renderComparisonRevisionTable): Added.
1740 (CustomAnalysisTaskConfigurator.prototype._optionalRepositoryList): Added.
1741 (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Added. Creates a table for specifying revisions
1742 and custom roots along with a list of repository groups to pick. The set of repositories and custom roots are
1743 shown at the all if all repository groups require them. Otherwise, they are grouped at the bottom as optional.
1744 (CustomAnalysisTaskConfigurator.prototype._buildRepositoryGroupList): Added.
1745 (CustomAnalysisTaskConfigurator.prototype._selectRepositoryGroup): Added.
1746 (CustomAnalysisTaskConfigurator.prototype._buildRevisionInput): Added. Creates an input element to specify
1747 a revision for a given repository. Autofills it with the latest commit for the currently selected platform if
1748 the user had not modified the field by the time the revisions are fetched.
1749 (CustomAnalysisTaskConfigurator.htmlTemplate): Added.
1750 (CustomAnalysisTaskConfigurator.cssTemplate): Added.
1752 * public/v3/components/instant-file-uploader.js: Added. A form to upload a custom darwinup root in "baseline"
1753 or "comparison" configurations of CustomAnalysisTaskConfigurator. It's "instant" because it auto-detects when a
1754 file to be uploaded had already been uploaded elsewhere by checking its SHA-256 hash.
1755 (InstantFileUploader):
1756 (InstantFileUploader.prototype.hasFileToUpload): Added.
1757 (InstantFileUploader.prototype.uploadedFiles): Added.
1758 (InstantFileUploader.prototype.addUploadedFile): Added. It's called on the uploader for "comparison"
1759 configuration when the uploader for "baseline" configuration dipsatches "uploadedFile" action to automatically
1760 mirror the newly uploaded custom root to "comparision" configuration.
1761 (InstantFileUploader.prototype.didConstructShadowTree): Added.
1762 (InstantFileUploader.prototype.render): Added.
1763 (InstantFileUploader.prototype._renderUploadedFiles): Added. Renders the list of the uploaded files.
1764 (InstantFileUploader.prototype._renderPreuploadFiles): Added. Renders the list of the files to be uploaded with
1766 (InstantFileUploader.prototype._updateUploadStatus): Added. Updates the progress bar for uploading the file.
1767 (InstantFileUploader.prototype._formatUploadError): Added.
1768 (InstantFileUploader.prototype._didFileInputChange): Added. Called when the user picks a file to uploaded on
1769 the input element. Fetch the meta data for the uploaded file with the same SHA-256 hash if there is any, and
1770 start uploading the file if there isn't one.
1771 (InstantFileUploader.prototype._removeUploadedFile): Added.
1772 (InstantFileUploader.prototype._didUploadFile): Added. Move a file from the list of files to be uploaded to
1773 the list of uploaded files.
1774 (InstantFileUploader.htmlTemplate): Added.
1775 (InstantFileUploader.cssTemplate): Added.
1777 * public/v3/index.html:
1779 * public/v3/models/analysis-task.js:
1780 (AnalysisTask): Made platform and metric optional as it is now.
1781 (AnalysisTask.findByPlatformAndMetric): Skip analysis tasks without a platform or a metric.
1782 (AnalysisTask.prototype.isCustom): Added. Returns true for a custom analysis task.
1783 (AnalysisTask.fetchRelatedTasks): Skip custom analysis tasks.
1784 (AnalysisTask._constructAnalysisTasksFromRawData): Construct analysis tasks even if they were missing a metric
1785 or a platform instead of silently skipping them.
1787 * public/v3/models/build-request.js:
1788 (BuildRequest.constructBuildRequestsFromData): Construct uploaded file objects returned by /api/build-requests.
1790 * public/v3/models/commit-log.js:
1791 (CommitLog.fetchLatestCommitForPlatform): Added.
1793 * public/v3/models/commit-set.js:
1794 (CommitSet): Added this._customRoots.
1795 (CommitSet.prototype.customRoots): Returns this._customRoots.
1796 (CommitSet.prototype.equals): Returns false when the set of custom roots are not equal.
1797 (CommitSet.areCustomRootsEqual): Added.
1799 (CustomCommitSet.prototype.equals): Added.
1800 (CustomCommitSet.prototype.customRoots): Added.
1801 (CustomCommitSet.prototype.addCustomRoot): Added.
1803 * public/v3/models/manifest.js:
1804 (Manifest._didFetchManifest): Store fileUploadSizeLimit in the manifest as UploadedFile.fileUploadSizeLimit.
1805 This allows a file size check in the client size instead of uploading it to the server and receiving an error.
1807 * public/v3/models/metric.js:
1808 (Metric.formatTime): Moved from ChartPaneStatusView to be also used by InstantFileUploader._renderUploadedFiles.
1810 * public/v3/models/test-group.js:
1811 (TestGroup.prototype.createWithTask): Added.
1812 (TestGroup.prototype.createAndRefetchTestGroups):
1813 (TestGroup.prototype._revisionSetsFromCommitSets): Added. Extracted from createAndRefetchTestGroups.
1814 (TestGroup.prototype._fetchTestGroupsForTask): Added. Extracted from createAndRefetchTestGroups.
1816 * public/v3/models/triggerable.js:
1817 (Triggerable.triggerablePlatformsForTests): Added.
1818 (Triggerable.sortByNamePreferringSmallerRepositories): Added.
1820 * public/v3/models/uploaded-file.js:
1821 (UploadedFile.prototype.createdAt): Added.
1822 (UploadedFile.prototype.filename): Added.
1823 (UploadedFile.prototype.author): Added.
1824 (UploadedFile.prototype.size): Added.
1825 (UploadedFile.uploadFile): Added a client-side check for the file size using UploadedFile.fileUploadSizeLimit.
1826 (UploadedFile.fetchUnloadedFileWithIdenticalHash): Ditto. Also fixed a bug that 404 was resulting in a rejected
1827 promise instead of a resolved promise with null.
1829 * public/v3/pages/analysis-category-page.js:
1830 (AnalysisCategoryPage.prototype._reconstructTaskList): Modernized the code. Added the support for platform and
1831 metric being null for some analysis tasks.
1833 * public/v3/pages/analysis-task-page.js:
1834 (AnalysisTaskPage.prototype._didFetchTask): Don't fetch the measurement set or create a chart for custom tasks.
1835 (AnalysisTaskPage.prototype.render): Don't display the charts or the stacking table for custom tasks.
1836 (AnalysisTaskPage.prototype._renderTaskNameAndStatus): Don't try to show the full test name for custom tasks
1837 since it's not associated with exactly one pair.
1839 * public/v3/pages/chart-pane-status-view.js:
1840 (ChartPaneStatusView.prototype._renderBuildRevisionTable):
1841 (ChartPaneStatusView.prototype._formatTime): Moved to Metric.formatTime.
1843 * public/v3/pages/chart-pane.js:
1844 (ChartPane.prototype._analyzeRange): Set inProgress to true to hide CustomAnalysisTaskConfigurator in
1845 CreateAnalysisTaskPage when creating a non-custom analysis task for a specific range.
1847 * public/v3/pages/create-analysis-task-page.js:
1848 (CreateAnalysisTaskPage): This page now shows CustomAnalysisTaskConfigurator by default, and lets a user create
1849 a custom analysis task by picking a test, a platform, and a set of revisions and custom darwinup roots.
1850 (CreateAnalysisTaskPage.prototype.updateFromSerializedState): Show a message when inProgress is set. This is
1851 the old behavior of this page.
1852 (CreateAnalysisTaskPage.prototype.didConstructShadowTree): Added.
1853 (CreateAnalysisTaskPage.prototype._createAnalysisTaskWithGroup): Added.
1854 (CreateAnalysisTaskPage.prototype.render):
1855 (CreateAnalysisTaskPage.prototype._renderMessage): Added. Hides CustomAnalysisTaskConfigurator and the select
1856 element to specify the numebr of iterations when a message is set.
1857 (CreateAnalysisTaskPage.htmlTemplate):
1858 (CreateAnalysisTaskPage.cssTemplate):
1860 * public/v3/pages/page-router.js:
1861 (PageRouter.prototype.route): Always enqueue the page to re-render when the route has changed.
1863 * server-tests/api-build-requests-tests.js: Updated test cases now that the response contains a list of
1864 uploaded files associated with build requests.
1865 *server-tests/api-commits-tests.js: Added a test case for /api/commits/<repository-name>/latest?platform=X.
1866 * server-tests/privileged-api-create-test-group-tests.js: Added test cases for creating a custom analysis task
1867 and a test group with custom roots.
1868 * server-tests/resources/mock-data.js:
1869 (MockData.addMockData): Updated the mock data to satisfy new constraint on analysis-tasks table. Also inserted
1870 more commits, builds, and build_commits rows for testing /api/commits/<repository-name>/latest?platform=X.
1872 * tools/js/remote.js: Include global.FormData from form-data.js.
1874 * unit-tests/analysis-task-tests.js: Added a test for calling findByPlatformAndMetric when there is a custom
1876 (sampleAnalysisTask): Removed the category since /api/analysis-tasks/ no longer generate this property.
1877 (sampleCustomAnalysisTask): Added.
1878 * unit-tests/build-request-tests.js:
1879 (sampleBuildRequestData): Updated the mock response. Added a test case for fetcing custom roots.
1880 * unit-tests/buildbot-syncer-tests.js:
1881 (createSampleBuildRequest): Ditto.
1882 * unit-tests/test-groups-tests.js:
1883 (sampleTestGroup): Ditto.
1885 2017-04-07 Ryosuke Niwa <rniwa@webkit.org>
1887 Make cycler page scroll down when a dashboard is too tall for the current viewport size
1888 https://bugs.webkit.org/show_bug.cgi?id=170588
1890 Rubber-stamped by Chris Dumez.
1892 Updated the cycler page to scroll down smoothly over 500ms and scroll up again before moving to the next page
1893 when a dashboard page is too tall to be shown at once. For now, we assume that each dashboard's height is no
1894 more than 2x the height of the viewport.
1896 * public/cycler.html:
1898 2017-04-06 Ryosuke Niwa <rniwa@webkit.org>
1900 Each build request should be associated with a repository group
1901 https://bugs.webkit.org/show_bug.cgi?id=170528
1903 Rubber-stamped by Chris Dumez.
1905 Make the buildbot syncing script use the concept of repository groups so that each repository group can post
1906 a different set of properties to buildbot. In order to do this, we associate each build request with
1907 a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via
1908 /api/update-triggerable just the same way the set of the supported platform, test pairs are updated.
1910 Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name
1911 to either a string value or a repository name enclosed in < and >:
1914 "repositoryGroups": {
1916 "repositories": ["WebKit", "macOS"],
1917 "properties": {"os": "<macOS>", "wk": "<WebKit>"}
1922 With this, removed the support for specifying a repository to use in generic dictionary of properties via
1923 a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of
1924 repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in
1927 After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group.
1928 Run the appropriate database queries to set the repository group on each build request. Because of this change,
1929 this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests.
1930 Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same
1931 test group if the next build request to be scheduled does not specify a repository group.
1933 * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for
1934 repository and group pair in triggerable_repositories table.
1936 * public/api/update-triggerable.php:
1937 (main): Validate and insert repository groups.
1938 (validate_configurations): Extracted from main.
1939 (validate_repository_groups): Added.
1941 * public/v3/models/repository.js:
1942 (Repository.findTopLevelByName): Added.
1944 * public/include/build-requests-fetcher.php:
1945 (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response.
1947 * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given
1948 triggerable for a list of repositories.
1949 (RepositoryGroupFinder): Added.
1950 (RepositoryGroupFinder::__construct): Added.
1951 (RepositoryGroupFinder::find_by_repositories): Added.
1952 (RepositoryGroupFinder::populate_map): Added.
1954 * public/privileged-api/create-test-group.php:
1955 (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains
1956 "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set.
1957 Use that to set the repository group in each new build request.
1958 (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group.
1959 (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its
1960 argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]}
1962 * public/v3/models/build-request.js:
1964 (BuildRequest.prototype.triggerable): Added.
1965 (BuildRequest.prototype.repositoryGroup): Added.
1966 (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group.
1968 * public/v3/models/triggerable.js:
1969 (Triggerable.prototype.name): Added.
1970 (Triggerable.prototype.acceptedRepositories): Deleted.
1971 (TriggerableRepositoryGroup):
1972 (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group
1974 * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request.
1975 * server-tests/api-manifest-tests.js: Added assertions for the repository groups.
1976 * server-tests/api-report-tests.js:
1978 (.reportWithTwoLevelsOfAggregations):
1979 * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with
1981 (.updateWithOSXRepositoryGroup):
1982 (.mapRepositoriesByGroup):
1983 * server-tests/privileged-api-create-test-group-tests.js:
1984 (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups
1985 in existing test cases, and added a test case for creating a test group with two different repository groups.
1987 * server-tests/resources/mock-data.js:
1988 (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps.
1989 (MockData.emptyTriggeragbleId): Added.
1990 (MockData.macosRepositoryId): Added.
1991 (MockData.webkitRepositoryId): Added.
1992 (MockData.gitWebkitRepositoryId): Added.
1993 (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some
1994 tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks.
1995 (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js.
1996 (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js.
1997 (MockData.addAnotherMockTestGroup): Cleanup.
1998 (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes.
1999 (MockData.mockTestSyncConfigWithTwoBuilders): Ditto.
2001 * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test
2002 updating the set of repository groups in addition to the set of test, platform pairs.
2003 (.refetchManifest): Added.
2005 * tools/js/buildbot-syncer.js:
2006 (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument,
2007 and buildRequestArgument as the third argument.
2008 (BuildbotSyncer.prototype.repositoryGroups): Added.
2009 (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find.
2010 Also added an assertion that the build request is associated with a repository group.
2011 (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to
2012 specify a revision in favor of explicity listing each property and repository name in a repository group.
2013 (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties
2014 shared across syncers, the name of properties which specifies the build slave name and build request ID. These
2015 values are not stored as top-level properties and superseded by the concept of repository groups.
2016 (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups.
2017 (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of
2018 properties or buildRequestArgument (often inherited from shared).
2019 (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of
2020 allowed proeprties in each configuration now that they're specified as top-level properties.
2022 * tools/js/buildbot-triggerable.js:
2023 (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups.
2024 (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is
2025 not included in the list of valid build requests.
2026 (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes
2027 those that lack a repository group set.
2028 (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds
2029 the next build request to be scheduled for the test group.
2030 (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from
2031 _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of
2032 a test group information since syncOnce now calls _nextRequestInGroup to find the next build request.
2034 * tools/js/v3-models.js:
2036 * unit-tests/build-request-tests.js: Fixed the test name.
2038 * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests
2039 for parsing repository groups.
2040 (sampleiOSConfig): Updated the mock configuration per code changes.
2041 (sampleiOSConfigWithExpansions): Ditto.
2042 (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration.
2043 Various test cases have been updated to reflect this.
2044 (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock
2045 configurations. The git hash was there to test "rootOptions", which this patch removed.
2046 (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding"
2047 which, again, this patch removed.
2048 (sampleInProgressBuild): Ditto.
2049 (sampleFinishedBuild): Ditto.
2051 * unit-tests/resources/mock-v3-models.js:
2052 (MockModels.inject): Added ock repository groups so that existing tests will continue to function.
2054 2017-04-05 Ryosuke Niwa <rniwa@webkit.org>
2056 Introduce the notion of repository groups to triggerables
2057 https://bugs.webkit.org/show_bug.cgi?id=170228
2059 Reviewed by Chris Dumez.
2061 On some triggerable, it's desirable to specify multiple sets of repositories that are accepted.
2063 For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and
2064 some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither
2065 (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set.
2067 This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by
2068 a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn
2069 now has many to one relationship to triggerable_repository_groups instead of build_triggerables.
2071 Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported.
2072 We don't want to delete the triggerable completely from the database since it would result in the associated
2073 A/B testing results being purged, which is not desirale.
2075 To migrate an existing database, run the following transaction:
2078 ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE;
2080 CREATE TABLE triggerable_repository_groups (
2081 repositorygroup_id serial PRIMARY KEY,
2082 repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL,
2083 repositorygroup_name varchar(256) NOT NULL,
2084 repositorygroup_description varchar(256),
2085 repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE,
2086 CONSTRAINT repository_group_name_must_be_unique_for_triggerable
2087 UNIQUE(repositorygroup_triggerable, repositorygroup_name));
2088 INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name)
2089 SELECT triggerable_id, 'default' FROM build_triggerables;
2091 ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups;
2092 UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups
2093 WHERE trigrepo_triggerable = repositorygroup_triggerable;
2094 ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL;
2096 ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable;
2097 ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots;
2101 * init-database.sql:
2102 * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups.
2103 (insert_triggerable_repositories): Added.
2104 (generate_repository_list): Added.
2105 (generate_repository_form): Added.
2106 (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable.
2108 * public/include/manifest-generator.php:
2109 (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable.
2110 Rewrote it to include an array of repository groups, which in turn contains an array of repositories along
2111 with its name and a description, and a boolean indicating whether it accepts a custom root file or not.
2112 The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories
2113 since it's still used by detect-changes.js.
2115 * public/v3/models/manifest.js:
2116 (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects.
2118 * public/v3/models/triggerable.js:
2120 (Triggerable.prototype.isDisabled): Added.
2121 (Triggerable.prototype.repositoryGroups): Added.
2122 (Triggerable.prototype.acceptsTest): Added.
2123 (TriggerableRepositoryGroup): Added.
2124 (TriggerableRepositoryGroup.prototype.description): Added.
2125 (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added.
2126 (TriggerableRepositoryGroup.prototype.repositories): Added.
2128 * public/v3/pages/analysis-task-page.js:
2129 (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable.
2131 * server-tests/api-manifest-tests.js: Updated a test case to test repository groups.
2133 * tools/js/database.js:
2134 (tableToPrefixMap): Added triggerable_repository_groups.
2136 * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js.
2138 2017-03-31 Ryosuke Niwa <rniwa@webkit.org>
2140 Build fix. For OS versions, we can end up with non-alphanumeric revision.
2141 Delete the code path only used by the v2 UI since nobody uses that now.
2143 * public/api/commits.php:
2146 2017-03-30 Ryosuke Niwa <rniwa@webkit.org>
2148 sync-buildbot.js can schedule more than one build per builder
2149 https://bugs.webkit.org/show_bug.cgi?id=170318
2151 Reviewed by Saam Barati.
2153 The bug was caused by _scheduleNextRequestInGroupIfSlaveIsAvailable not returning a promise when
2154 scheduling the first build request of a test group. This resulted in _pullBuildbotOnAllSyncers
2155 to prematurely resolve before POST'ing new build had finished. That in turn could result in the
2156 next cycle of syncing to occur before POST'ing has actually taken place.
2158 More precisely, when the nextRequest was the first request or its associated syncer object could
2159 not be identified, we were supposed to find the first available syncer, schedule the request,
2160 and then return the promise returned by scheduleRequestInGroupIfAvailable. However, the for loop
2161 which called scheduleRequestInGroupIfAvailable on every syncer was declaring its own variable
2162 named "promise" thereby shadowing the outer variable, which is returned to the caller.
2164 Fixed the bug by not declaring a shadowing variable, and refactored the code. Namely, the only
2165 reason we had such a complicated logic with two local variables, promise and syncer, was so that
2166 we could log that we're scheduling a build. Extracted this code as _scheduleRequestWithLog.
2168 _scheduleNextRequestInGroupIfSlaveIsAvailable can now simply exit early with a call to
2169 _scheduleRequestWithLog when the syncer is readily identified. When looping over syncers, it can
2170 simply return the first non-null result of _scheduleNextRequestInGroupIfSlaveIsAvailable.
2172 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case where we wait 10ms after
2173 receiving the request to POST a build. There should be no new network request until we resolve
2176 * tools/js/buildbot-triggerable.js:
2177 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Fixed the bug.
2178 (BuildbotTriggerable.prototype._scheduleRequestWithLog): Extracted.
2180 2017-03-30 Ryosuke Niwa <rniwa@webkit.org>
2182 Modernize BuildbotSyncer and BuildbotTriggerable
2183 https://bugs.webkit.org/show_bug.cgi?id=170310
2185 Reviewed by Chris Dumez.
2187 Modernized the code to use arrow functions and other modern idoms in ES2016.
2189 * ReadMe.md: Added instructions on how to run tests, and moved the steps to configure postgres
2190 above the steps to configure Apache since only the former is needed to run tests.
2191 * tools/js/buildbot-syncer.js:
2192 * tools/js/buildbot-triggerable.js:
2194 2017-03-30 Ryosuke Niwa <rniwa@webkit.org>
2196 Yet another build fix after r214502. Workaround webkit.org/b/169907 for now.
2198 * public/v3/pages/analysis-task-page.js:
2199 (AnalysisTaskPage.cssTemplate):
2201 2017-03-30 Ryosuke Niwa <rniwa@webkit.org>
2203 Revert an erronously change in the previous commit.
2205 * public/v3/components/base.js:
2207 2017-03-30 Ryosuke Niwa <rniwa@webkit.org>
2209 Build fix after r214280. Don't render components until its element is inserted into a document.
2211 * public/v3/components/base.js:
2214 2017-03-29 Ryosuke Niwa <rniwa@webkit.org>
2216 Another build fix after r214502.
2218 * public/v3/components/analysis-results-viewer.js:
2219 (AnalysisResultsViewer.prototype.render): this._groupToCellMap.get may not contain the cell when startPoint
2220 or metric had not been fetched yet even if currentTestGroup is set.
2222 2017-03-29 Ryosuke Niwa <rniwa@webkit.org>
2224 Build fix after r214502. Analysis tasks without any test groups are throwing exceptions.
2226 * public/v3/components/results-table.js:
2227 (ResultsTable.prototype.renderTable): Don't show the header row when there are no content to show.
2228 (ResultsTable.prototype._computeRepositoryList): Return a pair of arrays. The caller expects the repository
2229 list to be an array, not undefined.
2231 2017-03-28 Ryosuke Niwa <rniwa@webkit.org>
2233 Modernize AnalysisTaskPage
2234 https://bugs.webkit.org/show_bug.cgi?id=170165
2236 Reviewed by Antti Koivisto.
2238 Modernized AnalysisTaskPage and related components. The main refactoring happened in AnalysisTaskPage
2239 from which AnalysisTaskResultsPane and AnalysisTaskTestGroupPane have been extracted.
2241 Decoupled BuildRequest from its results. AnalysisResultsViewer and TestGroupResultsTable now stores
2242 a reference to AnalysisResultsView and Metric to find the results for each build request.
2243 This refactoring is necessary in order to view results of an arbitrary metric in the future.
2245 Also refactored ResultsTable and its subclasses extensively. Instead of making its render() to invoke
2246 subclass' methods such as buildRowGroups, heading, and additionalHeading, rely on each subclass call
2247 to invoke renderTable(), renamed from render(), with callbacks to add extra headers and columns.
2249 This patch also fixes a number of usability issues found by the user such as changing the test name
2250 resets the customized revisions by the virtue of the modern code being naturally more correct.
2252 * public/v3/components/analysis-results-viewer.js:
2253 (AnalysisResultsViewer):
2254 (AnalysisResultsViewer.prototype.setTestGroupCallback): Deleted. Replaced by "testGroupClick" action.
2255 (AnalysisResultsViewer.prototype.setRangeSelectorLabels): Moved here from ResultsTable since it's
2256 never used in ResultsTable or TestGroupResultsTable.
2257 (AnalysisResultsViewer.prototype.selectedRange): Ditto.
2258 (AnalysisResultsViewer.prototype.setPoints): Now takes metric as the third argument.
2259 (AnalysisResultsViewer.prototype.setTestGroups): Now takes the current test group.
2260 (AnalysisResultsViewer.prototype.didUpdateResults): Deleted.
2261 (AnalysisResultsViewer.prototype.setAnalysisResultsView): Added.
2262 (AnalysisResultsViewer.prototype.render): Invoke _renderTestGroups lazily. Also simplified the logic
2263 to find the selected list item. Since we always use a shadow DOM now, we can simply look for an element
2264 with ".seleted" instead of crafting a unique class name.
2265 (AnalysisResultsViewer.prototype.renderTestGroups): Renamed from buildRowGroups. Specify callbacks to
2266 insert headers for A/B radio buttons, which has been moved from ResultsTable.prototype.render, and the
2267 stacked blocks of testing results.
2268 (AnalysisResultsViewer.prototype._classForTestGroup): Deleted.
2269 (AnalysisResultsViewer.prototype._openStackingBlock): Deleted.
2270 (AnalysisResultsViewer.prototype._expandBetween): Create a new set for expandedPoints to make
2271 _renderTestGroupsLazily.evaluate do the work.
2272 (AnalysisResultsViewer._layoutBlocks): Moved from TestGroupStackingGrid.layout.
2273 (AnalysisResultsViewer._sortBlocksByRow): Moved from AnalysisResultsViewer.TestGroupStackingGrid.
2274 (AnalysisResultsViewer._insertAfterBlockWithSameRange): Ditto.
2275 (AnalysisResultsViewer._insertBlockInFirstAvailableColumn): Ditto.
2276 (AnalysisResultsViewer._createCellsForRow): Ditto.
2278 (AnalysisResultsViewer.TestGroupStackingBlock):
2279 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.addRowIndex):
2280 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): No longer creates a unique
2281 class name here. See the inline comment for AnalysisResultsViewer.prototype.render.
2282 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.isThin): Deleted. We used to collapse "failed"
2283 test groups as a thin vertical line, and we wanted to show them next to each other in _layoutBlock but
2284 we don't do that anymore.
2285 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForCommitSet): Added. Uses
2286 this._analysisResultsView to extract the results for the current metrics.
2287 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
2289 * public/v3/components/analysis-task-bug-list.js: Added.
2290 (AnalysisTaskBugList): Added. Extracted from AnalysisTaskChartPane.
2291 (AnalysisTaskBugList.prototype.setTask): Added.
2292 (AnalysisTaskBugList.prototype.didConstructShadowTree): Added.
2293 (AnalysisTaskBugList.prototype.render): Added.
2294 (AnalysisTaskBugList.prototype._associateBug): Added.
2295 (AnalysisTaskBugList.prototype._dissociateBug): Added.
2296 (AnalysisTaskBugList.htmlTemplate): Added.
2298 * public/v3/components/chart-pane-base.js:
2299 (ChartPaneBase.htmlTemplate): Added a hook to insert more content at the end in AnalysisTaskChartPane.
2300 (ChartPaneBase.paneFooterTemplate): Added.
2302 * public/v3/components/customizable-test-group-form.js:
2303 (CustomizableTestGroupForm):
2304 (CustomizableTestGroupForm.prototype.setCommitSetMap):
2305 (CustomizableTestGroupForm.prototype.startTesting): Renamed from _submitted. Now dispatches an action
2306 by the name of "startTesting" instead of calling this._startCallback.
2307 (CustomizableTestGroupForm.prototype.didConstructShadowTree): Added. Moved the logic to attach event
2308 handlers here to avoid eagerly creating the shadow tree in the constructor.
2309 (CustomizableTestGroupForm.prototype._computeCommitSetMap): Use the newly added this._revisionEditorMap
2310 to find the relevant input element instead of running a querySelector.
2311 (CustomizableTestGroupForm.prototype.render): Lazily invoke _renderCustomRevisionTable. This avoids
2312 overriding the customized revisions when the user finally types in the test group name.
2313 (CustomizableTestGroupForm.prototype._renderCustomRevisionTable): Extracted from render.
2314 (CustomizableTestGroupForm.prototype._constructRevisionRadioButtons): Made this a non-static method
2315 since it needs to update this._revisionEditorMap now. Merged _constructRevisionRadioButtons.
2316 (CustomizableTestGroupForm.prototype._createRadioButton): Deleted. See above.
2317 (CustomizableTestGroupForm.cssTemplate):
2318 (CustomizableTestGroupForm.formContent): Use IDs instead of classes to make this.content(ID) work.
2320 * public/v3/components/mutable-list-view.js:
2321 (MutableListView.prototype.setList):
2322 (MutableListView.prototype.setKindList):
2323 (MutableListView.prototype.setAddCallback): Deleted. Replaced by "addItem" action.
2324 (MutableListView.prototype.render):
2325 (MutableListItem.prototype.content):
2327 * public/v3/components/results-table.js:
2328 (ResultsTable): Removed this._rangeSelectorLabels, this._rangeSelectorCallback, and this._selectedRange
2329 as they are only used by AnalysisResultsViewer. Also replaced this._valueFormatter by
2330 this._analysisResultsView which knows a metric.
2331 (ResultsTable.prototype.setValueFormatter): Deleted.
2332 (ResultsTable.prototype.setRangeSelectorLabels): Deleted.
2333 (ResultsTable.prototype.setRangeSelectorCallback): Deleted.
2334 (ResultsTable.prototype.selectedRange): Deleted.
2335 (ResultsTable.prototype._rangeSelectorClicked): Deleted.
2336 (ResultsTable.prototype.setAnalysisResultsView): Added.
2337 (ResultsTable.prototype.renderTable): Added. Removed the logic to add _rangeSelectorLabels since it has
2338 been moved to AnalysisResultsViewer.prototype.render inside buildColumns, which also inserts additional
2339 columns which used to be stored on each ResultsTableRow. Use the same technique to insert additional
2340 headers. Also take the name (thead tr th) of row header (tbody tr td) as an argument and automatically
2341 create a table cell of an appropriate colspan.
2342 (ResultsTable.prototype._createRevisionListCells):
2343 (ResultsTable.prototype.heading): Deleted. Superseded by buildHeaders callback.
2344 (ResultsTable.prototype.additionalHeading): Ditto.
2345 (ResultsTable.prototype.buildRowGroups): Deleted. It is now the responsibility of each subclass to call
2346 ResultsTable's renderTable() in the subclass' render() function.
2347 (ResultsTable.prototype._computeRepositoryList): No longer takes extraRepositories as an argument.
2348 Instead, this function now returns a pair of the repository list and the list of constant commits.
2349 (ResultsTable.htmlTemplate):
2350 (ResultsTable.cssTemplate):
2352 * public/v3/components/test-group-form.js:
2353 (TestGroupForm): Avoid eagerly creating the shadow tree. Also removed the removed the dead code.
2354 (TestGroupForm.prototype.setRepetitionCount): Simply override the value of the select element.
2355 (TestGroupForm.prototype.didConstructShadowTree): Added. Attach event handlers here to avoid eagerly
2356 creating the shadow tree in the constructor.
2357 (TestGroupForm.prototype.startTesting): Renamed from _submitted. Dispatch "startTesting" action instead
2358 of invoking _startCallback which has been removed.
2359 (TestGroupForm.htmlTemplate):
2360 (TestGroupForm.formContent):
2362 * public/v3/components/test-group-results-table.js:
2363 (TestGroupResultsTable):
2364 (TestGroupResultsTable.prototype.didUpdateResults): Deleted. No longer neeed per setAnalysisResultsView
2366 (TestGroupResultsTable.prototype.setTestGroup):
2367 (TestGroupResultsTable.prototype.heading): Deleted.
2368 (TestGroupResultsTable.prototype.render):
2369 (TestGroupResultsTable.prototype._renderTestGroup): Extracted from render.
2370 (TestGroupResultsTable.prototype._buildRowGroups): Renamed from buildRowGroups.
2371 (TestGroupResultsTable.prototype._buildRowGroupForCommitSet): Extracted from buildRowGroups.
2372 (TestGroupResultsTable.prototype._buildComparisonRow): Extracted from buildRowGroups.buildRowGroups
2374 * public/v3/index.html: Include analysis-task-bug-list.js.
2376 * public/v3/models/analysis-results.js:
2377 (AnalysisResults): Inverted the map so that we can easily create a view based on metric.
2378 (AnalysisResults.prototype.find): Ditto.
2379 (AnalysisResults.prototype.add): Ditto.
2380 (AnalysisResults.prototype.viewForMetric): Added.
2381 (AnalysisResults.fetch):
2382 (AnalysisResultsView): Added.
2383 (AnalysisResultsView.prototype.metric): Added.
2384 (AnalysisResultsView.prototype.resultForBuildId): Added.
2386 * public/v3/models/build-request.js:
2387 (BuildRequest.result): Deleted.
2388 (BuildRequest.setResult): Deleted.
2390 * public/v3/models/test-group.js:
2391 (TestGroup): Removed this._allCommitSets since it was never used.
2392 (TestGroup.prototype.didSetResult): Deleted since it was never used.
2393 (TestGroup.prototype.compareTestResults): Now takes an array of measurement set values.
2394 (TestGroup.prototype._valuesForCommitSet): Deleted.
2396 * public/v3/pages/analysis-task-page.js:
2397 (AnalysisTaskChartPane): This class now includes the form to cutomize the revisions.
2398 (AnalysisTaskChartPane.prototype.setShowForm): Added.
2399 (AnalysisTaskChartPane.prototype._mainSelectionDidChange):
2400 (AnalysisTaskChartPane.prototype.didConstructShadowTree): Added. Dispatches "newTestGroup" action when
2401 the user presses the button to start a new A/B testing from the chart.
2402 (AnalysisTaskChartPane.prototype.render): Added.
2403 (AnalysisTaskChartPane.prototype.paneFooterTemplate): Added.
2404 (AnalysisTaskChartPane.cssTemplate):
2406 (AnalysisTaskResultsPane): Added. Encapsulates AnalysisResultsViewer and CustomizableTestGroupForm.
2407 (AnalysisTaskResultsPane.prototype.setPoints): Added.
2408 (AnalysisTaskResultsPane.prototype.setTestGroups): Added.
2409 (AnalysisTaskResultsPane.prototype.setAnalysisResultsView): Added.
2410 (AnalysisTaskResultsPane.prototype.setShowForm): Added.
2411 (AnalysisTaskResultsPane.prototype.didConstructShadowTree): Added. Dispatches "newTestGroup" action
2412 when the user presses the button to start a new A/B testing from the chart.
2413 (AnalysisTaskResultsPane.prototype.render): Added.
2414 (AnalysisTaskResultsPane.htmlTemplate): Added.
2415 (AnalysisTaskResultsPane.cssTemplate): Added.
2417 (AnalysisTaskTestGroupPane): Added. Encapsulates TestGroupResultsTable and CustomizableTestGroupForm.
2418 (AnalysisTaskTestGroupPane.prototype.didConstructShadowTree): Added.
2419 (AnalysisTaskTestGroupPane.prototype.setTestGroups): Added.
2420 (AnalysisTaskTestGroupPane.prototype.setAnalysisResultsView): Added.
2421 (AnalysisTaskTestGroupPane.prototype.render): Added.
2422 (AnalysisTaskTestGroupPane.prototype._renderTestGroups): Added. Updates the list of test groups. Hide
2423 the hidden groups unless showHiddenGroups is set. Updates this._testGroupMap so that the visibility of
2424 groups and their names can be updated without having to re-render the entire list.
2425 (AnalysisTaskTestGroupPane.prototype._renderTestGroupVisibility): Added.
2426 (AnalysisTaskTestGroupPane.prototype._renderTestGroupNames): Added.
2427 (AnalysisTaskTestGroupPane.prototype._renderCurrentTestGroup): Added. Update TestGroupResultsTable with
2428 the selected test group. Also highlight the list view, and update the hide-unhide toggle button's label
2430 (AnalysisTaskTestGroupPane.htmlTemplate): Added.
2431 (AnalysisTaskTestGroupPane.cssTemplate): Added.
2433 (AnalysisTaskPage): Deleted a massive number of instance variables. They are now manged by newly added
2434 AnalysisTaskChartPane, AnalysisTaskResultsPane, and AnalysisTaskTestGroupPane
2435 (AnalysisTaskPage.prototype.didConstructShadowTree): Added. Attach various event handlers here to avoid
2436 eagerly creating the shadow tree in the constructor.
2437 (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId):
2438 (AnalysisTaskPage.prototype._didFetchTask): No longer sets the value formatter to the results viewer
2439 and the results table as they now recieve AnalysisResultsView later in _assignTestResultsIfPossible.
2440 (AnalysisTaskPage.prototype._didFetchMeasurement): Set the metric to the results viewer.
2441 (AnalysisTaskPage.prototype._didUpdateTestGroupHiddenState):
2442 (AnalysisTaskPage.prototype._assignTestResultsIfPossible): Create AnalysisResultsView from the newly
2443 retrieved AnalysisResults and pass it to AnalysisTaskResultsPane and AnalysisTaskTestGroupPane.
2444 (AnalysisTaskPage.prototype.render): Dramatically simplified.
2445 (AnalysisTaskPage.prototype._renderTaskNameAndStatus): Extracted from render.
2446 (AnalysisTaskPage.prototype._renderRelatedTasks): Ditto.
2447 (AnalysisTaskPage.prototype._renderCauseAndFixes): Ditto.
2448 (AnalysisTaskPage.prototype._showTestGroup):
2449 (AnalysisTaskPage.prototype._updateTaskName): Now takes the new name as an argument.
2450 (AnalysisTaskPage.prototype._updateTestGroupName): Now takes the new name as the second argument.
2451 (AnalysisTaskPage.prototype._hideCurrentTestGroup): Now takes the test group to hide.
2452 (AnalysisTaskPage.prototype._associateCommit): Moved to AnalysisTaskBugList.
2453 (AnalysisTaskPage.prototype._dissociateCommit): Ditto.
2454 (AnalysisTaskPage.prototype._retryCurrentTestGroup): Now takes the test group as the first argument.
2455 (AnalysisTaskPage.prototype._chartSelectionDidChange): Deleted.
2456 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Deleted.
2457 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): Deleted.
2458 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Deleted.
2459 (AnalysisTaskPage.htmlTemplate):
2460 (AnalysisTaskPage.cssTemplate):
2462 * unit-tests/test-groups-tests.js: Updated a test case which was expecting BuildReqeust's result, which
2463 has been removed, to exist.
2465 2017-03-23 Ryosuke Niwa <rniwa@webkit.org>
2467 Share more code between ManifestGenerator and /api/triggerables
2468 https://bugs.webkit.org/show_bug.cgi?id=169993
2470 Reviewed by Chris Dumez.
2472 Shared the code to fetch the list of triggerables from the database between ManifestGenerator
2473 and /api/triggerables.
2475 * public/api/triggerables.php:
2477 * public/include/manifest-generator.php:
2478 (ManifestGenerator::fetch_triggerables): Extracted as a static function. Also include the ID
2479 in the triggerable data.
2481 2017-03-23 Ryosuke Niwa <rniwa@webkit.org>
2483 create-test-group should allow a different set of repositories to be used in each configuration
2484 https://bugs.webkit.org/show_bug.cgi?id=169992
2486 Rubber-stamped by Antti Koivisto.
2488 Added the support for new POST parameter, revisionSets, to /privileged-api/create-test-group.
2489 This new parameter now specifies an array of repository id to revision dictionaries, and allows
2490 different set of repositories' revisions to be specified in each dictionary.
2492 We keep the old API for v2 UI and detect-changes.js compatibility for now.
2494 * public/privileged-api/create-test-group.php:
2496 (commit_sets_from_revision_sets): Added.
2497 (ensure_commit_sets): Only fetch the top-level repository per r213788 and r213976.
2499 * public/v3/models/test-group.js:
2500 (TestGroup.createAndRefetchTestGroups): Use the newly added revisionSets parameter instead of
2501 the now depreacted commitSets parameter.
2503 * public/v3/pages/analysis-task-page.js:
2504 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingCommitSetList): Simplified this code
2505 by simply verifying the consistency of commit sets now that createAndRefetchTestGroups takes
2506 an array of commit sets instead of a dictionary of repository name to a list of revisions.
2508 * server-tests/privileged-api-create-test-group-tests.js: Added test cases for new parameter.
2510 2017-03-22 Ryosuke Niwa <rniwa@webkit.org>
2512 /api/uploaded-file should return createdAt as a POSIX timestamp
2513 https://bugs.webkit.org/show_bug.cgi?id=169980
2515 Rubber-stamped by Antti Koivisto.
2517 Call Database::to_js_time on createdAt to return it as a POSIX timestamp.
2519 * public/include/uploaded-file-helpers.php:
2520 (format_uploaded_file): Fixed the bug.
2521 * server-tests/api-manifest-tests.js: Renamed from api-manifest.js.
2522 * server-tests/api-uploaded-file-tests.js: Renamed from api-uploaded-file.js. Added a test case.
2524 2017-03-22 Ryosuke Niwa <rniwa@webkit.org>
2526 UploadedFile should support a callback for upload progress
2527 https://bugs.webkit.org/show_bug.cgi?id=169977
2529 Reviewed by Andreas Kling.
2531 Added a new option dictionary to CommonRemoteAPI.sendHttpRequest with uploadProgressCallback
2533 Moved request headers and responseHandler callback in NodeRemoteAPI to this dictionary,
2534 and updated the tests which relied on this code.
2536 * public/shared/common-remote.js:
2537 (CommonRemoteAPI.prototype.postJSON):
2538 (CommonRemoteAPI.prototype.postJSONWithStatus):
2539 (CommonRemoteAPI.prototype.postFormData):
2540 (CommonRemoteAPI.prototype.postFormDataWithStatus):
2541 * public/v3/privileged-api.js:
2542 (PrivilegedAPI.prototype.sendRequest):
2543 * public/v3/remote.js:
2544 (BrowserRemoteAPI.prototype.sendHttpRequest):
2545 (BrowserRemoteAPI.prototype.sendHttpRequestWithFormData):
2547 * server-tests/api-uploaded-file.js:
2548 * tools/js/remote.js:
2549 (NodeRemoteAPI.prototype.sendHttpRequest):
2550 (NodeRemoteAPI.prototype.sendHttpRequestWithFormData):
2553 2017-03-22 Ryosuke Niwa <rniwa@webkit.org>
2555 ComponentBase should enqueue itself to render when it becomes connected
2556 https://bugs.webkit.org/show_bug.cgi?id=169905
2558 Reviewed by Antti Koivisto.
2560 When a component becomes connected to a document, enqueue itself to render automatically.
2561 Also added the support for boolean attribute to ComponentBase.createElement.
2563 * ReadMe.md: Added an instruction to raise the upload limit per r214065.
2564 * browser-tests/component-base-tests.js: Added tests for the new behavior and createElement. Also moved
2565 the tests related to enqueueToRenderOnResize out of defineElement tests.
2567 * browser-tests/index.html:
2568 (BrowsingContext.prototype.constructor): Override requestAnimationFrame so that the callback would be
2569 involved immediately durign testing.
2571 * public/v3/components/base.js:
2572 (ComponentBase): Enqueue itself to render during construction if custom elements is not available.
2573 (ComponentBase.defineElement):
2574 (ComponentBase.defineElement.elementClass.prototype.connectedCallback): Enqueue itself to render when
2575 the component's element became connected.
2576 (ComponentBase.createElement): Use Array.isArray instead of instanceof to make it work with arrays made
2577 in other realms (global objects) during testing. Added the support for boolean attributes. Setting an
2578 attribute value to true would set the attribute, and setting it to false would not set the attribute.
2579 (ComponentBase.useNativeCustomElements): Added. True iff window.customElements is defined.
2581 * public/v3/components/chart-pane-base.js:
2582 (ChartPaneBase.prototype.render): No longer need to call enqueueToRender on the commit log viewer.
2584 * public/v3/components/commit-log-viewer.js:
2585 (CommitLogViewer.prototype.render): No longer need to call enqueueToRender on the spinner icon.
2587 * public/v3/models/time-series.js:
2588 (TimeSeries): Made this a proper class declaration now that we don't include data.js after r213300.
2590 * public/v3/pages/chart-pane.js:
2591 (ChartPane.prototype._renderActionToolbar): No longer need to call enqueueToRender on the close icon.
2593 * public/v3/pages/summary-page.js:
2594 (SummaryPage.prototype._renderCell): No longer need to call enqueueToRender on the spinner icon.
2596 2017-03-20 Ryosuke Niwa <rniwa@webkit.org>
2598 Delete another function that was supposed to be removed in the previous commit.
2600 * public/v3/models/build-request.js:
2601 (BuildRequest.cachedRequestsForTriggerableID): Deleted.
2603 2017-03-20 Ryosuke Niwa <rniwa@webkit.org>
2605 Modernize BuildRequestQueuePage
2606 https://bugs.webkit.org/show_bug.cgi?id=169903
2608 Reviewed by Antti Koivisto.
2610 Modernized the code for /v3/#/analysis/queue.
2612 * public/v3/models/build-request.js:
2613 (BuildRequest.fetchTriggerables): Deleted since the manifest JSON now contains all the triggerables.
2615 * public/v3/pages/build-request-queue-page.js:
2616 (BuildRequestQueuePage): Deleted this._triggerables. Added this._buildRequestsByTriggerable.
2617 (BuildRequestQueuePage.prototype.open): Modernized the code.
2618 (BuildRequestQueuePage.prototype.render): Ditto.
2619 (BuildRequestQueuePage.prototype._constructBuildRequestTable): Ditto.
2621 2017-03-19 Ryosuke Niwa <rniwa@webkit.org>
2623 Charts page show an inconsistent list of revisions for Git and Subversion
2624 https://bugs.webkit.org/show_bug.cgi?id=169888
2626 Reviewed by Andreas Kling.
2628 With Git, CommitLogViewer was showing the list of revisions including the starting hash,
2629 which was the last data point's revision instead of all revisions after the last data point.
2631 Fixed the bug by always specifying the revision at the last data point in both Subversion
2632 and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision.
2633 For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and
2634 "lastRevision" respectively.
2636 We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g.
2637 when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250"
2638 instead of "r1235-r1250".
2640 * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer
2641 specifies from/to revisions.
2642 * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer.
2643 * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css.
2645 * public/api/commits.php:
2646 (main): Renamed "from" and "to" query parameters.
2648 * public/include/commit-log-fetcher.php:
2649 (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified
2650 in both rows or not specified in either. Also reject when before_first_revision is identical
2651 or after last_revision instead of re-ordering them since it no longer makes sense to do so with
2652 new query parameter names.
2654 * public/v3/components/base.js:
2655 (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient
2656 againt realm (global object) differences.
2658 * public/v3/components/chart-pane-base.js:
2659 (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since
2660 CommitLogViewer does that on its own now.
2661 (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer
2662 to remember which repository is current. This was the only use of currentRepository.
2664 * public/v3/components/commit-log-viewer.js:
2666 (CommitLogViewer.prototype.currentRepository): Deleted.
2667 (CommitLogViewer.prototype.view):
2668 (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy.
2669 Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision
2670 since the generic JSON API no longer supports being called with the identical revisions.
2671 (CommitLogViewer.prototype.render): Modernized & simplified the code.
2672 (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy.
2673 (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable.
2674 (CommitLogViewer.cssTemplate):
2676 * public/v3/models/commit-log.js:
2677 (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding
2678 1 to a Subversion-like starting revision for creating the label. See above. But we still do this
2679 for forming URLs due to the way tools like Trac work with Subversion revisions.
2680 (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for
2681 what this function is supposed to be doing.
2682 (CommitLog._cachedCommitLogs): Deleted.
2683 (CommitLog.fetchForSingleRevision): Added.
2684 (CommitLog._constructFromRawData): Added.
2686 * public/v3/models/data-model.js:
2687 (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them.
2689 * public/v3/remote.js:
2690 (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo.
2692 * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to
2693 use new query parameters and added more test cases.
2695 * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer
2696 includes from/to values. They're computed in ChartRevisionRange instead.
2698 2017-03-20 Ryosuke Niwa <rniwa@webkit.org>
2700 Fix os-build-fetcher.js and subprocess.js to make them work
2701 https://bugs.webkit.org/show_bug.cgi?id=169844
2703 Reviewed by Antti Koivisto.
2705 The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel.
2706 Some commands to poll the lsit of system components is not desirable to be ran in parallel.
2708 * server-tests/resources/mock-subprocess.js:
2709 (MockSubprocess): Use const declaration.
2710 (MockSubprocess.resetAndWaitForInvocation): Added.
2711 (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb.
2712 See https://webkit.org/code-style-guidelines/#names-verb
2713 (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array
2714 regardless of whether reset is called or when it's called.
2716 * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now
2717 expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting
2718 them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve,
2719 its subcommand to run, and then move onto the second top-level command. Also use a local reference
2720 to MockSubprocess.invocations instead of using the fully qualified name.
2722 * tools/js/os-build-fetcher.js:
2723 (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array
2724 in serial (not asynchronous) is a very common pattern in this class.
2725 (OSBuildFetcher.fetchAndReportAllInOrder): Added.
2726 (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted.
2727 (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result
2728 in each top-level command to be execued in parallel. Since each subcommand is executed as soon as
2729 its parent command is executed, this results in commands to be executed in parallel.
2730 Added a whole bunch of logging so that we can at least detect a bug like this in the future.
2731 (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style.
2732 (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion
2733 about the content returned by a subcommand.
2735 * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess.
2736 execFile is defined on require('child_process') itself.
2737 (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist.
2740 * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js.
2741 (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep.
2743 2017-03-16 Ryosuke Niwa <rniwa@webkit.org>
2745 Add the file uploading capability to the perf dashboard.
2746 https://bugs.webkit.org/show_bug.cgi?id=169737
2748 Reviewed by Chris Dumez.
2750 Added /privileged-api/upload-file to upload a file, and /api/uploaded-file/ to download the file
2751 and retrieve its meta data based on its SHA256. We treat two files with the identical SHA256 as
2752 identical since anyone who can upload a file using this mechanism can execute arbitrary code in
2753 our bots anyway. This is important for avoiding uploading a large darwinup roots multiple times
2754 to the server, saving both user's time/bandwidth and server's disk space.
2756 * config.json: Added uploadDirectory, uploadFileLimitInMB, and uploadUserQuotaInMB as options.
2757 * init-database.sql: Added uploaded_files table.
2759 * public/api/uploaded-file.php: Added.
2760 (main): /api/uploaded-file/N would download uploaded_file with id=N. /api/uploaded-file/?sha256=X
2761 would return the meta data for uploaded_file with sha256=X.
2762 (stream_file_content): Streams the file content in 64KB chunks. We support Range & If-Range HTTP
2763 request headers so that browsers can pause and resume downloading of a large root file.
2764 (parse_range_header): Parses Range HTTP request header.
2766 * public/include/json-header.php:
2767 (remote_user_name): Use the default argument of NULL.
2769 * public/include/manifest-generator.php:
2770 (ManifestGenerator::generate): Include the maximum upload size in the manifest file to let the
2771 frontend code preemptively check the file size before attempting to submit a file.
2773 * public/include/uploaded-file-helpers.php: Added.
2774 (format_uploaded_file):
2775 (uploaded_file_path_for_row):
2777 * public/privileged-api/upload-file-form.html: Added. For debugging purposes.
2781 * public/privileged-api/upload-file.php: Added.
2783 (query_total_file_size):
2784 (create_uploaded_file_from_form_data):
2786 * public/shared/common-remote.js:
2787 (CommonRemoteAPI.prototype.postFormData): Added.
2788 (CommonRemoteAPI.prototype.postFormDataWithStatus): Added.
2789 (CommonRemoteAPI.prototype.sendHttpRequestWithFormData): Added.
2790 (CommonRemoteAPI.prototype._asJSON): Throw an exception instead of calling a non-existent reject.
2792 * public/v3/models/uploaded-file.js: Added.
2793 (UploadedFile): Added.
2794 (UploadedFile.uploadFile): Added.
2795 (UploadedFile.fetchUnloadedFileWithIdenticalHash): Added. Finds the file with the same SHA256 in
2796 the server to avoid uploading a large custom root multiple times.
2797 (UploadedFile._computeSHA256Hash): Added.
2799 * public/v3/privileged-api.js:
2800 (PrivilegedAPI.prototype.sendRequest): Added the options dictionary as a third argument. For now,
2801 only support useFormData boolean.
2803 * public/v3/remote.js:
2804 (BrowserRemoteAPI.prototype.sendHttpRequestWithFormData): Added.
2806 * server-tests/api-manifest.js: Updated per the inclusion of fileUploadSizeLimit in the manifest.
2807 * server-tests/api-uploaded-file.js: Added.
2808 * server-tests/privileged-api-upload-file-tests.js: Added.
2810 * server-tests/resources/temporary-file.js: Added.
2811 (TemporaryFile): Added. A helper class for creating a temporary file to upload.
2812 (TemporaryFile.makeTemporaryFileOfSizeInMB):
2813 (TemporaryFile.makeTemporaryFile):
2814 (TemporaryFile.inject):
2816 * server-tests/resources/test-server.conf: Set upload_max_filesize and post_max_size for testing.
2817 * server-tests/resources/test-server.js:
2818 (TestServer.prototype.testConfig): Use uploadFileLimitInMB and uploadUserQuotaInMB of 2MB and 5MB.
2819 (TestServer.prototype._ensureDataDirectory): Create a directory to store uploaded files inside
2820 the data directory. In a production server, we can place it outside ServerRoot / DocumentRoot.
2821 (TestServer.prototype.cleanDataDirectory): Delete the aforementioned directory as needed.
2823 * tools/js/database.js:
2824 (tableToPrefixMap): Added uploaded_files.
2826 * tools/js/remote.js:
2827 (NodeRemoteAPI.prototype.sendHttpRequest): Added a dictionary to specify request headers and
2828 a callback to process the response as arguments. Fixed the bug that any 2xx code other than 200
2829 was resulting in a rejected promise. Also include the response headers in the result for tests.
2830 Finally, when content is a function, call that instead of writing the content since FormData
2831 requires a custom logic.
2832 (NodeRemoteAPI.prototype.sendHttpRequestWithFormData): Added.
2834 * tools/js/v3-models.js: Include uploaded-file.js.
2836 * tools/run-tests.py:
2837 (main): Add form-data as a new dependency.
2839 2017-03-15 Dewei Zhu <dewei_zhu@apple.com>
2841 Fix unit test and bug fix for 'pull-os-versions.js' script.
2842 https://bugs.webkit.org/show_bug.cgi?id=169701
2844 Reviewed by Ryosuke Niwa.
2846 Fix unit tests warnings on node-6.10.0.
2847 Fix 'pull-os-versions.js' does not fetch new builds and report.
2849 * server-tests/tools-os-build-fetcher-tests.js:
2853 * tools/pull-os-versions.js:
2856 2017-03-15 Ryosuke Niwa <rniwa@webkit.org>
2858 In-browser and node.js implementations of RemoteAPI should share some code
2859 https://bugs.webkit.org/show_bug.cgi?id=169695
2861 Rubber-stamped by Antti Koivisto.
2863 Extracted CommonRemoteAPI out of RemoteAPI implementations for node.js and browser.
2865 * public/shared/common-remote.js: Added.
2866 (CommonRemoteAPI): Added.
2867 (CommonRemoteAPI.prototype.postJSON): Extracted from RemoteAPI.
2868 (CommonRemoteAPI.prototype.postJSONWithStatus): Ditto.
2869 (CommonRemoteAPI.prototype.getJSON): Ditto.
2870 (CommonRemoteAPI.prototype.getJSONWithStatus): Ditto.
2871 (CommonRemoteAPI.prototype.sendHttpRequest): Added. Needs to implemented by a subclass.
2872 (CommonRemoteAPI.prototype._asJSON): Added.
2873 (CommonRemoteAPI.prototype._checkStatus): Added.
2875 * public/v3/index.html: Include common-remote.js.
2877 * public/v3/privileged-api.js:
2878 (PrivilegedAPI): Use class now that we don't include data.js.
2879 (PrivilegedAPI.sendRequest): Modernized the code.
2880 (PrivilegedAPI.requestCSRFToken): Ditto.
2882 * public/v3/remote.js:
2883 (BrowserRemoteAPI): Renamed from RemoteAPI. window.RemoteAPI is now an instance of this class.
2884 (BrowserRemoteAPI.prototype.sendHttpRequest): Moved from RemoteAPI.sendHttpRequest.
2885 (BrowserRemoteAPI.prototype.sendHttpRequest):
2887 * server-tests/privileged-api-create-analysis-task-tests.js: Updated tests since NodeJSRemoteAPI
2888 now throws the JSON status as an error to be consistent with BrowserRemoteAPI.
2889 * server-tests/privileged-api-create-test-group-tests.js: Ditto.
2890 * server-tests/privileged-api-upate-run-status.js: Ditto.
2892 * tools/js/buildbot-triggerable.js:
2893 (BuildbotTriggerable.prototype.syncOnce): Just use postJSONWithStatus instead of manually
2894 checking the status.
2896 * tools/js/remote.js:
2897 (NodeRemoteAPI): Renamed from RemoteAPI. Still exported as RemoteAPI.
2898 (NodeRemoteAPI.prototype.constructor):
2899 (NodeRemoteAPI.prototype.sendHttpRequest): Modernized the code.
2901 2017-03-15 Ryosuke Niwa <rniwa@webkit.org>
2903 Fix server tests after r213998 and r213969
2904 https://bugs.webkit.org/show_bug.cgi?id=169690
2906 Reviewed by Antti Koivisto.
2908 Fixed the existing server tests.
2910 * public/v3/models/analysis-task.js:
2911 (AnalysisTask.prototype._updateRemoteState): Use the relative path from the root so that it works inside tests.
2912 (AnalysisTask.prototype.associateBug): Ditto.
2913 (AnalysisTask.prototype.dissociateBug): Ditto.
2914 (AnalysisTask.prototype.associateCommit): Ditto.
2915 (AnalysisTask.prototype.dissociateCommit): Ditto.
2916 (AnalysisTask._fetchSubset): Ditto.
2917 (AnalysisTask.fetchAll): Ditto.
2918 * public/v3/models/test-group.js:
2919 (TestGroup.prototype.updateName): Ditto.
2920 (TestGroup.prototype.updateHiddenFlag): Ditto.
2921 (TestGroup.createAndRefetchTestGroups): Ditto.
2922 (TestGroup.cachedFetch): Ditto.
2923 * server-tests/api-manifest.js: Reverted an inadvertant change in r213969.
2924 * tools/js/database.js:
2925 (tableToPrefixMap): Added analysis_strategies.
2926 * unit-tests/analysis-task-tests.js: Updated expectations per changes to AnalysisTask.
2928 2017-03-15 Ryosuke Niwa <rniwa@webkit.org>
2930 Add tests for privileged-api/create-analysis-task and privileged-api/create-test-group
2931 https://bugs.webkit.org/show_bug.cgi?id=169688
2933 Rubber-stamped by Antti Koivisto.
2935 Added tests for privileged-api/create-analysis-task and privileged-api/create-test-group, and fixed newly found bugs.
2937 * public/privileged-api/create-analysis-task.php:
2938 (main): Fixed the bug that we were not explicitly checking whether start_run and end_run were integers or not.
2939 Also return InvalidTimeRange when start and end times are identical as that makes no sense for an analysis task.
2941 * public/privileged-api/create-test-group.php:
2942 (main): Fixed a bug that we were not explicitly checking task and repetitionCount to be an integer.
2943 (ensure_commit_sets): Fixed the bug that the number of commit sets weren't checked.
2945 * server-tests/privileged-api-create-analysis-task-tests.js: Added.
2946 * server-tests/privileged-api-create-test-group-tests.js: Added.
2948 * server-tests/resources/common-operations.js:
2949 (prepareServerTest): Increase the timeout from 1s to 5s.
2951 * server-tests/resources/mock-data.js:
2952 (MockData.addMockData): Use a higher database ID of 20 for a mock build_slave to avoid a conflict with auto-generated IDs.
2954 2017-03-15 Ryosuke Niwa <rniwa@webkit.org>
2956 Make unit tests return a promise instead of manually calling done
2957 https://bugs.webkit.org/show_bug.cgi?id=169663
2959 Reviewed by Antti Koivisto.
2961 Make the existing unit tests always reutrn a promise instead of manually calling "done" callback as done
2962 in r213969. The promise tests are a lot more stable and less error prone.
2964 Also use MockRemoteAPI.waitForRequest() instead of chaining two resolved promises where appropriate.
2966 * unit-tests/analysis-task-tests.js:
2967 * unit-tests/buildbot-syncer-tests.js:
2968 * unit-tests/checkconfig.js:
2969 * unit-tests/privileged-api-tests.js:
2971 2017-03-15 Dewei Zhu <dewei_zhu@apple.com>
2973 Rewrite 'pull-os-versions' script in Javascript to add support for reporting os revisions with sub commits.
2974 https://bugs.webkit.org/show_bug.cgi?id=169542
2976 Reviewed by Ryosuke Niwa.
2978 Extend '/api/commits/<repository>/last-reported' to accept a range and return last reported commits in given range.
2979 Rewrite 'pull-os-versions' in JavaScript and add unit tests for it.
2980 Instead of writing query manually while searching criteria contains null columns, use the methods provided in 'db.php'.
2981 Add '.gitignore' file to ommit files generated by while running tests/instances locally.
2983 * .gitignore: Added.
2984 * public/api/commits.php:
2985 * public/api/report-commits.php:
2986 * public/include/commit-log-fetcher.php:
2987 * public/include/db.php: 'null_columns' of prepare_params should be a reference.
2988 * public/include/report-processor.php:
2989 * server-tests/api-commits.js:
2991 * server-tests/api-report-commits-tests.js:
2992 * server-tests/resources/mock-logger.js: Added.
2994 (MockLogger.prototype.log):
2995 (MockLogger.prototype.error):
2996 * server-tests/resources/mock-subprocess.js: Added.
2997 (MockSubprocess.call):
2998 (MockSubprocess.waitingForInvocation):
2999 (MockSubprocess.inject):
3000 (MockSubprocess.reset):
3001 * server-tests/tools-buildbot-triggerable-tests.js:
3002 (MockLogger): Deleted.
3003 (MockLogger.prototype.log): Deleted.
3004 (MockLogger.prototype.error): Deleted.
3005 * server-tests/tools-os-build-fetcher-tests.js: Added.
3007 (return.waitingForInvocationPromise.then):
3009 (string_appeared_here.return.waitingForInvocationPromise.then):
3010 (return.addSlaveForReport.emptyReport.then):
3011 * tools/js/os-build-fetcher.js: Added.
3013 (OSBuildFetcher.prototype._fetchAvailableBuilds):
3014 (OSBuildFetcher.prototype._computeOrder):
3015 (OSBuildFetcher.prototype._commitsForAvailableBuilds.return.this._subprocess.call.then.):
3016 (OSBuildFetcher.prototype._commitsForAvailableBuilds):
3017 (OSBuildFetcher.prototype._addSubCommitsForBuild):
3018 (OSBuildFetcher.prototype._submitCommits):
3019 (OSBuildFetcher.prototype.fetchAndReportNewBuilds):
3020 * tools/js/subprocess.js: Added.
3021 (const.childProcess.require.string_appeared_here.Subprocess.prototype.call):
3022 (const.childProcess.require.string_appeared_here.Subprocess):
3023 * tools/pull-os-versions.js: Added.
3026 * tools/sync-commits.py:
3027 (Repository.fetch_commits_and_submit):
3029 2017-03-14 Ryosuke Niwa <rniwa@webkit.org>
3031 Make server tests return a promise instead of manually calling done
3032 https://bugs.webkit.org/show_bug.cgi?id=169648
3034 Rubber-stamped by Chris Dumez.
3036 Make the existing server tests always reutrn a promise instead of manually calling "done" callback.
3037 The promise tests are a lot more stable and less error prone.
3039 Also use arrow functions everywhere and use prepareServerTest, renamed from connectToDatabaseInEveryTest,
3040 in more tests instead of manually connecting to database in every test, and reset v3 models.
3042 * server-tests/admin-platforms-tests.js:
3043 * server-tests/admin-reprocess-report-tests.js:
3044 * server-tests/api-build-requests-tests.js:
3045 * server-tests/api-manifest.js:
3046 * server-tests/api-measurement-set-tests.js:
3047 (.postReports): Deleted. Not used in any test.
3048 * server-tests/api-report-commits-tests.js:
3049 * server-tests/api-report-tests.js:
3050 * server-tests/api-update-triggerable.js:
3051 * server-tests/privileged-api-upate-run-status.js:
3052 * server-tests/resources/common-operations.js:
3053 (prepareServerTest): Renamed from connectToDatabaseInEveryTest. Increase the timeout and reset v3 models.
3054 * server-tests/tools-buildbot-triggerable-tests.js:
3056 2017-03-12 Ryosuke Niwa <rniwa@webkit.org>
3058 Rename RootSet to CommitSet
3059 https://bugs.webkit.org/show_bug.cgi?id=169580
3061 Rubber-stamped by Chris Dumez.
3063 Renamed root_sets to commit_sets and roots to commit_set_relationships in the database schema, and renamed
3064 related classes in public/v3/ and tools accordingly.
3066 RootSet, MeasurementRootSet, and CustomRootSet are respectively renamed to CommitSet, MeasurementCommitSet,
3067 and CustomCommitSet.
3069 In order to migrate the database, run:
3072 ALTER TABLE root_sets RENAME TO commit_sets;
3073 ALTER TABLE commit_sets RENAME COLUMN rootset_id TO commitset_id;
3074 ALTER TABLE roots RENAME TO commit_set_relationships;
3075 ALTER TABLE commit_set_relationships RENAME COLUMN root_set TO commitset_set;
3076 ALTER TABLE commit_set_relationships RENAME COLUMN root_commit TO commitset_commit;
3077 ALTER TABLE build_requests RENAME COLUMN request_root_set TO request_commit_set;
3081 * browser-tests/index.html:
3082 * init-database.sql:
3083 * public/api/build-requests.php:
3085 * public/api/test-groups.php:
3087 (format_test_group):
3088 * public/include/build-requests-fetcher.php:
3089 (BuildRequestsFetcher::__construct):
3090 (BuildRequestsFetcher::results_internal):
3091 (BuildRequestsFetcher::commit_sets): Renamed from root_sets.
3092 (BuildRequestsFetcher::commits): Renamed from roots.
3093 (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Renamed from fetch_roots_for_set_if_needed.
3094 * public/privileged-api/create-test-group.php:
3096 (ensure_commit_sets): Renamed from commit_sets_from_root_sets.
3097 * public/v3/components/analysis-results-viewer.js:
3098 (AnalysisResultsViewer.prototype.buildRowGroups):
3099 (AnalysisResultsViewer.prototype._collectCommitSetsInTestGroups): Renamed from _collectRootSetsInTestGroups.
3100 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
3101 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
3102 (AnalysisResultsViewer.CommitSetInTestGroup): Renamed from RootSetInTestGroup.
3103 (AnalysisResultsViewer.CommitSetInTestGroup.prototype.constructor):
3104 (AnalysisResultsViewer.CommitSetInTestGroup.prototype.commitSet): Renamed from rootSet.
3105 (AnalysisResultsViewer.CommitSetInTestGroup.prototype.succeedingCommitSet): Renamed from succeedingRootSet.
3106 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.constructor):
3107 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.addRowIndex):
3108 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.isComplete):
3109 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.startRowIndex):
3110 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.endRowIndex):
3111 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
3112 * public/v3/components/chart-revision-range.js:
3113 (ChartRevisionRange.prototype._revisionForPoint):
3114 (ChartRevisionRange.prototype._computeRevisionList):
3115 * public/v3/components/customizable-test-group-form.js:
3116 (CustomizableTestGroupForm.prototype.constructor):
3117 (CustomizableTestGroupForm.prototype.setCommitSetMap): Renamed from setRootSetMap.
3118 (CustomizableTestGroupForm.prototype._submitted):
3119 (CustomizableTestGroupForm.prototype._computeCommitSetMap): Renamed from _computeRootSetMap.
3120 (CustomizableTestGroupForm.prototype.render): Renamed from render.
3121 (CustomizableTestGroupForm.prototype._constructRevisionRadioButtons):
3122 * public/v3/components/results-table.js:
3123 (ResultsTable.prototype.render):
3124 (ResultsTable.prototype._createRevisionListCells):
3125 (ResultsTable.prototype._computeRepositoryList):
3126 (ResultsTableRow.prototype.constructor):
3127 (ResultsTableRow.prototype.commitSet): Renamed from rootSet.
3128 * public/v3/components/test-group-results-table.js:
3129 (TestGroupResultsTable.prototype.buildRowGroups):
3130 * public/v3/index.html:
3131 * public/v3/models/build-request.js:
3132 (BuildRequest.prototype.constructor):
3133 (BuildRequest.prototype.updateSingleton):
3134 (BuildRequest.prototype.commitSet): Renamed from rootSet.
3135 (BuildRequest.constructBuildRequestsFromData):
3136 * public/v3/models/commit-set.js: Renamed from public/v3/models/root-set.js.
3137 (CommitSet): Renamed from RootSet.
3138 (CommitSet.containsMultipleCommitsForRepository):
3139 (MeasurementCommitSet): Renamed from MeasurementRootSet.
3140 (MeasurementCommitSet.prototype.namedStaticMap):
3141 (MeasurementCommitSet.prototype.ensureNamedStaticMap):
3142 (MeasurementCommitSet.namedStaticMap):
3143 (MeasurementCommitSet.ensureNamedStaticMap):
3144 (MeasurementCommitSet.ensureSingleton):
3145 (CustomCommitSet): Renamed from CustomRootSet.
3146 * public/v3/models/measurement-adaptor.js:
3147 (MeasurementAdaptor.prototype.applyTo):
3148 * public/v3/models/test-group.js:
3149 (TestGroup.prototype.constructor):
3150 (TestGroup.prototype.addBuildRequest):
3151 (TestGroup.prototype.repetitionCount):
3152 (TestGroup.prototype.requestedCommitSets): Renamed from requestedRootSets.
3153 (TestGroup.prototype.requestsForCommitSet): Renamed from requestsForRootSet.
3154 (TestGroup.prototype.labelForCommitSet): Renamed from labelForRootSet.
3155 (TestGroup.prototype.didSetResult):
3156 (TestGroup.prototype.compareTestResults):
3157 (TestGroup.prototype._valuesForCommitSet): Renamed from _valuesForRootSet.
3158 (TestGroup.prototype.createAndRefetchTestGroups):
3159 * public/v3/pages/analysis-task-page.js:
3160 (AnalysisTaskPage.prototype.render):
3161 (AnalysisTaskPage.prototype._retryCurrentTestGroup):
3162 (AnalysisTaskPage.prototype._createNewTestGroupFromChart):
3163 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer):
3164 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingCommitSetList):
3165 * server-tests/api-build-requests-tests.js:
3166 * server-tests/resources/mock-data.js:
3167 (MockData.resetV3Models):
3168 (MockData.addMockData):
3169 (MockData.addAnotherMockTestGroup):
3170 * tools/detect-changes.js:
3171 (createAnalysisTaskAndNotify):
3172 * tools/js/buildbot-syncer.js:
3173 (BuildbotSyncer.prototype._propertiesForBuildRequest):
3174 (BuildbotSyncer.prototype._revisionSetFromCommitSetWithExclusionList):
3175 * tools/js/database.js:
3177 * tools/js/v3-models.js:
3178 * tools/sync-buildbot.js:
3180 * tools/sync-with-buildbot.py: Deleted. No longer used.
3181 * unit-tests/analysis-task-tests.js:
3182 * unit-tests/build-request-tests.js:
3183 (sampleBuildRequestData):
3184 * unit-tests/buildbot-syncer-tests.js:
3185 (sampleCommitSetData):
3186 * unit-tests/measurement-adaptor-tests.js:
3187 * unit-tests/measurement-set-tests.js:
3188 * unit-tests/resources/mock-v3-models.js:
3189 (MockModels.inject):
3190 * unit-tests/test-groups-tests.js:
3193 2017-03-13 Ryosuke Niwa <rniwa@webkit.org>
3195 Database's query functions should support querying for a row with NULL value
3196 https://bugs.webkit.org/show_bug.cgi?id=169504
3198 Reviewed by Antti Koivisto.
3200 Add the support for calling select_* with one of column values set to NULL.
3201 This feature is useful in webkit.org/b/146374 and webkit.org/b/168962.
3203 * public/include/db.php:
3204 (Database::prepare_params): Added $null_columns as an optional argument.
3205 (Database::select_conditions_with_null_columns): Added. Builds up a query string by appending AND x is NULL
3206 to match columns whose value must be NULL.
3207 (Database::_select_update_or_insert_row):
3208 (Database::select_rows):
3210 2017-03-13 Dewei Zhu <dewei_zhu@apple.com>
3212 Add the ability to report a commit with sub-commits.
3213 https://bugs.webkit.org/show_bug.cgi?id=168962
3215 Reviewed by Ryosuke Niwa.
3217 Introduce 'commit_ownerships' which records ownership between commits.
3218 On existing production server, run ```
3219 CREATE TABLE commit_ownerships (
3220 commit_owner integer NOT NULL REFERENCES commits ON DELETE CASCADE,
3221 commit_ownee integer NOT NULL REFERENCES commits ON DELETE CASCADE,
3222 PRIMARY KEY (commit_owner, commit_ownee)
3224 ALTER TABLE repositories RENAME repository_parent TO repository_owner;
3225 ALTER TABLE repositories DROP repository_name_must_be_unique;
3226 CREATE UNIQUE INDEX repository_name_owner_unique_index ON repositories (repository_owner, repository_name) WHERE repository_owner IS NOT NULL;
3227 CREATE UNIQUE INDEX repository_name_unique_index ON repositories (repository_name) WHERE repository_owner IS NULL;
3228 ``` to update database.
3229 Add unit-tests to cover this change.
3231 * init-database.sql:
3232 * public/api/report-commits.php:
3233 * public/include/commit-log-fetcher.php:
3234 * public/include/db.php:
3235 * public/include/manifest-generator.php:
3236 * public/include/report-processor.php:
3237 * public/v3/models/repository.js:
3239 (Repository.prototype.owner):
3240 * server-tests/admin-reprocess-report-tests.js:
3241 (addBuilderForReport.simpleReportWithRevisions.0.then):
3243 * server-tests/api-manifest.js:
3245 * server-tests/api-report-commits-tests.js:
3246 (addSlaveForReport.sameRepositoryNameInSubCommitAndMajorCommit.then):
3248 (addSlaveForReport.systemVersionCommitWithSubcommits.then):
3249 (addSlaveForReport.multipleSystemVersionCommitsWithSubcommits.then):
3250 (addSlaveForReport.systemVersionCommitWithEmptySubcommits.then):
3251 (addSlaveForReport.systemVersionCommitAndSubcommitWithTimestamp.then):
3252 * tools/js/database.js:
3254 2017-03-07 Ryosuke Niwa <rniwa@webkit.org>
3256 Update ReadMe.md to use directory format for backing up & restoring the database
3257 https://bugs.webkit.org/show_bug.cgi?id=169263
3259 Reviewed by Joseph Pecoraro.
3261 Update ReadMe.md's instruction to backup and restore the database to use directory format instead of
3262 piping it to gzip. The new command will backup and restore the database with multiple concurrent processes
3263 with a custom compression level.
3267 2017-03-02 Ryosuke Niwa <rniwa@webkit.org>
3269 Make baseline data points selectable
3270 https://bugs.webkit.org/show_bug.cgi?id=169069
3271 <rdar://problem/29209427>
3273 Reviewed by Antti Koivisto.
3275 Add the capability to select data points other than "current" configuration type.
3277 This patch refactors the way the "chart status" is computed. Before this patch, ChartStatusView was
3278 responsible for determining two data points for which to compute the status, and computing the status
3279 between two data points. ChartPaneStatusView which inherits from ChartStatusView and used in the charts
3280 page relied upon ChartStatusView to compute these values, and computed the list of revision ranges for
3281 each relevant repository between the data points. ChartPane then had callbacks on ChartPaneStatusView
3282 to know whenever these values changed. Because of this entangled mess, ChartStatusView had to be aware
3283 of InteractiveTimeSeriesChart even though only ChartPaneStatusView could be used with it.
3285 This patch dramatically simplifies the situation by adding referencePoints() on TimeSeriesChart and
3286 InteractiveTimeSeriesChart which returns the current point, the previous point if there is any, and
3287 their time series view. It also extracts ChartStatusEvaluator which computes the current status values
3288 and ChartRevisionRange which computes a list of revision differences both based on the referencePoints.
3289 As a result, ChartPaneStatusView no longer inherits from ChartStatusView, and ChartStatusView has been
3290 renamed to DashboardChartStatusView to reflect its purpose. Furthermore, ChartPane which used to rely on
3291 ChartPaneStatusView's revisionCallback to update the commit log viewer simply uses another instance of
3292 ChartRevisionRange, eliminating the need for the callback.
3294 To implement these classes easily, this patch also introduces a new class, LazilyEvaluatedFunction to
3295 memoize the return value of a function when called with the same arguments. Delaying the computation of
3296 a value and avoiding the work when the values are the same is a very common pattern in the perf dashboard
3297 so I expect this class would be used in a lot more places in the future.
3299 * browser-tests/chart-revision-range-tests.js: Added. Tests for ChartRevisionRange.
3300 * browser-tests/chart-status-evaluator-tests.js: Added. Tests for ChartStatusEvaluator.
3302 * browser-tests/index.html:
3304 (BrowsingContext.importScripts): Fixed the bug that calling importScripts twice results in MockRemoteAPI
3306 (ChartTest.importChartScripts): Import more model objects.
3307 (ChartTest.sampleCluster): Made this a getter.
3308 (ChartTest.makeModelObjectsForSampleCluster):
3309 (ChartTest.makeSampleCluster): Added. Cutomizes the valus of baseline / target based on options.
3310 (ChartTest.respondWithSampleCluster): Now takes an options argument for makeSampleCluster.
3312 * public/v3/components/chart-pane-base.js:
3313 (ChartPaneBase): Added _openRepository to keep track of the currently open repository instead of relying
3314 on _mainChartStatus or _commitLogViewer to keep track of it.
3315 (ChartPaneBase.prototype.configure): The callback for when the user clicked on a repository name in
3316 ChartPaneStatusView has been replaced by "openRepository" action.
3317 (ChartPaneBase.prototype.setOpenRepository): Moved from ChartPane.
3318 (ChartPaneBase.prototype._mainSelectionDidChange):
3319 (ChartPaneBase.prototype._indicatorDidChange):
3320 (ChartPaneBase.prototype._didFetchData):
3321 (ChartPaneBase.prototype._updateCommitLogViewer): Renamed from _updateStatus.
3322 (ChartPaneBase.prototype.openNewRepository): Renamed from _requestOpeningCommitViewer. Fixed a bug that
3323 clicking on the repository name inside ChartPaneStatusView would not focus the pane, which resulted in
3324 arrow keys to be ignored instead of moving the main chart's indicator or the currently open repository.
3325 (ChartPaneBase.prototype._keyup):
3326 (ChartPaneBase.prototype._moveOpenRepository): Moved from ChartPaneStatusView's
3327 moveRepositoryWithNotification. Used when changing the open repository by up/down arrow keys.
3329 * public/v3/components/chart-revision-range.js: Added. Extracted from ChartPaneStatusView.
3330 (ChartRevisionRange): Added.
3331 (ChartRevisionRange.prototype.revisionList): Added.
3332 (ChartRevisionRange.prototype.rangeForRepository): Added.
3333 (ChartRevisionRange._revisionForPoint): Added. Extracted from ChartPaneStatusView's
3334 _updateRevisionListForNewCurrentRepository.
3335 (ChartRevisionRange._computeRevisionList): Ditto from computeChartStatusLabels.
3337 * public/v3/components/chart-status-evaluator.js: Added.
3338 (ChartStatusEvaluator): Added.
3339 (ChartStatusEvaluator.prototype.status): Added.
3340 (ChartStatusEvaluator.computeChartStatus): Added. Extracted from ChartStatusView's updateStatusIfNeeded.
3342 * public/v3/components/chart-status-view.js: Removed.
3343 (ChartStatusView): Deleted. Split into ChartStatusEvaluator and DashboardChartStatusView.
3345 * public/v3/components/chart-styles.js:
3346 (ChartStyles.baselineStyle): Make baseline data points interactive. This single line change is what
3347 enables the user to interact with the data points. The rest of changes in this patch mostly deals with
3348 the status text such as "5% worse than baseline" and the list of revisions shown in the commit log viewer
3349 which would have shown the wrong range without these changes.
3351 * public/v3/components/dashboard-chart-status-view.js: Added. Extracted from ChartStatusView.
3352 (DashboardChartStatusView): Added.
3353 (DashboardChartStatusView.prototype.render): Added.
3354 (DashboardChartStatusView.htmlTemplate): Added.
3355 (DashboardChartStatusView.cssTemplate): Added.
3357 * public/v3/components/interactive-time-series-chart.js:
3358 (InteractiveTimeSeriesChart.prototype.referencePoints): Added. Return the first point and the last point
3359 as the reference points when there is a selection. Only report the previous point if they are distinct as
3360 showing a range of revisions from a data point to itself makes no sense. When there is a indicator simply
3361 return it and its previous point as reference points. Otherwise return null unlike TimeSeriesChart's
3362 referencePoints which always returns the latest point as the reference point.
3364 * public/v3/components/time-series-chart.js:
3365 (TimeSeriesChart.prototype.referencePoints): Added. Return the latest point as the reference point. It
3366 never returns the previous point even if there were more data points as there is no way for the user to
3367 specify which data points to compare.
3369 * public/v3/index.html: Include newly added files.
3371 * public/v3/lazily-evaluated-function.js: Added.
3372 (LazilyEvaluatedFunction): Added.
3373 (LazilyEvaluatedFunction.prototype.evaluate): Added.
3375 * public/v3/models/commit-log.js:
3376 (CommitLog.prototype.diff): Fixed a bug that computing the diff of two Subversion-like revisions results
3377 in "from" field to be unexpectedly an integer instead of a string.
3379 * public/v3/models/metric.js:
3380 (Metric): Moved the code to compute the unit from the metric name from v2's RunsData class. This makes
3381 writing tests easier since it eliminates the need to load v2's data.js.
3382 (Metric.prototype.unit):
3383 (Metric.prototype.isSmallerBetter): Ditto for determining whether the unit is smaller-is-better.
3385 * public/v3/pages/analysis-task-page.js:
3386 (AnalysisTaskChartPane.prototype._updateStatus): Deleted the unused code.
3388 * public/v3/pages/chart-pane-status-view.js:
3389 (ChartPaneStatusView): No longer inherits from ChartStatusView. Uses ChartStatusEvaluator and
3390 ChartRevisionRange to to compute the chart status and the list of revision changes.
3391 (ChartPaneStatusView.prototype.pointsRangeForAnalysis): Deleted.
3392 (ChartPaneStatusView.prototype.render): Split it into _renderStatus and _renderBuildRevisionTable using
3393 LazilyEvaluatedFunction.
3394 (ChartPaneStatusView.prototype._renderStatus): Added.
3395 (ChartPaneStatusView.prototype._renderBuildRevisionTable): Added.
3396 (ChartPaneStatusView.prototype.setCurrentRepository): _updateRevisionListForNewCurrentRepository has been
3397 moved into ChartRevisionRange. Just enqueue itself to re-render.
3398 (ChartPaneStatusView.prototype._setRevisionRange): Deleted.
3399 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Deleted.
3400 (ChartPaneStatusView.prototype.updateRevisionList): Deleted.
3401 (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Deleted.
3402 (ChartPaneStatusView.prototype.computeChartStatusLabels): Deleted.
3403 (ChartPaneStatusView.htmlTemplate):
3404 (ChartPaneStatusView.cssTemplate):
3406 * public/v3/pages/chart-pane.js:
3407 (ChartPane.prototype.openNewRepository): Overrides the one in ChartPaneBase, which has been renamed from
3408 _requestOpeningCommitViewer.
3409 (ChartPane.prototype._analyzeRange):
3410 (ChartPane.prototype._renderActionToolbar): Use the main chart's selection directly to determine whether
3411 an analysis task can be created for the currenty selected range.
3413 * public/v3/pages/dashboard-page.js:
3414 (DashboardPage.prototype._createChartForCell):
3416 * unit-tests/lazily-evaluated-function-tests.js: Added. Tests for LazilyEvaluatedFunction.
3418 2017-03-01 Ryosuke Niwa <rniwa@webkit.org>
3420 Build fix after r212853. Make creating an analysis task work again.
3422 * public/v3/pages/analysis-task-page.js:
3423 (AnalysisTaskPage.prototype.render):
3425 2017-02-27 Ryosuke Niwa <rniwa@webkit.org>
3427 Fix tests after r213119 and r213120.
3429 * browser-tests/time-series-chart-tests.js:
3430 (return.ChartTest.importChartScripts.context.then):
3431 (string_appeared_here.then): Deleted.
3433 2017-02-27 Ryosuke Niwa <rniwa@webkit.org>
3435 Removed the unused code that was supposed to be removed in the previous commit.
3437 * browser-tests/time-series-chart-tests.js:
3439 2017-02-27 Ryosuke Niwa <rniwa@webkit.org>
3441 Split tests for InteractiveTimeSeriesChart into a separate test file.
3442 https://bugs.webkit.org/show_bug.cgi?id=168960
3444 Reviewed by Joseph Pecoraro.
3446 Extracted the test cases for InteractiveTimeSeriesChart charts from time-series-chart-tests.js
3447 into interactive-time-series-chart-tests.js now that the former file has gotten really big over time.
3449 Also extracted a bunch of helper functions time-series-chart-tests.js as ChartTest in index.html.
3450 Any test which instantiates a time series chart can use this helper class.
3452 * browser-tests/index.html:
3453 (ChartTest.importChartScripts): Ditto.
3454 (ChartTest.posixTime): Moved from time-series-chart-tests.js.
3455 (ChartTest.sampleCluster): Ditto.
3456 (ChartTest.createChartWithSampleCluster): Ditto.
3457 (ChartTest.createInteractiveChartWithSampleCluster): Ditto.
3458 (ChartTest.respondWithSampleCluster):
3459 * browser-tests/interactive-time-series-chart-tests.js: Extracted from time-series-chart-tests.js.
3460 * browser-tests/time-series-chart-tests.js:
3462 (dayInMilliseconds): Moved.
3463 (sampleCluster): Moved.
3464 (createChartWithSampleCluster): Moved.
3465 (createInteractiveChartWithSampleCluster): Moved.
3466 (respondWithSampleCluster): Moved.
3467 * unit-tests/analysis-task-tests.js: Fixed a typo. s/adopter/adapter/.
3469 2017-02-27 Ryosuke Niwa <rniwa@webkit.org>
3471 Calling build() on a baseline point results in an exception
3472 https://bugs.webkit.org/show_bug.cgi?id=168959
3474 Reviewed by Joseph Pecoraro.
3476 Some baseline points may lack the build information. e.g. A custom data point made by an user.
3477 Only instantiate Build object in a point object returned by MeasurementAdaptor when the builder id
3478 is available so that we don't hit an assertion inside Build's constructor.
3480 * public/v3/models/measurement-adaptor.js:
3481 (MeasurementAdaptor.prototype.applyTo..build): Only instantiate Build when builderId is set.
3482 * unit-tests/measurement-adaptor-tests.js: Added a test case.
3484 2017-02-27 Ryosuke Niwa <rniwa@webkit.org>
3486 Arrow key shouldn't move the indicator beyond the visible points
3487 https://bugs.webkit.org/show_bug.cgi?id=168956
3489 Reviewed by Joseph Pecoraro.
3491 The bug was caused by moveLockedIndicatorWithNotification using the full sampled time series view
3492 instead of the one constrained by the domain. Since the time series chart expands the visible domain
3493 to include at least one point before the start time and one point after the end tiem to draw lines
3494 extending beyond the visible region (otherwise it looks as though the graph ends there), we need to
3495 use a view constrained by the start time and the end time before looking for a next/previous point.
3497 * browser-tests/time-series-chart-tests.js: Added test cases for moveLockedIndicatorWithNotification.
3498 * public/v3/components/interactive-time-series-chart.js:
3499 (InteractiveTimeSeriesChart.prototype.moveLockedIndicatorWithNotification): Fixed the bug. Also
3500 enqueue itself to render instead of relying on a parent component to do it.
3502 2017-02-27 Ryosuke Niwa <rniwa@webkit.org>
3504 A Locked indicator should be visually distinct from an unlocked indicator
3505 https://bugs.webkit.org/show_bug.cgi?id=168868
3506 <rdar://problem/29666054>
3508 Reviewed by Antti Koivisto.
3510 Added the support for specifying options.lockedIndicator in addition to options.indicator to style
3511 an locked indicator differently from an unlocked one.
3513 * browser-tests/time-series-chart-tests.js: Added new test cases for indicators.
3514 (createChartWithSampleCluster): Renamed and swapped the order of arguments to better match
3515 TimeSeriesChart's constructor. Now the second argument is an array of source as is in the constructor.
3516 (createInteractiveChartWithSampleCluster): Added.
3518 * public/v3/components/chart-styles.js:
3519 (ChartStyles.overviewChartOptions): Changed the color of a selection to blue.
3520 (ChartStyles.mainChartOptions): Ditto. Also use a different style for a locked indicator.
3522 * public/v3/components/interactive-time-series-chart.js:
3523 (InteractiveTimeSeriesChart.prototype._layout): Removed the unused variable.
3524 (InteractiveTimeSeriesChart.prototype._renderChartContent): Use options.lockedIndicator when rendering
3525 a locked indicator. Also stroke the circle in addition to filling it so that we can use a blue circle
3526 with a white hole for a locked indicator to make it even more visually distinctive from an unlocked one.
3528 2017-02-25 Dewei Zhu <dewei_zhu@apple.com>
3530 Commit should order by 'commit_order' as secondary key.
3531 https://bugs.webkit.org/show_bug.cgi?id=168866
3533 Reviewed by Ryosuke Niwa.
3535 Currently, commits are sorted by 'commit_time' only.
3536 We should use 'commit_order' as secondary key when 'commit_time' is equal or null.
3538 * public/include/commit-log-fetcher.php:
3539 * public/include/db.php:
3540 * server-tests/api-commits.js:
3541 (return.addSlaveForReport.subversionCommits.then):
3544 2017-02-24 Ryosuke Niwa <rniwa@webkit.org>
3546 REGRESSION(r212853): Comparisons to baseline no longer shows up
3547 https://bugs.webkit.org/show_bug.cgi?id=168863
3549 Reviewed by Joseph Pecoraro.
3551 The bug was caused by ChartStatusView's code not being updated to use TimeSeriesView's.
3552 Updated the code to use TimeSeriesView's methods to fix the bug.
3554 Also made InteractiveTimeSeriesChart's currentPoint to return a (TimeSeriesView, point, isLocked) tuple
3555 to consolidate it with lockedIndicator() to work towards making the baseline data points selectable.
3557 * browser-tests/time-series-chart-tests.js: Up