1 2017-09-11 Ryosuke Niwa <rniwa@webkit.org>
3 Analysis task page shows an empty results for an irrelevant top-level test
4 https://bugs.webkit.org/show_bug.cgi?id=175252
6 Reviewed by Antti Koivisto.
8 The bug was caused by TestGroupResultsViewer always listing every top-level test which has a result for the
9 entire analysis task. Since a custom analysis task (perf try bots) allows multiple tests to be tested in each
10 group, we have to only list the tests which contains results in a particular test group.
12 * public/v3/components/test-group-results-viewer.js:
13 (TestGroupResultsViewer.prototype.render): Find the tests that have results for the current test group instead
14 of for any test group in this analysis task.
16 * public/v3/models/analysis-results.js:
18 (AnalysisResults.prototype.topLevelTestsForTestGroup): Renamed from highestTests. Now takes a test group
20 (AnalysisResults.prototype._computedTopLevelTests): Renamed from _computeHighestTests. Filters the results
21 with the specified test group.
23 2017-09-06 Aakash Jain <aakash_jain@apple.com>
25 Add initSyncers method in BuildbotTriggerable
26 https://bugs.webkit.org/show_bug.cgi?id=176125
28 Reviewed by Ryosuke Niwa.
30 * tools/sync-buildbot.js:
31 (syncLoop): Use initSyncers() which returns a promise. Modified to handle the promise.
32 * tools/js/buildbot-triggerable.js:
33 (BuildbotTriggerable): Invokes initSyncers() appropriately.
34 (BuildbotTriggerable.prototype.initSyncers): Returns a promise which initialize all the syncers.
35 * server-tests/tools-buildbot-triggerable-tests.js: Updated tests to handle initSyncers().
36 * server-tests/tools-sync-buildbot-integration-tests.js: Ditto.
38 2017-09-05 Ryosuke Niwa <rniwa@webkit.org>
40 Add a button to show two weeks of data to perf dashboard
41 https://bugs.webkit.org/show_bug.cgi?id=176438
43 Reviewed by Saam Barati.
45 Add "2W" button to show 14 days of data on dashboard pages.
47 * public/v3/pages/dashboard-toolbar.js:
50 2017-08-29 Ryosuke Niwa <rniwa@webkit.org>
52 Build fix. OS X "revision" can have a space.
54 * public/include/commit-log-fetcher.php:
56 2017-08-29 Ryosuke Niwa <rniwa@webkit.org>
58 Make it possible to specify A/B testing revision with a partial hash
59 https://bugs.webkit.org/show_bug.cgi?id=176047
61 Rubber-stamped by Chris Dumez.
63 Added the support for specifying a partial hash in A/B testing instead of the full hash.
65 * public/include/commit-log-fetcher.php:
66 (CommitLogFetcher::find_commit_id_by_revision): Extracted from associate-commit.php.
67 * public/privileged-api/associate-commit.php:
69 * public/privileged-api/create-test-group.php:
70 (main): Use find_commit_id_by_revision here to support scheduling an A/B testing with a partial hash.
71 * server-tests/privileged-api-create-test-group-tests.js:
72 (createAnalysisTask): Make it possible to customize revision string in some test cases.
73 * server-tests/resources/test-server.js:
74 (TestServer.prototype._stopApache): Fixed the bug that cleanup step always fails whenever the test file
77 2017-08-26 Ryosuke Niwa <rniwa@webkit.org>
79 Build fix. Creating trying a test group no longer updates the page.
81 * public/v3/models/test-group.js:
82 (TestGroup.createWithCustomConfiguration): Added the missing ignoreCache=true.
84 2017-08-21 Dewei Zhu <dewei_zhu@apple.com>
86 Performance Dashboard should be compatible with PHP 7.
87 https://bugs.webkit.org/show_bug.cgi?id=175813
89 Reviewed by Ryosuke Niwa.
91 Use `file_get_contents('php://input')` instead of '$HTTP_RAW_POST_DATA'.
92 Update test harness script to load right php module in httpd.
94 * ReadMe.md: JSON example format fix.
95 * public/api/report-commits.php: Stop using '$HTTP_RAW_POST_DATA'.
96 * public/api/report.php: Stop using '$HTTP_RAW_POST_DATA'.
97 * public/api/update-triggerable.php: Stop using '$HTTP_RAW_POST_DATA'.
98 * public/include/json-header.php: Stop using '$HTTP_RAW_POST_DATA'.
99 * public/include/report-processor.php: Stop using '$HTTP_RAW_POST_DATA'.
100 * server-tests/resources/test-server.conf: Load php5 or php7 module conditionally.
101 * server-tests/resources/test-server.js: Pass PHP version info while launching httpd.
102 (TestServer.prototype._startApache):
103 * tools/remote-cache-server.py: Pass PHP version info while launching httpd.
105 * tools/remote-server-relay.conf: Load php5 or php7 module conditionally.
106 * tools/sync-buildbot.js:
107 (syncLoop.const.makeTriggerable):
110 2017-08-17 Ryosuke Niwa <rniwa@webkit.org>
112 Number each section in ReadMe.md and add more clarifications
113 https://bugs.webkit.org/show_bug.cgi?id=175687
115 Rubber-stamped by Joseph Pecoraro.
117 Numbered each section and added more clarifications per issues Aakash encountered.
121 2017-08-17 Ryosuke Niwa <rniwa@webkit.org>
123 Build fix. Make the test work with the latest versions of node modules.
125 * server-tests/privileged-api-upload-file-tests.js:
127 2017-07-27 Ryosuke Niwa <rniwa@webkit.org>
129 Build fix. Fixed a typo. task.id() isn't a thing in this function.
131 * public/v3/models/test-group.js:
132 (TestGroup.createWithCustomConfiguration):
134 2017-07-11 Ryosuke Niwa <rniwa@webkit.org>
138 * public/v3/components/chart-pane-base.js:
139 (ChartPaneBase.prototype._updateCommitLogViewer):
141 2017-07-11 Ryosuke Niwa <rniwa@webkit.org>
143 Build fix. It looks like the code here is racy.
145 * public/v3/components/chart-pane-base.js:
146 (ChartPaneBase.prototype.configure):
147 (ChartPaneBase.prototype.setOpenRepository):
149 2017-07-11 Ryosuke Niwa <rniwa@webkit.org>
151 Show the roots built by perf try bots on results page
152 https://bugs.webkit.org/show_bug.cgi?id=174305
154 Reviewed by Joseph Pecoraro.
156 Show build products created by a perf try bots so that we can download them for local testing.
158 * public/v3/components/test-group-revision-table.js:
159 (TestGroupRevisionTable.prototype._renderTable): Find the set of repositories for which a patch is applied.
160 Show build products for all commit sets for such a repository since when WebKit is built with a patch in
161 one configuration, the other configuration also needs to be built for consistency.
162 (TestGroupRevisionTable.prototype._buildCommitCell): Added the hyperlink for build products.
163 (TestGroupRevisionTable.prototype._buildFileInfo): Takes a string to override the file's label. Since all
164 build products made by bots tend to have the same filename, we show the label of "Build product" instead.
165 (TestGroupRevisionTable.prototype._mergeCellsWithSameCommitsAcrossRows): Fixed a bug that any entry with
166 a patch wasn't getting merged since it was comparing against the result commit set, which does not contain
167 the patch (only requested commit set contains a patch).
169 2017-07-10 Ryosuke Niwa <rniwa@webkit.org>
171 Address Antti's review comment.
173 * public/v3/models/analysis-results.js:
174 (AnalysisResults.prototype.containsTest):
176 2017-07-10 Ryosuke Niwa <rniwa@webkit.org>
178 A/B testing results page show results for the top-level tests instead of the one being analyzed
179 https://bugs.webkit.org/show_bug.cgi?id=174304
181 Reviewed by Antti Koivisto.
183 When a specific subtest is analyzed (e.g. Images subtest of MotionMark), then TestGroupResultsViewer
184 should expand and highlight that specific subtest instead of simply showing the top-level test's score.
185 This is especially misleading since AnalysisResultsViewer (stacking bars for each test group) uses
186 the score of the specific subtest being analyzed.
188 Fixed the bug by passing in the metric associated with the analysis task from AnalysisTaskPage to
189 TestGroupResultsViewer via AnalysisTaskTestGroupPane. Also made TestGroupResultsViewer.setAnalysisResults
190 auto-expand the tests that are ancestors of the specified metric. Without that, the test won't be shown
191 to the user until the ancestor tests are expanded by the user.
193 Also fixed the bug that we were always listing sub-tests regardless of whether they have results or not.
194 Since tests tend to change over time, we shouldn't show a test if it doesn't have any results associated.
196 * public/v3/components/test-group-results-viewer.js:
197 (TestGroupResultsViewer.prototype.setAnalysisResults): Expand the ancestor tests of the metric.
198 (TestGroupResultsViewer.prototype._buildRowsForTest): Exit early if this test doesn't have any results.
199 * public/v3/models/analysis-results.js:
200 (AnalysisResults.prototype.containsTest): Added.
201 * public/v3/pages/analysis-task-page.js:
202 (AnalysisTaskTestGroupPane.prototype.setAnalysisResults): Takes a metric to pass it to the results viewer.
203 (AnalysisTaskPage.prototype._assignTestResultsIfPossible):
205 2017-07-06 Ryosuke Niwa <rniwa@webkit.org>
207 Safari 10.1 fails to upload a patch on perf try bots page
208 https://bugs.webkit.org/show_bug.cgi?id=174214
210 Reviewed by Chris Dumez.
212 Added the workaround to make the analysis task page work on Safari 10.1
214 * public/v3/components/instant-file-uploader.js:
215 (InstantFileUploader.prototype._uploadFiles): Convert files to an array since for-of doesn't work otherwise on Safari 10.1.
216 * public/v3/models/uploaded-file.js:
217 (UploadedFile._computeSHA256Hash): Fallback to crypto.webkitSubtle since crypto.subtle isn't available on Safari 10.1 or 11.
219 2017-07-03 Ryosuke Niwa <rniwa@webkit.org>
221 Fix a typo pointed out by Andreas Kling.
223 * public/v3/components/instant-file-uploader.js:
224 (InstantFileUploader.prototype._uploadFiles):
225 * public/v3/models/uploaded-file.js:
226 (UploadedFile.fetchUploadedFileWithIdenticalHash): Renamed from fetchUnloadedFileWithIdenticalHash.
228 2017-07-03 Ryosuke Niwa <rniwa@webkit.org>
230 Add an admin page to manage uploaded files
231 https://bugs.webkit.org/show_bug.cgi?id=174089
233 Reviewed by Andreas Kling.
235 Add an admin page to see the disk usage per user as well as the total, and to prune any zombie files (ones marked
236 as deleted but aren't actually deleted in the filesystem).
238 * public/admin/files.php: Added.
239 (format_size): Added.
240 * public/include/admin-header.php:
242 2017-07-03 Ryosuke Niwa <rniwa@webkit.org>
244 Roots uploaded by bots don't get author specified properly
245 https://bugs.webkit.org/show_bug.cgi?id=174087
247 Reviewed by Andreas Kling.
249 When a root file is uploaded from the bot, we manually specify the remote user to upload_file_in_transaction.
250 However, this was getting ignored by create_uploaded_file_from_form_data since it was always calling
251 remote_user_name to get the user name off of $_SERVER.
253 Fixed the bug by passing in the user name from upload_file_in_transaction to create_uploaded_file_from_form_data.
255 * public/include/uploaded-file-helpers.php:
256 (create_uploaded_file_from_form_data): Take the remote user as an argument instead of calling remote_user_name.
257 (upload_file_in_transaction):
258 * server-tests/api-upload-root-tests.js: Updated an existing test cases to make sure root files' author is set.
259 (createTestGroupWihPatch): Manually override the author of a test group for testing.
261 2017-07-03 Ryosuke Niwa <rniwa@webkit.org>
263 Prune unused uploaded files when the file quota is reached
264 https://bugs.webkit.org/show_bug.cgi?id=174086
266 Reviewed by Andreas Kling.
268 Made /privileged-api/uploaded-file and /api/upload-root automatically delete old uploaded files when
269 uploading a new file results in the file quota to be exceeded. Also added the notion of the total quota
270 to avoid running out of a disk when there are hundreds of users each uploading near their quota.
272 * config.json: Added a sample total disk quota of 100GB.
273 * public/include/uploaded-file-helpers.php:
274 (query_file_usage_for_user): Renamed from query_total_file_size.
275 (query_total_file_usage): Added.
276 (upload_file_in_transaction):
277 (delete_file): Added.
278 (prune_old_files): Added.
279 * server-tests/privileged-api-upload-file-tests.js: Added tests for deleting old uploaded files as well as
280 tests for the total quota.
281 * server-tests/resources/test-server.js:
282 (TestServer.prototype.testConfig): Added uploadTotalQuotaInMB to the test configuration.
284 2017-06-29 Ryosuke Niwa <rniwa@webkit.org>
286 UploadedFile should include the file extension in its url
287 https://bugs.webkit.org/show_bug.cgi?id=174009
289 Reviewed by Chris Dumez.
291 Some command line tools such as darwinup use the file extension to determine the file type.
292 Include the file extension in the URL of an uploaded file to make it work with these tools.
294 * public/include/uploaded-file-helpers.php:
295 (format_uploaded_file): Include the file extension.
296 * public/v3/models/uploaded-file.js:
298 (UploadedFile.prototype.url): Return the URL with hthe file extension specified. /api/uploaded-file
299 already supports having the file extension specified.
300 * server-tests/tools-sync-buildbot-integration-tests.js: Updated test cases.
301 * unit-tests/buildbot-syncer-tests.js: Ditto.
303 2017-05-31 Ryosuke Niwa <rniwa@webkit.org>
305 Don't shouldn't create a request to build a patch if there is no patch to build
306 https://bugs.webkit.org/show_bug.cgi?id=172791
308 Reviewed by Chris Dumez.
310 When a commit set doesn't have a patch specified, don't create a request to build. For example, when we're comparing
311 WebKit in the system to WebKit with a patch, there is nothing to build for the first commit set.
313 However, when conducting an A/B testing, it's advisible to compare WebKit built with and without a patch on a single
314 machine with the same version of Xcode, etc... For this reason, we still create a request to build for a commit set
315 if there is another commit set with a patch which uses the same repository group.
317 * public/privileged-api/create-test-group.php:
318 (main): Fixed the bug. Only create a build request to build if there is a matching repository group with a patch.
319 * server-tests/privileged-api-create-test-group-tests.js: Added a test case.
321 2017-05-31 Ryosuke Niwa <rniwa@webkit.org>
323 Allow sync-buildbot.js to set a buildbot property only when patches are built
324 https://bugs.webkit.org/show_bug.cgi?id=172743
326 Rubber-stamped by Chris Dumez.
328 Added the ability to specify a buildbot property only when there are build requests to build a patch.
330 * tools/js/buildbot-syncer.js:
331 (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group.
332 (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto.
333 (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property.
334 For the condition type of "built", we check if there was any other
335 (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional.
337 * tools/js/buildbot-triggerable.js:
338 (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that
339 belong to the same test group.
340 (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto.
342 * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch.
343 Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest,
344 and scheduleRequestInGroupIfAvailable.
345 (createSampleBuildRequestWithPatch): Added.
347 * unit-tests/resources/mock-v3-models.js:
348 (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing.
350 2017-05-30 Ryosuke Niwa <rniwa@webkit.org>
352 sync-builedbot.js fails to schedule the second request to test with a patch
353 https://bugs.webkit.org/show_bug.cgi?id=172701
355 Reviewed by Antti Koivisto.
357 The bug was caused by an assertion failure in BuildbotTriggerable's _pullBuildbotOnAllSyncers failing to
358 take into account that for a test group with a patch could be associated with two syncers, one to build
359 a patch and another to run tests. Fixed the bug by differentiating the two types of syncers by buildSyncer
360 and testSyncer per test group.
362 * server-tests/tools-sync-buildbot-integration-tests.js: Extended a test case so that it would hit the
363 assertion without the fix.
365 * tools/js/buildbot-triggerable.js:
366 (BuildbotTriggerable.prototype.syncOnce): Use the right kind of the syncer to schedule a build or a test.
367 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Associate a given syncer based on the kind of
368 the build request it processed, and assert accordingly.
370 2017-05-29 Ryosuke Niwa <rniwa@webkit.org>
372 Fix UI glitches with a custom analysis test group with a patch
373 https://bugs.webkit.org/show_bug.cgi?id=172694
375 Reviewed by Sam Weinig.
377 Fix the following UI glitches with perf try bots:
378 - Retrying an A/B testing with a patch fails.
379 - A patch specified in an test group does not get specified in the configurator.
380 - Drag & dropping a patch doesn't work.
381 - Results for custom analysis tasks don't get shown.
383 * public/api/test-groups.php:
384 (main): Fix a bug that test group's platform does not match that of the request'ed platform. Since each test
385 group is associated with platform, just use that instead of querying test_configurations. This resulted in
386 the configurator not being able to find a triggerable in some cases.
388 * public/v3/components/custom-analysis-task-configurator.js:
389 (CustomAnalysisTaskConfigurator):
390 (CustomAnalysisTaskConfigurator.prototype.setCommitSets): Add patches in the commit set.
391 (CustomAnalysisTaskConfigurator.prototype._setUploadedFilesToUploader): Now clears the exiting uploaded files
392 Also renamed from _setUploadedFilesIfEmpty.
393 (CustomAnalysisTaskConfigurator.prototype._setPatchFiles): Added.
394 (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): We no longer update the list of roots
395 for the comparsion when a new root is added to the baseline.
396 (CustomAnalysisTaskConfigurator.prototype._configureComparison): Copy over the list of patches and roots when
397 starting to configure the comparsion.
399 * public/v3/components/instant-file-uploader.js:
400 (InstantFileUploader.prototype.clear): Added.
401 (InstantFileUploader.prototype.didConstructShadowTree): Added event handlers for dragover & drop events to
402 allow specifying a patch and root using drag & drop. Unfortunately, this still doesn't work in WebKit due to
403 a bug in our shadow DOM implementation.
404 (InstantFileUploader.prototype._didFileInputChange):
405 (InstantFileUploader.prototype._uploadFiles): Extracted from _didFileInputChange.
407 * public/v3/pages/analysis-task-page.js:
408 (AnalysisTaskTestGroupPane.prototype.setAnalysisResults): No longer takes metric.
409 (AnalysisTaskTestGroupPane.cssTemplate): Removed unused rules. Also disallow flexing on the list of test groups
410 to avoid the name of a test froup from overflowing on top of the results pane.
411 (AnalysisTaskPage.prototype._assignTestResultsIfPossible): Set setAnalysisResults even when metric is not set
412 as is the case for a custom analysis task.
413 (AnalysisTaskPage.prototype._retryCurrentTestGroup): Use createWithCustomConfiguration to allow retrying of
414 an A/B testing with a patch in a custom analysis task.
415 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingCommitSetList):
417 2017-05-26 Ryosuke Niwa <rniwa@webkit.org>
419 Show patches applied in each A/B testing build requests
420 https://bugs.webkit.org/show_bug.cgi?id=172636
422 Reviewed by Antti Koivisto.
424 List patches applied along side revisions inn the list of revisions for an A/B tesing build requests if there
425 are any patches applied.
427 * public/v3/components/test-group-revision-table.js:
428 (TestGroupRevisionTable.prototype._renderTable): Indicate which request is to build a patch and which one is
430 (TestGroupRevisionTable.prototype._buildCommitCell): Include the patch file's information when there is one.
431 We need to use the requested commit set instead of the one reported by testers or builders since they don't
432 include patch or root information.
433 (TestGroupRevisionTable.prototype._buildCustomRootsCell):
434 (TestGroupRevisionTable.prototype._buildFileInfo): Extracted from _buildCustomRootsCell.
436 2017-05-26 Ryosuke Niwa <rniwa@webkit.org>
438 The queue page is broke when there is a custom analysis task
439 https://bugs.webkit.org/show_bug.cgi?id=172631
441 Reviewed by Antti Koivisto.
443 Fix the bug that we were always assuming each build request to have a test associated.
445 * public/v3/models/test-group.js:
446 (TestGroup.createAndRefetchTestGroups): Fixed the bug that we were referring to a non-existent variable task.
447 * public/v3/pages/build-request-queue-page.js:
448 (BuildRequestQueuePage.prototype._constructBuildRequestTable): Fixed the bug. Collect every request in the group
449 and then find the first test request's test name. Make it clear that we're waiting for a build as needed.
451 2017-05-25 Ryosuke Niwa <rniwa@webkit.org>
453 Syncing script shouldn't schedule a build request when there is a build from another test group in progress
454 https://bugs.webkit.org/show_bug.cgi?id=172577
455 <rdar://problem/32395049>
457 Reviewed by Chris Dumez.
459 When a buildbot master gets restarted while there is an in-progress build and a pending build, the master will
460 re-schedule the currently running build, and this can result in multiple build requests from different test
461 groups being scheduled simultaneously.
463 sync-buildbot.js was supposed to recover from this state by only processing build requests from one test group
464 at a time and eventually come back to a state where only a single test group is running per buildbot slave.
466 We had a test for this particular case but it wasn't testing what it claimed to test. Rewriten the test case
467 and fixed the bug by explicitly checking this condition and treating it as if there is a pending build already
468 scheduled in the builder in this case.
470 * public/api/test-groups.php:
471 (main): Fixed a regression from r217397. Return the platform ID of the first request when none of the requets
472 have been processed yet or all of them had failed.
473 * server-tests/tools-buildbot-triggerable-tests.js: Rewritten a test case intended to cover this bug.
474 (.assertRequestAndResolve): Added.
475 * tools/js/buildbot-syncer.js:
476 (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Fixed the bug. Avoid scheduling a new request on
477 this syncer if there is a build in progress for a test group different from that of the new request. Reuse the
478 code we had to deal with a pending build for this purpose.
480 2017-05-24 Ryosuke Niwa <rniwa@webkit.org>
482 Opening an analysis task from the queue page is broken
483 https://bugs.webkit.org/show_bug.cgi?id=172559
484 <rdar://problem/32389708>
486 Rubber-stamped by Chris Dumez.
488 Fix the bug that opening the analysis task page from the queue page results in multiple assertion failures
489 as well as the list of test groups in the analysis task page not getting updated.
491 * public/v3/models/build-request.js:
492 (BuildRequest.prototype.updateSingleton): Because /api/build-requests/ do not include test groups, it's
493 possible for testGroup to be dynamically updated upon loading an analysis task page. Update _testGroup in
494 such instances instead of asserting that it doesn't happen.
496 * public/v3/models/data-model.js:
497 (DataModelObject.cachedFetch): Because various code to create model objects from the result of a JSON API
498 modify the fetched content in irreversible manner, e.g. `object.platform = Platform.findById(object.platform)`
499 we must return a fresh new content each time even if the result had been cached.
501 * public/v3/models/test-group.js:
502 (TestGroup.prototype.platform): Return this._platform as that's not available.
504 * public/v3/pages/analysis-task-page.js:
506 (AnalysisTaskPage.prototype._resetVariables): Extracted from the constructor.
507 (AnalysisTaskPage.prototype.updateFromSerializedState): Reset all instance variables when opening a new
508 analysis task page. This would avoid showing the stale result even when fetching new test groups had failed.
510 * unit-tests/test-groups-tests.js: Added a test case for fetching the same test group twice. This used to hit
511 a problem in BuildRequest.constructBuildRequestsFromData which overrode platform property of each raw content
512 with a Platform model object because in the case of a cached fetch, we end up trying to look up the platform
513 again using the result of stringifying the Platform object instead of the platform ID included in the original
515 (sampleTestGroup): Added "platform" as included in the JSON API's response now.
517 2017-05-24 Ryosuke Niwa <rniwa@webkit.org>
519 The commit log viewer can overlap the analysis results viewer
520 https://bugs.webkit.org/show_bug.cgi?id=172534
522 Rubber-stamped by Chris Dumez.
524 Allocate the padding on the right for the commit log viewer, and add a horizontal scrollbar
525 to the analysis results viewer instead of letting it expand beneath the commit log viewer.
527 * public/v3/pages/analysis-task-page.js:
528 (AnalysisTaskResultsPane.htmlTemplate):
529 (AnalysisTaskResultsPane.cssTemplate):
531 2017-05-24 Ryosuke Niwa <rniwa@webkit.org>
533 Sycning script build fix after r217378.
535 * tools/sync-buildbot.js:
538 2017-05-23 Ryosuke Niwa <rniwa@webkit.org>
540 Add the support for perf try bots to sync-buildbot.js
541 https://bugs.webkit.org/show_bug.cgi?id=172529
543 Rubber-stamped by Chris Dumez.
545 Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot.
547 Change the buildbot property format in the syncing script's configuration again to use a dictionary
548 with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots,
549 and simplified the structure of the configuration by always having "types" and "builders", and
550 make each entry in "configurations" refer to a list of types, platforms, and builders.
552 Since now there are build requests to build patches and run tests, "configurations" has been renamed to
553 "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations"
554 specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot
555 properties for testing is now specified as "testProperties" and ones for building a patch is specified
556 in newly introduced "buildProperties".
558 * public/api/build-requests.php:
559 (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed
560 since there is no way to run tests without a successful build.
562 * public/api/update-triggerable.php:
563 (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was
564 the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js.
566 * public/v3/models/build-request.js:
567 (BuildRequest.prototype.hasCompleted): Added.
569 * public/v3/models/manifest.js:
570 (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and
571 syncLoop in tools/sync-buildbot.js
572 (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually
573 reset V3 models in syncLoop.
575 * public/v3/models/uploaded-file.js:
576 (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path.
578 * public/v3/remote.js:
579 (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL.
581 * server-tests/api-update-triggerable-tests.js:
582 (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call
583 Manifest.fetch instead.
585 * server-tests/resources/mock-data.js:
586 (MockData.resetV3Models): Calls Manifest.reset().
587 (MockData.addMockConfiguration): Extracted from addMockData.
588 (MockData.addMockData): Updated per the format change.
589 (MockData.mockTestSyncConfigWithSingleBuilder): Ditto.
590 (MockData.mockTestSyncConfigWithTwoBuilders): Ditto.
591 (MockData.runningBuild): Make buildNumber specifiable.
592 (MockData.finishedBuild): Ditto.
594 * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change.
595 Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a
596 repository group that which accepts a patch and not take roots.
598 * server-tests/tools-sync-buildbot-integration-tests.js: Added.
599 (createTriggerable): Added.
600 (createTestGroupWihPatch): Added.
602 (.assertAndResolveRequest): Added.
603 (.assertTestBuildHasFailed): Added.
605 * tools/js/buildbot-syncer.js:
606 (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder
607 is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed
608 _testConfigurations to _configurations.
609 (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't
610 been set or it's a tester.
611 (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder.
612 (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder.
613 (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this
614 syncer is a builder. Otherwise returns [].
615 (BuildbotSyncer.prototype.isTester): Added.
616 (BuildbotSyncer.prototype.matchesConfiguration):
617 (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format.
618 (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations.
619 (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry,
620 creates the list of configurations per builder and platform.
621 (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision,
622 roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial
623 explosion in the number of things that can go wrong. Also parse buildProperties optionally.
624 (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of
625 buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved
626 type such as "revision" and "patch".
627 (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types",
628 "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms.
630 * tools/js/buildbot-triggerable.js:
631 (BuildbotTriggerable.prototype.syncOnce):
632 (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not
633 associated with any test.
634 (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to
635 build a patch which has not been completed (pending, scheduled, running, or failed). Since all
636 requests to build a patch has a negative order, those requests should all show up at the beginning.
637 (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when
638 scheduling the first request to build a patch or the first request to run a test. The first request
639 to run a test will always have order of 0, so it's a sufficient condition to find such a request.
640 On the other hand, the first request to build a patch can have a negative order number so we must
641 explicitly check if it's the first item in the ordered list of requests in the test group.
643 * tools/remote-server-relay.log: Added.
645 * tools/sync-buildbot.js:
646 (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so
647 that Triggerable and related objects we have in the memory may not reflect what we just synced to
648 the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that.
650 * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test
651 exception messages explicitly since allowing any exception was resulting in some tests passing a
652 result of unrelated parsing error being thrown, etc...
653 (sampleiOSConfig): Updated per the format change.
654 (sampleiOSConfigWithExpansions): Ditto.
655 (smallConfiguration): Ditto.
657 2017-05-22 Dewei Zhu <dewei_zhu@apple.com>
659 Fix the bug that sometimes analysis task results pane is missing.
660 https://bugs.webkit.org/show_bug.cgi?id=172404
662 Reviewed by Ryosuke Niwa.
664 AnalysisTaskPage._didFetchTask and AnalaysisTaskPage._fetchRelatedInfoForTaskId should be called in order.
665 The race between those two functions causes the analysis task results pane sometimes missing.
667 * public/v3/components/analysis-results-viewer.js:
668 (AnalysisResultsViewer.prototype.render): Fix the bug in r217173 that commitSet can be undefined.
669 * public/v3/pages/analysis-task-page.js:
670 (AnalysisTaskPage.prototype.updateFromSerializedState): Use arrow function to get rid of self variable.
671 Use `const` instead of var for constant variable. And call _didFetchTask before calling _fetchRelatedInfoForTaskId.
672 (AnalysisTaskPage.prototype._renderTaskNameAndStatus):
673 (AnalysisTaskPage.cssTemplate):
675 2017-05-19 Ryosuke Niwa <rniwa@webkit.org>
677 Add a commit log viewer next to the analysis results viewer
678 https://bugs.webkit.org/show_bug.cgi?id=172399
680 Reviewed by Chris Dumez.
682 Add a commit log viewer next to the analysis results viewer, which visualizes the A/B testing results.
684 Also linkify the revisions in the table that shows the status of each A/B testing job,
685 and allow the prefix of "r" when associating a Subversion revision.
687 Finally, Fixed a bug that the list of commits associated with the analysis task were not re-rendered
688 when the list was updated by the user.
690 * public/v3/components/analysis-results-viewer.js:
691 (AnalysisResultsViewer): Added _selectorRadioButtonList as an instance variable. It's a list of radio
692 buttons to select a configuration (A/B) with a commit set. It's added to update the checked status of
693 radio buttons upon changing the currently selected test group.
694 (AnalysisResultsViewer.prototype.setTestGroups): Update the selected range to that of the currently
696 (AnalysisResultsViewer.prototype.render): Fill _selectorRadioButtonList with radio buttons.
698 * public/v3/components/commit-log-viewer.js:
699 (CommitLogViewer): Added _showRepositoryName as an instance variable.
700 (CommitLogViewer.prototype.setShowRepositoryName): Added.
701 (CommitLogViewer.prototype.render): Hide the repository name when _showRepositoryName is false. This
702 is used in the newly added commit log viewer for the analysis results since we're showing a select
703 element with all the names of repositories above this component.
705 * public/v3/components/test-group-revision-table.js:
706 (TestGroupRevisionTable.prototype._buildCommitCell): Linkify the revisions if possible.
708 * public/v3/models/analysis-task.js:
709 (AnalysisTask.prototype.associateCommit): Strip "r" at the beginning for a Subversion like r12345
710 since that's the format we use to show to the user. This makes copy & paste easier.
712 * public/v3/pages/analysis-task-page.js:
713 (AnalysisTaskResultsPane): Added a bunch of new instance variables to show and update the commit log
714 viewer next to the analysis results viewer.
715 (AnalysisTaskResultsPane.prototype.setPoints): Create the list of repositories to show details.
716 (AnalysisTaskResultsPane.prototype.didConstructShadowTree): Re-render when the current selected test
717 group changes since that may have updated the selected range for A/B testing. Also re-render when
718 a new repository is selected to show details.
719 (AnalysisTaskResultsPane.prototype.render): Update the list of repositories and the commit log viewer.
720 (AnalysisTaskResultsPane.prototype._renderRepositoryList): Renders the list of repositories.
721 (AnalysisTaskResultsPane.prototype._updateCommitViewer): Updates the commit log viewer given the range
722 selected in the analysis results viewer.
723 (AnalysisTaskResultsPane.htmlTemplate): Updated the template.
724 (AnalysisTaskResultsPane.cssTemplate): Ditto.
725 (AnalysisTaskTestGroupPane.cssTemplate): Add a little space between the list of results and the table
726 of A/B testing jobs with revisions.
727 (AnalysisTaskPage.prototype.render): Fixed the bug that the list of commits associated with the task
728 is not updated when the list changes the task or the start point never changed when the list of commits
729 associated with the task changed. Make the lazily evaluated function compare the actual list of commits
730 so that it will invoke _renderCauseAndFixes when the list changes.
731 (AnalysisTaskPage.prototype._renderCauseAndFixes): Now renders a specific list.
733 2017-05-16 Ryosuke Niwa <rniwa@webkit.org>
735 Another build fix. Added a missing null check.
737 * public/v3/components/custom-analysis-task-configurator.js:
738 (CustomAnalysisTaskConfigurator.prototype._setUploadedFilesIfEmpty):
740 2017-05-14 Ryosuke Niwa <rniwa@webkit.org>
742 Build fix. Added a missing null check.
744 * public/v3/pages/analysis-task-page.js:
745 (AnalysisTaskConfiguratorPane.prototype.setTestGroups):
747 2017-05-11 Ryosuke Niwa <rniwa@webkit.org>
749 Remove the code for old syncing script configuration in BuildbotSyncer
750 https://bugs.webkit.org/show_bug.cgi?id=171963
752 Reviewed by Chris Dumez.
754 Removed the code for specifying {"root": ~}, {"rootOptions": [~]}, and {"rootsExcluding": [~]} in buildbot
755 properties in the syncing script's configurations since they are no longer used after r215061.
757 Also removed the support for using "arguments" as an alias to "properties", and updated the tests accordingly.
759 * tools/js/buildbot-syncer.js:
760 (BuildbotSyncer._parseRepositoryGroup): Removed the unused code.
761 (BuildbotSyncer._validateAndMergeConfig): Just allow string values in properties.
762 (BuildbotSyncer._validateAndMergeProperties): Deleted.
764 * unit-tests/buildbot-syncer-tests.js:
765 (sampleiOSConfig): Use "properties" instead of "arguments" to specify the buildbot properties.
766 (sampleiOSConfigWithExpansions): Ditto.
768 2017-05-10 Ryosuke Niwa <rniwa@webkit.org>
770 Another build fix after r215633 to make the bar graphs render even when the confidence intervals aren't available.
772 * public/v3/components/bar-graph-group.js:
773 (BarGraphGroup.prototype._computeRange):
775 2017-05-10 Ryosuke Niwa <rniwa@webkit.org>
777 Build fix after r215633.
779 * public/v3/models/test-group.js:
780 (TestGroup.prototype._computeRequestedCommitSets):
781 (TestGroup.prototype.requestsForCommitSet):
783 2017-05-10 Ryosuke Niwa <rniwa@webkit.org>
785 Add API to upload a patched build for a custom A/B testing
786 https://bugs.webkit.org/show_bug.cgi?id=171956
788 Reviewed by Chris Dumez.
790 Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set.
792 Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code
793 with /api/upload-root.php.
795 * public/api/upload-root.php: Added.
797 (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with.
798 A root can be associated with multiple repositories and there fore commit set items; e.g. if a software
799 is built from multiple repositories and there is a patch associated with one of them, the built product
800 must be associated with all those repositories.
802 * public/include/build-requests-fetcher.php:
803 (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one.
805 * public/include/json-header.php:
806 (validate_arguments): Added the support for validating json string.
807 (verify_slave): Return the slave ID found.
809 * public/include/uploaded-file-helpers.php:
810 (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root.
811 (query_total_file_size): Ditto.
812 (create_uploaded_file_from_form_data): Ditto.
813 (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction.
815 * public/privileged-api/upload-file.php:
818 * public/v3/models/build-request.js:
819 (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item.
821 * public/v3/models/commit-set.js:
822 (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables.
823 (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after
824 its creation. After this patch, each item can be newly associated with a root so we must update its
825 _repositoryToRootMap and _allRootFiles. For simplicity, we update all states.
826 (CommitSet.prototype._updateFromObject): Extracted from the constructor.
827 (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches.
828 (CommitSet.prototype.rootForRepository): Added.
829 (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to
830 _repositoryToCommitMap, and added a check for _repositoryToRootMap.
832 * public/v3/models/test-group.js:
833 (TestGroup.prototype.task): Added.
834 (TestGroup.createWithTask):
835 (TestGroup.createWithCustomConfiguration):
836 (TestGroup.createAndRefetchTestGroups):
837 (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache.
838 (TestGroup.findAllByTask): Added.
839 (TestGroup.fetchForTask): Renamed from fetchByTask.
841 * public/v3/pages/analysis-task-page.js:
842 (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId):
844 * server-tests/api-build-requests-tests.js:
846 * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root.
848 (addSlaveAndCreateRootFile): Added.
849 (createTestGroupWihPatch): Added.
851 * server-tests/privileged-api-create-test-group-tests.js:
853 * server-tests/resources/mock-data.js:
854 (MockData.sharedRepositoryId): Added.
855 (MockData.addMockData): Added "Shared" repository along with commits.
857 2017-05-10 Ryosuke Niwa <rniwa@webkit.org>
859 Rename server-tests/api-update-triggerable.js to server-tests/api-update-triggerable-tests.js
860 https://bugs.webkit.org/show_bug.cgi?id=171905
862 Reviewed by Chris Dumez.
864 * server-tests/api-update-triggerable-tests.js: Renamed from server-tests/api-update-triggerable.js.
866 2017-04-30 Ryosuke Niwa <rniwa@webkit.org>
868 Add the support for scheduling a A/B testing with a patch.
869 https://bugs.webkit.org/show_bug.cgi?id=171209
871 Reviewed by Chris Dumez.
873 Added the support for creating a custom test group with a patch applied.
875 First, each repository in a repository group has a boolean indicating whether a given repository can have
876 a patch applied or not. When any configuration in a test group contains a patch, we create build requests
877 without a test specified in order to "build" those patches. These build requests have negative order numbers
878 to differentiate them from regular build requests. We can't simply build ones with patches since there could
879 be differences in SDK, build options, etc... when patches are applied.
881 The JSON format for commit sets returned by /api/build-requests have been changed from using an array of
882 commit IDs to an array of dictionaries indicate commit and acceptsPatch boolean. /api/update-triggerable now
883 uses a dictionary with two keys: repository and acceptsPatch to specify a set of repositories associated with
884 a repository group, and /privileged-api-create-test-group uses a dictionary with two keys: revision and patch
885 instead of a revision string to specify commit sets.
887 Furthermore, the syncing script's configuration have been updated to use a dictionary of repository names to
888 an options dictionary instead of an array of repositories names. For now, the only supported option is
889 acceptsPatch but will be extended when we add the support for rolling back system components.
890 e.g. {"WebKit": {acceptsPatch: true}, "macOS": {}} instead of ["WebKit", "macOS"]
892 On the UI side, InstantFileUploader has been changed to accept only one file by default, and added a new method
893 allowMultipleFiles() to allow multiple files to be selected for custom roots. Also replaced the input element
894 with type=file by a button with a custom label to show labels such as "Apply a patch" or "Add a new root"
895 instead of the generic label like "choose a file".
898 * init-database.sql: Added trigrepo_accepts_patch to triggerable_repositories to indicate whether a given
899 repository can have a patch applied or not. Made request_test optional in build_requests for when a build
900 request is created to build patches. Such a build request have a negative request_order. Updated the related
901 constraints accordingly.
903 * public/admin/triggerables.php: Added the support for updating whether a given repository can have a patch
904 applied in each repository group. Only show the repositories in the repository group for this purpose since
905 there is no way to accept a patch on a repository without it being a part of the group.
906 (generate_repository_form): Now takes the markup for checkboxes instead of generating one itself.
907 (generate_repository_checkboxes): Now takes an array of repositories to generate checkboxes. The checkbox is
908 shown when the repository ID exists as a key in this array, and is checked when its value is true. The new
909 capability to skip repositories not in the array is used to hide repositories not associated with the group
910 in the list of checkboxes to indicate a repository accepts a patch.
912 * public/api/update-triggerable.php:
913 (main): Now updates the description and acceptsRoots states of each repository group, and sets acceptsPatch
914 boolean for each repository in the group if set in the update.
915 (validate_repository_groups): Use a reference to $repository_groups in order to set repository_id_list, which
916 contains an array of repository IDs to find the existing repository group that matches the set via
917 RepositoryGroupFinder's find_by_repositories. Also added a various validations for acceptsRoots, a dictionary
918 specifying repository and acceptsPatch.
920 * public/include/build-requests-fetcher.php:
921 (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Instead of returning an array of commit IDs as
922 "commits", it now returns an array of dictionaries with "commit" and "patch" keys specifying the commit ID
923 and the patch file's ID respectively as "revisionItems".
924 (BuildRequestsFetcher::add_uploaded_file): Added. Extracted from fetch_commits_for_set_if_needed. Used to
925 add either a patch file or a custom root file in the list of uploaded files in the result.
927 * public/include/manifest-generator.php:
928 (fetch_triggerables): Each element in repository group's "repositories" field is now an array of dictionaries
929 with "repository" and "acceptsPatch" as keys.
931 * public/include/repository-group-finder.php:
932 (RepositoryGroupFinder::__construct): Added a map for boolean indicating whether a given repository group
933 allows a patch on a repository. Used in /privileged-api/create-test-group.
934 (RepositoryGroupFinder::accepts_patch): Added.
935 (RepositoryGroupFinder::populate_map): Build up the map for acceptsPatch boolean per repository per group.
937 * public/privileged-api/create-test-group.php:
938 (main): Fixed a bug that we were not explicitly checking for a duplicate test group name (with a test). Create
939 build requests to "build" patches if there is any patch file specified.
940 (commit_sets_from_revision_sets): Updated to take a dictionary with "revision" and "patch" as keys to specify
941 a revision and a patch if any instead of just a revision string for each repository. Also validate that each
942 repository is allowed to have a patch once the repository group has been found for the set of repositories.
943 (ensure_commit_sets):
945 * public/v3/components/custom-analysis-task-configurator.js:
946 (CustomAnalysisTaskConfigurator): Added _patchUploaders as an instance variable, which is a dictionary of
947 configuration names to a map of InstantFileUploader's used to upload a patch. Also renamed _fileUploaders to
948 _customRootUploaders for clarity.
949 (CustomAnalysisTaskConfigurator.prototype.setCommitSets):
950 (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree.createRootUploader): Added.
951 (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree):
952 (CustomAnalysisTaskConfigurator.prototype._ensurePatchUploader): Added. Creates an instant file uploader for
953 patches. We only allow a single patch per repository.
954 (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Include a patch in the commit set as needed.
955 (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Show the patch file uploader for repositories
956 which can have patches in the current repository group.
957 (CustomAnalysisTaskConfigurator.cssTemplate): Show borders between every rows instead of just between tbody's
958 now that each row can have a patch file uploader.
960 * public/v3/components/instant-file-uploader.js:
961 (InstantFileUploader): Added _fileInput and _allowMultipleFiles as instance variables. We now show a button
962 in the UI instead of an input with type=file. _fileInput is a hidden input with type=file used inside a click
963 event of the button to let the user pick a file.
964 (InstantFileUploader.prototype.allowMultipleFiles): Added. Allows this instance to accept multiple files.
965 (InstantFileUploader.prototype.didConstructShadowTree): Synthetically click on the hidden input element when
966 the newly added button element is clicked to open the browser's file picker.
967 (InstantFileUploader.prototype.render): Hide the button to add a file if this instance can only select one file
968 and there is already some file being uploaded in this instance.
969 (InstantFileUploader.htmlTemplate): Replaced the input element with type=file with a button. Its label comes
970 from the default slot content.
972 * public/v3/models/build-request.js:
973 (BuildRequest): Made the test optional.
974 (BuildRequest.prototype.isBuild): Returns true if this is a build request for building a patch.
975 (BuildRequest.prototype.isTest): Returns true if this is a build request for running tests.
976 (BuildRequest.constructBuildRequestsFromData): Create each commit log here instead of relying on CommitSet's
977 constructor to construct its commit logs. Also updated per the replacement of an array of commit IDs by
978 an array of dictionaries with commit and patch properties.
980 * public/v3/models/commit-set.js:
981 (CommitSet): Made _repositoryToCommitMap a real Map object. Also added _repositoryToPatchMap. Also got rid of
982 the code to instantiate commit logs since that's now done in BuildRequest.constructBuildRequestsFromData.
983 (CommitSet.prototype.commitForRepository):
984 (CommitSet.prototype.revisionForRepository):
985 (CommitSet.prototype.patchForRepository): Added.
986 (CommitSet.prototype.latestCommitTime): Modernized the code.
987 (CommitSet.prototype.equals): Modernized the code. Also added the check for patches.
988 (MeasurementCommitSet): Updated per the change to make _repositoryToCommitMap a real Map.
989 (CustomCommitSet.prototype.setRevisionForRepository):
990 (CustomCommitSet.prototype.equals): Added the check for patches.
991 (CustomCommitSet.prototype.revisionForRepository):
992 (CustomCommitSet.prototype.patchForRepository): Added.
994 * public/v3/models/manifest.js:
995 (Manifest._didFetchManifest): Updated per the replacement of an array of commit IDs by an array of dictionaries
996 with commit and patch properties.
998 * public/v3/models/repository.js:
999 (Repository.prototype.ownerId): Renamed from owner for clarity.
1001 * public/v3/models/test-group.js:
1002 (TestGroup): Modernized the code by using LazilyEvaluatedFunction. Removed _requestsAreInOrder since it's not
1003 necessary anymore with LazilyEvaluatedFunction.
1004 (TestGroup.prototype.addBuildRequest):
1005 (TestGroup.prototype.test): Use the last build request's test since the first few requests could be requests to
1007 (TestGroup.prototype.platform): Ditto.
1008 (TestGroup.prototype._lastRequest): Added.
1009 (TestGroup.prototype._orderedBuildRequests): Added.
1010 (TestGroup.prototype.repetitionCount): Only count the build requests for testing (skipping any requests to
1012 (TestGroup.prototype.requestedCommitSets): Simply call _computeRequestedCommitSetsLazily.
1013 (TestGroup.prototype._computeRequestedCommitSets): Extracted from requestedCommitSets.
1014 (TestGroup.prototype.requestsForCommitSet):
1015 (TestGroup.prototype.labelForCommitSet): Rewritten. Just compute the label here instead of relying on
1016 _commitSetToLabel since requestedSets is always of the length two at the moment.
1017 (TestGroup._revisionSetsFromCommitSets): Specify both the revision and the patch in the revision set.
1019 * public/v3/models/triggerable.js:
1020 (TriggerableRepositoryGroup): Added _patchAcceptingSet as an instance variable. Use
1021 sortByNamePreferringOnesWithURL to sort repositories instead of simple sortByName.
1022 (TriggerableRepositoryGroup.prototype.accepts): Added checks for the custom roots and patches.
1023 (TriggerableRepositoryGroup.prototype.acceptsPatchForRepository): Added.
1025 * server-tests/api-build-requests-tests.js: Updated the test cases per the replacement of an array of commit
1026 IDs by an array of dictionaries with commit and patch properties.
1028 * server-tests/api-manifest-tests.js: Updated the test case per the name of Repository's owner to ownerId.
1030 * server-tests/api-update-triggerable.js: Updated the test case per the name of Repository's owner to ownerId,
1031 and added a test case for updating whether a given repository group allows custom roots as well as patches
1032 on repositories via /api/update-triggerable.
1033 (.updateWithOSXRepositoryGroup): Updated the sample syncing script configuration per the format change.
1034 (.refetchManifest): Added.
1036 * server-tests/privileged-api-create-test-group-tests.js: Updated per the syncing script configuration format
1037 change. Also added a test for creating a test group with a duplicate name, which is expected to fail with
1038 DuplicateTestGroupName, and creating a test group with a patch both when it's allowed and when it's not allowed
1039 in the matching repository group.
1040 (.addTriggerableAndCreateTask): Updated per the format change.
1042 * server-tests/resources/mock-data.js:
1043 (MockData.addEmptyTriggerable): Added a metric and its configuration to make it appear in the manifest file.
1044 The new test case in api-update-triggerable.js requires this.
1045 (MockData.mockTestSyncConfigWithSingleBuilder): Updated per the syncing script configuration format change.
1046 (MockData.mockTestSyncConfigWithTwoBuilders): Ditto.
1048 * server-tests/tools-buildbot-triggerable-tests.js: Removed the useless assertions about test configurations,
1049 and added assertions about custom roots and patches in the test case for updateTriggerables.
1051 * tools/js/buildbot-syncer.js:
1052 (BuildbotSyncer._parseRepositoryGroup): Made each assertion explicitly refer to the specific repository group
1053 to make it more user friendly. Now each repository group uses a dictionary of repository names to its options
1054 in the syncing script configurations. When parsed, we insert it as an array of dictionaries with repository ID
1055 and acceptsPatch boolean specified separately since this is the format /api/update-triggerable expects.
1057 * tools/js/buildbot-triggerable.js:
1058 (BuildbotTriggerable.prototype.updateTriggerable):
1060 * unit-tests/build-request-tests.js:
1061 (sampleBuildRequestData): Updated per the commit sets format change in /api/build-requests.
1063 * unit-tests/buildbot-syncer-tests.js: Updated the existing tests per various format changes and added a couple
1064 of new test cases for the syncing script's configuration validation.
1066 (smallConfiguration):
1067 (createSampleBuildRequest):
1069 * unit-tests/resources/mock-v3-models.js:
1070 (MockModels.inject): Updated per the repository group format change.
1072 * unit-tests/test-groups-tests.js:
1073 (sampleTestGroup): Updated per the commit sets format change in /api/build-requests.
1075 2017-04-21 Ryosuke Niwa <rniwa@webkit.org>
1077 Rename commit_set_relationships to commit_set_items
1078 https://bugs.webkit.org/show_bug.cgi?id=171143
1080 Reviewed by Joseph Pecoraro.
1082 Renamed commit_set_relationships to commit_set_items. Also added commitset_patch_file in the preparation to add
1083 the support for applying patches in custom test groups. To migrate an existing database, run:
1087 ALTER TABLE commit_set_relationships RENAME TO commit_set_items;
1088 ALTER TABLE commit_set_items ADD COLUMN commitset_patch_file integer REFERENCES uploaded_files;
1089 ALTER TABLE commit_set_items ADD CONSTRAINT commitset_with_patch_must_have_commit
1090 CHECK (commitset_patch_file IS NULL OR commitset_commit IS NOT NULL);
1094 * init-database.sql:
1095 * public/include/build-requests-fetcher.php:
1096 * public/privileged-api/create-test-group.php:
1097 * server-tests/resources/mock-data.js:
1098 (MockData.addMockData):
1099 (MockData.addMockTestGroupWithGitWebKit):
1100 * tools/js/database.js:
1102 2017-04-21 Ryosuke Niwa <rniwa@webkit.org>
1104 Add the support for creating a custom test group in the analysis task page
1106 Make it possible to create more custom test groups in the analysis task page
1107 https://bugs.webkit.org/show_bug.cgi?id=171138
1109 Rubber-stamped by Chris Dumez.
1111 Extracted CustomConfigurationTestGroupForm out of CreateAnalysisTaskPage and added it to AnalysisTaskPage inside
1112 AnalysisTaskConfiguratorPane. This allows configuration of a new test group within a custom analysis task.
1114 * public/privileged-api/create-test-group.php:
1115 (main): Fixed the bug that the triggerable wasn't resolved when creating a test group in a custom analysis task.
1117 * public/v3/components/custom-analysis-task-configurator.js:
1118 (CustomAnalysisTaskConfigurator.prototype.selectTests): Added. Used by CustomConfigurationTestGroupForm's
1120 (CustomAnalysisTaskConfigurator.prototype.selectPlatform): Ditto.
1121 (CustomAnalysisTaskConfigurator.prototype.setCommitSets): Ditto.
1122 (CustomAnalysisTaskConfigurator.prototype._setUploadedFilesIfEmpty): Added.
1123 (CustomAnalysisTaskConfigurator.prototype._revisionMapFromCommitSet): Added.
1124 (CustomAnalysisTaskConfigurator.prototype.render): Update the currently selected platforms and tests now that
1125 they can be set externally via selectTests and selectPlatform.
1126 (CustomAnalysisTaskConfigurator.prototype._renderTriggerableTests): Return the result of _renderRadioButtonList
1127 so that the caller can update the currently selected tests without having to reconstruct the list.
1128 (CustomAnalysisTaskConfigurator.prototype._renderTriggerablePlatforms): Ditto.
1129 (CustomAnalysisTaskConfigurator.prototype._renderRadioButtonList): Renamed from _buildCheckboxList. Now returns
1130 a function which updates the currently selected items. We still pretend that multiple items can be selected to
1131 make it future-proof.
1133 * public/v3/components/custom-configuration-test-group-form.js: Added.
1134 (CustomConfigurationTestGroupForm): Added. Inherits from TestGroupForm. Extracted from CreateAnalysisTaskPage.
1135 (CustomConfigurationTestGroupForm.prototype.setHasTask): Added.
1136 (CustomConfigurationTestGroupForm.prototype.hasCommitSets): Added.
1137 (CustomConfigurationTestGroupForm.prototype.setConfigurations): Added. Used by AnalysisTaskConfiguratorPane to
1138 set the default configuration to what the latest test group used.
1139 (CustomConfigurationTestGroupForm.prototype.startTesting): Added. Dispatches "startTesting" action with
1140 platform, test, taskName in addition to what CustomizedTestGroupForm emits.
1141 (CustomConfigurationTestGroupForm.prototype.didConstructShadowTree): Added.
1142 (CustomConfigurationTestGroupForm.prototype.render): Added.
1143 (CustomConfigurationTestGroupForm.prototype._updateTestGroupName): Added.
1144 (CustomConfigurationTestGroupForm.cssTemplate): Added.
1145 (CustomConfigurationTestGroupForm.htmlTemplate): Added.
1147 * public/v3/components/test-group-form.js:
1148 (TestGroupForm.cssTemplate): Make the form display: block.
1150 * public/v3/index.html:
1152 * public/v3/models/test-group.js:
1153 (TestGroup.prototype.test): Added.
1154 (TestGroup.prototype.platform): Added.
1155 (TestGroup.createWithCustomConfiguration): Added. Creates a custom test group with an existing analysis task.
1157 * public/v3/models/uploaded-file.js:
1158 (UploadedFile): Fixed a bug that _deletedAt was set to a Date object even when object.deletedAt is null.
1160 * public/v3/pages/analysis-task-page.js:
1161 (AnalysisTaskConfiguratorPane): Added.
1162 (AnalysisTaskConfiguratorPane.prototype.didConstructShadowTree): Added. Dispatch createCustomTestGroup action
1163 in turn when receiving startTesting from CustomConfigurationTestGroupForm.
1164 (AnalysisTaskConfiguratorPane.prototype.setTestGroups): Added.
1165 (AnalysisTaskConfiguratorPane.prototype.render): Added.
1166 (AnalysisTaskConfiguratorPane.htmlTemplate): Added. We override this instead of formContent to display the
1167 "Start" button at the end instead of at the beginnning.
1168 (AnalysisTaskConfiguratorPane.cssTemplate): Added.
1169 (AnalysisTaskPage.prototype.didConstructShadowTree): Listen to createCustomTestGroup.
1170 (AnalysisTaskPage.prototype.render): Hide AnalysisTaskConfiguratorPane when the analysis task is not custom.
1171 (AnalysisTaskPage.prototype._showTestGroup): Let AnalysisTaskConfiguratorPane know of the current test group
1172 so that it can update the default configuration if the user hasn't modified yet.
1173 (AnalysisTaskPage.prototype._createCustomTestGroup): Added.
1175 * public/v3/pages/create-analysis-task-page.js:
1176 (CreateAnalysisTaskPage.prototype.didConstructShadowTree):
1177 (CreateAnalysisTaskPage.prototype._createAnalysisTaskWithGroup):
1178 (CreateAnalysisTaskPage.prototype.render):
1179 (CreateAnalysisTaskPage.prototype._renderMessage):
1180 (CreateAnalysisTaskPage.htmlTemplate):
1181 (CreateAnalysisTaskPage.cssTemplate):
1183 * server-tests/privileged-api-create-test-group-tests.js: Added a test case for creating a custom test group for
1184 an existing analysis task.
1186 * server-tests/resources/mock-data.js:
1187 (MockData.otherPlatformId): Added.
1188 (MockData.addMockData): Added a test configuration for otherPlatformId.
1190 2017-04-21 Ryosuke Niwa <rniwa@webkit.org>
1192 Make it possible to view results for sub tests and metrics in A/B testing
1193 https://bugs.webkit.org/show_bug.cgi?id=170975
1195 Reviewed by Chris Dumez.
1197 Replaced TestGroupResultsTable, which was a single table that presented the test results with a set of revisions
1198 each build request used, with TestGroupResultsViewer and TestGroupRevisionTable. TestGroupResultsViewer provides
1199 an UI to look the results of sub-tests and sub-metrics and TestGroupRevisionTable provides an UI to display
1200 the set of revisions each build request used. TestGroupRevisionTable can also show the list of custom roots now
1201 that we've added UI to schedule an analysis task with a custom test group.
1203 This patch extends BarGraphGroup to show multiple bars per SingleBarGraph using a canvas with bars indicating
1204 their mean and confidence interval.
1206 * browser-tests/index.html:
1207 (ChartTest.importChartScripts): Include lazily-evaluated-function.js now that Test model object uses
1208 LazilyEvaluatedFunction.
1210 * public/v3/components/analysis-results-viewer.js:
1211 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForCommitSet):
1212 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
1214 * public/v3/components/bar-graph-group.js:
1215 (BarGraphGroup): No longer takes formatter. Added _computeRangeLazily and _showLabels as instance variables.
1216 (BarGraphGroup.prototype.addBar): Now takes a list of values, their labels, mean, confidence interval, and
1217 the colors of bar graphs shown for each value and the mean indicator.
1218 (BarGraphGroup.prototype.showLabels): Added.
1219 (BarGraphGroup.prototype.setShowLabels): Added.
1220 (BarGraphGroup.prototype.range): Added.
1221 (BarGraphGroup.prototype._computeRange): Renamed from updateGroupRendering. Now returns the range instead off
1222 setting it to each bar, and each SingleBarGraph's render function uses the value via BarGraphGroup's range.
1223 (BarGraph): Renamed from SingleBarGraph. Added various arguments introduced in addBar, and now stores various
1224 lazily evaluated functions used for rendering.
1225 (BarGraph.prototype.render): Rewritten to use canvas to draw bar graphs and show a label when group's
1226 showLabels() returns true.
1227 (BarGraph.prototype._resizeCanvas): Added.
1228 (BarGraph.prototype._renderCanvas): Added.
1229 (BarGraph.prototype._renderLabels): Added. We align the top of each label to the middle of each bar and shift it
1230 back up by half the height of the label (0.4rem) using margin-top in css.
1231 (BarGraph.htmlTemplate): Uses a canvas now.
1232 (BarGraph.cssTemplate):
1234 * public/v3/components/results-table.js:
1235 (ResultsTable.prototype.renderTable): Updated per code changes to BarGraphGroup.
1236 (ResultsTableRow.prototype.resultContent): Ditto.
1238 * public/v3/components/test-group-results-table.js: Removed.
1239 * public/v3/components/test-group-results-viewer.js: Added.
1240 (TestGroupResultsViewer): Added. Shows a list of test results with bar graphs with mean and confidence interval
1241 indicators. The results of sub tests and metrics can be expanded via "(Breakdown)" link shown below each test.
1242 (TestGroupResultsViewer.prototype.setTestGroup): Added.
1243 (TestGroupResultsViewer.prototype.setAnalysisResults): Added.
1244 (TestGroupResultsViewer.prototype.render): Added.
1245 (TestGroupResultsViewer.prototype._renderResultsTable): Compute the depth of the test tree we show, and construct
1246 the header rows. Each sub test is "indented" by a new column.
1247 (TestGroupResultsViewer.prototype._buildRowForTest): Added. Build rows for metrics of the given test. Expand the
1248 list of its child tests if it's in expandedTests. Otherwise add a link to "Breakdown" if it has any child tests.
1249 (TestGroupResultsViewer.prototype._buildRowForMetric): Added. Builds rows of table cells to show the results for
1250 the given metric for each configuration.
1251 (TestGroupResultsViewer.prototype._buildRowForMetric.createConfigurationRow): Added. A helper to build cells for
1252 a given configuration represented by a requested commit set.
1253 (TestGroupResultsViewer.prototype._buildValueMap): Added. Creates a mappting between a requested commit set, and
1254 the list of values, mean, etc... associated with the results for the commit set.
1255 (TestGroupResultsViewer.prototype._buildEmptyCells): Added. A helper to create empty cells to indent sub tests.
1256 (TestGroupResultsViewer.prototype._expandCurrentMetrics): Added. Highlights the current metrics and renders the
1257 label for each bar in the results.
1258 (TestGroupResultsViewer.htmlTemplate): Added.
1259 (TestGroupResultsViewer.cssTemplate): Added.
1261 * public/v3/components/test-group-revision-table.js: Added.
1262 (TestGroupRevisionTable): Added. Renders the list of revisions requested for each test configuration as well as
1263 ones used in actual testing, and additional repositories being reported (e.g. repositories for helper scripts).
1264 (TestGroupRevisionTable.prototype.setTestGroup): Added.
1265 (TestGroupRevisionTable.prototype.setAnalysisResults): Added.
1266 (TestGroupRevisionTable.prototype.render): Added.
1267 (TestGroupRevisionTable.prototype._renderTable): Added. The basic algorithm here is to first create a row entry
1268 object for each build request, merge cells that use the same revision of the same repository, and then render
1270 (TestGroupRevisionTable.prototype._buildCommitCell): Added.
1271 (TestGroupRevisionTable.prototype._buildCustomRootsCell): Added.
1272 (TestGroupRevisionTable.prototype._mergeCellsWithSameCommitsAcrossRows): Added. Compute rowspan for each cell
1273 by traversing the rows that use the same revision per repository, and store it in rowCountByRepository while
1274 adding the repository to each succeeding row's repositoriesToSkip.
1275 (TestGroupRevisionTable.htmlTemplate): Added.
1276 (TestGroupRevisionTable.cssTemplate): Added.
1278 * public/v3/index.html:
1279 * public/v3/models/analysis-results.js:
1280 (AnalysisResults): Added _metricIds and _lazilyComputedHighestTests as instance variables.
1281 (AnalysisResults.prototype.findResult): Renamed from find.
1282 (AnalysisResults.prototype.highestTests): Added.
1283 (AnalysisResults.prototype._computeHighestTests): Added. Finds the root tests for this analysis result.
1284 (AnalysisResults.prototype.add): Update _metricIds.
1285 (AnalysisResults.prototype.commitSetForRequest): Added. Returns the reported commit set for the build request.
1286 This commit set contains the set of revisions reported to /api/report by A/B testers.
1287 (AnalysisResultsView.prototype.resultForRequest): Renamed from resultForBuildId.
1289 * public/v3/models/metric.js:
1290 (Metric.prototype.relativeName): Added. Computes the relative name given the test/metric path. This function is
1291 used to determine the label for each test/metric in TestGroupResultsViewer.
1292 (Metric.prototype.aggregatorLabel): Extracted from label.
1293 (Metric.prototype.label):
1294 (Metric.makeFormatter): Added the default value of false to alwaysShowSign.
1296 * public/v3/models/test-group.js:
1297 (TestGroup.prototype.compareTestResults): Now takes a metric instead of retrieving it from the analysis task
1298 since a custom analysis task may not have a metric associated with it.
1300 * public/v3/models/test.js:
1301 (Test): Added _computePathLazily as an instance variable.
1302 (Test.prototype.path): Lazily computes the path now that this function can be called on the same test for many
1303 times in TestGroupResultsViewer while computing relative names of tests and metrics.
1304 (Test.prototype._computePath): Extracted path.
1305 (Test.prototype.fullName): Modernized the code.
1306 (Test.prototype.relativeName): Added.
1308 * public/v3/models/uploaded-file.js:
1310 (UploadedFile.prototype.deletedAt): Added.
1311 (UploadedFile.prototype.label): Added.
1312 (UploadedFile.prototype.url): Added.
1314 * public/v3/pages/analysis-task-page.js:
1315 (AnalysisTaskTestGroupPane.prototype.setTestGroups):
1316 (AnalysisTaskTestGroupPane.prototype.setAnalysisResults): Replaced setAnalysisResultsView. Now takes an
1317 analysisResults instead of its view.
1318 (AnalysisTaskTestGroupPane.prototype.render): No longer enqueues the results table and the retry form to render
1319 since the results table no longer exists, and the retry form re-renders itself as needed.
1320 (AnalysisTaskTestGroupPane.htmlTemplate): Now uses test-group-results-viewer and test-group-revision-table
1321 instead of test-group-results-table, which has been removed.
1322 (AnalysisTaskTestGroupPane.cssTemplate):
1323 (AnalysisTaskPage.prototype._assignTestResultsIfPossible):
1325 * public/v3/pages/create-analysis-task-page.js:
1326 (CreateAnalysisTaskPage.prototype._createAnalysisTaskWithGroup): Removed superflous console.log's.
1328 * tools/js/v3-models.js: Import LazilyEvaluatedFunction now that it's used in the Test model.
1330 * unit-tests/test-model-tests.js: Added.
1332 2017-04-19 Ryosuke Niwa <rniwa@webkit.org>
1334 Another build fix after r215061. Clear TriggerableRepositoryGroup's static map in each iteration.
1336 * tools/sync-buildbot.js:
1339 2017-04-18 Ryosuke Niwa <rniwa@webkit.org>
1341 Build fix after r215061.
1343 There was a mismatch between the format updateTriggerable and /api/update-triggerable were using.
1344 Namely, each repository group was assumed to contain a name field in /api/update-triggerable
1345 but updateTriggerable was not including that at all.
1347 We didn't catch this because the test for updateTriggerable also used the wrong format :(
1349 * server-tests/tools-buildbot-triggerable-tests.js:
1350 * tools/js/buildbot-triggerable.js:
1351 (BuildbotTriggerable.prototype.updateTriggerable):
1353 2017-04-14 Dewei Zhu <dewei_zhu@apple.com>
1355 Add sub-commit UI in commit log viewer.
1356 https://bugs.webkit.org/show_bug.cgi?id=170379
1358 Reviewed by Ryosuke Niwa.
1360 Add an API to return sub-commits for a given commit.
1361 Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits.
1362 Add 'ownsSubCommits' info in 'api/commits' return values.
1363 Extend 'api/manifest' to include whether a repositories owns other repositories.
1364 Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits.
1365 Add unit tests for those new features.
1367 * browser-tests/commit-log-viewer-tests.js: Updated test cases.
1368 * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit.
1369 * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits.
1370 * public/v3/components/expand-collapse-button.js: Added.
1371 (ExpandCollapseButton):
1372 (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event.
1373 (ExpandCollapseButton.sizeFactor):
1374 (ExpandCollapseButton.buttonContent):
1375 (ExpandCollapseButton.cssTemplate):
1376 * public/v3/components/commit-log-viewer.js:
1377 (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits.
1378 (CommitLogViewer.cssTemplate):
1379 * public/v3/components/sub-commit-viewer.js: Added.
1380 (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.`
1381 (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event.
1382 (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked.
1383 (SubCommitViewer.prototype.render): Render sub-commit view based on the state.
1384 (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries.
1385 (SubCommitViewer.htmlTemplate):
1386 (SubCommitViewer.cssTemplate):
1387 * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'.
1388 * public/v3/models/commit-log.js:
1389 (CommitLog): Added '_subCommits'.
1390 (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well.
1391 (CommitLog.prototype.ownsSubCommits):
1392 (CommitLog.prototype.subCommits): Added. Returns sub-commits.
1393 (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before.
1394 (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits.
1395 (CommitLog.diffSubCommits): Added. Finds difference between two given commits.
1396 (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change.
1397 (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change.
1398 (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'.
1399 * public/v3/models/repository.js:
1401 (Repository.prototype.owner): Returns the owner id.
1402 (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository.
1403 * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter.
1404 * server-tests/api-manifest-tests.js: Added a test.
1405 * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'.
1406 * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'.
1408 2017-04-11 Ryosuke Niwa <rniwa@webkit.org>
1410 Retrying an A/B testing does not set the repetition count in some cases
1411 https://bugs.webkit.org/show_bug.cgi?id=170695
1413 Reviewed by Joseph Pecoraro.
1415 When selecting an existing A/B test group, the analysis task page automatically sets the repetition count
1416 of its retry to be that of the original test group. However, this information wasn't being passed correctly
1417 to the code that actually created a test group. As a result, the retried test group's repetition count does
1418 not match that of the original group or the number shown to the user on UI.
1420 Fixed the bug by updating this._repetitionCount in setRepetitionCount.
1422 * browser-tests/index.html:
1423 * browser-tests/test-group-form-tests.js: Added. Added tests.
1424 (.createTestGroupFormWithContext): Added.
1425 * public/v3/components/test-group-form.js:
1426 (TestGroupForm.prototype.setRepetitionCount):
1427 (TestGroupForm.formContent):
1430 2017-04-10 Ryosuke Niwa <rniwa@webkit.org>
1432 Add the UI for scheduling a A/B testing with a custom root
1433 https://bugs.webkit.org/show_bug.cgi?id=170622
1435 Reviewed by Anders Carlsson.
1437 This patch adds the support for creating a new analysis task with a custom darwinup roots. A follow up patch
1438 would update the syncing script to schedule such an A/B testing job to a buildbot instance.
1441 * ReadMe.md: Updated instructions for backing up and restoring the database so that it's easier to replace
1442 the file path for the backup.
1444 * init-database.sql: Make task_platform and task_metric optional in each analysis task. Also added a column
1445 to store the root file in commit_set_relationships.
1447 * public/api/build-requests.php:
1448 (main): Include the uploaded files.
1450 * public/api/commits.php:
1451 (main): Added the support for querying the latest commits for a given platform. This is used in a new page
1452 to create a custom analysis task to autofill the latest revisions for a given platform.
1454 * public/api/test-groups.php:
1455 (main): Include the uploaded files.
1457 * public/include/build-requests-fetcher.php:
1458 (BuildRequestsFetcher::__construct): Added a list of uploaded_files and a map from its id.
1459 (BuildRequestsFetcher::uploaded_files): Added.
1460 (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Added the support for including custom roots' id in
1461 each commit set, and inserting its meta data in the list of uplaoded files.
1463 * public/include/commit-log-fetcher.php:
1464 (CommitLogFetcher::fetch_latest_for_platform): Added. Finds the latest commit for a given platform. Ideally,
1465 we should be finding the latest commit for a given platform, but this is very slow so instead find the commit
1466 of the latest build for a given platform.
1468 * public/privileged-api/create-test-group.php:
1469 (main): Added the support for creating an analysis task along with a group.
1470 (commit_sets_from_revision_sets): Added the support for custom roots. Verify the specified uploaded file exists
1471 and include it in commit_set_relationships. Because commits and upload files are stored in a different column
1472 in commit_set_relationships, this function now stores the information for each row of commit_set_relationships
1473 except the commit set ID, which is unknown until the set is created, instead of a commit ID.
1474 (ensure_commit_sets): Made the each entry in a commit set a row instead of a commit ID as done. As this format
1475 is only by v2 UI and detect-changes.js, we don't add the support for specifying custom roots here.
1477 * public/privileged-api/upload-file.php:
1478 (main): Fixed a typo. Also added one more error check.
1480 * public/v3/components/custom-analysis-task-configurator.js: Added. The UI for selecting a test, a platform,
1481 and a set of revisions, as well as custom roots for a custom A/B testing job. The first set of revision with
1482 custom roots is referred as "baseline", and the second configuration is referred as "comparison" in this class.
1483 (CustomAnalysisTaskConfigurator):
1484 (CustomAnalysisTaskConfigurator.prototype.tests): Added.
1485 (CustomAnalysisTaskConfigurator.prototype.platform): Added.
1486 (CustomAnalysisTaskConfigurator.prototype.commitSets): Added. Returns a pair of baseline and comparsion if both
1487 have been configured by the user.
1488 (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): Added.
1489 (CustomAnalysisTaskConfigurator.prototype._configureComparison): Added. Called when the user is to configu the
1490 "comparison" configuration.
1491 (CustomAnalysisTaskConfigurator.prototype.render): Added.
1492 (CustomAnalysisTaskConfigurator.prototype._renderTriggerableTests): Added. Renders the list of top-level tests
1493 that can be scheduled by a triggerable.
1494 (CustomAnalysisTaskConfigurator.prototype._renderTriggerablePlatforms): Added. Renders the list of platforms
1495 that can be schedule with the currently selected list of tests by a triggerable. Note that the current UI only
1496 lets the user select a single test but the intent is to allow multiple tests to be selected in the near future.
1497 (CustomAnalysisTaskConfigurator.prototype._buildCheckboxList): Added. Creates a list of radio boxes to select
1498 an item with a callback for each. It automatically sets "selected" class on the selected item. It's used to
1499 render both the list of tests and platforms.
1500 (CustomAnalysisTaskConfigurator.prototype._updateTriggerable): Added. Finds the triggerable for a given list of
1501 tests and platforms. Returns an error when some tests belong to another triggearalbe.
1502 (CustomAnalysisTaskConfigurator.prototype._updateRepositoryGroups): Added. Finds a repository group to use when
1503 the current triggerable has changed. We try to use the repository group of the same name if there is any, and
1504 defaults to the first repository group if there is none. This allows the set of repositories to be specified to
1505 more or less persist across different triggerables. For example, if iOS platforms and Mac platforms use two
1506 distinct triggerables , and both triggerables have two repository groups: one that only specify the OS and the
1507 other that specifies both teh OS and WebKit revision, then this code allows the choice the user had made to
1508 specify either just the OS or the OS and WebKit will be preserved when the user switches from an iOS platform
1510 (CustomAnalysisTaskConfigurator.prototype._updateCommitSetMap): Added. Create a commit set map, the format that
1511 TestGroup.createWithTask accepts given "baseline" and "comparison" commit sets. Pretend "comparison" is not set
1512 if two sets are identical since it makes no sense to schedule an A/B testing job when A and B are identical.
1513 (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Added. Creates a commit set using the revisions
1514 and the csutom roots the user had specified.
1515 (CustomAnalysisTaskConfigurator.prototype._renderRepositoryPanes): Added. Renders the pane to specify revisions
1516 and custom roots for "baseline" and "comparison".
1517 (CustomAnalysisTaskConfigurator.prototype._renderBaselineRevisionTable): Added.
1518 (CustomAnalysisTaskConfigurator.prototype._renderComparisonRevisionTable): Added.
1519 (CustomAnalysisTaskConfigurator.prototype._optionalRepositoryList): Added.
1520 (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Added. Creates a table for specifying revisions
1521 and custom roots along with a list of repository groups to pick. The set of repositories and custom roots are
1522 shown at the all if all repository groups require them. Otherwise, they are grouped at the bottom as optional.
1523 (CustomAnalysisTaskConfigurator.prototype._buildRepositoryGroupList): Added.
1524 (CustomAnalysisTaskConfigurator.prototype._selectRepositoryGroup): Added.
1525 (CustomAnalysisTaskConfigurator.prototype._buildRevisionInput): Added. Creates an input element to specify
1526 a revision for a given repository. Autofills it with the latest commit for the currently selected platform if
1527 the user had not modified the field by the time the revisions are fetched.
1528 (CustomAnalysisTaskConfigurator.htmlTemplate): Added.
1529 (CustomAnalysisTaskConfigurator.cssTemplate): Added.
1531 * public/v3/components/instant-file-uploader.js: Added. A form to upload a custom darwinup root in "baseline"
1532 or "comparison" configurations of CustomAnalysisTaskConfigurator. It's "instant" because it auto-detects when a
1533 file to be uploaded had already been uploaded elsewhere by checking its SHA-256 hash.
1534 (InstantFileUploader):
1535 (InstantFileUploader.prototype.hasFileToUpload): Added.
1536 (InstantFileUploader.prototype.uploadedFiles): Added.
1537 (InstantFileUploader.prototype.addUploadedFile): Added. It's called on the uploader for "comparison"
1538 configuration when the uploader for "baseline" configuration dipsatches "uploadedFile" action to automatically
1539 mirror the newly uploaded custom root to "comparision" configuration.
1540 (InstantFileUploader.prototype.didConstructShadowTree): Added.
1541 (InstantFileUploader.prototype.render): Added.
1542 (InstantFileUploader.prototype._renderUploadedFiles): Added. Renders the list of the uploaded files.
1543 (InstantFileUploader.prototype._renderPreuploadFiles): Added. Renders the list of the files to be uploaded with
1545 (InstantFileUploader.prototype._updateUploadStatus): Added. Updates the progress bar for uploading the file.
1546 (InstantFileUploader.prototype._formatUploadError): Added.
1547 (InstantFileUploader.prototype._didFileInputChange): Added. Called when the user picks a file to uploaded on
1548 the input element. Fetch the meta data for the uploaded file with the same SHA-256 hash if there is any, and
1549 start uploading the file if there isn't one.
1550 (InstantFileUploader.prototype._removeUploadedFile): Added.
1551 (InstantFileUploader.prototype._didUploadFile): Added. Move a file from the list of files to be uploaded to
1552 the list of uploaded files.
1553 (InstantFileUploader.htmlTemplate): Added.
1554 (InstantFileUploader.cssTemplate): Added.
1556 * public/v3/index.html:
1558 * public/v3/models/analysis-task.js:
1559 (AnalysisTask): Made platform and metric optional as it is now.
1560 (AnalysisTask.findByPlatformAndMetric): Skip analysis tasks without a platform or a metric.
1561 (AnalysisTask.prototype.isCustom): Added. Returns true for a custom analysis task.
1562 (AnalysisTask.fetchRelatedTasks): Skip custom analysis tasks.
1563 (AnalysisTask._constructAnalysisTasksFromRawData): Construct analysis tasks even if they were missing a metric
1564 or a platform instead of silently skipping them.
1566 * public/v3/models/build-request.js:
1567 (BuildRequest.constructBuildRequestsFromData): Construct uploaded file objects returned by /api/build-requests.
1569 * public/v3/models/commit-log.js:
1570 (CommitLog.fetchLatestCommitForPlatform): Added.
1572 * public/v3/models/commit-set.js:
1573 (CommitSet): Added this._customRoots.
1574 (CommitSet.prototype.customRoots): Returns this._customRoots.
1575 (CommitSet.prototype.equals): Returns false when the set of custom roots are not equal.
1576 (CommitSet.areCustomRootsEqual): Added.
1578 (CustomCommitSet.prototype.equals): Added.
1579 (CustomCommitSet.prototype.customRoots): Added.
1580 (CustomCommitSet.prototype.addCustomRoot): Added.
1582 * public/v3/models/manifest.js:
1583 (Manifest._didFetchManifest): Store fileUploadSizeLimit in the manifest as UploadedFile.fileUploadSizeLimit.
1584 This allows a file size check in the client size instead of uploading it to the server and receiving an error.
1586 * public/v3/models/metric.js:
1587 (Metric.formatTime): Moved from ChartPaneStatusView to be also used by InstantFileUploader._renderUploadedFiles.
1589 * public/v3/models/test-group.js:
1590 (TestGroup.prototype.createWithTask): Added.
1591 (TestGroup.prototype.createAndRefetchTestGroups):
1592 (TestGroup.prototype._revisionSetsFromCommitSets): Added. Extracted from createAndRefetchTestGroups.
1593 (TestGroup.prototype._fetchTestGroupsForTask): Added. Extracted from createAndRefetchTestGroups.
1595 * public/v3/models/triggerable.js:
1596 (Triggerable.triggerablePlatformsForTests): Added.
1597 (Triggerable.sortByNamePreferringSmallerRepositories): Added.
1599 * public/v3/models/uploaded-file.js:
1600 (UploadedFile.prototype.createdAt): Added.
1601 (UploadedFile.prototype.filename): Added.
1602 (UploadedFile.prototype.author): Added.
1603 (UploadedFile.prototype.size): Added.
1604 (UploadedFile.uploadFile): Added a client-side check for the file size using UploadedFile.fileUploadSizeLimit.
1605 (UploadedFile.fetchUnloadedFileWithIdenticalHash): Ditto. Also fixed a bug that 404 was resulting in a rejected
1606 promise instead of a resolved promise with null.
1608 * public/v3/pages/analysis-category-page.js:
1609 (AnalysisCategoryPage.prototype._reconstructTaskList): Modernized the code. Added the support for platform and
1610 metric being null for some analysis tasks.
1612 * public/v3/pages/analysis-task-page.js:
1613 (AnalysisTaskPage.prototype._didFetchTask): Don't fetch the measurement set or create a chart for custom tasks.
1614 (AnalysisTaskPage.prototype.render): Don't display the charts or the stacking table for custom tasks.
1615 (AnalysisTaskPage.prototype._renderTaskNameAndStatus): Don't try to show the full test name for custom tasks
1616 since it's not associated with exactly one pair.
1618 * public/v3/pages/chart-pane-status-view.js:
1619 (ChartPaneStatusView.prototype._renderBuildRevisionTable):
1620 (ChartPaneStatusView.prototype._formatTime): Moved to Metric.formatTime.
1622 * public/v3/pages/chart-pane.js:
1623 (ChartPane.prototype._analyzeRange): Set inProgress to true to hide CustomAnalysisTaskConfigurator in
1624 CreateAnalysisTaskPage when creating a non-custom analysis task for a specific range.
1626 * public/v3/pages/create-analysis-task-page.js:
1627 (CreateAnalysisTaskPage): This page now shows CustomAnalysisTaskConfigurator by default, and lets a user create
1628 a custom analysis task by picking a test, a platform, and a set of revisions and custom darwinup roots.
1629 (CreateAnalysisTaskPage.prototype.updateFromSerializedState): Show a message when inProgress is set. This is
1630 the old behavior of this page.
1631 (CreateAnalysisTaskPage.prototype.didConstructShadowTree): Added.
1632 (CreateAnalysisTaskPage.prototype._createAnalysisTaskWithGroup): Added.
1633 (CreateAnalysisTaskPage.prototype.render):
1634 (CreateAnalysisTaskPage.prototype._renderMessage): Added. Hides CustomAnalysisTaskConfigurator and the select
1635 element to specify the numebr of iterations when a message is set.
1636 (CreateAnalysisTaskPage.htmlTemplate):
1637 (CreateAnalysisTaskPage.cssTemplate):
1639 * public/v3/pages/page-router.js:
1640 (PageRouter.prototype.route): Always enqueue the page to re-render when the route has changed.
1642 * server-tests/api-build-requests-tests.js: Updated test cases now that the response contains a list of
1643 uploaded files associated with build requests.
1645 * server-tests/privileged-api-create-test-group-tests.js: Added test cases for creating a custom analysis task
1646 and a test group with custom roots.
1648 * server-tests/resources/mock-data.js:
1649 (MockData.addMockData): Updated the mock data to satisfy new constraint on analysis-tasks table.
1651 * tools/js/remote.js: Include global.FormData from form-data.js.
1653 * unit-tests/build-request-tests.js:
1654 (sampleBuildRequestData): Updated the mock response.
1655 * unit-tests/buildbot-syncer-tests.js:
1656 (createSampleBuildRequest): Ditto.
1657 * unit-tests/test-groups-tests.js:
1658 (sampleTestGroup): Ditto.
1660 2017-04-10 Commit Queue <commit-queue@webkit.org>
1662 Unreviewed, rolling out r215202.
1663 https://bugs.webkit.org/show_bug.cgi?id=170694
1665 Committed incorrectly (Requested by rniwa on #webkit).
1669 "Add the UI for scheduling a A/B testing with a custom root"
1670 https://bugs.webkit.org/show_bug.cgi?id=170622
1671 http://trac.webkit.org/changeset/215202
1673 2017-04-10 Ryosuke Niwa <rniwa@webkit.org>
1675 Add the UI for scheduling a A/B testing with a custom root
1676 https://bugs.webkit.org/show_bug.cgi?id=170622
1678 Reviewed by Anders Carlsson.
1680 This patch adds the support for creating a new analysis task with a custom darwinup roots. A follow up patch
1681 would update the syncing script to schedule such an A/B testing job to a buildbot instance.
1684 * ReadMe.md: Updated instructions for backing up and restoring the database so that it's easier to replace
1685 the file path for the backup.
1687 * init-database.sql: Make task_platform and task_metric optional in each analysis task. Also added a column
1688 to store the root file in commit_set_relationships.
1690 * public/api/build-requests.php:
1691 (main): Include the uploaded files.
1693 * public/api/commits.php:
1694 (main): Added the support for querying the latest commits for a given platform. This is used in a new page
1695 to create a custom analysis task to autofill the latest revisions for a given platform.
1697 * public/api/test-groups.php:
1698 (main): Include the uploaded files.
1700 * public/include/build-requests-fetcher.php:
1701 (BuildRequestsFetcher::__construct): Added a list of uploaded_files and a map from its id.
1702 (BuildRequestsFetcher::uploaded_files): Added.
1703 (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Added the support for including custom roots' id in
1704 each commit set, and inserting its meta data in the list of uplaoded files.
1706 * public/include/commit-log-fetcher.php:
1707 (CommitLogFetcher::fetch_latest_for_platform): Added. Finds the latest commit for a given platform. Ideally,
1708 we should be finding the latest commit for a given platform, but this is very slow so instead find the commit
1709 of the latest build for a given platform.
1711 * public/privileged-api/create-test-group.php:
1712 (main): Added the support for creating an analysis task along with a group.
1713 (commit_sets_from_revision_sets): Added the support for custom roots. Verify the specified uploaded file exists
1714 and include it in commit_set_relationships. Because commits and upload files are stored in a different column
1715 in commit_set_relationships, this function now stores the information for each row of commit_set_relationships
1716 except the commit set ID, which is unknown until the set is created, instead of a commit ID.
1717 (ensure_commit_sets): Made the each entry in a commit set a row instead of a commit ID as done. As this format
1718 is only by v2 UI and detect-changes.js, we don't add the support for specifying custom roots here.
1720 * public/privileged-api/upload-file.php:
1721 (main): Fixed a typo. Also added one more error check.
1723 * public/v3/components/custom-analysis-task-configurator.js: Added. The UI for selecting a test, a platform,
1724 and a set of revisions, as well as custom roots for a custom A/B testing job. The first set of revision with
1725 custom roots is referred as "baseline", and the second configuration is referred as "comparison" in this class.
1726 (CustomAnalysisTaskConfigurator):
1727 (CustomAnalysisTaskConfigurator.prototype.tests): Added.
1728 (CustomAnalysisTaskConfigurator.prototype.platform): Added.
1729 (CustomAnalysisTaskConfigurator.prototype.commitSets): Added. Returns a pair of baseline and comparsion if both
1730 have been configured by the user.
1731 (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): Added.
1732 (CustomAnalysisTaskConfigurator.prototype._configureComparison): Added. Called when the user is to configu the
1733 "comparison" configuration.
1734 (CustomAnalysisTaskConfigurator.prototype.render): Added.
1735 (CustomAnalysisTaskConfigurator.prototype._renderTriggerableTests): Added. Renders the list of top-level tests
1736 that can be scheduled by a triggerable.
1737 (CustomAnalysisTaskConfigurator.prototype._renderTriggerablePlatforms): Added. Renders the list of platforms
1738 that can be schedule with the currently selected list of tests by a triggerable. Note that the current UI only
1739 lets the user select a single test but the intent is to allow multiple tests to be selected in the near future.
1740 (CustomAnalysisTaskConfigurator.prototype._buildCheckboxList): Added. Creates a list of radio boxes to select
1741 an item with a callback for each. It automatically sets "selected" class on the selected item. It's used to
1742 render both the list of tests and platforms.
1743 (CustomAnalysisTaskConfigurator.prototype._updateTriggerable): Added. Finds the triggerable for a given list of
1744 tests and platforms. Returns an error when some tests belong to another triggearalbe.
1745 (CustomAnalysisTaskConfigurator.prototype._updateRepositoryGroups): Added. Finds a repository group to use when
1746 the current triggerable has changed. We try to use the repository group of the same name if there is any, and
1747 defaults to the first repository group if there is none. This allows the set of repositories to be specified to
1748 more or less persist across different triggerables. For example, if iOS platforms and Mac platforms use two
1749 distinct triggerables , and both triggerables have two repository groups: one that only specify the OS and the
1750 other that specifies both teh OS and WebKit revision, then this code allows the choice the user had made to
1751 specify either just the OS or the OS and WebKit will be preserved when the user switches from an iOS platform
1753 (CustomAnalysisTaskConfigurator.prototype._updateCommitSetMap): Added. Create a commit set map, the format that
1754 TestGroup.createWithTask accepts given "baseline" and "comparison" commit sets. Pretend "comparison" is not set
1755 if two sets are identical since it makes no sense to schedule an A/B testing job when A and B are identical.
1756 (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Added. Creates a commit set using the revisions
1757 and the csutom roots the user had specified.
1758 (CustomAnalysisTaskConfigurator.prototype._renderRepositoryPanes): Added. Renders the pane to specify revisions
1759 and custom roots for "baseline" and "comparison".
1760 (CustomAnalysisTaskConfigurator.prototype._renderBaselineRevisionTable): Added.
1761 (CustomAnalysisTaskConfigurator.prototype._renderComparisonRevisionTable): Added.
1762 (CustomAnalysisTaskConfigurator.prototype._optionalRepositoryList): Added.
1763 (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Added. Creates a table for specifying revisions
1764 and custom roots along with a list of repository groups to pick. The set of repositories and custom roots are
1765 shown at the all if all repository groups require them. Otherwise, they are grouped at the bottom as optional.
1766 (CustomAnalysisTaskConfigurator.prototype._buildRepositoryGroupList): Added.
1767 (CustomAnalysisTaskConfigurator.prototype._selectRepositoryGroup): Added.
1768 (CustomAnalysisTaskConfigurator.prototype._buildRevisionInput): Added. Creates an input element to specify
1769 a revision for a given repository. Autofills it with the latest commit for the currently selected platform if
1770 the user had not modified the field by the time the revisions are fetched.
1771 (CustomAnalysisTaskConfigurator.htmlTemplate): Added.
1772 (CustomAnalysisTaskConfigurator.cssTemplate): Added.
1774 * public/v3/components/instant-file-uploader.js: Added. A form to upload a custom darwinup root in "baseline"
1775 or "comparison" configurations of CustomAnalysisTaskConfigurator. It's "instant" because it auto-detects when a
1776 file to be uploaded had already been uploaded elsewhere by checking its SHA-256 hash.
1777 (InstantFileUploader):
1778 (InstantFileUploader.prototype.hasFileToUpload): Added.
1779 (InstantFileUploader.prototype.uploadedFiles): Added.
1780 (InstantFileUploader.prototype.addUploadedFile): Added. It's called on the uploader for "comparison"
1781 configuration when the uploader for "baseline" configuration dipsatches "uploadedFile" action to automatically
1782 mirror the newly uploaded custom root to "comparision" configuration.
1783 (InstantFileUploader.prototype.didConstructShadowTree): Added.
1784 (InstantFileUploader.prototype.render): Added.
1785 (InstantFileUploader.prototype._renderUploadedFiles): Added. Renders the list of the uploaded files.
1786 (InstantFileUploader.prototype._renderPreuploadFiles): Added. Renders the list of the files to be uploaded with
1788 (InstantFileUploader.prototype._updateUploadStatus): Added. Updates the progress bar for uploading the file.
1789 (InstantFileUploader.prototype._formatUploadError): Added.
1790 (InstantFileUploader.prototype._didFileInputChange): Added. Called when the user picks a file to uploaded on
1791 the input element. Fetch the meta data for the uploaded file with the same SHA-256 hash if there is any, and
1792 start uploading the file if there isn't one.
1793 (InstantFileUploader.prototype._removeUploadedFile): Added.
1794 (InstantFileUploader.prototype._didUploadFile): Added. Move a file from the list of files to be uploaded to
1795 the list of uploaded files.
1796 (InstantFileUploader.htmlTemplate): Added.
1797 (InstantFileUploader.cssTemplate): Added.
1799 * public/v3/index.html:
1801 * public/v3/models/analysis-task.js:
1802 (AnalysisTask): Made platform and metric optional as it is now.
1803 (AnalysisTask.findByPlatformAndMetric): Skip analysis tasks without a platform or a metric.
1804 (AnalysisTask.prototype.isCustom): Added. Returns true for a custom analysis task.
1805 (AnalysisTask.fetchRelatedTasks): Skip custom analysis tasks.
1806 (AnalysisTask._constructAnalysisTasksFromRawData): Construct analysis tasks even if they were missing a metric
1807 or a platform instead of silently skipping them.
1809 * public/v3/models/build-request.js:
1810 (BuildRequest.constructBuildRequestsFromData): Construct uploaded file objects returned by /api/build-requests.
1812 * public/v3/models/commit-log.js:
1813 (CommitLog.fetchLatestCommitForPlatform): Added.
1815 * public/v3/models/commit-set.js:
1816 (CommitSet): Added this._customRoots.
1817 (CommitSet.prototype.customRoots): Returns this._customRoots.
1818 (CommitSet.prototype.equals): Returns false when the set of custom roots are not equal.
1819 (CommitSet.areCustomRootsEqual): Added.
1821 (CustomCommitSet.prototype.equals): Added.
1822 (CustomCommitSet.prototype.customRoots): Added.
1823 (CustomCommitSet.prototype.addCustomRoot): Added.
1825 * public/v3/models/manifest.js:
1826 (Manifest._didFetchManifest): Store fileUploadSizeLimit in the manifest as UploadedFile.fileUploadSizeLimit.
1827 This allows a file size check in the client size instead of uploading it to the server and receiving an error.
1829 * public/v3/models/metric.js:
1830 (Metric.formatTime): Moved from ChartPaneStatusView to be also used by InstantFileUploader._renderUploadedFiles.
1832 * public/v3/models/test-group.js:
1833 (TestGroup.prototype.createWithTask): Added.
1834 (TestGroup.prototype.createAndRefetchTestGroups):
1835 (TestGroup.prototype._revisionSetsFromCommitSets): Added. Extracted from createAndRefetchTestGroups.
1836 (TestGroup.prototype._fetchTestGroupsForTask): Added. Extracted from createAndRefetchTestGroups.
1838 * public/v3/models/triggerable.js:
1839 (Triggerable.triggerablePlatformsForTests): Added.
1840 (Triggerable.sortByNamePreferringSmallerRepositories): Added.
1842 * public/v3/models/uploaded-file.js:
1843 (UploadedFile.prototype.createdAt): Added.
1844 (UploadedFile.prototype.filename): Added.
1845 (UploadedFile.prototype.author): Added.
1846 (UploadedFile.prototype.size): Added.
1847 (UploadedFile.uploadFile): Added a client-side check for the file size using UploadedFile.fileUploadSizeLimit.
1848 (UploadedFile.fetchUnloadedFileWithIdenticalHash): Ditto. Also fixed a bug that 404 was resulting in a rejected
1849 promise instead of a resolved promise with null.
1851 * public/v3/pages/analysis-category-page.js:
1852 (AnalysisCategoryPage.prototype._reconstructTaskList): Modernized the code. Added the support for platform and
1853 metric being null for some analysis tasks.
1855 * public/v3/pages/analysis-task-page.js:
1856 (AnalysisTaskPage.prototype._didFetchTask): Don't fetch the measurement set or create a chart for custom tasks.
1857 (AnalysisTaskPage.prototype.render): Don't display the charts or the stacking table for custom tasks.
1858 (AnalysisTaskPage.prototype._renderTaskNameAndStatus): Don't try to show the full test name for custom tasks
1859 since it's not associated with exactly one pair.
1861 * public/v3/pages/chart-pane-status-view.js:
1862 (ChartPaneStatusView.prototype._renderBuildRevisionTable):
1863 (ChartPaneStatusView.prototype._formatTime): Moved to Metric.formatTime.
1865 * public/v3/pages/chart-pane.js:
1866 (ChartPane.prototype._analyzeRange): Set inProgress to true to hide CustomAnalysisTaskConfigurator in
1867 CreateAnalysisTaskPage when creating a non-custom analysis task for a specific range.
1869 * public/v3/pages/create-analysis-task-page.js:
1870 (CreateAnalysisTaskPage): This page now shows CustomAnalysisTaskConfigurator by default, and lets a user create
1871 a custom analysis task by picking a test, a platform, and a set of revisions and custom darwinup roots.
1872 (CreateAnalysisTaskPage.prototype.updateFromSerializedState): Show a message when inProgress is set. This is
1873 the old behavior of this page.
1874 (CreateAnalysisTaskPage.prototype.didConstructShadowTree): Added.
1875 (CreateAnalysisTaskPage.prototype._createAnalysisTaskWithGroup): Added.
1876 (CreateAnalysisTaskPage.prototype.render):
1877 (CreateAnalysisTaskPage.prototype._renderMessage): Added. Hides CustomAnalysisTaskConfigurator and the select
1878 element to specify the numebr of iterations when a message is set.
1879 (CreateAnalysisTaskPage.htmlTemplate):
1880 (CreateAnalysisTaskPage.cssTemplate):
1882 * public/v3/pages/page-router.js:
1883 (PageRouter.prototype.route): Always enqueue the page to re-render when the route has changed.
1885 * server-tests/api-build-requests-tests.js: Updated test cases now that the response contains a list of
1886 uploaded files associated with build requests.
1887 *server-tests/api-commits-tests.js: Added a test case for /api/commits/<repository-name>/latest?platform=X.
1888 * server-tests/privileged-api-create-test-group-tests.js: Added test cases for creating a custom analysis task
1889 and a test group with custom roots.
1890 * server-tests/resources/mock-data.js:
1891 (MockData.addMockData): Updated the mock data to satisfy new constraint on analysis-tasks table. Also inserted
1892 more commits, builds, and build_commits rows for testing /api/commits/<repository-name>/latest?platform=X.
1894 * tools/js/remote.js: Include global.FormData from form-data.js.
1896 * unit-tests/analysis-task-tests.js: Added a test for calling findByPlatformAndMetric when there is a custom
1898 (sampleAnalysisTask): Removed the category since /api/analysis-tasks/ no longer generate this property.
1899 (sampleCustomAnalysisTask): Added.
1900 * unit-tests/build-request-tests.js:
1901 (sampleBuildRequestData): Updated the mock response. Added a test case for fetcing custom roots.
1902 * unit-tests/buildbot-syncer-tests.js:
1903 (createSampleBuildRequest): Ditto.
1904 * unit-tests/test-groups-tests.js:
1905 (sampleTestGroup): Ditto.
1907 2017-04-07 Ryosuke Niwa <rniwa@webkit.org>
1909 Make cycler page scroll down when a dashboard is too tall for the current viewport size
1910 https://bugs.webkit.org/show_bug.cgi?id=170588
1912 Rubber-stamped by Chris Dumez.
1914 Updated the cycler page to scroll down smoothly over 500ms and scroll up again before moving to the next page
1915 when a dashboard page is too tall to be shown at once. For now, we assume that each dashboard's height is no
1916 more than 2x the height of the viewport.
1918 * public/cycler.html:
1920 2017-04-06 Ryosuke Niwa <rniwa@webkit.org>
1922 Each build request should be associated with a repository group
1923 https://bugs.webkit.org/show_bug.cgi?id=170528
1925 Rubber-stamped by Chris Dumez.
1927 Make the buildbot syncing script use the concept of repository groups so that each repository group can post
1928 a different set of properties to buildbot. In order to do this, we associate each build request with
1929 a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via
1930 /api/update-triggerable just the same way the set of the supported platform, test pairs are updated.
1932 Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name
1933 to either a string value or a repository name enclosed in < and >:
1936 "repositoryGroups": {
1938 "repositories": ["WebKit", "macOS"],
1939 "properties": {"os": "<macOS>", "wk": "<WebKit>"}
1944 With this, removed the support for specifying a repository to use in generic dictionary of properties via
1945 a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of
1946 repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in
1949 After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group.
1950 Run the appropriate database queries to set the repository group on each build request. Because of this change,
1951 this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests.
1952 Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same
1953 test group if the next build request to be scheduled does not specify a repository group.
1955 * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for
1956 repository and group pair in triggerable_repositories table.
1958 * public/api/update-triggerable.php:
1959 (main): Validate and insert repository groups.
1960 (validate_configurations): Extracted from main.
1961 (validate_repository_groups): Added.
1963 * public/v3/models/repository.js:
1964 (Repository.findTopLevelByName): Added.
1966 * public/include/build-requests-fetcher.php:
1967 (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response.
1969 * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given
1970 triggerable for a list of repositories.
1971 (RepositoryGroupFinder): Added.
1972 (RepositoryGroupFinder::__construct): Added.
1973 (RepositoryGroupFinder::find_by_repositories): Added.
1974 (RepositoryGroupFinder::populate_map): Added.
1976 * public/privileged-api/create-test-group.php:
1977 (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains
1978 "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set.
1979 Use that to set the repository group in each new build request.
1980 (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group.
1981 (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its
1982 argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]}
1984 * public/v3/models/build-request.js:
1986 (BuildRequest.prototype.triggerable): Added.
1987 (BuildRequest.prototype.repositoryGroup): Added.
1988 (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group.
1990 * public/v3/models/triggerable.js:
1991 (Triggerable.prototype.name): Added.
1992 (Triggerable.prototype.acceptedRepositories): Deleted.
1993 (TriggerableRepositoryGroup):
1994 (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group
1996 * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request.
1997 * server-tests/api-manifest-tests.js: Added assertions for the repository groups.
1998 * server-tests/api-report-tests.js:
2000 (.reportWithTwoLevelsOfAggregations):
2001 * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with
2003 (.updateWithOSXRepositoryGroup):
2004 (.mapRepositoriesByGroup):
2005 * server-tests/privileged-api-create-test-group-tests.js:
2006 (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups
2007 in existing test cases, and added a test case for creating a test group with two different repository groups.
2009 * server-tests/resources/mock-data.js:
2010 (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps.
2011 (MockData.emptyTriggeragbleId): Added.
2012 (MockData.macosRepositoryId): Added.
2013 (MockData.webkitRepositoryId): Added.
2014 (MockData.gitWebkitRepositoryId): Added.
2015 (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some
2016 tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks.
2017 (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js.
2018 (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js.
2019 (MockData.addAnotherMockTestGroup): Cleanup.
2020 (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes.
2021 (MockData.mockTestSyncConfigWithTwoBuilders): Ditto.
2023 * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test
2024 updating the set of repository groups in addition to the set of test, platform pairs.
2025 (.refetchManifest): Added.
2027 * tools/js/buildbot-syncer.js:
2028 (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument,
2029 and buildRequestArgument as the third argument.
2030 (BuildbotSyncer.prototype.repositoryGroups): Added.
2031 (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find.
2032 Also added an assertion that the build request is associated with a repository group.
2033 (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to
2034 specify a revision in favor of explicity listing each property and repository name in a repository group.
2035 (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties
2036 shared across syncers, the name of properties which specifies the build slave name and build request ID. These
2037 values are not stored as top-level properties and superseded by the concept of repository groups.
2038 (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups.
2039 (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of
2040 properties or buildRequestArgument (often inherited from shared).
2041 (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of
2042 allowed proeprties in each configuration now that they're specified as top-level properties.
2044 * tools/js/buildbot-triggerable.js:
2045 (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups.
2046 (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is
2047 not included in the list of valid build requests.
2048 (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes
2049 those that lack a repository group set.
2050 (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds
2051 the next build request to be scheduled for the test group.
2052 (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from
2053 _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of
2054 a test group information since syncOnce now calls _nextRequestInGroup to find the next build request.
2056 * tools/js/v3-models.js:
2058 * unit-tests/build-request-tests.js: Fixed the test name.
2060 * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests
2061 for parsing repository groups.
2062 (sampleiOSConfig): Updated the mock configuration per code changes.
2063 (sampleiOSConfigWithExpansions): Ditto.
2064 (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration.
2065 Various test cases have been updated to reflect this.
2066 (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock
2067 configurations. The git hash was there to test "rootOptions", which this patch removed.
2068 (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding"
2069 which, again, this patch removed.
2070 (sampleInProgressBuild): Ditto.
2071 (sampleFinishedBuild): Ditto.
2073 * unit-tests/resources/mock-v3-models.js:
2074 (MockModels.inject): Added ock repository groups so that existing tests will continue to function.
2076 2017-04-05 Ryosuke Niwa <rniwa@webkit.org>
2078 Introduce the notion of repository groups to triggerables
2079 https://bugs.webkit.org/show_bug.cgi?id=170228
2081 Reviewed by Chris Dumez.
2083 On some triggerable, it's desirable to specify multiple sets of repositories that are accepted.
2085 For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and
2086 some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither
2087 (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set.
2089 This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by
2090 a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn
2091 now has many to one relationship to triggerable_repository_groups instead of build_triggerables.
2093 Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported.
2094 We don't want to delete the triggerable completely from the database since it would result in the associated
2095 A/B testing results being purged, which is not desirale.
2097 To migrate an existing database, run the following transaction:
2100 ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE;
2102 CREATE TABLE triggerable_repository_groups (
2103 repositorygroup_id serial PRIMARY KEY,
2104 repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL,
2105 repositorygroup_name varchar(256) NOT NULL,
2106 repositorygroup_description varchar(256),
2107 repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE,
2108 CONSTRAINT repository_group_name_must_be_unique_for_triggerable
2109 UNIQUE(repositorygroup_triggerable, repositorygroup_name));
2110 INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name)
2111 SELECT triggerable_id, 'default' FROM build_triggerables;
2113 ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups;
2114 UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups
2115 WHERE trigrepo_triggerable = repositorygroup_triggerable;
2116 ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL;
2118 ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable;
2119 ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots;
2123 * init-database.sql:
2124 * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups.
2125 (insert_triggerable_repositories): Added.
2126 (generate_repository_list): Added.
2127 (generate_repository_form): Added.
2128 (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable.
2130 * public/include/manifest-generator.php:
2131 (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable.
2132 Rewrote it to include an array of repository groups, which in turn contains an array of repositories along
2133 with its name and a description, and a boolean indicating whether it accepts a custom root file or not.
2134 The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories
2135 since it's still used by detect-changes.js.
2137 * public/v3/models/manifest.js:
2138 (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects.
2140 * public/v3/models/triggerable.js:
2142 (Triggerable.prototype.isDisabled): Added.
2143 (Triggerable.prototype.repositoryGroups): Added.
2144 (Triggerable.prototype.acceptsTest): Added.
2145 (TriggerableRepositoryGroup): Added.
2146 (TriggerableRepositoryGroup.prototype.description): Added.
2147 (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added.
2148 (TriggerableRepositoryGroup.prototype.repositories): Added.
2150 * public/v3/pages/analysis-task-page.js:
2151 (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable.
2153 * server-tests/api-manifest-tests.js: Updated a test case to test repository groups.
2155 * tools/js/database.js:
2156 (tableToPrefixMap): Added triggerable_repository_groups.
2158 * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js.
2160 2017-03-31 Ryosuke Niwa <rniwa@webkit.org>
2162 Build fix. For OS versions, we can end up with non-alphanumeric revision.
2163 Delete the code path only used by the v2 UI since nobody uses that now.
2165 * public/api/commits.php:
2168 2017-03-30 Ryosuke Niwa <rniwa@webkit.org>
2170 sync-buildbot.js can schedule more than one build per builder
2171 https://bugs.webkit.org/show_bug.cgi?id=170318
2173 Reviewed by Saam Barati.
2175 The bug was caused by _scheduleNextRequestInGroupIfSlaveIsAvailable not returning a promise when
2176 scheduling the first build request of a test group. This resulted in _pullBuildbotOnAllSyncers
2177 to prematurely resolve before POST'ing new build had finished. That in turn could result in the
2178 next cycle of syncing to occur before POST'ing has actually taken place.
2180 More precisely, when the nextRequest was the first request or its associated syncer object could
2181 not be identified, we were supposed to find the first available syncer, schedule the request,
2182 and then return the promise returned by scheduleRequestInGroupIfAvailable. However, the for loop
2183 which called scheduleRequestInGroupIfAvailable on every syncer was declaring its own variable
2184 named "promise" thereby shadowing the outer variable, which is returned to the caller.
2186 Fixed the bug by not declaring a shadowing variable, and refactored the code. Namely, the only
2187 reason we had such a complicated logic with two local variables, promise and syncer, was so that
2188 we could log that we're scheduling a build. Extracted this code as _scheduleRequestWithLog.
2190 _scheduleNextRequestInGroupIfSlaveIsAvailable can now simply exit early with a call to
2191 _scheduleRequestWithLog when the syncer is readily identified. When looping over syncers, it can
2192 simply return the first non-null result of _scheduleNextRequestInGroupIfSlaveIsAvailable.
2194 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case where we wait 10ms after
2195 receiving the request to POST a build. There should be no new network request until we resolve
2198 * tools/js/buildbot-triggerable.js:
2199 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Fixed the bug.
2200 (BuildbotTriggerable.prototype._scheduleRequestWithLog): Extracted.
2202 2017-03-30 Ryosuke Niwa <rniwa@webkit.org>
2204 Modernize BuildbotSyncer and BuildbotTriggerable
2205 https://bugs.webkit.org/show_bug.cgi?id=170310
2207 Reviewed by Chris Dumez.
2209 Modernized the code to use arrow functions and other modern idoms in ES2016.
2211 * ReadMe.md: Added instructions on how to run tests, and moved the steps to configure postgres
2212 above the steps to configure Apache since only the former is needed to run tests.
2213 * tools/js/buildbot-syncer.js:
2214 * tools/js/buildbot-triggerable.js:
2216 2017-03-30 Ryosuke Niwa <rniwa@webkit.org>
2218 Yet another build fix after r214502. Workaround webkit.org/b/169907 for now.
2220 * public/v3/pages/analysis-task-page.js:
2221 (AnalysisTaskPage.cssTemplate):
2223 2017-03-30 Ryosuke Niwa <rniwa@webkit.org>
2225 Revert an erronously change in the previous commit.
2227 * public/v3/components/base.js:
2229 2017-03-30 Ryosuke Niwa <rniwa@webkit.org>
2231 Build fix after r214280. Don't render components until its element is inserted into a document.
2233 * public/v3/components/base.js:
2236 2017-03-29 Ryosuke Niwa <rniwa@webkit.org>
2238 Another build fix after r214502.
2240 * public/v3/components/analysis-results-viewer.js:
2241 (AnalysisResultsViewer.prototype.render): this._groupToCellMap.get may not contain the cell when startPoint
2242 or metric had not been fetched yet even if currentTestGroup is set.
2244 2017-03-29 Ryosuke Niwa <rniwa@webkit.org>
2246 Build fix after r214502. Analysis tasks without any test groups are throwing exceptions.
2248 * public/v3/components/results-table.js:
2249 (ResultsTable.prototype.renderTable): Don't show the header row when there are no content to show.
2250 (ResultsTable.prototype._computeRepositoryList): Return a pair of arrays. The caller expects the repository
2251 list to be an array, not undefined.
2253 2017-03-28 Ryosuke Niwa <rniwa@webkit.org>
2255 Modernize AnalysisTaskPage
2256 https://bugs.webkit.org/show_bug.cgi?id=170165
2258 Reviewed by Antti Koivisto.
2260 Modernized AnalysisTaskPage and related components. The main refactoring happened in AnalysisTaskPage
2261 from which AnalysisTaskResultsPane and AnalysisTaskTestGroupPane have been extracted.
2263 Decoupled BuildRequest from its results. AnalysisResultsViewer and TestGroupResultsTable now stores
2264 a reference to AnalysisResultsView and Metric to find the results for each build request.
2265 This refactoring is necessary in order to view results of an arbitrary metric in the future.
2267 Also refactored ResultsTable and its subclasses extensively. Instead of making its render() to invoke
2268 subclass' methods such as buildRowGroups, heading, and additionalHeading, rely on each subclass call
2269 to invoke renderTable(), renamed from render(), with callbacks to add extra headers and columns.
2271 This patch also fixes a number of usability issues found by the user such as changing the test name
2272 resets the customized revisions by the virtue of the modern code being naturally more correct.
2274 * public/v3/components/analysis-results-viewer.js:
2275 (AnalysisResultsViewer):
2276 (AnalysisResultsViewer.prototype.setTestGroupCallback): Deleted. Replaced by "testGroupClick" action.
2277 (AnalysisResultsViewer.prototype.setRangeSelectorLabels): Moved here from ResultsTable since it's
2278 never used in ResultsTable or TestGroupResultsTable.
2279 (AnalysisResultsViewer.prototype.selectedRange): Ditto.
2280 (AnalysisResultsViewer.prototype.setPoints): Now takes metric as the third argument.
2281 (AnalysisResultsViewer.prototype.setTestGroups): Now takes the current test group.
2282 (AnalysisResultsViewer.prototype.didUpdateResults): Deleted.
2283 (AnalysisResultsViewer.prototype.setAnalysisResultsView): Added.
2284 (AnalysisResultsViewer.prototype.render): Invoke _renderTestGroups lazily. Also simplified the logic
2285 to find the selected list item. Since we always use a shadow DOM now, we can simply look for an element
2286 with ".seleted" instead of crafting a unique class name.
2287 (AnalysisResultsViewer.prototype.renderTestGroups): Renamed from buildRowGroups. Specify callbacks to
2288 insert headers for A/B radio buttons, which has been moved from ResultsTable.prototype.render, and the
2289 stacked blocks of testing results.
2290 (AnalysisResultsViewer.prototype._classForTestGroup): Deleted.
2291 (AnalysisResultsViewer.prototype._openStackingBlock): Deleted.
2292 (AnalysisResultsViewer.prototype._expandBetween): Create a new set for expandedPoints to make
2293 _renderTestGroupsLazily.evaluate do the work.
2294 (AnalysisResultsViewer._layoutBlocks): Moved from TestGroupStackingGrid.layout.
2295 (AnalysisResultsViewer._sortBlocksByRow): Moved from AnalysisResultsViewer.TestGroupStackingGrid.
2296 (AnalysisResultsViewer._insertAfterBlockWithSameRange): Ditto.
2297 (AnalysisResultsViewer._insertBlockInFirstAvailableColumn): Ditto.
2298 (AnalysisResultsViewer._createCellsForRow): Ditto.
2300 (AnalysisResultsViewer.TestGroupStackingBlock):
2301 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.addRowIndex):
2302 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): No longer creates a unique
2303 class name here. See the inline comment for AnalysisResultsViewer.prototype.render.
2304 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.isThin): Deleted. We used to collapse "failed"
2305 test groups as a thin vertical line, and we wanted to show them next to each other in _layoutBlock but
2306 we don't do that anymore.
2307 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForCommitSet): Added. Uses
2308 this._analysisResultsView to extract the results for the current metrics.
2309 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
2311 * public/v3/components/analysis-task-bug-list.js: Added.
2312 (AnalysisTaskBugList): Added. Extracted from AnalysisTaskChartPane.
2313 (AnalysisTaskBugList.prototype.setTask): Added.
2314 (AnalysisTaskBugList.prototype.didConstructShadowTree): Added.
2315 (AnalysisTaskBugList.prototype.render): Added.
2316 (AnalysisTaskBugList.prototype._associateBug): Added.
2317 (AnalysisTaskBugList.prototype._dissociateBug): Added.
2318 (AnalysisTaskBugList.htmlTemplate): Added.
2320 * public/v3/components/chart-pane-base.js:
2321 (ChartPaneBase.htmlTemplate): Added a hook to insert more content at the end in AnalysisTaskChartPane.
2322 (ChartPaneBase.paneFooterTemplate): Added.
2324 * public/v3/components/customizable-test-group-form.js:
2325 (CustomizableTestGroupForm):
2326 (CustomizableTestGroupForm.prototype.setCommitSetMap):
2327 (CustomizableTestGroupForm.prototype.startTesting): Renamed from _submitted. Now dispatches an action
2328 by the name of "startTesting" instead of calling this._startCallback.
2329 (CustomizableTestGroupForm.prototype.didConstructShadowTree): Added. Moved the logic to attach event
2330 handlers here to avoid eagerly creating the shadow tree in the constructor.
2331 (CustomizableTestGroupForm.prototype._computeCommitSetMap): Use the newly added this._revisionEditorMap
2332 to find the relevant input element instead of running a querySelector.
2333 (CustomizableTestGroupForm.prototype.render): Lazily invoke _renderCustomRevisionTable. This avoids
2334 overriding the customized revisions when the user finally types in the test group name.
2335 (CustomizableTestGroupForm.prototype._renderCustomRevisionTable): Extracted from render.
2336 (CustomizableTestGroupForm.prototype._constructRevisionRadioButtons): Made this a non-static method
2337 since it needs to update this._revisionEditorMap now. Merged _constructRevisionRadioButtons.
2338 (CustomizableTestGroupForm.prototype._createRadioButton): Deleted. See above.
2339 (CustomizableTestGroupForm.cssTemplate):
2340 (CustomizableTestGroupForm.formContent): Use IDs instead of classes to make this.content(ID) work.
2342 * public/v3/components/mutable-list-view.js:
2343 (MutableListView.prototype.setList):
2344 (MutableListView.prototype.setKindList):
2345 (MutableListView.prototype.setAddCallback): Deleted. Replaced by "addItem" action.
2346 (MutableListView.prototype.render):
2347 (MutableListItem.prototype.content):
2349 * public/v3/components/results-table.js:
2350 (ResultsTable): Removed this._rangeSelectorLabels, this._rangeSelectorCallback, and this._selectedRange
2351 as they are only used by AnalysisResultsViewer. Also replaced this._valueFormatter by
2352 this._analysisResultsView which knows a metric.
2353 (ResultsTable.prototype.setValueFormatter): Deleted.
2354 (ResultsTable.prototype.setRangeSelectorLabels): Deleted.
2355 (ResultsTable.prototype.setRangeSelectorCallback): Deleted.
2356 (ResultsTable.prototype.selectedRange): Deleted.
2357 (ResultsTable.prototype._rangeSelectorClicked): Deleted.
2358 (ResultsTable.prototype.setAnalysisResultsView): Added.
2359 (ResultsTable.prototype.renderTable): Added. Removed the logic to add _rangeSelectorLabels since it has
2360 been moved to AnalysisResultsViewer.prototype.render inside buildColumns, which also inserts additional
2361 columns which used to be stored on each ResultsTableRow. Use the same technique to insert additional
2362 headers. Also take the name (thead tr th) of row header (tbody tr td) as an argument and automatically
2363 create a table cell of an appropriate colspan.
2364 (ResultsTable.prototype._createRevisionListCells):
2365 (ResultsTable.prototype.heading): Deleted. Superseded by buildHeaders callback.
2366 (ResultsTable.prototype.additionalHeading): Ditto.
2367 (ResultsTable.prototype.buildRowGroups): Deleted. It is now the responsibility of each subclass to call
2368 ResultsTable's renderTable() in the subclass' render() function.
2369 (ResultsTable.prototype._computeRepositoryList): No longer takes extraRepositories as an argument.
2370 Instead, this function now returns a pair of the repository list and the list of constant commits.
2371 (ResultsTable.htmlTemplate):
2372 (ResultsTable.cssTemplate):
2374 * public/v3/components/test-group-form.js:
2375 (TestGroupForm): Avoid eagerly creating the shadow tree. Also removed the removed the dead code.
2376 (TestGroupForm.prototype.setRepetitionCount): Simply override the value of the select element.
2377 (TestGroupForm.prototype.didConstructShadowTree): Added. Attach event handlers here to avoid eagerly
2378 creating the shadow tree in the constructor.
2379 (TestGroupForm.prototype.startTesting): Renamed from _submitted. Dispatch "startTesting" action instead
2380 of invoking _startCallback which has been removed.
2381 (TestGroupForm.htmlTemplate):
2382 (TestGroupForm.formContent):
2384 * public/v3/components/test-group-results-table.js:
2385 (TestGroupResultsTable):
2386 (TestGroupResultsTable.prototype.didUpdateResults): Deleted. No longer neeed per setAnalysisResultsView
2388 (TestGroupResultsTable.prototype.setTestGroup):
2389 (TestGroupResultsTable.prototype.heading): Deleted.
2390 (TestGroupResultsTable.prototype.render):
2391 (TestGroupResultsTable.prototype._renderTestGroup): Extracted from render.
2392 (TestGroupResultsTable.prototype._buildRowGroups): Renamed from buildRowGroups.
2393 (TestGroupResultsTable.prototype._buildRowGroupForCommitSet): Extracted from buildRowGroups.
2394 (TestGroupResultsTable.prototype._buildComparisonRow): Extracted from buildRowGroups.buildRowGroups
2396 * public/v3/index.html: Include analysis-task-bug-list.js.
2398 * public/v3/models/analysis-results.js:
2399 (AnalysisResults): Inverted the map so that we can easily create a view based on metric.
2400 (AnalysisResults.prototype.find): Ditto.
2401 (AnalysisResults.prototype.add): Ditto.
2402 (AnalysisResults.prototype.viewForMetric): Added.
2403 (AnalysisResults.fetch):
2404 (AnalysisResultsView): Added.
2405 (AnalysisResultsView.prototype.metric): Added.
2406 (AnalysisResultsView.prototype.resultForBuildId): Added.
2408 * public/v3/models/build-request.js:
2409 (BuildRequest.result): Deleted.
2410 (BuildRequest.setResult): Deleted.
2412 * public/v3/models/test-group.js:
2413 (TestGroup): Removed this._allCommitSets since it was never used.
2414 (TestGroup.prototype.didSetResult): Deleted since it was never used.
2415 (TestGroup.prototype.compareTestResults): Now takes an array of measurement set values.
2416 (TestGroup.prototype._valuesForCommitSet): Deleted.
2418 * public/v3/pages/analysis-task-page.js:
2419 (AnalysisTaskChartPane): This class now includes the form to cutomize the revisions.
2420 (AnalysisTaskChartPane.prototype.setShowForm): Added.
2421 (AnalysisTaskChartPane.prototype._mainSelectionDidChange):
2422 (AnalysisTaskChartPane.prototype.didConstructShadowTree): Added. Dispatches "newTestGroup" action when
2423 the user presses the button to start a new A/B testing from the chart.
2424 (AnalysisTaskChartPane.prototype.render): Added.
2425 (AnalysisTaskChartPane.prototype.paneFooterTemplate): Added.
2426 (AnalysisTaskChartPane.cssTemplate):
2428 (AnalysisTaskResultsPane): Added. Encapsulates AnalysisResultsViewer and CustomizableTestGroupForm.
2429 (AnalysisTaskResultsPane.prototype.setPoints): Added.
2430 (AnalysisTaskResultsPane.prototype.setTestGroups): Added.
2431 (AnalysisTaskResultsPane.prototype.setAnalysisResultsView): Added.
2432 (AnalysisTaskResultsPane.prototype.setShowForm): Added.
2433 (AnalysisTaskResultsPane.prototype.didConstructShadowTree): Added. Dispatches "newTestGroup" action
2434 when the user presses the button to start a new A/B testing from the chart.
2435 (AnalysisTaskResultsPane.prototype.render): Added.
2436 (AnalysisTaskResultsPane.htmlTemplate): Added.
2437 (AnalysisTaskResultsPane.cssTemplate): Added.
2439 (AnalysisTaskTestGroupPane): Added. Encapsulates TestGroupResultsTable and CustomizableTestGroupForm.
2440 (AnalysisTaskTestGroupPane.prototype.didConstructShadowTree): Added.
2441 (AnalysisTaskTestGroupPane.prototype.setTestGroups): Added.
2442 (AnalysisTaskTestGroupPane.prototype.setAnalysisResultsView): Added.
2443 (AnalysisTaskTestGroupPane.prototype.render): Added.
2444 (AnalysisTaskTestGroupPane.prototype._renderTestGroups): Added. Updates the list of test groups. Hide
2445 the hidden groups unless showHiddenGroups is set. Updates this._testGroupMap so that the visibility of
2446 groups and their names can be updated without having to re-render the entire list.
2447 (AnalysisTaskTestGroupPane.prototype._renderTestGroupVisibility): Added.
2448 (AnalysisTaskTestGroupPane.prototype._renderTestGroupNames): Added.
2449 (AnalysisTaskTestGroupPane.prototype._renderCurrentTestGroup): Added. Update TestGroupResultsTable with
2450 the selected test group. Also highlight the list view, and update the hide-unhide toggle button's label
2452 (AnalysisTaskTestGroupPane.htmlTemplate): Added.
2453 (AnalysisTaskTestGroupPane.cssTemplate): Added.
2455 (AnalysisTaskPage): Deleted a massive number of instance variables. They are now manged by newly added
2456 AnalysisTaskChartPane, AnalysisTaskResultsPane, and AnalysisTaskTestGroupPane
2457 (AnalysisTaskPage.prototype.didConstructShadowTree): Added. Attach various event handlers here to avoid
2458 eagerly creating the shadow tree in the constructor.
2459 (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId):
2460 (AnalysisTaskPage.prototype._didFetchTask): No longer sets the value formatter to the results viewer
2461 and the results table as they now recieve AnalysisResultsView later in _assignTestResultsIfPossible.
2462 (AnalysisTaskPage.prototype._didFetchMeasurement): Set the metric to the results viewer.
2463 (AnalysisTaskPage.prototype._didUpdateTestGroupHiddenState):
2464 (AnalysisTaskPage.prototype._assignTestResultsIfPossible): Create AnalysisResultsView from the newly
2465 retrieved AnalysisResults and pass it to AnalysisTaskResultsPane and AnalysisTaskTestGroupPane.
2466 (AnalysisTaskPage.prototype.render): Dramatically simplified.
2467 (AnalysisTaskPage.prototype._renderTaskNameAndStatus): Extracted from render.
2468 (AnalysisTaskPage.prototype._renderRelatedTasks): Ditto.
2469 (AnalysisTaskPage.prototype._renderCauseAndFixes): Ditto.
2470 (AnalysisTaskPage.prototype._showTestGroup):
2471 (AnalysisTaskPage.prototype._updateTaskName): Now takes the new name as an argument.
2472 (AnalysisTaskPage.prototype._updateTestGroupName): Now takes the new name as the second argument.
2473 (AnalysisTaskPage.prototype._hideCurrentTestGroup): Now takes the test group to hide.
2474 (AnalysisTaskPage.prototype._associateCommit): Moved to AnalysisTaskBugList.
2475 (AnalysisTaskPage.prototype._dissociateCommit): Ditto.
2476 (AnalysisTaskPage.prototype._retryCurrentTestGroup): Now takes the test group as the first argument.
2477 (AnalysisTaskPage.prototype._chartSelectionDidChange): Deleted.
2478 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Deleted.
2479 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): Deleted.
2480 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Deleted.
2481 (AnalysisTaskPage.htmlTemplate):
2482 (AnalysisTaskPage.cssTemplate):
2484 * unit-tests/test-groups-tests.js: Updated a test case which was expecting BuildReqeust's result, which
2485 has been removed, to exist.
2487 2017-03-23 Ryosuke Niwa <rniwa@webkit.org>
2489 Share more code between ManifestGenerator and /api/triggerables
2490 https://bugs.webkit.org/show_bug.cgi?id=169993
2492 Reviewed by Chris Dumez.
2494 Shared the code to fetch the list of triggerables from the database between ManifestGenerator
2495 and /api/triggerables.
2497 * public/api/triggerables.php:
2499 * public/include/manifest-generator.php:
2500 (ManifestGenerator::fetch_triggerables): Extracted as a static function. Also include the ID
2501 in the triggerable data.
2503 2017-03-23 Ryosuke Niwa <rniwa@webkit.org>
2505 create-test-group should allow a different set of repositories to be used in each configuration
2506 https://bugs.webkit.org/show_bug.cgi?id=169992
2508 Rubber-stamped by Antti Koivisto.
2510 Added the support for new POST parameter, revisionSets, to /privileged-api/create-test-group.
2511 This new parameter now specifies an array of repository id to revision dictionaries, and allows
2512 different set of repositories' revisions to be specified in each dictionary.
2514 We keep the old API for v2 UI and detect-changes.js compatibility for now.
2516 * public/privileged-api/create-test-group.php:
2518 (commit_sets_from_revision_sets): Added.
2519 (ensure_commit_sets): Only fetch the top-level repository per r213788 and r213976.
2521 * public/v3/models/test-group.js:
2522 (TestGroup.createAndRefetchTestGroups): Use the newly added revisionSets parameter instead of
2523 the now depreacted commitSets parameter.
2525 * public/v3/pages/analysis-task-page.js:
2526 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingCommitSetList): Simplified this code
2527 by simply verifying the consistency of commit sets now that createAndRefetchTestGroups takes
2528 an array of commit sets instead of a dictionary of repository name to a list of revisions.
2530 * server-tests/privileged-api-create-test-group-tests.js: Added test cases for new parameter.
2532 2017-03-22 Ryosuke Niwa <rniwa@webkit.org>
2534 /api/uploaded-file should return createdAt as a POSIX timestamp
2535 https://bugs.webkit.org/show_bug.cgi?id=169980
2537 Rubber-stamped by Antti Koivisto.
2539 Call Database::to_js_time on createdAt to return it as a POSIX timestamp.
2541 * public/include/uploaded-file-helpers.php:
2542 (format_uploaded_file): Fixed the bug.
2543 * server-tests/api-manifest-tests.js: Renamed from api-manifest.js.
2544 * server-tests/api-uploaded-file-tests.js: Renamed from api-uploaded-file.js. Added a test case.
2546 2017-03-22 Ryosuke Niwa <rniwa@webkit.org>
2548 UploadedFile should support a callback for upload progress
2549 https://bugs.webkit.org/show_bug.cgi?id=169977
2551 Reviewed by Andreas Kling.
2553 Added a new option dictionary to CommonRemoteAPI.sendHttpRequest with uploadProgressCallback
2555 Moved request headers and responseHandler callback in NodeRemoteAPI to this dictionary,
2556 and updated the tests which relied on this code.
2558 * public/shared/common-remote.js:
2559 (CommonRemoteAPI.prototype.postJSON):
2560 (CommonRemoteAPI.prototype.postJSONWithStatus):
2561 (CommonRemoteAPI.prototype.postFormData):
2562 (CommonRemoteAPI.prototype.postFormDataWithStatus):
2563 * public/v3/privileged-api.js:
2564 (PrivilegedAPI.prototype.sendRequest):
2565 * public/v3/remote.js:
2566 (BrowserRemoteAPI.prototype.sendHttpRequest):
2567 (BrowserRemoteAPI.prototype.sendHttpRequestWithFormData):
2569 * server-tests/api-uploaded-file.js:
2570 * tools/js/remote.js:
2571 (NodeRemoteAPI.prototype.sendHttpRequest):
2572 (NodeRemoteAPI.prototype.sendHttpRequestWithFormData):
2575 2017-03-22 Ryosuke Niwa <rniwa@webkit.org>
2577 ComponentBase should enqueue itself to render when it becomes connected
2578 https://bugs.webkit.org/show_bug.cgi?id=169905
2580 Reviewed by Antti Koivisto.
2582 When a component becomes connected to a document, enqueue itself to render automatically.
2583 Also added the support for boolean attribute to ComponentBase.createElement.
2585 * ReadMe.md: Added an instruction to raise the upload limit per r214065.
2586 * browser-tests/component-base-tests.js: Added tests for the new behavior and createElement. Also moved
2587 the tests related to enqueueToRenderOnResize out of defineElement tests.
2589 * browser-tests/index.html:
2590 (BrowsingContext.prototype.constructor): Override requestAnimationFrame so that the callback would be
2591 involved immediately durign testing.
2593 * public/v3/components/base.js:
2594 (ComponentBase): Enqueue itself to render during construction if custom elements is not available.
2595 (ComponentBase.defineElement):
2596 (ComponentBase.defineElement.elementClass.prototype.connectedCallback): Enqueue itself to render when
2597 the component's element became connected.
2598 (ComponentBase.createElement): Use Array.isArray instead of instanceof to make it work with arrays made
2599 in other realms (global objects) during testing. Added the support for boolean attributes. Setting an
2600 attribute value to true would set the attribute, and setting it to false would not set the attribute.
2601 (ComponentBase.useNativeCustomElements): Added. True iff window.customElements is defined.
2603 * public/v3/components/chart-pane-base.js:
2604 (ChartPaneBase.prototype.render): No longer need to call enqueueToRender on the commit log viewer.
2606 * public/v3/components/commit-log-viewer.js:
2607 (CommitLogViewer.prototype.render): No longer need to call enqueueToRender on the spinner icon.
2609 * public/v3/models/time-series.js:
2610 (TimeSeries): Made this a proper class declaration now that we don't include data.js after r213300.
2612 * public/v3/pages/chart-pane.js:
2613 (ChartPane.prototype._renderActionToolbar): No longer need to call enqueueToRender on the close icon.
2615 * public/v3/pages/summary-page.js:
2616 (SummaryPage.prototype._renderCell): No longer need to call enqueueToRender on the spinner icon.
2618 2017-03-20 Ryosuke Niwa <rniwa@webkit.org>
2620 Delete another function that was supposed to be removed in the previous commit.
2622 * public/v3/models/build-request.js:
2623 (BuildRequest.cachedRequestsForTriggerableID): Deleted.
2625 2017-03-20 Ryosuke Niwa <rniwa@webkit.org>
2627 Modernize BuildRequestQueuePage
2628 https://bugs.webkit.org/show_bug.cgi?id=169903
2630 Reviewed by Antti Koivisto.
2632 Modernized the code for /v3/#/analysis/queue.
2634 * public/v3/models/build-request.js:
2635 (BuildRequest.fetchTriggerables): Deleted since the manifest JSON now contains all the triggerables.
2637 * public/v3/pages/build-request-queue-page.js:
2638 (BuildRequestQueuePage): Deleted this._triggerables. Added this._buildRequestsByTriggerable.
2639 (BuildRequestQueuePage.prototype.open): Modernized the code.
2640 (BuildRequestQueuePage.prototype.render): Ditto.
2641 (BuildRequestQueuePage.prototype._constructBuildRequestTable): Ditto.
2643 2017-03-19 Ryosuke Niwa <rniwa@webkit.org>
2645 Charts page show an inconsistent list of revisions for Git and Subversion
2646 https://bugs.webkit.org/show_bug.cgi?id=169888
2648 Reviewed by Andreas Kling.
2650 With Git, CommitLogViewer was showing the list of revisions including the starting hash,
2651 which was the last data point's revision instead of all revisions after the last data point.
2653 Fixed the bug by always specifying the revision at the last data point in both Subversion
2654 and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision.
2655 For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and
2656 "lastRevision" respectively.
2658 We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g.
2659 when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250"
2660 instead of "r1235-r1250".
2662 * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer
2663 specifies from/to revisions.
2664 * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer.
2665 * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css.
2667 * public/api/commits.php:
2668 (main): Renamed "from" and "to" query parameters.
2670 * public/include/commit-log-fetcher.php:
2671 (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified
2672 in both rows or not specified in either. Also reject when before_first_revision is identical
2673 or after last_revision instead of re-ordering them since it no longer makes sense to do so with
2674 new query parameter names.
2676 * public/v3/components/base.js:
2677 (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient
2678 againt realm (global object) differences.
2680 * public/v3/components/chart-pane-base.js:
2681 (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since
2682 CommitLogViewer does that on its own now.
2683 (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer
2684 to remember which repository is current. This was the only use of currentRepository.
2686 * public/v3/components/commit-log-viewer.js:
2688 (CommitLogViewer.prototype.currentRepository): Deleted.
2689 (CommitLogViewer.prototype.view):
2690 (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy.
2691 Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision
2692 since the generic JSON API no longer supports being called with the identical revisions.
2693 (CommitLogViewer.prototype.render): Modernized & simplified the code.
2694 (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy.
2695 (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable.
2696 (CommitLogViewer.cssTemplate):
2698 * public/v3/models/commit-log.js:
2699 (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding
2700 1 to a Subversion-like starting revision for creating the label. See above. But we still do this
2701 for forming URLs due to the way tools like Trac work with Subversion revisions.
2702 (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for
2703 what this function is supposed to be doing.
2704 (CommitLog._cachedCommitLogs): Deleted.
2705 (CommitLog.fetchForSingleRevision): Added.
2706 (CommitLog._constructFromRawData): Added.
2708 * public/v3/models/data-model.js:
2709 (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them.
2711 * public/v3/remote.js:
2712 (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo.
2714 * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to
2715 use new query parameters and added more test cases.
2717 * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer
2718 includes from/to values. They're computed in ChartRevisionRange instead.
2720 2017-03-20 Ryosuke Niwa <rniwa@webkit.org>
2722 Fix os-build-fetcher.js and subprocess.js to make them work
2723 https://bugs.webkit.org/show_bug.cgi?id=169844
2725 Reviewed by Antti Koivisto.
2727 The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel.
2728 Some commands to poll the lsit of system components is not desirable to be ran in parallel.
2730 * server-tests/resources/mock-subprocess.js:
2731 (MockSubprocess): Use const declaration.
2732 (MockSubprocess.resetAndWaitForInvocation): Added.
2733 (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb.
2734 See https://webkit.org/code-style-guidelines/#names-verb
2735 (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array
2736 regardless of whether reset is called or when it's called.
2738 * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now
2739 expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting
2740 them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve,
2741 its subcommand to run, and then move onto the second top-level command. Also use a local reference
2742 to MockSubprocess.invocations instead of using the fully qualified name.
2744 * tools/js/os-build-fetcher.js:
2745 (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array
2746 in serial (not asynchronous) is a very common pattern in this class.
2747 (OSBuildFetcher.fetchAndReportAllInOrder): Added.
2748 (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted.
2749 (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result
2750 in each top-level command to be execued in parallel. Since each subcommand is executed as soon as
2751 its parent command is executed, this results in commands to be executed in parallel.
2752 Added a whole bunch of logging so that we can at least detect a bug like this in the future.
2753 (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style.
2754 (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion
2755 about the content returned by a subcommand.
2757 * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess.
2758 execFile is defined on require('child_process') itself.
2759 (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist.
2762 * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js.
2763 (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep.
2765 2017-03-16 Ryosuke Niwa <rniwa@webkit.org>
2767 Add the file uploading capability to the perf dashboard.
2768 https://bugs.webkit.org/show_bug.cgi?id=169737
2770 Reviewed by Chris Dumez.
2772 Added /privileged-api/upload-file to upload a file, and /api/uploaded-file/ to download the file
2773 and retrieve its meta data based on its SHA256. We treat two files with the identical SHA256 as
2774 identical since anyone who can upload a file using this mechanism can execute arbitrary code in
2775 our bots anyway. This is important for avoiding uploading a large darwinup roots multiple times
2776 to the server, saving both user's time/bandwidth and server's disk space.
2778 * config.json: Added uploadDirectory, uploadFileLimitInMB, and uploadUserQuotaInMB as options.
2779 * init-database.sql: Added uploaded_files table.
2781 * public/api/uploaded-file.php: Added.
2782 (main): /api/uploaded-file/N would download uploaded_file with id=N. /api/uploaded-file/?sha256=X
2783 would return the meta data for uploaded_file with sha256=X.
2784 (stream_file_content): Streams the file content in 64KB chunks. We support Range & If-Range HTTP
2785 request headers so that browsers can pause and resume downloading of a large root file.
2786 (parse_range_header): Parses Range HTTP request header.
2788 * public/include/json-header.php:
2789 (remote_user_name): Use the default argument of NULL.
2791 * public/include/manifest-generator.php:
2792 (ManifestGenerator::generate): Include the maximum upload size in the manifest file to let the
2793 frontend code preemptively check the file size before attempting to submit a file.
2795 * public/include/uploaded-file-helpers.php: Added.
2796 (format_uploaded_file):
2797 (uploaded_file_path_for_row):
2799 * public/privileged-api/upload-file-form.html: Added. For debugging purposes.
2803 * public/privileged-api/upload-file.php: Added.
2805 (query_total_file_size):
2806 (create_uploaded_file_from_form_data):
2808 * public/shared/common-remote.js:
2809 (CommonRemoteAPI.prototype.postFormData): Added.
2810 (CommonRemoteAPI.prototype.postFormDataWithStatus): Added.
2811 (CommonRemoteAPI.prototype.sendHttpRequestWithFormData): Added.
2812 (CommonRemoteAPI.prototype._asJSON): Throw an exception instead of calling a non-existent reject.
2814 * public/v3/models/uploaded-file.js: Added.
2815 (UploadedFile): Added.
2816 (UploadedFile.uploadFile): Added.
2817 (UploadedFile.fetchUnloadedFileWithIdenticalHash): Added. Finds the file with the same SHA256 in
2818 the server to avoid uploading a large custom root multiple times.
2819 (UploadedFile._computeSHA256Hash): Added.
2821 * public/v3/privileged-api.js:
2822 (PrivilegedAPI.prototype.sendRequest): Added the options dictionary as a third argument. For now,
2823 only support useFormData boolean.
2825 * public/v3/remote.js:
2826 (BrowserRemoteAPI.prototype.sendHttpRequestWithFormData): Added.
2828 * server-tests/api-manifest.js: Updated per the inclusion of fileUploadSizeLimit in the manifest.
2829 * server-tests/api-uploaded-file.js: Added.
2830 * server-tests/privileged-api-upload-file-tests.js: Added.
2832 * server-tests/resources/temporary-file.js: Added.
2833 (TemporaryFile): Added. A helper class for creating a temporary file to upload.
2834 (TemporaryFile.makeTemporaryFileOfSizeInMB):
2835 (TemporaryFile.makeTemporaryFile):
2836 (TemporaryFile.inject):
2838 * server-tests/resources/test-server.conf: Set upload_max_filesize and post_max_size for testing.
2839 * server-tests/resources/test-server.js:
2840 (TestServer.prototype.testConfig): Use uploadFileLimitInMB and uploadUserQuotaInMB of 2MB and 5MB.
2841 (TestServer.prototype._ensureDataDirectory): Create a directory to store uploaded files inside
2842 the data directory. In a production server, we can place it outside ServerRoot / DocumentRoot.
2843 (TestServer.prototype.cleanDataDirectory): Delete the aforementioned directory as needed.
2845 * tools/js/database.js:
2846 (tableToPrefixMap): Added uploaded_files.
2848 * tools/js/remote.js:
2849 (NodeRemoteAPI.prototype.sendHttpRequest): Added a dictionary to specify request headers and
2850 a callback to process the response as arguments. Fixed the bug that any 2xx code other than 200
2851 was resulting in a rejected promise. Also include the response headers in the result for tests.
2852 Finally, when content is a function, call that instead of writing the content since FormData
2853 requires a custom logic.
2854 (NodeRemoteAPI.prototype.sendHttpRequestWithFormData): Added.
2856 * tools/js/v3-models.js: Include uploaded-file.js.
2858 * tools/run-tests.py:
2859 (main): Add form-data as a new dependency.
2861 2017-03-15 Dewei Zhu <dewei_zhu@apple.com>
2863 Fix unit test and bug fix for 'pull-os-versions.js' script.
2864 https://bugs.webkit.org/show_bug.cgi?id=169701
2866 Reviewed by Ryosuke Niwa.
2868 Fix unit tests warnings on node-6.10.0.
2869 Fix 'pull-os-versions.js' does not fetch new builds and report.
2871 * server-tests/tools-os-build-fetcher-tests.js:
2875 * tools/pull-os-versions.js:
2878 2017-03-15 Ryosuke Niwa <rniwa@webkit.org>
2880 In-browser and node.js implementations of RemoteAPI should share some code
2881 https://bugs.webkit.org/show_bug.cgi?id=169695
2883 Rubber-stamped by Antti Koivisto.
2885 Extracted CommonRemoteAPI out of RemoteAPI implementations for node.js and browser.
2887 * public/shared/common-remote.js: Added.
2888 (CommonRemoteAPI): Added.
2889 (CommonRemoteAPI.prototype.postJSON): Extracted from RemoteAPI.
2890 (CommonRemoteAPI.prototype.postJSONWithStatus): Ditto.
2891 (CommonRemoteAPI.prototype.getJSON): Ditto.
2892 (CommonRemoteAPI.prototype.getJSONWithStatus): Ditto.
2893 (CommonRemoteAPI.prototype.sendHttpRequest): Added. Needs to implemented by a subclass.
2894 (CommonRemoteAPI.prototype._asJSON): Added.
2895 (CommonRemoteAPI.prototype._checkStatus): Added.
2897 * public/v3/index.html: Include common-remote.js.
2899 * public/v3/privileged-api.js:
2900 (PrivilegedAPI): Use class now that we don't include data.js.
2901 (PrivilegedAPI.sendRequest): Modernized the code.
2902 (PrivilegedAPI.requestCSRFToken): Ditto.
2904 * public/v3/remote.js:
2905 (BrowserRemoteAPI): Renamed from RemoteAPI. window.RemoteAPI is now an instance of this class.
2906 (BrowserRemoteAPI.prototype.sendHttpRequest): Moved from RemoteAPI.sendHttpRequest.
2907 (BrowserRemoteAPI.prototype.sendHttpRequest):
2909 * server-tests/privileged-api-create-analysis-task-tests.js: Updated tests since NodeJSRemoteAPI
2910 now throws the JSON status as an error to be consistent with BrowserRemoteAPI.
2911 * server-tests/privileged-api-create-test-group-tests.js: Ditto.
2912 * server-tests/privileged-api-upate-run-status.js: Ditto.
2914 * tools/js/buildbot-triggerable.js:
2915 (BuildbotTriggerable.prototype.syncOnce): Just use postJSONWithStatus instead of manually
2916 checking the status.
2918 * tools/js/remote.js:
2919 (NodeRemoteAPI): Renamed from RemoteAPI. Still exported as RemoteAPI.
2920 (NodeRemoteAPI.prototype.constructor):
2921 (NodeRemoteAPI.prototype.sendHttpRequest): Modernized the code.
2923 2017-03-15 Ryosuke Niwa <rniwa@webkit.org>
2925 Fix server tests after r213998 and r213969
2926 https://bugs.webkit.org/show_bug.cgi?id=169690
2928 Reviewed by Antti Koivisto.
2930 Fixed the existing server tests.
2932 * public/v3/models/analysis-task.js:
2933 (AnalysisTask.prototype._updateRemoteState): Use the relative path from the root so that it works inside tests.
2934 (AnalysisTask.prototype.associateBug): Ditto.
2935 (AnalysisTask.prototype.dissociateBug): Ditto.
2936 (AnalysisTask.prototype.associateCommit): Ditto.
2937 (AnalysisTask.prototype.dissociateCommit): Ditto.
2938 (AnalysisTask._fetchSubset): Ditto.
2939 (AnalysisTask.fetchAll): Ditto.
2940 * public/v3/models/test-group.js:
2941 (TestGroup.prototype.updateName): Ditto.
2942 (TestGroup.prototype.updateHiddenFlag): Ditto.
2943 (TestGroup.createAndRefetchTestGroups): Ditto.
2944 (TestGroup.cachedFetch): Ditto.
2945 * server-tests/api-manifest.js: Reverted an inadvertant change in r213969.
2946 * tools/js/database.js:
2947 (tableToPrefixMap): Added analysis_strategies.
2948 * unit-tests/analysis-task-tests.js: Updated expectations per changes to AnalysisTask.
2950 2017-03-15 Ryosuke Niwa <rniwa@webkit.org>
2952 Add tests for privileged-api/create-analysis-task and privileged-api/create-test-group
2953 https://bugs.webkit.org/show_bug.cgi?id=169688
2955 Rubber-stamped by Antti Koivisto.
2957 Added tests for privileged-api/create-analysis-task and privileged-api/create-test-group, and fixed newly found bugs.
2959 * public/privileged-api/create-analysis-task.php:
2960 (main): Fixed the bug that we were not explicitly checking whether start_run and end_run were integers or not.
2961 Also return InvalidTimeRange when start and end times are identical as that makes no sense for an analysis task.
2963 * public/privileged-api/create-test-group.php:
2964 (main): Fixed a bug that we were not explicitly checking task and repetitionCount to be an integer.
2965 (ensure_commit_sets): Fixed the bug that the number of commit sets weren't checked.
2967 * server-tests/privileged-api-create-analysis-task-tests.js: Added.
2968 * server-tests/privileged-api-create-test-group-tests.js: Added.
2970 * server-tests/resources/common-operations.js:
2971 (prepareServerTest): Increase the timeout from 1s to 5s.
2973 * server-tests/resources/mock-data.js:
2974 (MockData.addMockData): Use a higher database ID of 20 for a mock build_slave to avoid a conflict with auto-generated IDs.
2976 2017-03-15 Ryosuke Niwa <rniwa@webkit.org>
2978 Make unit tests return a promise instead of manually calling done
2979 https://bugs.webkit.org/show_bug.cgi?id=169663
2981 Reviewed by Antti Koivisto.
2983 Make the existing unit tests always reutrn a promise instead of manually calling "done" callback as done
2984 in r213969. The promise tests are a lot more stable and less error prone.
2986 Also use MockRemoteAPI.waitForRequest() instead of chaining two resolved promises where appropriate.
2988 * unit-tests/analysis-task-tests.js:
2989 * unit-tests/buildbot-syncer-tests.js:
2990 * unit-tests/checkconfig.js:
2991 * unit-tests/privileged-api-tests.js:
2993 2017-03-15 Dewei Zhu <dewei_zhu@apple.com>
2995 Rewrite 'pull-os-versions' script in Javascript to add support for reporting os revisions with sub commits.
2996 https://bugs.webkit.org/show_bug.cgi?id=169542
2998 Reviewed by Ryosuke Niwa.
3000 Extend '/api/commits/<repository>/last-reported' to accept a range and return last reported commits in given range.
3001 Rewrite 'pull-os-versions' in JavaScript and add unit tests for it.
3002 Instead of writing query manually while searching criteria contains null columns, use the methods provided in 'db.php'.
3003 Add '.gitignore' file to ommit files generated by while running tests/instances locally.
3005 * .gitignore: Added.
3006 * public/api/commits.php:
3007 * public/api/report-commits.php:
3008 * public/include/commit-log-fetcher.php:
3009 * public/include/db.php: 'null_columns' of prepare_params should be a reference.
3010 * public/include/report-processor.php:
3011 * server-tests/api-commits.js:
3013 * server-tests/api-report-commits-tests.js:
3014 * server-tests/resources/mock-logger.js: Added.
3016 (MockLogger.prototype.log):
3017 (MockLogger.prototype.error):
3018 * server-tests/resources/mock-subprocess.js: Added.
3019 (MockSubprocess.call):
3020 (MockSubprocess.waitingForInvocation):
3021 (MockSubprocess.inject):
3022 (MockSubprocess.reset):
3023 * server-tests/tools-buildbot-triggerable-tests.js:
3024 (MockLogger): Deleted.
3025 (MockLogger.prototype.log): Deleted.
3026 (MockLogger.prototype.error): Deleted.
3027 * server-tests/tools-os-build-fetcher-tests.js: Added.
3029 (return.waitingForInvocationPromise.then):
3031 (string_appeared_here.return.waitingForInvocationPromise.then):
3032 (return.addSlaveForReport.emptyReport.then):
3033 * tools/js/os-build-fetcher.js: Added.
3035 (OSBuildFetcher.prototype._fetchAvailableBuilds):
3036 (OSBuildFetcher.prototype._computeOrder):
3037 (OSBuildFetcher.prototype._commitsForAvailableBuilds.return.this._subprocess.call.then.):
3038 (OSBuildFetcher.prototype._commitsForAvailableBuilds):
3039 (OSBuildFetcher.prototype._addSubCommitsForBuild):
3040 (OSBuildFetcher.prototype._submitCommits):
3041 (OSBuildFetcher.prototype.fetchAndReportNewBuilds):
3042 * tools/js/subprocess.js: Added.
3043 (const.childProcess.require.string_appeared_here.Subprocess.prototype.call):
3044 (const.childProcess.require.string_appeared_here.Subprocess):
3045 * tools/pull-os-versions.js: Added.
3048 * tools/sync-commits.py:
3049 (Repository.fetch_commits_and_submit):
3051 2017-03-14 Ryosuke Niwa <rniwa@webkit.org>
3053 Make server tests return a promise instead of manually calling done
3054 https://bugs.webkit.org/show_bug.cgi?id=169648
3056 Rubber-stamped by Chris Dumez.
3058 Make the existing server tests always reutrn a promise instead of manually calling "done" callback.
3059 The promise tests are a lot more stable and less error prone.
3061 Also use arrow functions everywhere and use prepareServerTest, renamed from connectToDatabaseInEveryTest,
3062 in more tests instead of manually connecting to database in every test, and reset v3 models.
3064 * server-tests/admin-platforms-tests.js:
3065 * server-tests/admin-reprocess-report-tests.js:
3066 * server-tests/api-build-requests-tests.js:
3067 * server-tests/api-manifest.js:
3068 * server-tests/api-measurement-set-tests.js:
3069 (.postReports): Deleted. Not used in any test.
3070 * server-tests/api-report-commits-tests.js:
3071 * server-tests/api-report-tests.js:
3072 * server-tests/api-update-triggerable.js:
3073 * server-tests/privileged-api-upate-run-status.js:
3074 * server-tests/resources/common-operations.js:
3075 (prepareServerTest): Renamed from connectToDatabaseInEveryTest. Increase the timeout and reset v3 models.
3076 * server-tests/tools-buildbot-triggerable-tests.js:
3078 2017-03-12 Ryosuke Niwa <rniwa@webkit.org>