Update ReadMe.md
[qtwebkit.git] / Websites / perf.webkit.org / ChangeLog-2018-01-01
blobf66c43788633cfa889e882fa648e410445e640da
1 2017-12-26  Dewei Zhu  <dewei_zhu@apple.com>
3         Test freshness page should use build time instead of commit time to determine the freshness of the data point.
4         https://bugs.webkit.org/show_bug.cgi?id=181156
6         Reviewed by Alexey Proskuryakov.
8         Build time is a better data point freshness indicator. Test freshness page is designed to highlight test failures.
9         Using commit time will result in including the compiling and test running time which does not quite match the
10         definition of data point fresshness.
12         * public/v3/pages/test-freshness-page.js:
13         (TestFreshnessPage.prototype._fetchTestResults): Use build time instead of commit time.
15 2017-12-21  Dewei Zhu  <dewei_zhu@apple.com>
17         Add UI for A/B testing on owned commits.
18         https://bugs.webkit.org/show_bug.cgi?id=177993
20         Reviewed by Ryosuke Niwa.
22         Customizable test group form should support specifying and A/B testing owned commits.
23         Introduce 'IntermediateCommitSet' to achieve the goal of specifying owned commits for A/B test.
24         In order to support configure A/B testing that may need to add/remove owned commits, CommitSet may be the
25         closest thing we can get. However, it is a subclass of DataModelObject, which means CommitSet is a representation
26         of 'commit_sets' table and can only be updated from server data. Thus, we want something like CustomCommitSet that
27         is not a representation of database table, but unlike CustomCommitSet, it should store information about commits
28         rather than a revision. As a result, IntermediateCommitSet is introduced. For a longer term, we may replace
29         CustomCommitSet with IntermediateCommitSet as it carries more information and could potentially simplify some
30         CustomCommitSet related APIs by using commit id instead of commit revision.
31         Extend ButtonBase class so that we can enable/disable a button.
33         * public/v3/components/button-base.js:
34         (ButtonBase):
35         (ButtonBase.prototype.setDisabled): Enable/disable a button.
36         (ButtonBase.prototype.render):
37         (ButtonBase.cssTemplate): Added css rule for disabled button.
38         * public/v3/components/combo-box.js: Added.
39         (ComboBox):
40         (ComboBox.prototype.didConstructShadowTree): Setup text field.
41         (ComboBox.prototype.render):
42         (ComboBox.prototype._candidateNameForCurrentIndex): Returns candidate name based on current index.
43         (ComboBox.prototype._candidateElementForCurrentIndex): Returns a list element based on current index.
44         (ComboBox.prototype._autoCompleteIfOnlyOneMatchingItem): Supports auto completion.
45         (ComboBox.prototype._moveCandidate): Supports arrow up/down.
46         (ComboBox.prototype._updateCandidateList): Hide/unhide candidate list and high-light selected candidate.
47         (ComboBox.prototype._renderCandidateList): Render candidate list base on value on text field.
48         (ComboBox.htmlTemplate):
49         (ComboBox.cssTemplate):
50         * public/v3/components/customizable-test-group-form.js:
51         (CustomizableTestGroupForm):
52         (CustomizableTestGroupForm.prototype.didConstructShadowTree): Only fetch the full commits when we about to create a customized A/B tests.
53         (CustomizableTestGroupForm.prototype._computeCommitSetMap): Compute the CustomCommitSet based on IntermediateCommitSet and
54         other revision related information in some map.
55         (CustomizableTestGroupForm.prototype.render):
56         (CustomizableTestGroupForm.prototype._renderCustomRevisionTable):
57         (CustomizableTestGroupForm.prototype._constructTableBodyList): This function builds table body for each highest level repository.
58         It will also include the owned repository rows in the same table body if the commits for highest level repository owns other commits.
59         (CustomizableTestGroupForm.prototype._constructTableRowForCommitsWithoutOwner): Build a table row for a highest level repository.
60         (CustomizableTestGroupForm.prototype._constructTableRowForCommitsWithOwner): Build a table row for repository with owner.
61         (CustomizableTestGroupForm.prototype._constructTableRowForIncompleteOwnedCommits): Build a table row for an unspecified repository.
62         (CustomizableTestGroupForm.prototype._constructRevisionRadioButtons): Update the logic to support build radio buttons for the owned repository rows.
63         (CustomizableTestGroupForm.cssTemplate):
64         * public/v3/components/minus-button.js: Added.
65         (MinusButton):
66         (MinusButton.buttonContent):
67         * public/v3/components/owned-commit-viewer.js:
68         (OwnedCommitViewer.prototype._renderOwnedCommitTable):
69         * public/v3/components/plus-button.js: Added.
70         (PlusButton):
71         (PlusButton.buttonContent):
72         * public/v3/index.html: Added new components.
73         * public/v3/models/commit-log.js: Added owner and owned commit information.
74         (CommitLog):
75         (CommitLog.prototype.ownedCommits): Returns a list of commits owned by current commit.
76         (CommitLog.prototype.ownerCommit): Return owner commit of current commit.
77         (CommitLog.prototype.setOwnerCommits): Set owner commit of current commit.
78         (CommitLog.prototype.label): Remove unnecessary 'else'.
79         (CommitLog.prototype.diff): Remove unused 'fromRevisionForURL' and tiny code cleanup.
80         (CommitLog.prototype.ownedCommitForOwnedRepository):
81         (CommitLog.prototype.fetchOwnedCommits): Sets the owner for those owned commits. The owner of a commit with multiple owner
82         commits will be overwritten by each time this function is called.
83         (CommitLog.ownedCommitDifferenceForOwnerCommits): A more generic version of diffOwnedCommits. diffOwnedCommits only accepts 2 commits,
84         but ownedCommitDifferenceForOwnerCommits supports multiple commits.
85         (CommitLog.diffOwnedCommits): Deleted and should use 'CommitLog.ownedCommitDifferenceForOwnerCommits' instead.
86         * public/v3/models/commit-set.js:
87         (CommitSet.prototype.topLevelRepositories):
88         (CommitSet.prototype.commitForRepository):
89         (IntermediateCommitSet): Take CommitSet as argument, note the commit from CommitSet doesn't contains full information of the commit.
90         Always call 'fetchFullCommits' once before any further usages.
91         (IntermediateCommitSet.prototype.fetchCommitLogs): Fetch all commits information in current commit set.
92         (IntermediateCommitSet.prototype._fetchCommitLogAndOwnedCommits): Fetch commit log and owned commits if necessary.
93         (IntermediateCommitSet.prototype.updateRevisionForOwnerRepository): Updates a commit for a repository by given a revision of the repository.
94         (IntermediateCommitSet.prototype.setCommitForRepository): Sets a commit for a repository in commit set.
95         (IntermediateCommitSet.prototype.removeCommitForRepository): Removes a commit for a repository in commit set.
96         (IntermediateCommitSet.prototype.ownsCommitsForRepository): Returns whether the commit for repository owns commits.
97         (IntermediateCommitSet.prototype.repositories): Returns all repositories in the commit set.
98         (IntermediateCommitSet.prototype.highestLevelRepositories): Returns all repositories those don't have an owner.
99         (IntermediateCommitSet.prototype.commitForRepository): Returns a commit for a given repository.
100         (IntermediateCommitSet.prototype.ownedRepositoriesForOwnerRepository): Returns all repositories owned by a given repository in current commit set.
101         (IntermediateCommitSet.prototype.ownerCommitForRepository): Returns owner commit for a given owned repository.
102         * tools/js/v3-models.js: Added import for 'IntermediateCommitSet'.
103         * unit-tests/commit-log-tests.js: Updated unittest which tests 'ownerCommit' function.
104         * unit-tests/commit-set-tests.js: Added unit tests for IntermediateCommitSet.
106 2017-12-13  Dewei Zhu  <dewei_zhu@apple.com>
108         Add a test freshness page.
109         https://bugs.webkit.org/show_bug.cgi?id=180126
111         Reviewed by Ryosuke Niwa.
113         Added a page to show freshness of a test.
114         The test freshness page reports on the same set of tests as the one shown in the summary page.
115         Use a logistic function to evaluate the freshness of the data points.
116         This function has the desired property which increase dramatically when it close to the center of the graph.
117         'acceptableLastDataPointDurationInHour' configs the center of the graph.
119         * public/include/manifest-generator.php:
120         * public/v3/components/freshness-indicator.js: Added.
121         (FreshnessIndicator): A cell of the test freshness table, color will transit from green to red.
122         (FreshnessIndicator.prototype.update): Update the the data point information and triggers
123         the cell to re-render if anything changes.
124         (FreshnessIndicator.prototype._renderIndicator): Re-render the indicator.
125         (FreshnessIndicator.prototype.render): Render the box color base on a logistic function.
126         (FreshnessIndicator.prototype._createIndicator):
127         (FreshnessIndicator.htmlTemplate):
128         (FreshnessIndicator.cssTemplate):
129         * public/v3/index.html:
130         * public/v3/main.js: Added test freshness page.
131         (main):
132         * public/v3/models/build-request.js: Refactored waitingTime function to make it reusable.
133         (BuildRequest.formatTimeInterval): Format time interval in million seconds to more user friendly text.
134         (BuildRequest.prototype.waitingTime):
135         * public/v3/pages/test-freshness-page.js: Added.
136         (TestFreshnessPage):
137         (TestFreshnessPage.prototype.name):
138         (TestFreshnessPage.prototype._loadConfig): Load config from summary page configurations.
139         (TestFreshnessPage.prototype.open):
140         (TestFreshnessPage.prototype._fetchTestResults):
141         (TestFreshnessPage.prototype.render):
142         (TestFreshnessPage.prototype._renderTable):
143         (TestFreshnessPage.prototype._isValidPlatformMetricCombination): Return whether a platform
144         and metric combination is valid.
145         (TestFreshnessPage.prototype._constructTableCell):
146         (TestFreshnessPage.cssTemplate):
147         (TestFreshnessPage.prototype.routeName):
148         * server-tests/api-manifest-tests.js: Added 'warningHourBaseline' so that we can config the
149         parameter of logistic funciton.
150         * unit-tests/build-request-tests.js: Added unit tests for formatTimeInterval.
152 2017-11-02  Dewei Zhu  <dewei_zhu@apple.com>
154         Add platform argument for syncing script.
155         https://bugs.webkit.org/show_bug.cgi?id=179162
157         Reviewed by Ryosuke Niwa.
159         Syncing script should pass platform name to buildbot if platform argument is specified in configuration.
161         * server-tests/tools-sync-buildbot-integration-tests.js:
162         (return.createTriggerable.configWithPlatformName.then): Added unit test for platform argument.
163         * tools/js/buildbot-syncer.js:
164         (BuildbotSyncer): Add '_platformPropertyName' property.
165         (BuildbotSyncer.prototype.scheduleRequest): Add '_platformPropertyName' to build property if specified.
166         (BuildbotSyncer._loadConfig): Read '_plaformPropertyName' from config.
168 2017-10-30  Dewei Zhu  <dewei_zhu@apple.com>
170         Limit the number of results to be submitted in one submission.
171         https://bugs.webkit.org/show_bug.cgi?id=179045
173         Reviewed by Ryosuke Niwa.
175         Submitting results for a large number of builds with owned commit information may exceed the size limit of php.
176         Added a way to split the results into groups of certain sizes, and submit them one by one.
178         * server-tests/tools-os-build-fetcher-tests.js: Updated the unit tests.
179         * tools/js/os-build-fetcher.js: Added '_maxNumberOfResultsPerSubmit' which can be specified by a configuration but also use 20 as default value.
180         (prototype.fetchAndReportNewBuilds): Instead of submitting all results once, split them into groups and submit them one by one.
181         (prototype._fetchAvailableBuilds): 'label' is already quoted, should remove unnecessary quotes.
182         (prototype._addOwnedCommitsForBuild): Added logging to log the size of owned commits.
184 2017-10-31  Dewei Zhu  <dewei_zhu@apple.com>
186         OwnedCommitViewer should include the preceding commit.
187         https://bugs.webkit.org/show_bug.cgi?id=179047
189         Reviewed by Ryosuke Niwa.
191         OwnedCommitViewer shows the difference between owned commits.
192         To show changes made by first owned commit, we need to have the preceding commit information.
194         * public/v3/components/commit-log-viewer.js:
195         (CommitLogViewer):
196         (CommitLogViewer.prototype._fetchCommitLogs): Fetch preceding commit if the commits fetched is not a single commit.
197         (CommitLogViewer.prototype.render):
198         (CommitLogViewer.prototype._renderCommitList): Conditionally rendering preceding commit in commit list.
200 2017-10-24  Dewei Zhu  <dewei_zhu@apple.com>
202         Fix a bug in syncing script that test/build syncer is never set.
203         https://bugs.webkit.org/show_bug.cgi?id=178772
205         Reviewed by Ryosuke Niwa.
207         Neither 'buildSyncer' nor 'testSyncer' is ever set.
208         Added a unit test to cover this case.
210         * server-tests/tools-sync-buildbot-integration-tests.js:
211         (createTriggerable): Refactor it to allow customized name.
212         * tools/js/buildbot-triggerable.js:
213         (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Update syncer info accordingly.
214         (BuildbotTriggerable._testGroupMapForBuildRequests): Initialize build and test syncer to null.
216 2017-10-24  Dewei Zhu  <dewei_zhu@apple.com>
218         Owner commit does not necessarily exist in the same commit set for an owned commit.
219         https://bugs.webkit.org/show_bug.cgi?id=178763
221         Reviewed by Ryosuke Niwa.
223         Remove the check based on previous incorrect assumption.
224         Added unit tests to cover this change.
226         * public/privileged-api/create-test-group.php:
227         * server-tests/privileged-api-create-test-group-tests.js:
228         (return.addTriggerableAndCreateTask.string_appeared_here.then.id.taskId.id.then):
230 2017-10-20  Dewei Zhu  <dewei_zhu@apple.com>
232         Update perf dashboard upload logic to support uploading binaries from owned commits.
233         https://bugs.webkit.org/show_bug.cgi?id=178610
235         Reviewed by Ryosuke Niwa.
237         Update build requests to 'completed' only when all commit set items are satisfied.
238         Extend 'repositoryList' parameter to be able to specified own commit information.
239         Items in 'repositoryList' can either be a string for top level repository,
240         or a dictionary with two keys: 'ownerRepository' and 'ownedRepository'.
242         * public/api/upload-root.php: Extend upload logic for support uploading binaries from owned commits.
243         * server-tests/api-upload-root-tests.js: Added unit tests.
244         * server-tests/tools-sync-buildbot-integration-tests.js: Added unit tests.
246 2017-10-05  Dewei Zhu  <dewei_zhu@apple.com>
248         Add try-bot button on perf analysis status page.
249         https://bugs.webkit.org/show_bug.cgi?id=177995
251         Reviewed by Ryosuke Niwa.
253         Add 'Create' button on analysis status top-left corner to create trybot analysis task.
255         * public/v3/pages/analysis-category-toolbar.js:
256         (AnalysisCategoryToolbar.cssTemplate):
258 2017-09-28  Dewei Zhu  <dewei_zhu@apple.com>
260         Update syncing script to be able to build binary for commit set with owned commits.
261         https://bugs.webkit.org/show_bug.cgi?id=177225
263         Reviewed by Ryosuke Niwa.
265         Added support for syncing script to be able to schedule builds to build binary for owned commits.
266         Introduces 'ifRepositorySet' and 'ownedRevisions' in 'buildProperties'.
267         'ifRepositorySet' will conditionaly set a build property if at least one of the repositories it specified requires build.
268         'ownedRevisions' specifies owned commits revision informations.
270         * public/v3/models/commit-set.js:
271         (CommitSet): Added '_ownerRepositoryToOwnedRepositoriesMap'.
272         (CommitSet.prototype.updateSingleton): Reset '_ownerRepositoryToOwnedRepositoriesMap'.
273         (CommitSet.prototype._updateFromObject): Only update '_repositoryToCommitOwnerMap' and '_ownerRepositoryToOwnedRepositoriesMap' when 'commitOwner' exists.
274         (CommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories.
275         (CommitSet.prototype.ownedRepositoriesForOwnerRepository): Returns owned repositories given a owner repository.
276         (CustomCommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories.
277         * public/v3/models/triggerable.js:
278         (prototype.accepts): It should only check against top-level repositories. Removed a deprecated 'FIXME'.
279         * server-tests/tools-sync-buildbot-integration-tests.js: Added unit test for building owned commits binary.
280         (createTriggerable): Added conditional 'ifRepositorySet' and 'ownedRevisions' in the repository groups.
281         * tools/js/buildbot-syncer.js:
282         (BuildbotSyncer.prototype._propertiesForBuildRequest):
283             Added logic to conditionaly create build property for 'ifRepositorySet'.
284             Added logic to create 'ownedRevisions' based on the owner repositories it specified.
285         (BuildbotSyncer._parseRepositoryGroup): Build property template should be able to handle 'ifRepositorySet' and 'ownedRevisions'.
286         * unit-tests/buildbot-syncer-tests.js: Added unit tests for 'ifRepositorySet' and 'ownedRevisions'.
287         * unit-tests/commit-set-tests.js: Added unit tests for 'topLevelRepositoriesSortedByNamePreferringOnesWithURL'.
288         * unit-tests/resources/mock-v3-models.js: Added a repository group contains 'ios', 'webkit' and 'ownerRepository'.
290 2017-09-19  Dewei Zhu  <dewei_zhu@apple.com>
292         Use 'owned commit' instead of 'sub commit' whenever refers to a commit owned by another commit.
293         https://bugs.webkit.org/show_bug.cgi?id=177178
295         Reviewed by Ryosuke Niwa.
297         We use both 'owned commit' and 'sub commit' to refer to a commit owned by an another commit. We should use one term instead of two.
298         Renaming 'subCommit' to 'ownedCommit', 'ownsSubCommit' to 'ownsCommit' and 'sub-commit' to 'owned-commit'.
300         * browser-tests/commit-log-viewer-tests.js:
301         * public/api/commits.php:
302         * public/api/report-commits.php:
303         * public/include/commit-log-fetcher.php:
304         * public/v3/components/commit-log-viewer.js:
305         (CommitLogViewer.prototype._renderCommitList):
306         * public/v3/components/owned-commit-viewer.js: Renamed from Websites/perf.webkit.org/public/v3/components/sub-commit-viewer.js.
307         (OwnedCommitViewer):
308         (OwnedCommitViewer.prototype.didConstructShadowTree):
309         (OwnedCommitViewer.prototype._toggleVisibility):
310         (OwnedCommitViewer.prototype.render):
311         (OwnedCommitViewer.prototype._renderOwnedCommitTable):
312         (OwnedCommitViewer.htmlTemplate):
313         (OwnedCommitViewer.cssTemplate):
314         * public/v3/index.html:
315         * public/v3/models/commit-log.js:
316         (CommitLog):
317         (CommitLog.prototype.updateSingleton):
318         (CommitLog.prototype.ownsCommits):
319         (CommitLog.prototype.fetchOwnedCommits):
320         (CommitLog.prototype._buildOwnedCommitMap):
321         (CommitLog.diffOwnedCommits):
322         (CommitLog.prototype.ownsSubCommits): Deleted.
323         (CommitLog.prototype.fetchSubCommits): Deleted.
324         (CommitLog.prototype._buildSubCommitMap): Deleted.
325         (CommitLog.diffSubCommits): Deleted.
326         * server-tests/api-commits-tests.js:
327         * server-tests/api-report-commits-tests.js:
328         * server-tests/tools-os-build-fetcher-tests.js:
329         (return.waitForInvocationPromise.then):
330         (string_appeared_here.return.waitForInvocationPromise.then):
331         * tools/js/os-build-fetcher.js:
332         (prototype._fetchAvailableBuilds):
333         (prototype._addOwnedCommitsForBuild):
334         (prototype._addSubCommitsForBuild): Deleted.
335         * unit-tests/commit-log-tests.js:
336         (return.commit.fetchOwnedCommits.then):
337         (return.fetchingPromise.then):
338         (return.commit.fetchSubCommits.then): Deleted.
340 2017-09-12  Dewei Zhu  <dewei_zhu@apple.com>
342         Performance Dashboard backend should support A/B testing for owned components.
343         https://bugs.webkit.org/show_bug.cgi?id=175978
345         Reviewed by Ryosuke Niwa.
347         Add backend change for Performance Dashboard to support A/B testing for owned components.
348         Added 'commitset_commit_owner' and 'commitset_requires_build' columns to 'commit_set_items' table.
349         'commitset_commit_owner' referrs to determine a commit with owner.
350         'commitset_requires_build' indicates whether a root build is required.
351         This will be set true whenever commit_set_item specifies a patch file,
352         or commit_set_item is commit with owner commit,
353         or any other commit from same repository and in same build-request group requires build.
354         SQL for updating existing database:
355             'BEGIN;
356                 ALTER TABLE commit_set_items ADD COLUMN commitset_commit_owner integer REFERENCES commits DEFAULT NULL, ADD COLUMN commitset_requires_build boolean DEFAULT FALSE;
357                 UPDATE commit_set_items SET commitset_requires_build = TRUE WHERE commitset_patch_file IS NOT NULL;
358                 UPDATE commit_set_items SET commitset_requires_build = TRUE WHERE commitset_set IN (SELECT requests1.request_commit_set FROM build_requests as requests1 JOIN build_requests as requests2 ON requests1.request_group = requests2.request_group JOIN commit_set_items as item ON item.commitset_set = requests2.request_commit_set  WHERE item.commitset_patch_file IS NOT NULL);
359                 ALTER TABLE commit_set_items ADD CONSTRAINT commitset_item_with_patch_must_requires_build CHECK (commitset_patch_file IS NULL OR commitset_requires_build = TRUE),
360                     ADD CONSTRAINT commitset_item_with_owned_commit_must_requires_build CHECK (commitset_commit_owner IS NULL OR commitset_requires_build = TRUE);
361             END;'
363         * init-database.sql: Updated 'commit_set_items' table.
364         * public/admin/triggerables.php: Only top level repository should show on triggerables page.
365         * public/include/build-requests-fetcher.php: Added 'commitOwner' and 'requireBuild' to 'revision_items'. Added 'commitOwner' field to a commit.
366         * public/include/db.php: Should be able to insert boolean value to database without explicted convert to 't' or 'f'.
367         * public/privileged-api/create-test-group.php:
368             Added logic to process 'commitOwner' and 'requireBuild' in 'commit_set_items'.
369             Removed a 'FIXME' that has been addressed before this commit.
370         * public/v3/models/build-request.js:
371         (BuildRequest.constructBuildRequestsFromData): Set 'commitOwner' field for a commit set item.
372         * public/v3/models/commit-set.js:
373         (CommitSet): Added maps for repository to commit owner and whether a repository requires builds.
374         (CommitSet.prototype.updateSingleton):
375         (CommitSet.prototype._updateFromObject):
376         (CommitSet.prototype.ownerRevisionForRepository): Returns owner revision for a given repository in current commit set.
377         (CommitSet.prototype.requiresBuildForRepository): Returns whether a repository need to build.
378         (CommitSet.prototype.equals): Equality check should include 2 new maps.
379         (CustomCommitSet): CustomCommitSet should be able to store commit with an owner commit.
380         (CustomCommitSet.prototype.setRevisionForRepository): Added each revision list entry should have 'ownerRevision'(null by default).
381         (CustomCommitSet.prototype.equals): Equality check should also check the equality of 'ownerRevision'.
382         (CustomCommitSet.prototype.ownerRevisionForRepository): Returns a owner revision for a given repository.
383         * public/v3/models/repository.js:
384         (Repository.prototype.findOwnedRepositoryByName): Return an repository owned by current repository with a given name.
385         * public/v3/models/test-group.js: Added 'ownerRevision' field in each entry of revisionSet.
386         * server-tests/api-build-requests-tests.js: Added tests.
387         * server-tests/privileged-api-create-test-group-tests.js: Added tests.
388         * server-tests/privileged-api-upload-file-tests.js: Fix unit tests by setting'requires_build' field to be true when updating commit_set_item which has a patch..
389         * server-tests/resources/mock-data.js: Added mock build requests with commit sets contain owned commits.
390         (MockData.jscRepositoryId): Returns id for JavaScriptsCore repository.
391         (MockData.addMockConfiguration): Added mock JavaScriptCore and owned JavaScriptCore repositories and commits associated with them.
392         (MockData.ownedJSCRepositoryId): Added a JavaScriptCore repository with WebKit as owner.
393         (MockData.addMockConfiguration): Added mock data for test cases those require a commit with a owner commit.
394         (MockData.addTestGroupWithOwnedCommits): Added mock data for analysis tasks, the build requires of which contains owned commits.
395         (MockData.set addAnotherTriggerable): Added another triggerable which has mac, webkit and javascript core repositories as triggerable repository group.
396         (MockData.set addAnotherMockTestGroup): Added another mock test group.
397         * tools/js/v3-models.js: Import CustomCommitSet.
398         * unit-tests/resources/mock-v3-models.js: Added an owned webkit repository.
399         * unit-tests/commit-set-tests.js: Added unit tests CustomCommitSet.
401 2017-09-15  Dewei Zhu  <dewei_zhu@apple.com>
403         Should not mark a platform as missing in summary page if all expecting metrics are exlucded.
404         https://bugs.webkit.org/show_bug.cgi?id=176970
406         Reviewed by Ryosuke Niwa.
408         In summary page, if all metrics for a test are excluded in excludedConfigurations for a platform, this platform should not be marked as missing.
410         * public/v3/pages/summary-page.js:
411         (SummaryPageConfigurationGroup):
413 2017-09-11  Ryosuke Niwa  <rniwa@webkit.org>
415         Analysis task page shows an empty results for an irrelevant top-level test
416         https://bugs.webkit.org/show_bug.cgi?id=175252
418         Reviewed by Antti Koivisto.
420         The bug was caused by TestGroupResultsViewer always listing every top-level test which has a result for the
421         entire analysis task. Since a custom analysis task (perf try bots) allows multiple tests to be tested in each
422         group, we have to only list the tests which contains results in a particular test group.
424         * public/v3/components/test-group-results-viewer.js:
425         (TestGroupResultsViewer.prototype.render): Find the tests that have results for the current test group instead
426         of for any test group in this analysis task.
427         any test 
428         * public/v3/models/analysis-results.js:
429         (AnalysisResults):
430         (AnalysisResults.prototype.topLevelTestsForTestGroup): Renamed from highestTests. Now takes a test group
431         as an argument.
432         (AnalysisResults.prototype._computedTopLevelTests): Renamed from _computeHighestTests. Filters the results
433         with the specified test group.
435 2017-09-06  Aakash Jain  <aakash_jain@apple.com>
437         Add initSyncers method in BuildbotTriggerable
438         https://bugs.webkit.org/show_bug.cgi?id=176125
440         Reviewed by Ryosuke Niwa.
442         * tools/sync-buildbot.js:
443         (syncLoop): Use initSyncers() which returns a promise. Modified to handle the promise.
444         * tools/js/buildbot-triggerable.js:
445         (BuildbotTriggerable): Invokes initSyncers() appropriately.
446         (BuildbotTriggerable.prototype.initSyncers): Returns a promise which initialize all the syncers.
447         * server-tests/tools-buildbot-triggerable-tests.js: Updated tests to handle initSyncers().
448         * server-tests/tools-sync-buildbot-integration-tests.js: Ditto.
450 2017-09-05  Ryosuke Niwa  <rniwa@webkit.org>
452         Add a button to show two weeks of data to perf dashboard
453         https://bugs.webkit.org/show_bug.cgi?id=176438
455         Reviewed by Saam Barati.
457         Add "2W" button to show 14 days of data on dashboard pages.
459         * public/v3/pages/dashboard-toolbar.js:
460         (DashboardToolbar):
462 2017-08-29  Ryosuke Niwa  <rniwa@webkit.org>
464         Build fix. OS X "revision" can have a space.
466         * public/include/commit-log-fetcher.php:
468 2017-08-29  Ryosuke Niwa  <rniwa@webkit.org>
470         Make it possible to specify A/B testing revision with a partial hash
471         https://bugs.webkit.org/show_bug.cgi?id=176047
473         Rubber-stamped by Chris Dumez.
475         Added the support for specifying a partial hash in A/B testing instead of the full hash.
477         * public/include/commit-log-fetcher.php:
478         (CommitLogFetcher::find_commit_id_by_revision): Extracted from associate-commit.php.
479         * public/privileged-api/associate-commit.php:
480         (main): 
481         * public/privileged-api/create-test-group.php:
482         (main): Use find_commit_id_by_revision here to support scheduling an A/B testing with a partial hash.
483         * server-tests/privileged-api-create-test-group-tests.js:
484         (createAnalysisTask): Make it possible to customize revision string in some test cases.
485         * server-tests/resources/test-server.js:
486         (TestServer.prototype._stopApache): Fixed the bug that cleanup step always fails whenever the test file
487         runs more than 8s.
489 2017-08-26  Ryosuke Niwa  <rniwa@webkit.org>
491         Build fix. Creating trying a test group no longer updates the page.
493         * public/v3/models/test-group.js:
494         (TestGroup.createWithCustomConfiguration): Added the missing ignoreCache=true.
496 2017-08-21  Dewei Zhu  <dewei_zhu@apple.com>
498         Performance Dashboard should be compatible with PHP 7.
499         https://bugs.webkit.org/show_bug.cgi?id=175813
501         Reviewed by Ryosuke Niwa.
503         Use `file_get_contents('php://input')` instead of '$HTTP_RAW_POST_DATA'.
504         Update test harness script to load right php module in httpd.
506         * ReadMe.md: JSON example format fix.
507         * public/api/report-commits.php: Stop using '$HTTP_RAW_POST_DATA'.
508         * public/api/report.php: Stop using '$HTTP_RAW_POST_DATA'.
509         * public/api/update-triggerable.php: Stop using '$HTTP_RAW_POST_DATA'.
510         * public/include/json-header.php: Stop using '$HTTP_RAW_POST_DATA'.
511         * public/include/report-processor.php: Stop using '$HTTP_RAW_POST_DATA'.
512         * server-tests/resources/test-server.conf: Load php5 or php7 module conditionally.
513         * server-tests/resources/test-server.js: Pass PHP version info while launching httpd.
514         (TestServer.prototype._startApache):
515         * tools/remote-cache-server.py: Pass PHP version info while launching httpd.
516         (start_httpd):
517         * tools/remote-server-relay.conf: Load php5 or php7 module conditionally.
518         * tools/sync-buildbot.js:
519         (syncLoop.const.makeTriggerable):
520         (syncLoop):
522 2017-08-17  Ryosuke Niwa  <rniwa@webkit.org>
524         Number each section in ReadMe.md and add more clarifications
525         https://bugs.webkit.org/show_bug.cgi?id=175687
527         Rubber-stamped by Joseph Pecoraro.
529         Numbered each section and added more clarifications per issues Aakash encountered.
531         * ReadMe.md:
533 2017-08-17  Ryosuke Niwa  <rniwa@webkit.org>
535         Build fix. Make the test work with the latest versions of node modules.
537         * server-tests/privileged-api-upload-file-tests.js:
539 2017-07-27  Ryosuke Niwa  <rniwa@webkit.org>
541         Build fix. Fixed a typo. task.id() isn't a thing in this function.
543         * public/v3/models/test-group.js:
544         (TestGroup.createWithCustomConfiguration):
546 2017-07-11  Ryosuke Niwa  <rniwa@webkit.org>
548         Another build fix.
550         * public/v3/components/chart-pane-base.js:
551         (ChartPaneBase.prototype._updateCommitLogViewer):
553 2017-07-11  Ryosuke Niwa  <rniwa@webkit.org>
555         Build fix. It looks like the code here is racy.
557         * public/v3/components/chart-pane-base.js:
558         (ChartPaneBase.prototype.configure):
559         (ChartPaneBase.prototype.setOpenRepository):
561 2017-07-11  Ryosuke Niwa  <rniwa@webkit.org>
563         Show the roots built by perf try bots on results page
564         https://bugs.webkit.org/show_bug.cgi?id=174305
566         Reviewed by Joseph Pecoraro.
568         Show build products created by a perf try bots so that we can download them for local testing.
570         * public/v3/components/test-group-revision-table.js:
571         (TestGroupRevisionTable.prototype._renderTable): Find the set of repositories for which a patch is applied.
572         Show build products for all commit sets for such a repository since when WebKit is built with a patch in
573         one configuration, the other configuration also needs to be built for consistency.
574         (TestGroupRevisionTable.prototype._buildCommitCell): Added the hyperlink for build products.
575         (TestGroupRevisionTable.prototype._buildFileInfo): Takes a string to override the file's label. Since all
576         build products made by bots tend to have the same filename, we show the label of "Build product" instead.
577         (TestGroupRevisionTable.prototype._mergeCellsWithSameCommitsAcrossRows): Fixed a bug that any entry with
578         a patch wasn't getting merged since it was comparing against the result commit set, which does not contain
579         the patch (only requested commit set contains a patch).
581 2017-07-10  Ryosuke Niwa  <rniwa@webkit.org>
583         Address Antti's review comment.
585         * public/v3/models/analysis-results.js:
586         (AnalysisResults.prototype.containsTest):
588 2017-07-10  Ryosuke Niwa  <rniwa@webkit.org>
590         A/B testing results page show results for the top-level tests instead of the one being analyzed
591         https://bugs.webkit.org/show_bug.cgi?id=174304
593         Reviewed by Antti Koivisto.
595         When a specific subtest is analyzed (e.g. Images subtest of MotionMark), then TestGroupResultsViewer
596         should expand and highlight that specific subtest instead of simply showing the top-level test's score.
597         This is especially misleading since AnalysisResultsViewer (stacking bars for each test group) uses
598         the score of the specific subtest being analyzed.
600         Fixed the bug by passing in the metric associated with the analysis task from AnalysisTaskPage to
601         TestGroupResultsViewer via AnalysisTaskTestGroupPane. Also made TestGroupResultsViewer.setAnalysisResults
602         auto-expand the tests that are ancestors of the specified metric. Without that, the test won't be shown
603         to the user until the ancestor tests are expanded by the user.
605         Also fixed the bug that we were always listing sub-tests regardless of whether they have results or not.
606         Since tests tend to change over time, we shouldn't show a test if it doesn't have any results associated.
608         * public/v3/components/test-group-results-viewer.js:
609         (TestGroupResultsViewer.prototype.setAnalysisResults): Expand the ancestor tests of the metric.
610         (TestGroupResultsViewer.prototype._buildRowsForTest): Exit early if this test doesn't have any results.
611         * public/v3/models/analysis-results.js:
612         (AnalysisResults.prototype.containsTest): Added.
613         * public/v3/pages/analysis-task-page.js:
614         (AnalysisTaskTestGroupPane.prototype.setAnalysisResults): Takes a metric to pass it to the results viewer.
615         (AnalysisTaskPage.prototype._assignTestResultsIfPossible):
617 2017-07-06  Ryosuke Niwa  <rniwa@webkit.org>
619         Safari 10.1 fails to upload a patch on perf try bots page
620         https://bugs.webkit.org/show_bug.cgi?id=174214
622         Reviewed by Chris Dumez.
624         Added the workaround to make the analysis task page work on Safari 10.1
626         * public/v3/components/instant-file-uploader.js:
627         (InstantFileUploader.prototype._uploadFiles): Convert files to an array since for-of doesn't work otherwise on Safari 10.1.
628         * public/v3/models/uploaded-file.js:
629         (UploadedFile._computeSHA256Hash): Fallback to crypto.webkitSubtle since crypto.subtle isn't available on Safari 10.1 or 11.
631 2017-07-03  Ryosuke Niwa  <rniwa@webkit.org>
633         Fix a typo pointed out by Andreas Kling.
635         * public/v3/components/instant-file-uploader.js:
636         (InstantFileUploader.prototype._uploadFiles):
637         * public/v3/models/uploaded-file.js:
638         (UploadedFile.fetchUploadedFileWithIdenticalHash): Renamed from fetchUnloadedFileWithIdenticalHash.
640 2017-07-03  Ryosuke Niwa  <rniwa@webkit.org>
642         Add an admin page to manage uploaded files
643         https://bugs.webkit.org/show_bug.cgi?id=174089
645         Reviewed by Andreas Kling.
647         Add an admin page to see the disk usage per user as well as the total, and to prune any zombie files (ones marked
648         as deleted but aren't actually deleted in the filesystem).
650         * public/admin/files.php: Added.
651         (format_size): Added.
652         * public/include/admin-header.php:
654 2017-07-03  Ryosuke Niwa  <rniwa@webkit.org>
656         Roots uploaded by bots don't get author specified properly
657         https://bugs.webkit.org/show_bug.cgi?id=174087
659         Reviewed by Andreas Kling.
661         When a root file is uploaded from the bot, we manually specify the remote user to upload_file_in_transaction.
662         However, this was getting ignored by create_uploaded_file_from_form_data since it was always calling
663         remote_user_name to get the user name off of $_SERVER.
665         Fixed the bug by passing in the user name from upload_file_in_transaction to create_uploaded_file_from_form_data.
667         * public/include/uploaded-file-helpers.php:
668         (create_uploaded_file_from_form_data): Take the remote user as an argument instead of calling remote_user_name.
669         (upload_file_in_transaction):
670         * server-tests/api-upload-root-tests.js: Updated an existing test cases to make sure root files' author is set.
671         (createTestGroupWihPatch): Manually override the author of a test group for testing.
673 2017-07-03  Ryosuke Niwa  <rniwa@webkit.org>
675         Prune unused uploaded files when the file quota is reached
676         https://bugs.webkit.org/show_bug.cgi?id=174086
678         Reviewed by Andreas Kling.
680         Made /privileged-api/uploaded-file and /api/upload-root automatically delete old uploaded files when
681         uploading a new file results in the file quota to be exceeded. Also added the notion of the total quota
682         to avoid running out of a disk when there are hundreds of users each uploading near their quota.
684         * config.json: Added a sample total disk quota of 100GB.
685         * public/include/uploaded-file-helpers.php:
686         (query_file_usage_for_user): Renamed from query_total_file_size.
687         (query_total_file_usage): Added.
688         (upload_file_in_transaction):
689         (delete_file): Added.
690         (prune_old_files): Added.
691         * server-tests/privileged-api-upload-file-tests.js: Added tests for deleting old uploaded files as well as
692         tests for the total quota.
693         * server-tests/resources/test-server.js:
694         (TestServer.prototype.testConfig): Added uploadTotalQuotaInMB to the test configuration.
696 2017-06-29  Ryosuke Niwa  <rniwa@webkit.org>
698         UploadedFile should include the file extension in its url
699         https://bugs.webkit.org/show_bug.cgi?id=174009
701         Reviewed by Chris Dumez.
703         Some command line tools such as darwinup use the file extension to determine the file type.
704         Include the file extension in the URL of an uploaded file to make it work with these tools.
706         * public/include/uploaded-file-helpers.php:
707         (format_uploaded_file): Include the file extension.
708         * public/v3/models/uploaded-file.js:
709         (UploadedFile):
710         (UploadedFile.prototype.url): Return the URL with hthe file extension specified. /api/uploaded-file
711         already supports having the file extension specified.
712         * server-tests/tools-sync-buildbot-integration-tests.js: Updated test cases.
713         * unit-tests/buildbot-syncer-tests.js: Ditto.
715 2017-05-31  Ryosuke Niwa  <rniwa@webkit.org>
717         Don't shouldn't create a request to build a patch if there is no patch to build
718         https://bugs.webkit.org/show_bug.cgi?id=172791
720         Reviewed by Chris Dumez.
722         When a commit set doesn't have a patch specified, don't create a request to build. For example, when we're comparing
723         WebKit in the system to WebKit with a patch, there is nothing to build for the first commit set.
725         However, when conducting an A/B testing, it's advisible to compare WebKit built with and without a patch on a single
726         machine with the same version of Xcode, etc... For this reason, we still create a request to build for a commit set
727         if there is another commit set with a patch which uses the same repository group.
729         * public/privileged-api/create-test-group.php:
730         (main): Fixed the bug. Only create a build request to build if there is a matching repository group with a patch.
731         * server-tests/privileged-api-create-test-group-tests.js: Added a test case.
733 2017-05-31  Ryosuke Niwa  <rniwa@webkit.org>
735         Allow sync-buildbot.js to set a buildbot property only when patches are built
736         https://bugs.webkit.org/show_bug.cgi?id=172743
738         Rubber-stamped by Chris Dumez.
740         Added the ability to specify a buildbot property only when there are build requests to build a patch.
742         * tools/js/buildbot-syncer.js:
743         (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group.
744         (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto.
745         (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property.
746         For the condition type of "built", we check if there was any other 
747         (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional.
749         * tools/js/buildbot-triggerable.js:
750         (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that
751         belong to the same test group.
752         (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto.
754         * unit-tests/buildbot-syncer-tests.js:  Added test case for newly added "ifBuilt" as well as specifying a patch.
755         Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest,
756         and scheduleRequestInGroupIfAvailable.
757         (createSampleBuildRequestWithPatch): Added.
759         * unit-tests/resources/mock-v3-models.js:
760         (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing.
762 2017-05-30  Ryosuke Niwa  <rniwa@webkit.org>
764         sync-builedbot.js fails to schedule the second request to test with a patch
765         https://bugs.webkit.org/show_bug.cgi?id=172701
767         Reviewed by Antti Koivisto.
769         The bug was caused by an assertion failure in BuildbotTriggerable's _pullBuildbotOnAllSyncers failing to
770         take into account that for a test group with a patch could be associated with two syncers, one to build
771         a patch and another to run tests. Fixed the bug by differentiating the two types of syncers by buildSyncer
772         and testSyncer per test group.
774         * server-tests/tools-sync-buildbot-integration-tests.js: Extended a test case so that it would hit the
775         assertion without the fix.
777         * tools/js/buildbot-triggerable.js:
778         (BuildbotTriggerable.prototype.syncOnce): Use the right kind of the syncer to schedule a build or a test.
779         (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Associate a given syncer based on the kind of
780         the build request it processed, and assert accordingly.
782 2017-05-29  Ryosuke Niwa  <rniwa@webkit.org>
784         Fix UI glitches with a custom analysis test group with a patch
785         https://bugs.webkit.org/show_bug.cgi?id=172694
787         Reviewed by Sam Weinig.
789         Fix the following UI glitches with perf try bots:
790          - Retrying an A/B testing with a patch fails.
791          - A patch specified in an test group does not get specified in the configurator.
792          - Drag & dropping a patch doesn't work.
793          - Results for custom analysis tasks don't get shown.
795         * public/api/test-groups.php:
796         (main): Fix a bug that test group's platform does not match that of the request'ed platform. Since each test
797         group is associated with platform, just use that instead of querying test_configurations. This resulted in
798         the configurator not being able to find a triggerable in some cases.
800         * public/v3/components/custom-analysis-task-configurator.js:
801         (CustomAnalysisTaskConfigurator):
802         (CustomAnalysisTaskConfigurator.prototype.setCommitSets): Add patches in the commit set.
803         (CustomAnalysisTaskConfigurator.prototype._setUploadedFilesToUploader): Now clears the exiting uploaded files
804         Also renamed from _setUploadedFilesIfEmpty.
805         (CustomAnalysisTaskConfigurator.prototype._setPatchFiles): Added.
806         (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): We no longer update the list of roots
807         for the comparsion when a new root is added to the baseline.
808         (CustomAnalysisTaskConfigurator.prototype._configureComparison): Copy over the list of patches and roots when
809         starting to configure the comparsion.
811         * public/v3/components/instant-file-uploader.js:
812         (InstantFileUploader.prototype.clear): Added.
813         (InstantFileUploader.prototype.didConstructShadowTree): Added event handlers for dragover & drop events to
814         allow specifying a patch and root using drag & drop. Unfortunately, this still doesn't work in WebKit due to
815         a bug in our shadow DOM implementation.
816         (InstantFileUploader.prototype._didFileInputChange):
817         (InstantFileUploader.prototype._uploadFiles): Extracted from _didFileInputChange.
819         * public/v3/pages/analysis-task-page.js:
820         (AnalysisTaskTestGroupPane.prototype.setAnalysisResults): No longer takes metric.
821         (AnalysisTaskTestGroupPane.cssTemplate): Removed unused rules. Also disallow flexing on the list of test groups
822         to avoid the name of a test froup from overflowing on top of the results pane.
823         (AnalysisTaskPage.prototype._assignTestResultsIfPossible): Set setAnalysisResults even when metric is not set
824         as is the case for a custom analysis task.
825         (AnalysisTaskPage.prototype._retryCurrentTestGroup): Use createWithCustomConfiguration to allow retrying of
826         an A/B testing with a patch in a custom analysis task.
827         (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingCommitSetList):
829 2017-05-26  Ryosuke Niwa  <rniwa@webkit.org>
831         Show patches applied in each A/B testing build requests
832         https://bugs.webkit.org/show_bug.cgi?id=172636
834         Reviewed by Antti Koivisto.
836         List patches applied along side revisions inn the list of revisions for an A/B tesing build requests if there
837         are any patches applied.
839         * public/v3/components/test-group-revision-table.js:
840         (TestGroupRevisionTable.prototype._renderTable): Indicate which request is to build a patch and which one is
841         to run tests.
842         (TestGroupRevisionTable.prototype._buildCommitCell): Include the patch file's information when there is one.
843         We need to use the requested commit set instead of the one reported by testers or builders since they don't
844         include patch or root information.
845         (TestGroupRevisionTable.prototype._buildCustomRootsCell):
846         (TestGroupRevisionTable.prototype._buildFileInfo): Extracted from _buildCustomRootsCell.
848 2017-05-26  Ryosuke Niwa  <rniwa@webkit.org>
850         The queue page is broke when there is a custom analysis task
851         https://bugs.webkit.org/show_bug.cgi?id=172631
853         Reviewed by Antti Koivisto.
855         Fix the bug that we were always assuming each build request to have a test associated.
857         * public/v3/models/test-group.js:
858         (TestGroup.createAndRefetchTestGroups): Fixed the bug that we were referring to a non-existent variable task.
859         * public/v3/pages/build-request-queue-page.js:
860         (BuildRequestQueuePage.prototype._constructBuildRequestTable): Fixed the bug. Collect every request in the group
861         and then find the first test request's test name. Make it clear that we're waiting for a build as needed.
863 2017-05-25  Ryosuke Niwa  <rniwa@webkit.org>
865         Syncing script shouldn't schedule a build request when there is a build from another test group in progress
866         https://bugs.webkit.org/show_bug.cgi?id=172577
867         <rdar://problem/32395049>
869         Reviewed by Chris Dumez.
871         When a buildbot master gets restarted while there is an in-progress build and a pending build, the master will
872         re-schedule the currently running build, and this can result in multiple build requests from different test
873         groups being scheduled simultaneously.
875         sync-buildbot.js was supposed to recover from this state by only processing build requests from one test group
876         at a time and eventually come back to a state where only a single test group is running per buildbot slave.
878         We had a test for this particular case but it wasn't testing what it claimed to test. Rewriten the test case
879         and fixed the bug by explicitly checking this condition and treating it as if there is a pending build already
880         scheduled in the builder in this case.
882         * public/api/test-groups.php:
883         (main): Fixed a regression from r217397. Return the platform ID of the first request when none of the requets
884         have been processed yet or all of them had failed.
885         * server-tests/tools-buildbot-triggerable-tests.js: Rewritten a test case intended to cover this bug.
886         (.assertRequestAndResolve): Added.
887         * tools/js/buildbot-syncer.js:
888         (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Fixed the bug. Avoid scheduling a new request on
889         this syncer if there is a build in progress for a test group different from that of the new request. Reuse the
890         code we had to deal with a pending build for this purpose.
892 2017-05-24  Ryosuke Niwa  <rniwa@webkit.org>
894         Opening an analysis task from the queue page is broken
895         https://bugs.webkit.org/show_bug.cgi?id=172559
896         <rdar://problem/32389708>
898         Rubber-stamped by Chris Dumez.
900         Fix the bug that opening the analysis task page from the queue page results in multiple assertion failures
901         as well as the list of test groups in the analysis task page not getting updated.
903         * public/v3/models/build-request.js:
904         (BuildRequest.prototype.updateSingleton): Because /api/build-requests/ do not include test groups, it's
905         possible for testGroup to be dynamically updated upon loading an analysis task page. Update _testGroup in
906         such instances instead of asserting that it doesn't happen.
908         * public/v3/models/data-model.js:
909         (DataModelObject.cachedFetch): Because various code to create model objects from the result of a JSON API
910         modify the fetched content in irreversible manner, e.g. `object.platform = Platform.findById(object.platform)`
911         we must return a fresh new content each time even if the result had been cached.
913         * public/v3/models/test-group.js:
914         (TestGroup.prototype.platform): Return this._platform as that's not available.
916         * public/v3/pages/analysis-task-page.js:
917         (AnalysisTaskPage):
918         (AnalysisTaskPage.prototype._resetVariables): Extracted from the constructor.
919         (AnalysisTaskPage.prototype.updateFromSerializedState): Reset all instance variables when opening a new
920         analysis task page. This would avoid showing the stale result even when fetching new test groups had failed.
922         * unit-tests/test-groups-tests.js: Added a test case for fetching the same test group twice. This used to hit
923         a problem in BuildRequest.constructBuildRequestsFromData which overrode platform property of each raw content
924         with a Platform model object because in the case of a cached fetch, we end up trying to look up the platform
925         again using the result of stringifying the Platform object instead of the platform ID included in the original
926         fetched content.
927         (sampleTestGroup): Added "platform" as included in the JSON API's response now.
929 2017-05-24  Ryosuke Niwa  <rniwa@webkit.org>
931         The commit log viewer can overlap the analysis results viewer
932         https://bugs.webkit.org/show_bug.cgi?id=172534
934         Rubber-stamped by Chris Dumez.
936         Allocate the padding on the right for the commit log viewer, and add a horizontal scrollbar
937         to the analysis results viewer instead of letting it expand beneath the commit log viewer.
939         * public/v3/pages/analysis-task-page.js:
940         (AnalysisTaskResultsPane.htmlTemplate):
941         (AnalysisTaskResultsPane.cssTemplate):
943 2017-05-24  Ryosuke Niwa  <rniwa@webkit.org>
945         Sycning script build fix after r217378.
947         * tools/sync-buildbot.js:
948         (syncLoop):
950 2017-05-23  Ryosuke Niwa  <rniwa@webkit.org>
952         Add the support for perf try bots to sync-buildbot.js
953         https://bugs.webkit.org/show_bug.cgi?id=172529
955         Rubber-stamped by Chris Dumez.
957         Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot.
959         Change the buildbot property format in the syncing script's configuration again to use a dictionary
960         with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots,
961         and simplified the structure of the configuration by always having "types" and "builders", and
962         make each entry in "configurations" refer to a list of types, platforms, and builders.
964         Since now there are build requests to build patches and run tests, "configurations" has been renamed to
965         "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations"
966         specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot
967         properties for testing is now specified as "testProperties" and ones for building a patch is specified
968         in newly introduced "buildProperties".
970         * public/api/build-requests.php:
971         (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed
972         since there is no way to run tests without a successful build.
974         * public/api/update-triggerable.php:
975         (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was
976         the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js.
978         * public/v3/models/build-request.js:
979         (BuildRequest.prototype.hasCompleted): Added.
981         * public/v3/models/manifest.js:
982         (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and
983         syncLoop in tools/sync-buildbot.js
984         (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually
985         reset V3 models in syncLoop.
987         * public/v3/models/uploaded-file.js:
988         (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path.
990         * public/v3/remote.js:
991         (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL.
993         * server-tests/api-update-triggerable-tests.js:
994         (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call
995         Manifest.fetch instead.
997         * server-tests/resources/mock-data.js:
998         (MockData.resetV3Models): Calls Manifest.reset().
999         (MockData.addMockConfiguration): Extracted from addMockData.
1000         (MockData.addMockData): Updated per the format change.
1001         (MockData.mockTestSyncConfigWithSingleBuilder): Ditto.
1002         (MockData.mockTestSyncConfigWithTwoBuilders): Ditto.
1003         (MockData.runningBuild): Make buildNumber specifiable.
1004         (MockData.finishedBuild): Ditto.
1006         * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change.
1007         Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a
1008         repository group that which accepts a patch and not take roots.
1010         * server-tests/tools-sync-buildbot-integration-tests.js: Added.
1011         (createTriggerable): Added.
1012         (createTestGroupWihPatch): Added.
1013         (uploadRoot): Added.
1014         (.assertAndResolveRequest): Added.
1015         (.assertTestBuildHasFailed): Added.
1017         * tools/js/buildbot-syncer.js:
1018         (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder
1019         is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed
1020         _testConfigurations to _configurations.
1021         (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't
1022         been set or it's a tester.
1023         (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder.
1024         (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder.
1025         (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this
1026         syncer is a builder. Otherwise returns [].
1027         (BuildbotSyncer.prototype.isTester): Added.
1028         (BuildbotSyncer.prototype.matchesConfiguration):
1029         (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format.
1030         (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations.
1031         (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry,
1032         creates the list of configurations per builder and platform.
1033         (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision,
1034         roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial
1035         explosion in the number of things that can go wrong. Also parse buildProperties optionally.
1036         (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of
1037         buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved
1038         type such as "revision" and "patch".
1039         (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types",
1040         "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms.
1042         * tools/js/buildbot-triggerable.js:
1043         (BuildbotTriggerable.prototype.syncOnce):
1044         (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not
1045         associated with any test.
1046         (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to
1047         build a patch which has not been completed (pending, scheduled, running, or failed). Since all
1048         requests to build a patch has a negative order, those requests should all show up at the beginning.
1049         (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when
1050         scheduling the first request to build a patch or the first request to run a test. The first request
1051         to run a test will always have order of 0, so it's a sufficient condition to find such a request.
1052         On the other hand, the first request to build a patch can have a negative order number so we must
1053         explicitly check if it's the first item in the ordered list of requests in the test group.
1055         * tools/remote-server-relay.log: Added.
1057         * tools/sync-buildbot.js:
1058         (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so
1059         that Triggerable and related objects we have in the memory may not reflect what we just synced to
1060         the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that.
1062         * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test
1063         exception messages explicitly since allowing any exception was resulting in some tests passing a
1064         result of unrelated parsing error being thrown, etc...
1065         (sampleiOSConfig): Updated per the format change.
1066         (sampleiOSConfigWithExpansions): Ditto.
1067         (smallConfiguration): Ditto.
1069 2017-05-22  Dewei Zhu  <dewei_zhu@apple.com>
1071         Fix the bug that sometimes analysis task results pane is missing.
1072         https://bugs.webkit.org/show_bug.cgi?id=172404
1074         Reviewed by Ryosuke Niwa.
1076         AnalysisTaskPage._didFetchTask and AnalaysisTaskPage._fetchRelatedInfoForTaskId should be called in order.
1077         The race between those two functions causes the analysis task results pane sometimes missing.
1079         * public/v3/components/analysis-results-viewer.js:
1080         (AnalysisResultsViewer.prototype.render): Fix the bug in r217173 that commitSet can be undefined.
1081         * public/v3/pages/analysis-task-page.js:
1082         (AnalysisTaskPage.prototype.updateFromSerializedState): Use arrow function to get rid of self variable.
1083         Use `const` instead of var for constant variable. And call _didFetchTask before calling _fetchRelatedInfoForTaskId.
1084         (AnalysisTaskPage.prototype._renderTaskNameAndStatus):
1085         (AnalysisTaskPage.cssTemplate):
1087 2017-05-19  Ryosuke Niwa  <rniwa@webkit.org>
1089         Add a commit log viewer next to the analysis results viewer
1090         https://bugs.webkit.org/show_bug.cgi?id=172399
1092         Reviewed by Chris Dumez.
1094         Add a commit log viewer next to the analysis results viewer, which visualizes the A/B testing results.
1096         Also linkify the revisions in the table that shows the status of each A/B testing job,
1097         and allow the prefix of "r" when associating a Subversion revision.
1099         Finally, Fixed a bug that the list of commits associated with the analysis task were not re-rendered
1100         when the list was updated by the user.
1102         * public/v3/components/analysis-results-viewer.js:
1103         (AnalysisResultsViewer): Added _selectorRadioButtonList as an instance variable. It's a list of radio
1104         buttons to select a configuration (A/B) with a commit set. It's added to update the checked status of
1105         radio buttons upon changing the currently selected test group.
1106         (AnalysisResultsViewer.prototype.setTestGroups): Update the selected range to that of the currently
1107         selected group.
1108         (AnalysisResultsViewer.prototype.render): Fill _selectorRadioButtonList with radio buttons.
1110         * public/v3/components/commit-log-viewer.js:
1111         (CommitLogViewer): Added _showRepositoryName as an instance variable.
1112         (CommitLogViewer.prototype.setShowRepositoryName): Added.
1113         (CommitLogViewer.prototype.render): Hide the repository name when _showRepositoryName is false. This
1114         is used in the newly added commit log viewer for the analysis results since we're showing a select
1115         element with all the names of repositories above this component.
1117         * public/v3/components/test-group-revision-table.js:
1118         (TestGroupRevisionTable.prototype._buildCommitCell): Linkify the revisions if possible.
1120         * public/v3/models/analysis-task.js:
1121         (AnalysisTask.prototype.associateCommit): Strip "r" at the beginning for a Subversion like r12345
1122         since that's the format we use to show to the user. This makes copy & paste easier.
1124         * public/v3/pages/analysis-task-page.js:
1125         (AnalysisTaskResultsPane): Added a bunch of new instance variables to show and update the commit log
1126         viewer next to the analysis results viewer.
1127         (AnalysisTaskResultsPane.prototype.setPoints): Create the list of repositories to show details.
1128         (AnalysisTaskResultsPane.prototype.didConstructShadowTree): Re-render when the current selected test
1129         group changes since that may have updated the selected range for A/B testing. Also re-render when
1130         a new repository is selected to show details.
1131         (AnalysisTaskResultsPane.prototype.render): Update the list of repositories and the commit log viewer.
1132         (AnalysisTaskResultsPane.prototype._renderRepositoryList): Renders the list of repositories.
1133         (AnalysisTaskResultsPane.prototype._updateCommitViewer): Updates the commit log viewer given the range
1134         selected in the analysis results viewer.
1135         (AnalysisTaskResultsPane.htmlTemplate): Updated the template.
1136         (AnalysisTaskResultsPane.cssTemplate): Ditto.
1137         (AnalysisTaskTestGroupPane.cssTemplate): Add a little space between the list of results and the table
1138         of A/B testing jobs with revisions.
1139         (AnalysisTaskPage.prototype.render): Fixed the bug that the list of commits associated with the task
1140         is not updated when the list changes the task or the start point never changed when the list of commits
1141         associated with the task changed. Make the lazily evaluated function compare the actual list of commits
1142         so that it will invoke _renderCauseAndFixes when the list changes.
1143         (AnalysisTaskPage.prototype._renderCauseAndFixes): Now renders a specific list.
1145 2017-05-16  Ryosuke Niwa  <rniwa@webkit.org>
1147         Another build fix. Added a missing null check.
1149         * public/v3/components/custom-analysis-task-configurator.js:
1150         (CustomAnalysisTaskConfigurator.prototype._setUploadedFilesIfEmpty):
1152 2017-05-14  Ryosuke Niwa  <rniwa@webkit.org>
1154         Build fix. Added a missing null check.
1156         * public/v3/pages/analysis-task-page.js:
1157         (AnalysisTaskConfiguratorPane.prototype.setTestGroups):
1159 2017-05-11  Ryosuke Niwa  <rniwa@webkit.org>
1161         Remove the code for old syncing script configuration in BuildbotSyncer
1162         https://bugs.webkit.org/show_bug.cgi?id=171963
1164         Reviewed by Chris Dumez.
1166         Removed the code for specifying {"root": ~}, {"rootOptions": [~]}, and {"rootsExcluding": [~]} in buildbot
1167         properties in the syncing script's configurations since they are no longer used after r215061.
1169         Also removed the support for using "arguments" as an alias to "properties", and updated the tests accordingly.
1171         * tools/js/buildbot-syncer.js:
1172         (BuildbotSyncer._parseRepositoryGroup): Removed the unused code.
1173         (BuildbotSyncer._validateAndMergeConfig): Just allow string values in properties.
1174         (BuildbotSyncer._validateAndMergeProperties): Deleted.
1176         * unit-tests/buildbot-syncer-tests.js:
1177         (sampleiOSConfig): Use "properties" instead of "arguments" to specify the buildbot properties.
1178         (sampleiOSConfigWithExpansions): Ditto.
1180 2017-05-10  Ryosuke Niwa  <rniwa@webkit.org>
1182         Another build fix after r215633 to make the bar graphs render even when the confidence intervals aren't available.
1184         * public/v3/components/bar-graph-group.js:
1185         (BarGraphGroup.prototype._computeRange):
1187 2017-05-10  Ryosuke Niwa  <rniwa@webkit.org>
1189         Build fix after r215633.
1191         * public/v3/models/test-group.js:
1192         (TestGroup.prototype._computeRequestedCommitSets):
1193         (TestGroup.prototype.requestsForCommitSet):
1195 2017-05-10  Ryosuke Niwa  <rniwa@webkit.org>
1197         Add API to upload a patched build for a custom A/B testing
1198         https://bugs.webkit.org/show_bug.cgi?id=171956
1200         Reviewed by Chris Dumez.
1202         Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set.
1204         Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code
1205         with /api/upload-root.php.
1207         * public/api/upload-root.php: Added.
1208         (main):
1209         (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with.
1210         A root can be associated with multiple repositories and there fore commit set items; e.g. if a software
1211         is built from multiple repositories and there is a patch associated with one of them, the built product
1212         must be associated with all those repositories.
1214         * public/include/build-requests-fetcher.php:
1215         (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one.
1217         * public/include/json-header.php:
1218         (validate_arguments): Added the support for validating json string.
1219         (verify_slave): Return the slave ID found.
1221         * public/include/uploaded-file-helpers.php:
1222         (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root.
1223         (query_total_file_size): Ditto.
1224         (create_uploaded_file_from_form_data): Ditto.
1225         (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction.
1227         * public/privileged-api/upload-file.php:
1228         (main):
1230         * public/v3/models/build-request.js:
1231         (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item.
1233         * public/v3/models/commit-set.js:
1234         (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables.
1235         (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after
1236         its creation. After this patch, each item can be newly associated with a root so we must update its
1237         _repositoryToRootMap and _allRootFiles. For simplicity, we update all states.
1238         (CommitSet.prototype._updateFromObject): Extracted from the constructor.
1239         (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches.
1240         (CommitSet.prototype.rootForRepository): Added.
1241         (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to
1242         _repositoryToCommitMap, and added a check for _repositoryToRootMap.
1244         * public/v3/models/test-group.js:
1245         (TestGroup.prototype.task): Added.
1246         (TestGroup.createWithTask):
1247         (TestGroup.createWithCustomConfiguration):
1248         (TestGroup.createAndRefetchTestGroups):
1249         (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache.
1250         (TestGroup.findAllByTask): Added.
1251         (TestGroup.fetchForTask): Renamed from fetchByTask.
1253         * public/v3/pages/analysis-task-page.js:
1254         (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId):
1256         * server-tests/api-build-requests-tests.js:
1258         * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root.
1259         (makeReport): Added.
1260         (addSlaveAndCreateRootFile): Added.
1261         (createTestGroupWihPatch): Added.
1263         * server-tests/privileged-api-create-test-group-tests.js:
1265         * server-tests/resources/mock-data.js:
1266         (MockData.sharedRepositoryId): Added.
1267         (MockData.addMockData): Added "Shared" repository along with commits.
1269 2017-05-10  Ryosuke Niwa  <rniwa@webkit.org>
1271         Rename server-tests/api-update-triggerable.js to server-tests/api-update-triggerable-tests.js
1272         https://bugs.webkit.org/show_bug.cgi?id=171905
1274         Reviewed by Chris Dumez.
1276         * server-tests/api-update-triggerable-tests.js: Renamed from server-tests/api-update-triggerable.js.
1278 2017-04-30  Ryosuke Niwa  <rniwa@webkit.org>
1280         Add the support for scheduling a A/B testing with a patch.
1281         https://bugs.webkit.org/show_bug.cgi?id=171209
1283         Reviewed by Chris Dumez.
1285         Added the support for creating a custom test group with a patch applied.
1287         First, each repository in a repository group has a boolean indicating whether a given repository can have
1288         a patch applied or not. When any configuration in a test group contains a patch, we create build requests
1289         without a test specified in order to "build" those patches. These build requests have negative order numbers
1290         to differentiate them from regular build requests. We can't simply build ones with patches since there could
1291         be differences in SDK, build options, etc... when patches are applied.
1293         The JSON format for commit sets returned by /api/build-requests have been changed from using an array of
1294         commit IDs to an array of dictionaries indicate commit and acceptsPatch boolean. /api/update-triggerable now
1295         uses a dictionary with two keys: repository and acceptsPatch to specify a set of repositories associated with
1296         a repository group, and /privileged-api-create-test-group uses a dictionary with two keys: revision and patch
1297         instead of a revision string to specify commit sets.
1299         Furthermore, the syncing script's configuration have been updated to use a dictionary of repository names to
1300         an options dictionary instead of an array of repositories names. For now, the only supported option is
1301         acceptsPatch but will be extended when we add the support for rolling back system components.
1302         e.g. {"WebKit": {acceptsPatch: true}, "macOS": {}} instead of ["WebKit", "macOS"]
1304         On the UI side, InstantFileUploader has been changed to accept only one file by default, and added a new method
1305         allowMultipleFiles() to allow multiple files to be selected for custom roots. Also replaced the input element
1306         with type=file by a button with a custom label to show labels such as "Apply a patch" or "Add a new root"
1307         instead of the generic label like "choose a file".
1310         * init-database.sql: Added trigrepo_accepts_patch to triggerable_repositories to indicate whether a given
1311         repository can have a patch applied or not. Made request_test optional in build_requests for when a build
1312         request is created to build patches. Such a build request have a negative request_order. Updated the related
1313         constraints accordingly.
1315         * public/admin/triggerables.php: Added the support for updating whether a given repository can have a patch
1316         applied in each repository group. Only show the repositories in the repository group for this purpose since
1317         there is no way to accept a patch on a repository without it being a part of the group.
1318         (generate_repository_form): Now takes the markup for checkboxes instead of generating one itself.
1319         (generate_repository_checkboxes): Now takes an array of repositories to generate checkboxes. The checkbox is
1320         shown when the repository ID exists as a key in this array, and is checked when its value is true. The new
1321         capability to skip repositories not in the array is used to hide repositories not associated with the group
1322         in the list of checkboxes to indicate a repository accepts a patch.
1324         * public/api/update-triggerable.php:
1325         (main): Now updates the description and acceptsRoots states of each repository group, and sets acceptsPatch
1326         boolean for each repository in the group if set in the update.
1327         (validate_repository_groups): Use a reference to $repository_groups in order to set repository_id_list, which
1328         contains an array of repository IDs to find the existing repository group that matches the set via
1329         RepositoryGroupFinder's find_by_repositories. Also added a various validations for acceptsRoots, a dictionary
1330         specifying repository and acceptsPatch.
1332         * public/include/build-requests-fetcher.php:
1333         (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Instead of returning an array of commit IDs as
1334         "commits", it now returns an array of dictionaries with "commit" and "patch" keys specifying the commit ID
1335         and the patch file's ID respectively as "revisionItems". 
1336         (BuildRequestsFetcher::add_uploaded_file): Added. Extracted from fetch_commits_for_set_if_needed. Used to
1337         add either a patch file or a custom root file in the list of uploaded files in the result.
1339         * public/include/manifest-generator.php:
1340         (fetch_triggerables): Each element in repository group's "repositories" field is now an array of dictionaries
1341         with "repository" and "acceptsPatch" as keys.
1343         * public/include/repository-group-finder.php:
1344         (RepositoryGroupFinder::__construct): Added a map for boolean indicating whether a given repository group
1345         allows a patch on a repository. Used in /privileged-api/create-test-group.
1346         (RepositoryGroupFinder::accepts_patch): Added.
1347         (RepositoryGroupFinder::populate_map): Build up the map for acceptsPatch boolean per repository per group.
1349         * public/privileged-api/create-test-group.php:
1350         (main): Fixed a bug that we were not explicitly checking for a duplicate test group name (with a test). Create
1351         build requests to "build" patches if there is any patch file specified.
1352         (commit_sets_from_revision_sets): Updated to take a dictionary with "revision" and "patch" as keys to specify
1353         a revision and a patch if any instead of just a revision string for each repository. Also validate that each
1354         repository is allowed to have a patch once the repository group has been found for the set of repositories.
1355         (ensure_commit_sets):
1357         * public/v3/components/custom-analysis-task-configurator.js:
1358         (CustomAnalysisTaskConfigurator): Added _patchUploaders as an instance variable, which is a dictionary of
1359         configuration names to a map of InstantFileUploader's used to upload a patch. Also renamed _fileUploaders to
1360         _customRootUploaders for clarity.
1361         (CustomAnalysisTaskConfigurator.prototype.setCommitSets):
1362         (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree.createRootUploader): Added.
1363         (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree):
1364         (CustomAnalysisTaskConfigurator.prototype._ensurePatchUploader): Added. Creates an instant file uploader for
1365         patches. We only allow a single patch per repository.
1366         (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Include a patch in the commit set as needed.
1367         (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Show the patch file uploader for repositories
1368         which can have patches in the current repository group.
1369         (CustomAnalysisTaskConfigurator.cssTemplate): Show borders between every rows instead of just between tbody's
1370         now that each row can have a patch file uploader.
1372         * public/v3/components/instant-file-uploader.js:
1373         (InstantFileUploader): Added _fileInput and _allowMultipleFiles as instance variables. We now show a button
1374         in the UI instead of an input with type=file. _fileInput is a hidden input with type=file used inside a click
1375         event of the button to let the user pick a file.
1376         (InstantFileUploader.prototype.allowMultipleFiles): Added. Allows this instance to accept multiple files.
1377         (InstantFileUploader.prototype.didConstructShadowTree): Synthetically click on the hidden input element when
1378         the newly added button element is clicked to open the browser's file picker.
1379         (InstantFileUploader.prototype.render): Hide the button to add a file if this instance can only select one file
1380         and there is already some file being uploaded in this instance.
1381         (InstantFileUploader.htmlTemplate): Replaced the input element with type=file with a button. Its label comes
1382         from the default slot content.
1384         * public/v3/models/build-request.js:
1385         (BuildRequest): Made the test optional.
1386         (BuildRequest.prototype.isBuild): Returns true if this is a build request for building a patch.
1387         (BuildRequest.prototype.isTest): Returns true if this is a build request for running tests.
1388         (BuildRequest.constructBuildRequestsFromData): Create each commit log here instead of relying on CommitSet's
1389         constructor to construct its commit logs. Also updated per the replacement of an array of commit IDs by
1390         an array of dictionaries with commit and patch properties.
1392         * public/v3/models/commit-set.js:
1393         (CommitSet): Made _repositoryToCommitMap a real Map object. Also added _repositoryToPatchMap. Also got rid of
1394         the code to instantiate commit logs since that's now done in BuildRequest.constructBuildRequestsFromData.
1395         (CommitSet.prototype.commitForRepository):
1396         (CommitSet.prototype.revisionForRepository):
1397         (CommitSet.prototype.patchForRepository): Added.
1398         (CommitSet.prototype.latestCommitTime): Modernized the code.
1399         (CommitSet.prototype.equals): Modernized the code. Also added the check for patches.
1400         (MeasurementCommitSet): Updated per the change to make _repositoryToCommitMap a real Map.
1401         (CustomCommitSet.prototype.setRevisionForRepository):
1402         (CustomCommitSet.prototype.equals): Added the check for patches.
1403         (CustomCommitSet.prototype.revisionForRepository):
1404         (CustomCommitSet.prototype.patchForRepository): Added.
1406         * public/v3/models/manifest.js:
1407         (Manifest._didFetchManifest): Updated per the replacement of an array of commit IDs by an array of dictionaries
1408         with commit and patch properties.
1410         * public/v3/models/repository.js:
1411         (Repository.prototype.ownerId): Renamed from owner for clarity.
1413         * public/v3/models/test-group.js:
1414         (TestGroup): Modernized the code by using LazilyEvaluatedFunction. Removed _requestsAreInOrder since it's not
1415         necessary anymore with LazilyEvaluatedFunction.
1416         (TestGroup.prototype.addBuildRequest):
1417         (TestGroup.prototype.test): Use the last build request's test since the first few requests could be requests to
1418         build patches.
1419         (TestGroup.prototype.platform): Ditto.
1420         (TestGroup.prototype._lastRequest): Added.
1421         (TestGroup.prototype._orderedBuildRequests): Added.
1422         (TestGroup.prototype.repetitionCount): Only count the build requests for testing (skipping any requests to
1423         build patches).
1424         (TestGroup.prototype.requestedCommitSets): Simply call _computeRequestedCommitSetsLazily.
1425         (TestGroup.prototype._computeRequestedCommitSets): Extracted from requestedCommitSets.
1426         (TestGroup.prototype.requestsForCommitSet):
1427         (TestGroup.prototype.labelForCommitSet): Rewritten. Just compute the label here instead of relying on
1428         _commitSetToLabel since requestedSets is always of the length two at the moment.
1429         (TestGroup._revisionSetsFromCommitSets): Specify both the revision and the patch in the revision set.        
1431         * public/v3/models/triggerable.js:
1432         (TriggerableRepositoryGroup): Added _patchAcceptingSet as an instance variable. Use
1433         sortByNamePreferringOnesWithURL to sort repositories instead of simple sortByName.
1434         (TriggerableRepositoryGroup.prototype.accepts): Added checks for the custom roots and patches.
1435         (TriggerableRepositoryGroup.prototype.acceptsPatchForRepository): Added.
1437         * server-tests/api-build-requests-tests.js: Updated the test cases per the replacement of an array of commit
1438         IDs by an array of dictionaries with commit and patch properties.
1440         * server-tests/api-manifest-tests.js: Updated the test case per the name of Repository's owner to ownerId.
1442         * server-tests/api-update-triggerable.js: Updated the test case per the name of Repository's owner to ownerId,
1443         and added a test case for updating whether a given repository group allows custom roots as well as patches
1444         on repositories via /api/update-triggerable. 
1445         (.updateWithOSXRepositoryGroup): Updated the sample syncing script configuration per the format change.
1446         (.refetchManifest): Added.
1448         * server-tests/privileged-api-create-test-group-tests.js: Updated per the syncing script configuration format
1449         change. Also added a test for creating a test group with a duplicate name, which is expected to fail with 
1450         DuplicateTestGroupName, and creating a test group with a patch both when it's allowed and when it's not allowed
1451         in the matching repository group.
1452         (.addTriggerableAndCreateTask): Updated per the format change.
1454         * server-tests/resources/mock-data.js:
1455         (MockData.addEmptyTriggerable): Added a metric and its configuration to make it appear in the manifest file.
1456         The new test case in api-update-triggerable.js requires this.
1457         (MockData.mockTestSyncConfigWithSingleBuilder): Updated per the syncing script configuration format change.
1458         (MockData.mockTestSyncConfigWithTwoBuilders): Ditto.
1460         * server-tests/tools-buildbot-triggerable-tests.js: Removed the useless assertions about test configurations,
1461         and added assertions about custom roots and patches in the test case for updateTriggerables.
1463         * tools/js/buildbot-syncer.js:
1464         (BuildbotSyncer._parseRepositoryGroup): Made each assertion explicitly refer to the specific repository group
1465         to make it more user friendly. Now each repository group uses a dictionary of repository names to its options
1466         in the syncing script configurations. When parsed, we insert it as an array of dictionaries with repository ID
1467         and acceptsPatch boolean specified separately since this is the format /api/update-triggerable expects.
1469         * tools/js/buildbot-triggerable.js:
1470         (BuildbotTriggerable.prototype.updateTriggerable):
1472         * unit-tests/build-request-tests.js:
1473         (sampleBuildRequestData): Updated per the commit sets format change in /api/build-requests.
1475         * unit-tests/buildbot-syncer-tests.js: Updated the existing tests per various format changes and added a couple
1476         of new test cases for the syncing script's configuration validation.
1477         (sampleiOSConfig):
1478         (smallConfiguration):
1479         (createSampleBuildRequest):
1481         * unit-tests/resources/mock-v3-models.js:
1482         (MockModels.inject): Updated per the repository group format change.
1484         * unit-tests/test-groups-tests.js:
1485         (sampleTestGroup): Updated per the commit sets format change in /api/build-requests. 
1487 2017-04-21  Ryosuke Niwa  <rniwa@webkit.org>
1489         Rename commit_set_relationships to commit_set_items
1490         https://bugs.webkit.org/show_bug.cgi?id=171143
1492         Reviewed by Joseph Pecoraro.
1494         Renamed commit_set_relationships to commit_set_items. Also added commitset_patch_file in the preparation to add
1495         the support for applying patches in custom test groups. To migrate an existing database, run:
1497         ```sql
1498         BEGIN;
1499         ALTER TABLE commit_set_relationships RENAME TO commit_set_items;
1500         ALTER TABLE commit_set_items ADD COLUMN commitset_patch_file integer REFERENCES uploaded_files;
1501         ALTER TABLE commit_set_items ADD CONSTRAINT commitset_with_patch_must_have_commit
1502             CHECK (commitset_patch_file IS NULL OR commitset_commit IS NOT NULL);
1503         END;
1504         ```
1506         * init-database.sql:
1507         * public/include/build-requests-fetcher.php:
1508         * public/privileged-api/create-test-group.php:
1509         * server-tests/resources/mock-data.js:
1510         (MockData.addMockData):
1511         (MockData.addMockTestGroupWithGitWebKit):
1512         * tools/js/database.js:
1514 2017-04-21  Ryosuke Niwa  <rniwa@webkit.org>
1516         Add the support for creating a custom test group in the analysis task page
1518         Make it possible to create more custom test groups in the analysis task page
1519         https://bugs.webkit.org/show_bug.cgi?id=171138
1521         Rubber-stamped by Chris Dumez.
1523         Extracted CustomConfigurationTestGroupForm out of CreateAnalysisTaskPage and added it to AnalysisTaskPage inside
1524         AnalysisTaskConfiguratorPane. This allows configuration of a new test group within a custom analysis task.
1526         * public/privileged-api/create-test-group.php:
1527         (main): Fixed the bug that the triggerable wasn't resolved when creating a test group in a custom analysis task.
1529         * public/v3/components/custom-analysis-task-configurator.js:
1530         (CustomAnalysisTaskConfigurator.prototype.selectTests): Added. Used by CustomConfigurationTestGroupForm's
1531         setConfigurations.
1532         (CustomAnalysisTaskConfigurator.prototype.selectPlatform): Ditto.
1533         (CustomAnalysisTaskConfigurator.prototype.setCommitSets): Ditto. 
1534         (CustomAnalysisTaskConfigurator.prototype._setUploadedFilesIfEmpty): Added.
1535         (CustomAnalysisTaskConfigurator.prototype._revisionMapFromCommitSet): Added.
1536         (CustomAnalysisTaskConfigurator.prototype.render): Update the currently selected platforms and tests now that
1537         they can be set externally via selectTests and selectPlatform.
1538         (CustomAnalysisTaskConfigurator.prototype._renderTriggerableTests): Return the result of _renderRadioButtonList
1539         so that the caller can update the currently selected tests without having to reconstruct the list.
1540         (CustomAnalysisTaskConfigurator.prototype._renderTriggerablePlatforms): Ditto.
1541         (CustomAnalysisTaskConfigurator.prototype._renderRadioButtonList): Renamed from _buildCheckboxList. Now returns
1542         a function which updates the currently selected items. We still pretend that multiple items can be selected to
1543         make it future-proof.
1545         * public/v3/components/custom-configuration-test-group-form.js: Added.
1546         (CustomConfigurationTestGroupForm): Added. Inherits from TestGroupForm. Extracted from CreateAnalysisTaskPage.
1547         (CustomConfigurationTestGroupForm.prototype.setHasTask): Added.
1548         (CustomConfigurationTestGroupForm.prototype.hasCommitSets): Added.
1549         (CustomConfigurationTestGroupForm.prototype.setConfigurations): Added. Used by AnalysisTaskConfiguratorPane to
1550         set the default configuration to what the latest test group used.
1551         (CustomConfigurationTestGroupForm.prototype.startTesting): Added. Dispatches "startTesting" action with
1552         platform, test, taskName in addition to what CustomizedTestGroupForm emits.
1553         (CustomConfigurationTestGroupForm.prototype.didConstructShadowTree): Added.
1554         (CustomConfigurationTestGroupForm.prototype.render): Added.
1555         (CustomConfigurationTestGroupForm.prototype._updateTestGroupName): Added.
1556         (CustomConfigurationTestGroupForm.cssTemplate): Added.
1557         (CustomConfigurationTestGroupForm.htmlTemplate): Added.
1559         * public/v3/components/test-group-form.js:
1560         (TestGroupForm.cssTemplate): Make the form display: block.
1562         * public/v3/index.html:
1564         * public/v3/models/test-group.js:
1565         (TestGroup.prototype.test): Added.
1566         (TestGroup.prototype.platform): Added.
1567         (TestGroup.createWithCustomConfiguration): Added. Creates a custom test group with an existing analysis task.
1569         * public/v3/models/uploaded-file.js:
1570         (UploadedFile): Fixed a bug that _deletedAt was set to a Date object even when object.deletedAt is null.
1572         * public/v3/pages/analysis-task-page.js:
1573         (AnalysisTaskConfiguratorPane): Added.
1574         (AnalysisTaskConfiguratorPane.prototype.didConstructShadowTree): Added. Dispatch createCustomTestGroup action
1575         in turn when receiving startTesting from CustomConfigurationTestGroupForm.
1576         (AnalysisTaskConfiguratorPane.prototype.setTestGroups): Added.
1577         (AnalysisTaskConfiguratorPane.prototype.render): Added.
1578         (AnalysisTaskConfiguratorPane.htmlTemplate): Added. We override this instead of formContent to display the
1579         "Start" button at the end instead of at the beginnning.
1580         (AnalysisTaskConfiguratorPane.cssTemplate): Added.
1581         (AnalysisTaskPage.prototype.didConstructShadowTree): Listen to createCustomTestGroup.
1582         (AnalysisTaskPage.prototype.render): Hide AnalysisTaskConfiguratorPane when the analysis task is not custom.
1583         (AnalysisTaskPage.prototype._showTestGroup): Let AnalysisTaskConfiguratorPane know of the current test group
1584         so that it can update the default configuration if the user hasn't modified yet.
1585         (AnalysisTaskPage.prototype._createCustomTestGroup): Added. 
1587         * public/v3/pages/create-analysis-task-page.js:
1588         (CreateAnalysisTaskPage.prototype.didConstructShadowTree):
1589         (CreateAnalysisTaskPage.prototype._createAnalysisTaskWithGroup):
1590         (CreateAnalysisTaskPage.prototype.render):
1591         (CreateAnalysisTaskPage.prototype._renderMessage):
1592         (CreateAnalysisTaskPage.htmlTemplate):
1593         (CreateAnalysisTaskPage.cssTemplate):
1595         * server-tests/privileged-api-create-test-group-tests.js: Added a test case for creating a custom test group for
1596         an existing analysis task.
1598         * server-tests/resources/mock-data.js:
1599         (MockData.otherPlatformId): Added.
1600         (MockData.addMockData): Added a test configuration for otherPlatformId.
1602 2017-04-21  Ryosuke Niwa  <rniwa@webkit.org>
1604         Make it possible to view results for sub tests and metrics in A/B testing
1605         https://bugs.webkit.org/show_bug.cgi?id=170975
1607         Reviewed by Chris Dumez.
1609         Replaced TestGroupResultsTable, which was a single table that presented the test results with a set of revisions
1610         each build request used, with TestGroupResultsViewer and TestGroupRevisionTable. TestGroupResultsViewer provides
1611         an UI to look the results of sub-tests and sub-metrics and TestGroupRevisionTable provides an UI to display
1612         the set of revisions each build request used. TestGroupRevisionTable can also show the list of custom roots now
1613         that we've added UI to schedule an analysis task with a custom test group.
1615         This patch extends BarGraphGroup to show multiple bars per SingleBarGraph using a canvas with bars indicating
1616         their mean and confidence interval.
1618         * browser-tests/index.html:
1619         (ChartTest.importChartScripts): Include lazily-evaluated-function.js now that Test model object uses
1620         LazilyEvaluatedFunction.
1622         * public/v3/components/analysis-results-viewer.js:
1623         (AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForCommitSet):
1624         (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
1626         * public/v3/components/bar-graph-group.js:
1627         (BarGraphGroup): No longer takes formatter. Added _computeRangeLazily and _showLabels as instance variables.
1628         (BarGraphGroup.prototype.addBar): Now takes a list of values, their labels, mean, confidence interval, and
1629         the colors of bar graphs shown for each value and the mean indicator.
1630         (BarGraphGroup.prototype.showLabels): Added.
1631         (BarGraphGroup.prototype.setShowLabels): Added.
1632         (BarGraphGroup.prototype.range): Added.
1633         (BarGraphGroup.prototype._computeRange): Renamed from updateGroupRendering. Now returns the range instead off
1634         setting it to each bar, and each SingleBarGraph's render function uses the value via BarGraphGroup's range.
1635         (BarGraph): Renamed from SingleBarGraph. Added various arguments introduced in addBar, and now stores various
1636         lazily evaluated functions used for rendering.
1637         (BarGraph.prototype.render): Rewritten to use canvas to draw bar graphs and show a label when group's
1638         showLabels() returns true.
1639         (BarGraph.prototype._resizeCanvas): Added.
1640         (BarGraph.prototype._renderCanvas): Added.
1641         (BarGraph.prototype._renderLabels): Added. We align the top of each label to the middle of each bar and shift it
1642         back up by half the height of the label (0.4rem) using margin-top in css.
1643         (BarGraph.htmlTemplate): Uses a canvas now.
1644         (BarGraph.cssTemplate):
1646         * public/v3/components/results-table.js:
1647         (ResultsTable.prototype.renderTable): Updated per code changes to BarGraphGroup.
1648         (ResultsTableRow.prototype.resultContent): Ditto.
1650         * public/v3/components/test-group-results-table.js: Removed.
1651         * public/v3/components/test-group-results-viewer.js: Added.
1652         (TestGroupResultsViewer): Added. Shows a list of test results with bar graphs with mean and confidence interval
1653         indicators. The results of sub tests and metrics can be expanded via "(Breakdown)" link shown below each test. 
1654         (TestGroupResultsViewer.prototype.setTestGroup): Added.
1655         (TestGroupResultsViewer.prototype.setAnalysisResults): Added.
1656         (TestGroupResultsViewer.prototype.render): Added.
1657         (TestGroupResultsViewer.prototype._renderResultsTable): Compute the depth of the test tree we show, and construct
1658         the header rows. Each sub test is "indented" by a new column.
1659         (TestGroupResultsViewer.prototype._buildRowForTest): Added. Build rows for metrics of the given test. Expand the
1660         list of its child tests if it's in expandedTests. Otherwise add a link to "Breakdown" if it has any child tests.
1661         (TestGroupResultsViewer.prototype._buildRowForMetric): Added. Builds rows of table cells to show the results for
1662         the given metric for each configuration.
1663         (TestGroupResultsViewer.prototype._buildRowForMetric.createConfigurationRow): Added. A helper to build cells for
1664         a given configuration represented by a requested commit set.
1665         (TestGroupResultsViewer.prototype._buildValueMap): Added. Creates a mappting between a requested commit set, and
1666         the list of values, mean, etc... associated with the results for the commit set.
1667         (TestGroupResultsViewer.prototype._buildEmptyCells): Added. A helper to create empty cells to indent sub tests.
1668         (TestGroupResultsViewer.prototype._expandCurrentMetrics): Added. Highlights the current metrics and renders the
1669         label for each bar in the results.
1670         (TestGroupResultsViewer.htmlTemplate): Added.
1671         (TestGroupResultsViewer.cssTemplate): Added.
1673         * public/v3/components/test-group-revision-table.js: Added.
1674         (TestGroupRevisionTable): Added. Renders the list of revisions requested for each test configuration as well as
1675         ones used in actual testing, and additional repositories being reported (e.g. repositories for helper scripts).
1676         (TestGroupRevisionTable.prototype.setTestGroup): Added.
1677         (TestGroupRevisionTable.prototype.setAnalysisResults): Added.
1678         (TestGroupRevisionTable.prototype.render): Added.
1679         (TestGroupRevisionTable.prototype._renderTable): Added. The basic algorithm here is to first create a row entry
1680         object for each build request, merge cells that use the same revision of the same repository, and then render
1681         the entire table.
1682         (TestGroupRevisionTable.prototype._buildCommitCell): Added.
1683         (TestGroupRevisionTable.prototype._buildCustomRootsCell): Added.
1684         (TestGroupRevisionTable.prototype._mergeCellsWithSameCommitsAcrossRows): Added. Compute rowspan for each cell
1685         by traversing the rows that use the same revision per repository, and store it in rowCountByRepository while
1686         adding the repository to each succeeding row's repositoriesToSkip.
1687         (TestGroupRevisionTable.htmlTemplate): Added.
1688         (TestGroupRevisionTable.cssTemplate): Added.
1690         * public/v3/index.html:
1691         * public/v3/models/analysis-results.js:
1692         (AnalysisResults): Added _metricIds and _lazilyComputedHighestTests as instance variables.
1693         (AnalysisResults.prototype.findResult): Renamed from find.
1694         (AnalysisResults.prototype.highestTests): Added.
1695         (AnalysisResults.prototype._computeHighestTests): Added. Finds the root tests for this analysis result.
1696         (AnalysisResults.prototype.add): Update _metricIds.
1697         (AnalysisResults.prototype.commitSetForRequest): Added. Returns the reported commit set for the build request.
1698         This commit set contains the set of revisions reported to /api/report by A/B testers.
1699         (AnalysisResultsView.prototype.resultForRequest): Renamed from resultForBuildId.
1701         * public/v3/models/metric.js:
1702         (Metric.prototype.relativeName): Added. Computes the relative name given the test/metric path. This function is
1703         used to determine the label for each test/metric in TestGroupResultsViewer.
1704         (Metric.prototype.aggregatorLabel): Extracted from label.
1705         (Metric.prototype.label):
1706         (Metric.makeFormatter): Added the default value of false to alwaysShowSign.
1708         * public/v3/models/test-group.js:
1709         (TestGroup.prototype.compareTestResults): Now takes a metric instead of retrieving it from the analysis task
1710         since a custom analysis task may not have a metric associated with it.
1712         * public/v3/models/test.js:
1713         (Test): Added _computePathLazily as an instance variable.
1714         (Test.prototype.path): Lazily computes the path now that this function can be called on the same test for many
1715         times in TestGroupResultsViewer while computing relative names of tests and metrics.
1716         (Test.prototype._computePath): Extracted path.
1717         (Test.prototype.fullName): Modernized the code.
1718         (Test.prototype.relativeName): Added.
1720         * public/v3/models/uploaded-file.js:
1721         (UploadedFile):
1722         (UploadedFile.prototype.deletedAt): Added.
1723         (UploadedFile.prototype.label): Added.
1724         (UploadedFile.prototype.url): Added.
1726         * public/v3/pages/analysis-task-page.js:
1727         (AnalysisTaskTestGroupPane.prototype.setTestGroups):
1728         (AnalysisTaskTestGroupPane.prototype.setAnalysisResults): Replaced setAnalysisResultsView. Now takes an
1729         analysisResults instead of its view.
1730         (AnalysisTaskTestGroupPane.prototype.render): No longer enqueues the results table and the retry form to render
1731         since the results table no longer exists, and the retry form re-renders itself as needed.
1732         (AnalysisTaskTestGroupPane.htmlTemplate): Now uses test-group-results-viewer and test-group-revision-table
1733         instead of test-group-results-table, which has been removed.
1734         (AnalysisTaskTestGroupPane.cssTemplate):
1735         (AnalysisTaskPage.prototype._assignTestResultsIfPossible):
1737         * public/v3/pages/create-analysis-task-page.js:
1738         (CreateAnalysisTaskPage.prototype._createAnalysisTaskWithGroup): Removed superflous console.log's.
1740         * tools/js/v3-models.js: Import LazilyEvaluatedFunction now that it's used in the Test model.
1742         * unit-tests/test-model-tests.js: Added.
1744 2017-04-19  Ryosuke Niwa  <rniwa@webkit.org>
1746         Another build fix after r215061. Clear TriggerableRepositoryGroup's static map in each iteration.
1748         * tools/sync-buildbot.js:
1749         (syncLoop):
1751 2017-04-18  Ryosuke Niwa  <rniwa@webkit.org>
1753         Build fix after r215061.
1755         There was a mismatch between the format updateTriggerable and /api/update-triggerable were using.
1756         Namely, each repository group was assumed to contain a name field in /api/update-triggerable
1757         but updateTriggerable was not including that at all.
1759         We didn't catch this because the test for updateTriggerable also used the wrong format :(
1761         * server-tests/tools-buildbot-triggerable-tests.js:
1762         * tools/js/buildbot-triggerable.js:
1763         (BuildbotTriggerable.prototype.updateTriggerable):
1765 2017-04-14  Dewei Zhu  <dewei_zhu@apple.com>
1767         Add sub-commit UI in commit log viewer.
1768         https://bugs.webkit.org/show_bug.cgi?id=170379
1770         Reviewed by Ryosuke Niwa.
1772         Add an API to return sub-commits for a given commit.
1773         Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits.
1774         Add 'ownsSubCommits' info in 'api/commits' return values.
1775         Extend 'api/manifest' to include whether a repositories owns other repositories.
1776         Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits.
1777         Add unit tests for those new features.
1779         * browser-tests/commit-log-viewer-tests.js: Updated test cases.
1780         * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit.
1781         * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits.
1782         * public/v3/components/expand-collapse-button.js: Added.
1783         (ExpandCollapseButton):
1784         (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event.
1785         (ExpandCollapseButton.sizeFactor):
1786         (ExpandCollapseButton.buttonContent):
1787         (ExpandCollapseButton.cssTemplate):
1788         * public/v3/components/commit-log-viewer.js:
1789         (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits.
1790         (CommitLogViewer.cssTemplate):
1791         * public/v3/components/sub-commit-viewer.js: Added.
1792         (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.`
1793         (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event.
1794         (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked.
1795         (SubCommitViewer.prototype.render): Render sub-commit view based on the state.
1796         (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries.
1797         (SubCommitViewer.htmlTemplate):
1798         (SubCommitViewer.cssTemplate):
1799         * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'.
1800         * public/v3/models/commit-log.js:
1801         (CommitLog): Added '_subCommits'.
1802         (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well.
1803         (CommitLog.prototype.ownsSubCommits):
1804         (CommitLog.prototype.subCommits): Added. Returns sub-commits.
1805         (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before.
1806         (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits.
1807         (CommitLog.diffSubCommits): Added. Finds difference between two given commits.
1808         (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change.
1809         (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change.
1810         (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'.
1811         * public/v3/models/repository.js:
1812         (Repository):
1813         (Repository.prototype.owner): Returns the owner id.
1814         (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository.
1815         * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter.
1816         * server-tests/api-manifest-tests.js: Added a test.
1817         * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'.
1818         * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'.
1820 2017-04-11  Ryosuke Niwa  <rniwa@webkit.org>
1822         Retrying an A/B testing does not set the repetition count in some cases
1823         https://bugs.webkit.org/show_bug.cgi?id=170695
1825         Reviewed by Joseph Pecoraro.
1827         When selecting an existing A/B test group, the analysis task page automatically sets the repetition count
1828         of its retry to be that of the original test group. However, this information wasn't being passed correctly
1829         to the code that actually created a test group. As a result, the retried test group's repetition count does
1830         not match that of the original group or the number shown to the user on UI.
1832         Fixed the bug by updating this._repetitionCount in setRepetitionCount.
1834         * browser-tests/index.html:
1835         * browser-tests/test-group-form-tests.js: Added. Added tests.
1836         (.createTestGroupFormWithContext): Added.
1837         * public/v3/components/test-group-form.js:
1838         (TestGroupForm.prototype.setRepetitionCount):
1839         (TestGroupForm.formContent):
1840         (TestGroupForm):
1842 2017-04-10  Ryosuke Niwa  <rniwa@webkit.org>
1844         Add the UI for scheduling a A/B testing with a custom root
1845         https://bugs.webkit.org/show_bug.cgi?id=170622
1847         Reviewed by Anders Carlsson.
1849         This patch adds the support for creating a new analysis task with a custom darwinup roots. A follow up patch
1850         would update the syncing script to schedule such an A/B testing job to a buildbot instance.
1853         * ReadMe.md: Updated instructions for backing up and restoring the database so that it's easier to replace
1854         the file path for the backup.
1856         * init-database.sql: Make task_platform and task_metric optional in each analysis task. Also added a column
1857         to store the root file in commit_set_relationships.
1859         * public/api/build-requests.php:
1860         (main): Include the uploaded files.
1862         * public/api/commits.php:
1863         (main): Added the support for querying the latest commits for a given platform. This is used in a new page
1864         to create a custom analysis task to autofill the latest revisions for a given platform.
1866         * public/api/test-groups.php:
1867         (main): Include the uploaded files.
1869         * public/include/build-requests-fetcher.php:
1870         (BuildRequestsFetcher::__construct): Added a list of uploaded_files and a map from its id.
1871         (BuildRequestsFetcher::uploaded_files): Added.
1872         (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Added the support for including custom roots' id in
1873         each commit set, and inserting its meta data in the list of uplaoded files.
1875         * public/include/commit-log-fetcher.php:
1876         (CommitLogFetcher::fetch_latest_for_platform): Added. Finds the latest commit for a given platform. Ideally,
1877         we should be finding the latest commit for a given platform, but this is very slow so instead find the commit
1878         of the latest build for a given platform.
1880         * public/privileged-api/create-test-group.php:
1881         (main): Added the support for creating an analysis task along with a group.
1882         (commit_sets_from_revision_sets): Added the support for custom roots. Verify the specified uploaded file exists
1883         and include it in commit_set_relationships. Because commits and upload files are stored in a different column
1884         in commit_set_relationships, this function now stores the information for each row of commit_set_relationships
1885         except the commit set ID, which is unknown until the set is created, instead of a commit ID.
1886         (ensure_commit_sets): Made the each entry in a commit set a row instead of a commit ID as done. As this format
1887         is only by v2 UI and detect-changes.js, we don't add the support for specifying custom roots here.
1889         * public/privileged-api/upload-file.php:
1890         (main): Fixed a typo. Also added one more error check.
1892         * public/v3/components/custom-analysis-task-configurator.js: Added. The UI for selecting a test, a platform,
1893         and a set of revisions, as well as custom roots for a custom A/B testing job. The first set of revision with
1894         custom roots is referred as "baseline", and the second configuration is referred as "comparison" in this class.
1895         (CustomAnalysisTaskConfigurator):
1896         (CustomAnalysisTaskConfigurator.prototype.tests): Added.
1897         (CustomAnalysisTaskConfigurator.prototype.platform): Added.
1898         (CustomAnalysisTaskConfigurator.prototype.commitSets): Added. Returns a pair of baseline and comparsion if both
1899         have been configured by the user.
1900         (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): Added.
1901         (CustomAnalysisTaskConfigurator.prototype._configureComparison): Added. Called when the user is to configu the
1902         "comparison" configuration.
1903         (CustomAnalysisTaskConfigurator.prototype.render): Added.
1904         (CustomAnalysisTaskConfigurator.prototype._renderTriggerableTests): Added. Renders the list of top-level tests
1905         that can be scheduled by a triggerable.
1906         (CustomAnalysisTaskConfigurator.prototype._renderTriggerablePlatforms): Added. Renders the list of platforms
1907         that can be schedule with the currently selected list of tests by a triggerable. Note that the current UI only
1908         lets the user select a single test but the intent is to allow multiple tests to be selected in the near future.
1909         (CustomAnalysisTaskConfigurator.prototype._buildCheckboxList): Added. Creates a list of radio boxes to select
1910         an item with a callback for each. It automatically sets "selected" class on the selected item. It's used to
1911         render both the list of tests and platforms.
1912         (CustomAnalysisTaskConfigurator.prototype._updateTriggerable): Added. Finds the triggerable for a given list of
1913         tests and platforms. Returns an error when some tests belong to another triggearalbe.
1914         (CustomAnalysisTaskConfigurator.prototype._updateRepositoryGroups): Added. Finds a repository group to use when
1915         the current triggerable has changed. We try to use the repository group of the same name if there is any, and
1916         defaults to the first repository group if there is none. This allows the set of repositories to be specified to
1917         more or less persist across different triggerables. For example, if iOS platforms and Mac platforms use two
1918         distinct triggerables , and both triggerables have two repository groups: one that only specify the OS and the
1919         other that specifies both teh OS and WebKit revision, then this code allows the choice the user had made to
1920         specify either just the OS or the OS and WebKit will be preserved when the user switches from an iOS platform
1921         to a Mac platform.
1922         (CustomAnalysisTaskConfigurator.prototype._updateCommitSetMap): Added. Create a commit set map, the format that
1923         TestGroup.createWithTask accepts given "baseline" and "comparison" commit sets. Pretend "comparison" is not set
1924         if two sets are identical since it makes no sense to schedule an A/B testing job when A and B are identical.
1925         (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Added. Creates a commit set using the revisions
1926         and the csutom roots the user had specified.
1927         (CustomAnalysisTaskConfigurator.prototype._renderRepositoryPanes): Added. Renders the pane to specify revisions
1928         and custom roots for "baseline" and "comparison".
1929         (CustomAnalysisTaskConfigurator.prototype._renderBaselineRevisionTable): Added.
1930         (CustomAnalysisTaskConfigurator.prototype._renderComparisonRevisionTable): Added.
1931         (CustomAnalysisTaskConfigurator.prototype._optionalRepositoryList): Added.
1932         (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Added. Creates a table for specifying revisions
1933         and custom roots along with a list of repository groups to pick. The set of repositories and custom roots are
1934         shown at the all if all repository groups require them. Otherwise, they are grouped at the bottom as optional.
1935         (CustomAnalysisTaskConfigurator.prototype._buildRepositoryGroupList): Added.
1936         (CustomAnalysisTaskConfigurator.prototype._selectRepositoryGroup): Added.
1937         (CustomAnalysisTaskConfigurator.prototype._buildRevisionInput): Added. Creates an input element to specify
1938         a revision for a given repository. Autofills it with the latest commit for the currently selected platform if
1939         the user had not modified the field by the time the revisions are fetched.
1940         (CustomAnalysisTaskConfigurator.htmlTemplate): Added.
1941         (CustomAnalysisTaskConfigurator.cssTemplate): Added.
1943         * public/v3/components/instant-file-uploader.js: Added. A form to upload a custom darwinup root in "baseline"
1944         or "comparison" configurations of CustomAnalysisTaskConfigurator. It's "instant" because it auto-detects when a
1945         file to be uploaded had already been uploaded elsewhere by checking its SHA-256 hash.
1946         (InstantFileUploader):
1947         (InstantFileUploader.prototype.hasFileToUpload): Added.
1948         (InstantFileUploader.prototype.uploadedFiles): Added.
1949         (InstantFileUploader.prototype.addUploadedFile): Added. It's called on the uploader for "comparison"
1950         configuration when the uploader for "baseline" configuration dipsatches "uploadedFile" action to automatically
1951         mirror the newly uploaded custom root to "comparision" configuration.
1952         (InstantFileUploader.prototype.didConstructShadowTree): Added.
1953         (InstantFileUploader.prototype.render): Added.
1954         (InstantFileUploader.prototype._renderUploadedFiles): Added. Renders the list of the uploaded files.
1955         (InstantFileUploader.prototype._renderPreuploadFiles): Added. Renders the list of the files to be uploaded with
1956         a progress bar.
1957         (InstantFileUploader.prototype._updateUploadStatus): Added. Updates the progress bar for uploading the file.
1958         (InstantFileUploader.prototype._formatUploadError): Added.
1959         (InstantFileUploader.prototype._didFileInputChange): Added. Called when the user picks a file to uploaded on
1960         the input element. Fetch the meta data for the uploaded file with the same SHA-256 hash if there is any, and
1961         start uploading the file if there isn't one.
1962         (InstantFileUploader.prototype._removeUploadedFile): Added.
1963         (InstantFileUploader.prototype._didUploadFile): Added. Move a file from the list of files to be uploaded to
1964         the list of uploaded files.
1965         (InstantFileUploader.htmlTemplate): Added.
1966         (InstantFileUploader.cssTemplate): Added.
1968         * public/v3/index.html:
1970         * public/v3/models/analysis-task.js:
1971         (AnalysisTask): Made platform and metric optional as it is now.
1972         (AnalysisTask.findByPlatformAndMetric): Skip analysis tasks without a platform or a metric.
1973         (AnalysisTask.prototype.isCustom): Added. Returns true for a custom analysis task.
1974         (AnalysisTask.fetchRelatedTasks): Skip custom analysis tasks.
1975         (AnalysisTask._constructAnalysisTasksFromRawData): Construct analysis tasks even if they were missing a metric
1976         or a platform instead of silently skipping them.
1978         * public/v3/models/build-request.js:
1979         (BuildRequest.constructBuildRequestsFromData): Construct uploaded file objects returned by /api/build-requests.
1981         * public/v3/models/commit-log.js:
1982         (CommitLog.fetchLatestCommitForPlatform): Added.
1984         * public/v3/models/commit-set.js:
1985         (CommitSet): Added this._customRoots.
1986         (CommitSet.prototype.customRoots): Returns this._customRoots.
1987         (CommitSet.prototype.equals): Returns false when the set of custom roots are not equal.
1988         (CommitSet.areCustomRootsEqual): Added.
1989         (CustomCommitSet):
1990         (CustomCommitSet.prototype.equals): Added.
1991         (CustomCommitSet.prototype.customRoots): Added.
1992         (CustomCommitSet.prototype.addCustomRoot): Added.
1994         * public/v3/models/manifest.js:
1995         (Manifest._didFetchManifest): Store fileUploadSizeLimit in the manifest as UploadedFile.fileUploadSizeLimit.
1996         This allows a file size check in the client size instead of uploading it to the server and receiving an error.
1998         * public/v3/models/metric.js:
1999         (Metric.formatTime): Moved from ChartPaneStatusView to be also used by InstantFileUploader._renderUploadedFiles.
2001         * public/v3/models/test-group.js:
2002         (TestGroup.prototype.createWithTask): Added.
2003         (TestGroup.prototype.createAndRefetchTestGroups):
2004         (TestGroup.prototype._revisionSetsFromCommitSets): Added. Extracted from createAndRefetchTestGroups.
2005         (TestGroup.prototype._fetchTestGroupsForTask): Added. Extracted from createAndRefetchTestGroups.
2007         * public/v3/models/triggerable.js:
2008         (Triggerable.triggerablePlatformsForTests): Added.
2009         (Triggerable.sortByNamePreferringSmallerRepositories): Added.
2011         * public/v3/models/uploaded-file.js:
2012         (UploadedFile.prototype.createdAt): Added.
2013         (UploadedFile.prototype.filename): Added.
2014         (UploadedFile.prototype.author): Added.
2015         (UploadedFile.prototype.size): Added.
2016         (UploadedFile.uploadFile): Added a client-side check for the file size using UploadedFile.fileUploadSizeLimit.
2017         (UploadedFile.fetchUnloadedFileWithIdenticalHash): Ditto. Also fixed a bug that 404 was resulting in a rejected
2018         promise instead of a resolved promise with null.
2020         * public/v3/pages/analysis-category-page.js:
2021         (AnalysisCategoryPage.prototype._reconstructTaskList): Modernized the code. Added the support for platform and
2022         metric being null for some analysis tasks.
2024         * public/v3/pages/analysis-task-page.js:
2025         (AnalysisTaskPage.prototype._didFetchTask): Don't fetch the measurement set or create a chart for custom tasks.
2026         (AnalysisTaskPage.prototype.render): Don't display the charts or the stacking table for custom tasks.
2027         (AnalysisTaskPage.prototype._renderTaskNameAndStatus): Don't try to show the full test name for custom tasks
2028         since it's not associated with exactly one pair.
2030         * public/v3/pages/chart-pane-status-view.js:
2031         (ChartPaneStatusView.prototype._renderBuildRevisionTable):
2032         (ChartPaneStatusView.prototype._formatTime): Moved to Metric.formatTime.
2034         * public/v3/pages/chart-pane.js:
2035         (ChartPane.prototype._analyzeRange): Set inProgress to true to hide CustomAnalysisTaskConfigurator in
2036         CreateAnalysisTaskPage when creating a non-custom analysis task for a specific range.
2038         * public/v3/pages/create-analysis-task-page.js:
2039         (CreateAnalysisTaskPage): This page now shows CustomAnalysisTaskConfigurator by default, and lets a user create
2040         a custom analysis task by picking a test, a platform, and a set of revisions and custom darwinup roots.
2041         (CreateAnalysisTaskPage.prototype.updateFromSerializedState): Show a message when inProgress is set. This is
2042         the old behavior of this page.
2043         (CreateAnalysisTaskPage.prototype.didConstructShadowTree): Added.
2044         (CreateAnalysisTaskPage.prototype._createAnalysisTaskWithGroup): Added.
2045         (CreateAnalysisTaskPage.prototype.render):
2046         (CreateAnalysisTaskPage.prototype._renderMessage): Added. Hides CustomAnalysisTaskConfigurator and the select
2047         element to specify the numebr of iterations when a message is set.
2048         (CreateAnalysisTaskPage.htmlTemplate):
2049         (CreateAnalysisTaskPage.cssTemplate):
2051         * public/v3/pages/page-router.js:
2052         (PageRouter.prototype.route): Always enqueue the page to re-render when the route has changed.
2054         * server-tests/api-build-requests-tests.js: Updated test cases now that the response contains a list of
2055         uploaded files associated with build requests.
2057         * server-tests/privileged-api-create-test-group-tests.js: Added test cases for creating a custom analysis task
2058         and a test group with custom roots. 
2060         * server-tests/resources/mock-data.js:
2061         (MockData.addMockData): Updated the mock data to satisfy new constraint on analysis-tasks table.
2063         * tools/js/remote.js: Include global.FormData from form-data.js.
2065         * unit-tests/build-request-tests.js:
2066         (sampleBuildRequestData): Updated the mock response.
2067         * unit-tests/buildbot-syncer-tests.js:
2068         (createSampleBuildRequest): Ditto.
2069         * unit-tests/test-groups-tests.js:
2070         (sampleTestGroup): Ditto.
2072 2017-04-10  Commit Queue  <commit-queue@webkit.org>
2074         Unreviewed, rolling out r215202.
2075         https://bugs.webkit.org/show_bug.cgi?id=170694
2077         Committed incorrectly (Requested by rniwa on #webkit).
2079         Reverted changeset:
2081         "Add the UI for scheduling a A/B testing with a custom root"
2082         https://bugs.webkit.org/show_bug.cgi?id=170622
2083         http://trac.webkit.org/changeset/215202
2085 2017-04-10  Ryosuke Niwa  <rniwa@webkit.org>
2087         Add the UI for scheduling a A/B testing with a custom root
2088         https://bugs.webkit.org/show_bug.cgi?id=170622
2090         Reviewed by Anders Carlsson.
2092         This patch adds the support for creating a new analysis task with a custom darwinup roots. A follow up patch
2093         would update the syncing script to schedule such an A/B testing job to a buildbot instance.
2096         * ReadMe.md: Updated instructions for backing up and restoring the database so that it's easier to replace
2097         the file path for the backup.
2099         * init-database.sql: Make task_platform and task_metric optional in each analysis task. Also added a column
2100         to store the root file in commit_set_relationships.
2102         * public/api/build-requests.php:
2103         (main): Include the uploaded files.
2105         * public/api/commits.php:
2106         (main): Added the support for querying the latest commits for a given platform. This is used in a new page
2107         to create a custom analysis task to autofill the latest revisions for a given platform.
2109         * public/api/test-groups.php:
2110         (main): Include the uploaded files.
2112         * public/include/build-requests-fetcher.php:
2113         (BuildRequestsFetcher::__construct): Added a list of uploaded_files and a map from its id.
2114         (BuildRequestsFetcher::uploaded_files): Added.
2115         (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Added the support for including custom roots' id in
2116         each commit set, and inserting its meta data in the list of uplaoded files.
2118         * public/include/commit-log-fetcher.php:
2119         (CommitLogFetcher::fetch_latest_for_platform): Added. Finds the latest commit for a given platform. Ideally,
2120         we should be finding the latest commit for a given platform, but this is very slow so instead find the commit
2121         of the latest build for a given platform.
2123         * public/privileged-api/create-test-group.php:
2124         (main): Added the support for creating an analysis task along with a group.
2125         (commit_sets_from_revision_sets): Added the support for custom roots. Verify the specified uploaded file exists
2126         and include it in commit_set_relationships. Because commits and upload files are stored in a different column
2127         in commit_set_relationships, this function now stores the information for each row of commit_set_relationships
2128         except the commit set ID, which is unknown until the set is created, instead of a commit ID.
2129         (ensure_commit_sets): Made the each entry in a commit set a row instead of a commit ID as done. As this format
2130         is only by v2 UI and detect-changes.js, we don't add the support for specifying custom roots here.
2132         * public/privileged-api/upload-file.php:
2133         (main): Fixed a typo. Also added one more error check.
2135         * public/v3/components/custom-analysis-task-configurator.js: Added. The UI for selecting a test, a platform,
2136         and a set of revisions, as well as custom roots for a custom A/B testing job. The first set of revision with
2137         custom roots is referred as "baseline", and the second configuration is referred as "comparison" in this class.
2138         (CustomAnalysisTaskConfigurator):
2139         (CustomAnalysisTaskConfigurator.prototype.tests): Added.
2140         (CustomAnalysisTaskConfigurator.prototype.platform): Added.
2141         (CustomAnalysisTaskConfigurator.prototype.commitSets): Added. Returns a pair of baseline and comparsion if both
2142         have been configured by the user.
2143         (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): Added.
2144         (CustomAnalysisTaskConfigurator.prototype._configureComparison): Added. Called when the user is to configu the
2145         "comparison" configuration.
2146         (CustomAnalysisTaskConfigurator.prototype.render): Added.
2147         (CustomAnalysisTaskConfigurator.prototype._renderTriggerableTests): Added. Renders the list of top-level tests
2148         that can be scheduled by a triggerable.
2149         (CustomAnalysisTaskConfigurator.prototype._renderTriggerablePlatforms): Added. Renders the list of platforms
2150         that can be schedule with the currently selected list of tests by a triggerable. Note that the current UI only
2151         lets the user select a single test but the intent is to allow multiple tests to be selected in the near future.
2152         (CustomAnalysisTaskConfigurator.prototype._buildCheckboxList): Added. Creates a list of radio boxes to select
2153         an item with a callback for each. It automatically sets "selected" class on the selected item. It's used to
2154         render both the list of tests and platforms.
2155         (CustomAnalysisTaskConfigurator.prototype._updateTriggerable): Added. Finds the triggerable for a given list of
2156         tests and platforms. Returns an error when some tests belong to another triggearalbe.
2157         (CustomAnalysisTaskConfigurator.prototype._updateRepositoryGroups): Added. Finds a repository group to use when
2158         the current triggerable has changed. We try to use the repository group of the same name if there is any, and
2159         defaults to the first repository group if there is none. This allows the set of repositories to be specified to
2160         more or less persist across different triggerables. For example, if iOS platforms and Mac platforms use two
2161         distinct triggerables , and both triggerables have two repository groups: one that only specify the OS and the
2162         other that specifies both teh OS and WebKit revision, then this code allows the choice the user had made to
2163         specify either just the OS or the OS and WebKit will be preserved when the user switches from an iOS platform
2164         to a Mac platform.
2165         (CustomAnalysisTaskConfigurator.prototype._updateCommitSetMap): Added. Create a commit set map, the format that
2166         TestGroup.createWithTask accepts given "baseline" and "comparison" commit sets. Pretend "comparison" is not set
2167         if two sets are identical since it makes no sense to schedule an A/B testing job when A and B are identical.
2168         (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Added. Creates a commit set using the revisions
2169         and the csutom roots the user had specified.
2170         (CustomAnalysisTaskConfigurator.prototype._renderRepositoryPanes): Added. Renders the pane to specify revisions
2171         and custom roots for "baseline" and "comparison".
2172         (CustomAnalysisTaskConfigurator.prototype._renderBaselineRevisionTable): Added.
2173         (CustomAnalysisTaskConfigurator.prototype._renderComparisonRevisionTable): Added.
2174         (CustomAnalysisTaskConfigurator.prototype._optionalRepositoryList): Added.
2175         (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Added. Creates a table for specifying revisions
2176         and custom roots along with a list of repository groups to pick. The set of repositories and custom roots are
2177         shown at the all if all repository groups require them. Otherwise, they are grouped at the bottom as optional.
2178         (CustomAnalysisTaskConfigurator.prototype._buildRepositoryGroupList): Added.
2179         (CustomAnalysisTaskConfigurator.prototype._selectRepositoryGroup): Added.
2180         (CustomAnalysisTaskConfigurator.prototype._buildRevisionInput): Added. Creates an input element to specify
2181         a revision for a given repository. Autofills it with the latest commit for the currently selected platform if
2182         the user had not modified the field by the time the revisions are fetched.
2183         (CustomAnalysisTaskConfigurator.htmlTemplate): Added.
2184         (CustomAnalysisTaskConfigurator.cssTemplate): Added.
2186         * public/v3/components/instant-file-uploader.js: Added. A form to upload a custom darwinup root in "baseline"
2187         or "comparison" configurations of CustomAnalysisTaskConfigurator. It's "instant" because it auto-detects when a
2188         file to be uploaded had already been uploaded elsewhere by checking its SHA-256 hash.
2189         (InstantFileUploader):
2190         (InstantFileUploader.prototype.hasFileToUpload): Added.
2191         (InstantFileUploader.prototype.uploadedFiles): Added.
2192         (InstantFileUploader.prototype.addUploadedFile): Added. It's called on the uploader for "comparison"
2193         configuration when the uploader for "baseline" configuration dipsatches "uploadedFile" action to automatically
2194         mirror the newly uploaded custom root to "comparision" configuration.
2195         (InstantFileUploader.prototype.didConstructShadowTree): Added.
2196         (InstantFileUploader.prototype.render): Added.
2197         (InstantFileUploader.prototype._renderUploadedFiles): Added. Renders the list of the uploaded files.
2198         (InstantFileUploader.prototype._renderPreuploadFiles): Added. Renders the list of the files to be uploaded with
2199         a progress bar.
2200         (InstantFileUploader.prototype._updateUploadStatus): Added. Updates the progress bar for uploading the file.
2201         (InstantFileUploader.prototype._formatUploadError): Added.
2202         (InstantFileUploader.prototype._didFileInputChange): Added. Called when the user picks a file to uploaded on
2203         the input element. Fetch the meta data for the uploaded file with the same SHA-256 hash if there is any, and
2204         start uploading the file if there isn't one.
2205         (InstantFileUploader.prototype._removeUploadedFile): Added.
2206         (InstantFileUploader.prototype._didUploadFile): Added. Move a file from the list of files to be uploaded to
2207         the list of uploaded files.
2208         (InstantFileUploader.htmlTemplate): Added.
2209         (InstantFileUploader.cssTemplate): Added.
2211         * public/v3/index.html:
2213         * public/v3/models/analysis-task.js:
2214         (AnalysisTask): Made platform and metric optional as it is now.
2215         (AnalysisTask.findByPlatformAndMetric): Skip analysis tasks without a platform or a metric.
2216         (AnalysisTask.prototype.isCustom): Added. Returns true for a custom analysis task.
2217         (AnalysisTask.fetchRelatedTasks): Skip custom analysis tasks.
2218         (AnalysisTask._constructAnalysisTasksFromRawData): Construct analysis tasks even if they were missing a metric
2219         or a platform instead of silently skipping them.
2221         * public/v3/models/build-request.js:
2222         (BuildRequest.constructBuildRequestsFromData): Construct uploaded file objects returned by /api/build-requests.
2224         * public/v3/models/commit-log.js:
2225         (CommitLog.fetchLatestCommitForPlatform): Added.
2227         * public/v3/models/commit-set.js:
2228         (CommitSet): Added this._customRoots.
2229         (CommitSet.prototype.customRoots): Returns this._customRoots.
2230         (CommitSet.prototype.equals): Returns false when the set of custom roots are not equal.
2231         (CommitSet.areCustomRootsEqual): Added.
2232         (CustomCommitSet):
2233         (CustomCommitSet.prototype.equals): Added.
2234         (CustomCommitSet.prototype.customRoots): Added.
2235         (CustomCommitSet.prototype.addCustomRoot): Added.
2237         * public/v3/models/manifest.js:
2238         (Manifest._didFetchManifest): Store fileUploadSizeLimit in the manifest as UploadedFile.fileUploadSizeLimit.
2239         This allows a file size check in the client size instead of uploading it to the server and receiving an error.
2241         * public/v3/models/metric.js:
2242         (Metric.formatTime): Moved from ChartPaneStatusView to be also used by InstantFileUploader._renderUploadedFiles.
2244         * public/v3/models/test-group.js:
2245         (TestGroup.prototype.createWithTask): Added.
2246         (TestGroup.prototype.createAndRefetchTestGroups):
2247         (TestGroup.prototype._revisionSetsFromCommitSets): Added. Extracted from createAndRefetchTestGroups.
2248         (TestGroup.prototype._fetchTestGroupsForTask): Added. Extracted from createAndRefetchTestGroups.
2250         * public/v3/models/triggerable.js:
2251         (Triggerable.triggerablePlatformsForTests): Added.
2252         (Triggerable.sortByNamePreferringSmallerRepositories): Added.
2254         * public/v3/models/uploaded-file.js:
2255         (UploadedFile.prototype.createdAt): Added.
2256         (UploadedFile.prototype.filename): Added.
2257         (UploadedFile.prototype.author): Added.
2258         (UploadedFile.prototype.size): Added.
2259         (UploadedFile.uploadFile): Added a client-side check for the file size using UploadedFile.fileUploadSizeLimit.
2260         (UploadedFile.fetchUnloadedFileWithIdenticalHash): Ditto. Also fixed a bug that 404 was resulting in a rejected
2261         promise instead of a resolved promise with null.
2263         * public/v3/pages/analysis-category-page.js:
2264         (AnalysisCategoryPage.prototype._reconstructTaskList): Modernized the code. Added the support for platform and
2265         metric being null for some analysis tasks.
2267         * public/v3/pages/analysis-task-page.js:
2268         (AnalysisTaskPage.prototype._didFetchTask): Don't fetch the measurement set or create a chart for custom tasks.
2269         (AnalysisTaskPage.prototype.render): Don't display the charts or the stacking table for custom tasks.
2270         (AnalysisTaskPage.prototype._renderTaskNameAndStatus): Don't try to show the full test name for custom tasks
2271         since it's not associated with exactly one pair.
2273         * public/v3/pages/chart-pane-status-view.js:
2274         (ChartPaneStatusView.prototype._renderBuildRevisionTable):
2275         (ChartPaneStatusView.prototype._formatTime): Moved to Metric.formatTime.
2277         * public/v3/pages/chart-pane.js:
2278         (ChartPane.prototype._analyzeRange): Set inProgress to true to hide CustomAnalysisTaskConfigurator in
2279         CreateAnalysisTaskPage when creating a non-custom analysis task for a specific range.
2281         * public/v3/pages/create-analysis-task-page.js:
2282         (CreateAnalysisTaskPage): This page now shows CustomAnalysisTaskConfigurator by default, and lets a user create
2283         a custom analysis task by picking a test, a platform, and a set of revisions and custom darwinup roots.
2284         (CreateAnalysisTaskPage.prototype.updateFromSerializedState): Show a message when inProgress is set. This is
2285         the old behavior of this page.
2286         (CreateAnalysisTaskPage.prototype.didConstructShadowTree): Added.
2287         (CreateAnalysisTaskPage.prototype._createAnalysisTaskWithGroup): Added.
2288         (CreateAnalysisTaskPage.prototype.render):
2289         (CreateAnalysisTaskPage.prototype._renderMessage): Added. Hides CustomAnalysisTaskConfigurator and the select
2290         element to specify the numebr of iterations when a message is set.
2291         (CreateAnalysisTaskPage.htmlTemplate):
2292         (CreateAnalysisTaskPage.cssTemplate):
2294         * public/v3/pages/page-router.js:
2295         (PageRouter.prototype.route): Always enqueue the page to re-render when the route has changed.
2297         * server-tests/api-build-requests-tests.js: Updated test cases now that the response contains a list of
2298         uploaded files associated with build requests.
2299         *server-tests/api-commits-tests.js: Added a test case for /api/commits/<repository-name>/latest?platform=X.
2300         * server-tests/privileged-api-create-test-group-tests.js: Added test cases for creating a custom analysis task
2301         and a test group with custom roots. 
2302         * server-tests/resources/mock-data.js:
2303         (MockData.addMockData): Updated the mock data to satisfy new constraint on analysis-tasks table. Also inserted
2304         more commits, builds, and build_commits rows for testing /api/commits/<repository-name>/latest?platform=X.
2306         * tools/js/remote.js: Include global.FormData from form-data.js.
2308         * unit-tests/analysis-task-tests.js: Added a test for calling findByPlatformAndMetric when there is a custom
2309         analysis task.
2310         (sampleAnalysisTask): Removed the category since /api/analysis-tasks/ no longer generate this property.
2311         (sampleCustomAnalysisTask): Added.
2312         * unit-tests/build-request-tests.js:
2313         (sampleBuildRequestData): Updated the mock response. Added a test case for fetcing custom roots.
2314         * unit-tests/buildbot-syncer-tests.js:
2315         (createSampleBuildRequest): Ditto.
2316         * unit-tests/test-groups-tests.js:
2317         (sampleTestGroup): Ditto.
2319 2017-04-07  Ryosuke Niwa  <rniwa@webkit.org>
2321         Make cycler page scroll down when a dashboard is too tall for the current viewport size
2322         https://bugs.webkit.org/show_bug.cgi?id=170588
2324         Rubber-stamped by Chris Dumez.
2326         Updated the cycler page to scroll down smoothly over 500ms and scroll up again before moving to the next page
2327         when a dashboard page is too tall to be shown at once. For now, we assume that each dashboard's height is no
2328         more than 2x the height of the viewport.
2330         * public/cycler.html:
2332 2017-04-06  Ryosuke Niwa  <rniwa@webkit.org>
2334         Each build request should be associated with a repository group
2335         https://bugs.webkit.org/show_bug.cgi?id=170528
2337         Rubber-stamped by Chris Dumez.
2339         Make the buildbot syncing script use the concept of repository groups so that each repository group can post
2340         a different set of properties to buildbot. In order to do this, we associate each build request with
2341         a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via
2342         /api/update-triggerable just the same way the set of the supported platform, test pairs are updated.
2344         Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name
2345         to either a string value or a repository name enclosed in < and >:
2347         ```js
2348         "repositoryGroups": {
2349             "webkit-svn": {
2350                 "repositories": ["WebKit", "macOS"],
2351                 "properties": {"os": "<macOS>", "wk": "<WebKit>"}
2352             }
2353         }
2354         ```
2356         With this, removed the support for specifying a repository to use in generic dictionary of properties via
2357         a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of
2358         repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in
2359         build requests.
2361         After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group.
2362         Run the appropriate database queries to set the repository group on each build request. Because of this change,
2363         this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests.
2364         Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same
2365         test group if the next build request to be scheduled does not specify a repository group.
2367         * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for
2368         repository and group pair in triggerable_repositories table.
2370         * public/api/update-triggerable.php:
2371         (main): Validate and insert repository groups.
2372         (validate_configurations): Extracted from main.
2373         (validate_repository_groups): Added.
2375         * public/v3/models/repository.js:
2376         (Repository.findTopLevelByName): Added.
2378         * public/include/build-requests-fetcher.php:
2379         (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response.
2381         * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given
2382         triggerable for a list of repositories.
2383         (RepositoryGroupFinder): Added. 
2384         (RepositoryGroupFinder::__construct): Added.
2385         (RepositoryGroupFinder::find_by_repositories): Added.
2386         (RepositoryGroupFinder::populate_map): Added.
2388         * public/privileged-api/create-test-group.php:
2389         (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains
2390         "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set.
2391         Use that to set the repository group in each new build request. 
2392         (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group.
2393         (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its
2394         argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]}
2396         * public/v3/models/build-request.js:
2397         (BuildRequest):
2398         (BuildRequest.prototype.triggerable): Added.
2399         (BuildRequest.prototype.repositoryGroup): Added.
2400         (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group.
2402         * public/v3/models/triggerable.js:
2403         (Triggerable.prototype.name): Added.
2404         (Triggerable.prototype.acceptedRepositories): Deleted.
2405         (TriggerableRepositoryGroup):
2406         (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group
2408         * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request.
2409         * server-tests/api-manifest-tests.js: Added assertions for the repository groups.
2410         * server-tests/api-report-tests.js:
2411         (.emptyReport):
2412         (.reportWithTwoLevelsOfAggregations):
2413         * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with
2414         a triggerable.
2415         (.updateWithOSXRepositoryGroup):
2416         (.mapRepositoriesByGroup):
2417         * server-tests/privileged-api-create-test-group-tests.js:
2418         (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups
2419         in existing test cases, and added a test case for creating a test group with two different repository groups.
2421         * server-tests/resources/mock-data.js:
2422         (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps.
2423         (MockData.emptyTriggeragbleId): Added.
2424         (MockData.macosRepositoryId): Added.
2425         (MockData.webkitRepositoryId): Added.
2426         (MockData.gitWebkitRepositoryId): Added.
2427         (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some
2428         tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks.
2429         (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js.
2430         (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js.
2431         (MockData.addAnotherMockTestGroup): Cleanup.
2432         (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes.
2433         (MockData.mockTestSyncConfigWithTwoBuilders): Ditto.
2435         * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test
2436         updating the set of repository groups in addition to the set of test, platform pairs.
2437         (.refetchManifest): Added.
2439         * tools/js/buildbot-syncer.js:
2440         (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument,
2441         and buildRequestArgument as the third argument.
2442         (BuildbotSyncer.prototype.repositoryGroups): Added.
2443         (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find.
2444         Also added an assertion that the build request is associated with a repository group.
2445         (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to
2446         specify a revision in favor of explicity listing each property and repository name in a repository group.
2447         (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties
2448         shared across syncers, the name of properties which specifies the build slave name and build request ID. These
2449         values are not stored as top-level properties and superseded by the concept of repository groups.
2450         (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups.
2451         (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of
2452         properties or buildRequestArgument (often inherited from shared).
2453         (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of
2454         allowed proeprties in each configuration now that they're specified as top-level properties.
2456         * tools/js/buildbot-triggerable.js:
2457         (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups.
2458         (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is
2459         not included in the list of valid build requests.
2460         (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes
2461         those that lack a repository group set.
2462         (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds
2463         the next build request to be scheduled for the test group.
2464         (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from
2465         _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of
2466         a test group information since syncOnce now calls _nextRequestInGroup to find the next build request.
2468         * tools/js/v3-models.js:
2470         * unit-tests/build-request-tests.js: Fixed the test name.
2472         * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests
2473         for parsing repository groups.
2474         (sampleiOSConfig): Updated the mock configuration per code changes.
2475         (sampleiOSConfigWithExpansions): Ditto.
2476         (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration.
2477         Various test cases have been updated to reflect this.
2478         (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock
2479         configurations. The git hash was there to test "rootOptions", which this patch removed.
2480         (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding"
2481         which, again, this patch removed.
2482         (sampleInProgressBuild): Ditto.
2483         (sampleFinishedBuild): Ditto.
2485         * unit-tests/resources/mock-v3-models.js:
2486         (MockModels.inject): Added ock repository groups so that existing tests will continue to function.
2488 2017-04-05  Ryosuke Niwa  <rniwa@webkit.org>
2490         Introduce the notion of repository groups to triggerables
2491         https://bugs.webkit.org/show_bug.cgi?id=170228
2493         Reviewed by Chris Dumez.
2495         On some triggerable, it's desirable to specify multiple sets of repositories that are accepted.
2497         For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and
2498         some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither
2499         (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set.
2501         This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by
2502         a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn
2503         now has many to one relationship to triggerable_repository_groups instead of build_triggerables.
2505         Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported.
2506         We don't want to delete the triggerable completely from the database since it would result in the associated
2507         A/B testing results being purged, which is not desirale.
2509         To migrate an existing database, run the following transaction:
2510         ```sql
2511         BEGIN;
2512         ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE;
2514         CREATE TABLE triggerable_repository_groups (
2515             repositorygroup_id serial PRIMARY KEY,
2516             repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL,
2517             repositorygroup_name varchar(256) NOT NULL,
2518             repositorygroup_description varchar(256),
2519             repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE,
2520             CONSTRAINT repository_group_name_must_be_unique_for_triggerable
2521                 UNIQUE(repositorygroup_triggerable, repositorygroup_name));
2522         INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name)
2523             SELECT triggerable_id, 'default' FROM build_triggerables;
2525         ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups;
2526         UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups
2527             WHERE trigrepo_triggerable = repositorygroup_triggerable;
2528         ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL;
2530         ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable;
2531         ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots;
2532         END;
2533         ```
2535         * init-database.sql:
2536         * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups.
2537         (insert_triggerable_repositories): Added.
2538         (generate_repository_list): Added.
2539         (generate_repository_form): Added.
2540         (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable.
2542         * public/include/manifest-generator.php:
2543         (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable.
2544         Rewrote it to include an array of repository groups, which in turn contains an array of repositories along
2545         with its name and a description, and a boolean indicating whether it accepts a custom root file or not.
2546         The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories
2547         since it's still used by detect-changes.js.
2549         * public/v3/models/manifest.js:
2550         (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects.
2552         * public/v3/models/triggerable.js:
2553         (Triggerable):
2554         (Triggerable.prototype.isDisabled): Added.
2555         (Triggerable.prototype.repositoryGroups): Added.
2556         (Triggerable.prototype.acceptsTest): Added.
2557         (TriggerableRepositoryGroup): Added.
2558         (TriggerableRepositoryGroup.prototype.description): Added.
2559         (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added.
2560         (TriggerableRepositoryGroup.prototype.repositories): Added.
2562         * public/v3/pages/analysis-task-page.js:
2563         (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable.
2565         * server-tests/api-manifest-tests.js: Updated a test case to test repository groups.
2567         * tools/js/database.js:
2568         (tableToPrefixMap): Added triggerable_repository_groups.
2570         * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js.
2572 2017-03-31  Ryosuke Niwa  <rniwa@webkit.org>
2574         Build fix. For OS versions, we can end up with non-alphanumeric revision.
2575         Delete the code path only used by the v2 UI since nobody uses that now.
2577         * public/api/commits.php:
2578         (main):
2580 2017-03-30  Ryosuke Niwa  <rniwa@webkit.org>
2582         sync-buildbot.js can schedule more than one build per builder
2583         https://bugs.webkit.org/show_bug.cgi?id=170318
2585         Reviewed by Saam Barati.
2587         The bug was caused by _scheduleNextRequestInGroupIfSlaveIsAvailable not returning a promise when
2588         scheduling the first build request of a test group. This resulted in _pullBuildbotOnAllSyncers
2589         to prematurely resolve before POST'ing new build had finished. That in turn could result in the
2590         next cycle of syncing to occur before POST'ing has actually taken place.
2592         More precisely, when the nextRequest was the first request or its associated syncer object could
2593         not be identified, we were supposed to find the first available syncer, schedule the request,
2594         and then return the promise returned by scheduleRequestInGroupIfAvailable. However, the for loop
2595         which called scheduleRequestInGroupIfAvailable on every syncer was declaring its own variable
2596         named "promise" thereby shadowing the outer variable, which is returned to the caller.
2598         Fixed the bug by not declaring a shadowing variable, and refactored the code. Namely, the only
2599         reason we had such a complicated logic with two local variables, promise and syncer, was so that
2600         we could log that we're scheduling a build. Extracted this code as _scheduleRequestWithLog.
2602         _scheduleNextRequestInGroupIfSlaveIsAvailable can now simply exit early with a call to
2603         _scheduleRequestWithLog when the syncer is readily identified. When looping over syncers, it can
2604         simply return the first non-null result of _scheduleNextRequestInGroupIfSlaveIsAvailable.
2606         * server-tests/tools-buildbot-triggerable-tests.js: Added a test case where we wait 10ms after
2607         receiving the request to POST a build. There should be no new network request until we resolve
2608         this request.
2610         * tools/js/buildbot-triggerable.js:
2611         (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Fixed the bug.
2612         (BuildbotTriggerable.prototype._scheduleRequestWithLog): Extracted.
2614 2017-03-30  Ryosuke Niwa  <rniwa@webkit.org>
2616         Modernize BuildbotSyncer and BuildbotTriggerable
2617         https://bugs.webkit.org/show_bug.cgi?id=170310
2619         Reviewed by Chris Dumez.
2621         Modernized the code to use arrow functions and other modern idoms in ES2016.
2623         * ReadMe.md: Added instructions on how to run tests, and moved the steps to configure postgres
2624         above the steps to configure Apache since only the former is needed to run tests.
2625         * tools/js/buildbot-syncer.js:
2626         * tools/js/buildbot-triggerable.js:
2628 2017-03-30  Ryosuke Niwa  <rniwa@webkit.org>
2630         Yet another build fix after r214502. Workaround webkit.org/b/169907 for now.
2632         * public/v3/pages/analysis-task-page.js:
2633         (AnalysisTaskPage.cssTemplate):
2635 2017-03-30  Ryosuke Niwa  <rniwa@webkit.org>
2637         Revert an erronously change in the previous commit.
2639         * public/v3/components/base.js:
2641 2017-03-30  Ryosuke Niwa  <rniwa@webkit.org>
2643         Build fix after r214280. Don't render components until its element is inserted into a document.
2645         * public/v3/components/base.js:
2646         (ComponentBase):
2648 2017-03-29  Ryosuke Niwa  <rniwa@webkit.org>
2650         Another build fix after r214502.
2652         * public/v3/components/analysis-results-viewer.js:
2653         (AnalysisResultsViewer.prototype.render): this._groupToCellMap.get may not contain the cell when startPoint
2654         or metric had not been fetched yet even if currentTestGroup is set.
2656 2017-03-29  Ryosuke Niwa  <rniwa@webkit.org>
2658         Build fix after r214502. Analysis tasks without any test groups are throwing exceptions.
2660         * public/v3/components/results-table.js:
2661         (ResultsTable.prototype.renderTable): Don't show the header row when there are no content to show. 
2662         (ResultsTable.prototype._computeRepositoryList): Return a pair of arrays. The caller expects the repository
2663         list to be an array, not undefined.
2665 2017-03-28  Ryosuke Niwa  <rniwa@webkit.org>
2667         Modernize AnalysisTaskPage
2668         https://bugs.webkit.org/show_bug.cgi?id=170165
2670         Reviewed by Antti Koivisto.
2672         Modernized AnalysisTaskPage and related components. The main refactoring happened in AnalysisTaskPage
2673         from which AnalysisTaskResultsPane and AnalysisTaskTestGroupPane have been extracted.
2675         Decoupled BuildRequest from its results. AnalysisResultsViewer and TestGroupResultsTable now stores
2676         a reference to AnalysisResultsView and Metric to find the results for each build request.
2677         This refactoring is necessary in order to view results of an arbitrary metric in the future.
2679         Also refactored ResultsTable and its subclasses extensively. Instead of making its render() to invoke
2680         subclass' methods such as buildRowGroups, heading, and additionalHeading, rely on each subclass call
2681         to invoke renderTable(), renamed from render(), with callbacks to add extra headers and columns.
2683         This patch also fixes a number of usability issues found by the user such as changing the test name
2684         resets the customized revisions by the virtue of the modern code being naturally more correct.
2686         * public/v3/components/analysis-results-viewer.js:
2687         (AnalysisResultsViewer):
2688         (AnalysisResultsViewer.prototype.setTestGroupCallback): Deleted. Replaced by "testGroupClick" action.
2689         (AnalysisResultsViewer.prototype.setRangeSelectorLabels): Moved here from ResultsTable since it's
2690         never used in ResultsTable or TestGroupResultsTable.
2691         (AnalysisResultsViewer.prototype.selectedRange): Ditto.
2692         (AnalysisResultsViewer.prototype.setPoints): Now takes metric as the third argument.
2693         (AnalysisResultsViewer.prototype.setTestGroups): Now takes the current test group.
2694         (AnalysisResultsViewer.prototype.didUpdateResults): Deleted.
2695         (AnalysisResultsViewer.prototype.setAnalysisResultsView): Added.
2696         (AnalysisResultsViewer.prototype.render): Invoke _renderTestGroups lazily. Also simplified the logic
2697         to find the selected list item. Since we always use a shadow DOM now, we can simply look for an element
2698         with ".seleted" instead of crafting a unique class name.
2699         (AnalysisResultsViewer.prototype.renderTestGroups): Renamed from buildRowGroups. Specify callbacks to
2700         insert headers for A/B radio buttons, which has been moved from ResultsTable.prototype.render, and the
2701         stacked blocks of testing results.
2702         (AnalysisResultsViewer.prototype._classForTestGroup): Deleted.
2703         (AnalysisResultsViewer.prototype._openStackingBlock): Deleted.
2704         (AnalysisResultsViewer.prototype._expandBetween): Create a new set for expandedPoints to make
2705         _renderTestGroupsLazily.evaluate do the work.
2706         (AnalysisResultsViewer._layoutBlocks): Moved from TestGroupStackingGrid.layout.
2707         (AnalysisResultsViewer._sortBlocksByRow): Moved from AnalysisResultsViewer.TestGroupStackingGrid.
2708         (AnalysisResultsViewer._insertAfterBlockWithSameRange): Ditto.
2709         (AnalysisResultsViewer._insertBlockInFirstAvailableColumn): Ditto.
2710         (AnalysisResultsViewer._createCellsForRow): Ditto.
2712         (AnalysisResultsViewer.TestGroupStackingBlock):
2713         (AnalysisResultsViewer.TestGroupStackingBlock.prototype.addRowIndex):
2714         (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): No longer creates a unique
2715         class name here. See the inline comment for AnalysisResultsViewer.prototype.render.
2716         (AnalysisResultsViewer.TestGroupStackingBlock.prototype.isThin): Deleted. We used to collapse "failed"
2717         test groups as a thin vertical line, and we wanted to show them next to each other in _layoutBlock but
2718         we don't do that anymore.
2719         (AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForCommitSet): Added. Uses
2720         this._analysisResultsView to extract the results for the current metrics.
2721         (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
2723         * public/v3/components/analysis-task-bug-list.js: Added.
2724         (AnalysisTaskBugList): Added. Extracted from AnalysisTaskChartPane.
2725         (AnalysisTaskBugList.prototype.setTask): Added.
2726         (AnalysisTaskBugList.prototype.didConstructShadowTree): Added.
2727         (AnalysisTaskBugList.prototype.render): Added.
2728         (AnalysisTaskBugList.prototype._associateBug): Added.
2729         (AnalysisTaskBugList.prototype._dissociateBug): Added.
2730         (AnalysisTaskBugList.htmlTemplate): Added.
2732         * public/v3/components/chart-pane-base.js:
2733         (ChartPaneBase.htmlTemplate): Added a hook to insert more content at the end in AnalysisTaskChartPane.
2734         (ChartPaneBase.paneFooterTemplate): Added.
2736         * public/v3/components/customizable-test-group-form.js:
2737         (CustomizableTestGroupForm):
2738         (CustomizableTestGroupForm.prototype.setCommitSetMap):
2739         (CustomizableTestGroupForm.prototype.startTesting): Renamed from _submitted. Now dispatches an action
2740         by the name of "startTesting" instead of calling this._startCallback.
2741         (CustomizableTestGroupForm.prototype.didConstructShadowTree): Added. Moved the logic to attach event
2742         handlers here to avoid eagerly creating the shadow tree in the constructor.
2743         (CustomizableTestGroupForm.prototype._computeCommitSetMap): Use the newly added this._revisionEditorMap
2744         to find the relevant input element instead of running a querySelector.
2745         (CustomizableTestGroupForm.prototype.render): Lazily invoke _renderCustomRevisionTable. This avoids
2746         overriding the customized revisions when the user finally types in the test group name.
2747         (CustomizableTestGroupForm.prototype._renderCustomRevisionTable): Extracted from render.
2748         (CustomizableTestGroupForm.prototype._constructRevisionRadioButtons): Made this a non-static method
2749         since it needs to update this._revisionEditorMap now. Merged _constructRevisionRadioButtons.
2750         (CustomizableTestGroupForm.prototype._createRadioButton): Deleted. See above.
2751         (CustomizableTestGroupForm.cssTemplate):
2752         (CustomizableTestGroupForm.formContent): Use IDs instead of classes to make this.content(ID) work.
2754         * public/v3/components/mutable-list-view.js:
2755         (MutableListView.prototype.setList):
2756         (MutableListView.prototype.setKindList):
2757         (MutableListView.prototype.setAddCallback): Deleted. Replaced by "addItem" action.
2758         (MutableListView.prototype.render):
2759         (MutableListItem.prototype.content):
2761         * public/v3/components/results-table.js:
2762         (ResultsTable): Removed this._rangeSelectorLabels, this._rangeSelectorCallback, and this._selectedRange
2763         as they are only used by AnalysisResultsViewer. Also replaced this._valueFormatter by
2764         this._analysisResultsView which knows a metric.
2765         (ResultsTable.prototype.setValueFormatter): Deleted.
2766         (ResultsTable.prototype.setRangeSelectorLabels): Deleted.
2767         (ResultsTable.prototype.setRangeSelectorCallback): Deleted.
2768         (ResultsTable.prototype.selectedRange): Deleted.
2769         (ResultsTable.prototype._rangeSelectorClicked): Deleted.
2770         (ResultsTable.prototype.setAnalysisResultsView): Added.
2771         (ResultsTable.prototype.renderTable): Added. Removed the logic to add _rangeSelectorLabels since it has
2772         been moved to AnalysisResultsViewer.prototype.render inside buildColumns, which also inserts additional
2773         columns which used to be stored on each ResultsTableRow. Use the same technique to insert additional
2774         headers. Also take the name (thead tr th) of row header (tbody tr td) as an argument and automatically
2775         create a table cell of an appropriate colspan.
2776         (ResultsTable.prototype._createRevisionListCells):
2777         (ResultsTable.prototype.heading): Deleted. Superseded by buildHeaders callback.
2778         (ResultsTable.prototype.additionalHeading): Ditto.
2779         (ResultsTable.prototype.buildRowGroups): Deleted. It is now the responsibility of each subclass to call
2780         ResultsTable's renderTable() in the subclass' render() function.
2781         (ResultsTable.prototype._computeRepositoryList): No longer takes extraRepositories as an argument.
2782         Instead, this function now returns a pair of the repository list and the list of constant commits.
2783         (ResultsTable.htmlTemplate):
2784         (ResultsTable.cssTemplate):
2786         * public/v3/components/test-group-form.js:
2787         (TestGroupForm): Avoid eagerly creating the shadow tree. Also removed the removed the dead code.
2788         (TestGroupForm.prototype.setRepetitionCount): Simply override the value of the select element.
2789         (TestGroupForm.prototype.didConstructShadowTree): Added. Attach event handlers here to avoid eagerly
2790         creating the shadow tree in the constructor.
2791         (TestGroupForm.prototype.startTesting): Renamed from _submitted. Dispatch "startTesting" action instead
2792         of invoking _startCallback which has been removed.
2793         (TestGroupForm.htmlTemplate):
2794         (TestGroupForm.formContent):
2796         * public/v3/components/test-group-results-table.js:
2797         (TestGroupResultsTable):
2798         (TestGroupResultsTable.prototype.didUpdateResults): Deleted. No longer neeed per setAnalysisResultsView
2799         in ResultsTable.
2800         (TestGroupResultsTable.prototype.setTestGroup):
2801         (TestGroupResultsTable.prototype.heading): Deleted.
2802         (TestGroupResultsTable.prototype.render):
2803         (TestGroupResultsTable.prototype._renderTestGroup): Extracted from render.
2804         (TestGroupResultsTable.prototype._buildRowGroups): Renamed from buildRowGroups.
2805         (TestGroupResultsTable.prototype._buildRowGroupForCommitSet): Extracted from buildRowGroups.
2806         (TestGroupResultsTable.prototype._buildComparisonRow): Extracted from buildRowGroups.buildRowGroups
2808         * public/v3/index.html: Include analysis-task-bug-list.js.
2810         * public/v3/models/analysis-results.js:
2811         (AnalysisResults): Inverted the map so that we can easily create a view based on metric.
2812         (AnalysisResults.prototype.find): Ditto.
2813         (AnalysisResults.prototype.add): Ditto.
2814         (AnalysisResults.prototype.viewForMetric): Added.
2815         (AnalysisResults.fetch):
2816         (AnalysisResultsView): Added.
2817         (AnalysisResultsView.prototype.metric): Added.
2818         (AnalysisResultsView.prototype.resultForBuildId): Added.
2820         * public/v3/models/build-request.js:
2821         (BuildRequest.result): Deleted.
2822         (BuildRequest.setResult): Deleted.
2824         * public/v3/models/test-group.js:
2825         (TestGroup): Removed this._allCommitSets since it was never used.
2826         (TestGroup.prototype.didSetResult): Deleted since it was never used.
2827         (TestGroup.prototype.compareTestResults): Now takes an array of measurement set values.
2828         (TestGroup.prototype._valuesForCommitSet): Deleted.
2830         * public/v3/pages/analysis-task-page.js:
2831         (AnalysisTaskChartPane): This class now includes the form to cutomize the revisions.
2832         (AnalysisTaskChartPane.prototype.setShowForm): Added.
2833         (AnalysisTaskChartPane.prototype._mainSelectionDidChange):
2834         (AnalysisTaskChartPane.prototype.didConstructShadowTree): Added. Dispatches "newTestGroup" action when
2835         the user presses the button to start a new A/B testing from the chart.
2836         (AnalysisTaskChartPane.prototype.render): Added.
2837         (AnalysisTaskChartPane.prototype.paneFooterTemplate): Added.
2838         (AnalysisTaskChartPane.cssTemplate):
2840         (AnalysisTaskResultsPane): Added. Encapsulates AnalysisResultsViewer and CustomizableTestGroupForm.
2841         (AnalysisTaskResultsPane.prototype.setPoints): Added.
2842         (AnalysisTaskResultsPane.prototype.setTestGroups): Added.
2843         (AnalysisTaskResultsPane.prototype.setAnalysisResultsView): Added.
2844         (AnalysisTaskResultsPane.prototype.setShowForm): Added.
2845         (AnalysisTaskResultsPane.prototype.didConstructShadowTree): Added. Dispatches "newTestGroup" action
2846         when the user presses the button to start a new A/B testing from the chart.
2847         (AnalysisTaskResultsPane.prototype.render): Added.
2848         (AnalysisTaskResultsPane.htmlTemplate): Added.
2849         (AnalysisTaskResultsPane.cssTemplate): Added.
2851         (AnalysisTaskTestGroupPane): Added. Encapsulates TestGroupResultsTable and CustomizableTestGroupForm.
2852         (AnalysisTaskTestGroupPane.prototype.didConstructShadowTree): Added.
2853         (AnalysisTaskTestGroupPane.prototype.setTestGroups): Added.
2854         (AnalysisTaskTestGroupPane.prototype.setAnalysisResultsView): Added.
2855         (AnalysisTaskTestGroupPane.prototype.render): Added.
2856         (AnalysisTaskTestGroupPane.prototype._renderTestGroups): Added. Updates the list of test groups. Hide
2857         the hidden groups unless showHiddenGroups is set. Updates this._testGroupMap so that the visibility of
2858         groups and their names can be updated without having to re-render the entire list.
2859         (AnalysisTaskTestGroupPane.prototype._renderTestGroupVisibility): Added.
2860         (AnalysisTaskTestGroupPane.prototype._renderTestGroupNames): Added.
2861         (AnalysisTaskTestGroupPane.prototype._renderCurrentTestGroup): Added. Update TestGroupResultsTable with
2862         the selected test group. Also highlight the list view, and update the hide-unhide toggle button's label
2863         as needed.
2864         (AnalysisTaskTestGroupPane.htmlTemplate): Added.
2865         (AnalysisTaskTestGroupPane.cssTemplate): Added.
2867         (AnalysisTaskPage): Deleted a massive number of instance variables. They are now manged by newly added
2868         AnalysisTaskChartPane, AnalysisTaskResultsPane, and AnalysisTaskTestGroupPane
2869         (AnalysisTaskPage.prototype.didConstructShadowTree): Added. Attach various event handlers here to avoid
2870         eagerly creating the shadow tree in the constructor.
2871         (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId):
2872         (AnalysisTaskPage.prototype._didFetchTask): No longer sets the value formatter to the results viewer
2873         and the results table as they now recieve AnalysisResultsView later in _assignTestResultsIfPossible.
2874         (AnalysisTaskPage.prototype._didFetchMeasurement): Set the metric to the results viewer.
2875         (AnalysisTaskPage.prototype._didUpdateTestGroupHiddenState):
2876         (AnalysisTaskPage.prototype._assignTestResultsIfPossible): Create AnalysisResultsView from the newly
2877         retrieved AnalysisResults and pass it to AnalysisTaskResultsPane and AnalysisTaskTestGroupPane.
2878         (AnalysisTaskPage.prototype.render): Dramatically simplified.
2879         (AnalysisTaskPage.prototype._renderTaskNameAndStatus): Extracted from render.
2880         (AnalysisTaskPage.prototype._renderRelatedTasks): Ditto.
2881         (AnalysisTaskPage.prototype._renderCauseAndFixes): Ditto.
2882         (AnalysisTaskPage.prototype._showTestGroup):
2883         (AnalysisTaskPage.prototype._updateTaskName): Now takes the new name as an argument.
2884         (AnalysisTaskPage.prototype._updateTestGroupName): Now takes the new name as the second argument.
2885         (AnalysisTaskPage.prototype._hideCurrentTestGroup): Now takes the test group to hide.
2886         (AnalysisTaskPage.prototype._associateCommit): Moved to AnalysisTaskBugList.
2887         (AnalysisTaskPage.prototype._dissociateCommit): Ditto.
2888         (AnalysisTaskPage.prototype._retryCurrentTestGroup): Now takes the test group as the first argument.
2889         (AnalysisTaskPage.prototype._chartSelectionDidChange): Deleted.
2890         (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Deleted.
2891         (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): Deleted.
2892         (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Deleted.
2893         (AnalysisTaskPage.htmlTemplate):
2894         (AnalysisTaskPage.cssTemplate):
2896         * unit-tests/test-groups-tests.js: Updated a test case which was expecting BuildReqeust's result, which
2897         has been removed, to exist.
2899 2017-03-23  Ryosuke Niwa  <rniwa@webkit.org>
2901         Share more code between ManifestGenerator and /api/triggerables
2902         https://bugs.webkit.org/show_bug.cgi?id=169993
2904         Reviewed by Chris Dumez.
2906         Shared the code to fetch the list of triggerables from the database between ManifestGenerator
2907         and /api/triggerables.
2909         * public/api/triggerables.php:
2910         (main):
2911         * public/include/manifest-generator.php:
2912         (ManifestGenerator::fetch_triggerables): Extracted as a static function. Also include the ID
2913         in the triggerable data.
2915 2017-03-23  Ryosuke Niwa  <rniwa@webkit.org>
2917         create-test-group should allow a different set of repositories to be used in each configuration
2918         https://bugs.webkit.org/show_bug.cgi?id=169992
2920         Rubber-stamped by Antti Koivisto.
2922         Added the support for new POST parameter, revisionSets, to /privileged-api/create-test-group.
2923         This new parameter now specifies an array of repository id to revision dictionaries, and allows
2924         different set of repositories' revisions to be specified in each dictionary.
2926         We keep the old API for v2 UI and detect-changes.js compatibility for now.
2928         * public/privileged-api/create-test-group.php:
2929         (main):
2930         (commit_sets_from_revision_sets): Added.
2931         (ensure_commit_sets): Only fetch the top-level repository per r213788 and r213976.
2933         * public/v3/models/test-group.js:
2934         (TestGroup.createAndRefetchTestGroups): Use the newly added revisionSets parameter instead of
2935         the now depreacted commitSets parameter.
2937         * public/v3/pages/analysis-task-page.js:
2938         (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingCommitSetList): Simplified this code
2939         by simply verifying the consistency of commit sets now that createAndRefetchTestGroups takes
2940         an array of commit sets instead of a dictionary of repository name to a list of revisions.
2942         * server-tests/privileged-api-create-test-group-tests.js: Added test cases for new parameter.
2944 2017-03-22  Ryosuke Niwa  <rniwa@webkit.org>
2946         /api/uploaded-file should return createdAt as a POSIX timestamp
2947         https://bugs.webkit.org/show_bug.cgi?id=169980
2949         Rubber-stamped by Antti Koivisto.
2951         Call Database::to_js_time on createdAt to return it as a POSIX timestamp.
2953         * public/include/uploaded-file-helpers.php:
2954         (format_uploaded_file): Fixed the bug.
2955         * server-tests/api-manifest-tests.js: Renamed from api-manifest.js.
2956         * server-tests/api-uploaded-file-tests.js: Renamed from api-uploaded-file.js. Added a test case.
2958 2017-03-22  Ryosuke Niwa  <rniwa@webkit.org>
2960         UploadedFile should support a callback for upload progress
2961         https://bugs.webkit.org/show_bug.cgi?id=169977
2963         Reviewed by Andreas Kling.
2965         Added a new option dictionary to CommonRemoteAPI.sendHttpRequest with uploadProgressCallback
2967         Moved request headers and responseHandler callback in NodeRemoteAPI to this dictionary,
2968         and updated the tests which relied on this code.
2970         * public/shared/common-remote.js:
2971         (CommonRemoteAPI.prototype.postJSON):
2972         (CommonRemoteAPI.prototype.postJSONWithStatus):
2973         (CommonRemoteAPI.prototype.postFormData):
2974         (CommonRemoteAPI.prototype.postFormDataWithStatus):
2975         * public/v3/privileged-api.js:
2976         (PrivilegedAPI.prototype.sendRequest):
2977         * public/v3/remote.js:
2978         (BrowserRemoteAPI.prototype.sendHttpRequest):
2979         (BrowserRemoteAPI.prototype.sendHttpRequestWithFormData):
2980         (BrowserRemoteAPI):
2981         * server-tests/api-uploaded-file.js:
2982         * tools/js/remote.js:
2983         (NodeRemoteAPI.prototype.sendHttpRequest):
2984         (NodeRemoteAPI.prototype.sendHttpRequestWithFormData):
2985         (NodeRemoteAPI):
2987 2017-03-22  Ryosuke Niwa  <rniwa@webkit.org>
2989         ComponentBase should enqueue itself to render when it becomes connected
2990         https://bugs.webkit.org/show_bug.cgi?id=169905
2992         Reviewed by Antti Koivisto.
2994         When a component becomes connected to a document, enqueue itself to render automatically.
2995         Also added the support for boolean attribute to ComponentBase.createElement.
2997         * ReadMe.md: Added an instruction to raise the upload limit per r214065.
2998         * browser-tests/component-base-tests.js: Added tests for the new behavior and createElement. Also moved
2999         the tests related to enqueueToRenderOnResize out of defineElement tests.
3001         * browser-tests/index.html:
3002         (BrowsingContext.prototype.constructor): Override requestAnimationFrame so that the callback would be
3003         involved immediately durign testing.
3005         * public/v3/components/base.js:
3006         (ComponentBase): Enqueue itself to render during construction if custom elements is not available.
3007         (ComponentBase.defineElement):
3008         (ComponentBase.defineElement.elementClass.prototype.connectedCallback): Enqueue itself to render when
3009         the component's element became connected.
3010         (ComponentBase.createElement): Use Array.isArray instead of instanceof to make it work with arrays made
3011         in other realms (global objects) during testing. Added the support for boolean attributes. Setting an
3012         attribute value to true would set the attribute, and setting it to false would not set the attribute.
3013         (ComponentBase.useNativeCustomElements): Added. True iff window.customElements is defined.
3015         * public/v3/components/chart-pane-base.js:
3016         (ChartPaneBase.prototype.render): No longer need to call enqueueToRender on the commit log viewer.
3018         * public/v3/components/commit-log-viewer.js:
3019         (CommitLogViewer.prototype.render): No longer need to call enqueueToRender on the spinner icon.
3021         * public/v3/models/time-series.js:
3022         (TimeSeries): Made this a proper class declaration now that we don't include data.js after r213300.
3024         * public/v3/pages/chart-pane.js:
3025         (ChartPane.prototype._renderActionToolbar): No longer need to call enqueueToRender on the close icon.
3027         * public/v3/pages/summary-page.js:
3028         (SummaryPage.prototype._renderCell): No longer need to call enqueueToRender on the spinner icon.
3030 2017-03-20  Ryosuke Niwa  <rniwa@webkit.org>
3032         Delete another function that was supposed to be removed in the previous commit.
3034         * public/v3/models/build-request.js:
3035         (BuildRequest.cachedRequestsForTriggerableID): Deleted.
3037 2017-03-20  Ryosuke Niwa  <rniwa@webkit.org>
3039         Modernize BuildRequestQueuePage
3040         https://bugs.webkit.org/show_bug.cgi?id=169903
3042         Reviewed by Antti Koivisto.
3044         Modernized the code for /v3/#/analysis/queue.
3046         * public/v3/models/build-request.js:
3047         (BuildRequest.fetchTriggerables): Deleted since the manifest JSON now contains all the triggerables.
3049         * public/v3/pages/build-request-queue-page.js:
3050         (BuildRequestQueuePage): Deleted this._triggerables. Added this._buildRequestsByTriggerable.
3051         (BuildRequestQueuePage.prototype.open): Modernized the code.
3052         (BuildRequestQueuePage.prototype.render): Ditto.
3053         (BuildRequestQueuePage.prototype._constructBuildRequestTable): Ditto.
3055 2017-03-19  Ryosuke Niwa  <rniwa@webkit.org>
3057         Charts page show an inconsistent list of revisions for Git and Subversion
3058         https://bugs.webkit.org/show_bug.cgi?id=169888
3060         Reviewed by Andreas Kling.
3062         With Git, CommitLogViewer was showing the list of revisions including the starting hash,
3063         which was the last data point's revision instead of all revisions after the last data point.
3065         Fixed the bug by always specifying the revision at the last data point in both Subversion
3066         and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision.
3067         For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and
3068         "lastRevision" respectively.
3070         We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g.
3071         when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250"
3072         instead of "r1235-r1250".
3074         * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer
3075         specifies from/to revisions.
3076         * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer.
3077         * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css.
3079         * public/api/commits.php:
3080         (main): Renamed "from" and "to" query parameters.
3082         * public/include/commit-log-fetcher.php:
3083         (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified
3084         in both rows or not specified in either. Also reject when before_first_revision is identical
3085         or after last_revision instead of re-ordering them since it no longer makes sense to do so with
3086         new query parameter names.
3088         * public/v3/components/base.js:
3089         (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient
3090         againt realm (global object) differences.
3092         * public/v3/components/chart-pane-base.js:
3093         (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since
3094         CommitLogViewer does that on its own now.
3095         (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer
3096         to remember which repository is current. This was the only use of currentRepository.
3098         * public/v3/components/commit-log-viewer.js:
3099         (CommitLogViewer):
3100         (CommitLogViewer.prototype.currentRepository): Deleted.
3101         (CommitLogViewer.prototype.view):
3102         (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy.
3103         Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision
3104         since the generic JSON API no longer supports being called with the identical revisions.
3105         (CommitLogViewer.prototype.render): Modernized & simplified the code.
3106         (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy.
3107         (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable.
3108         (CommitLogViewer.cssTemplate):
3110         * public/v3/models/commit-log.js:
3111         (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding
3112         1 to a Subversion-like starting revision for creating the label. See above. But we still do this
3113         for forming URLs due to the way tools like Trac work with Subversion revisions.
3114         (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for
3115         what this function is supposed to be doing.
3116         (CommitLog._cachedCommitLogs): Deleted.
3117         (CommitLog.fetchForSingleRevision): Added.
3118         (CommitLog._constructFromRawData): Added.
3120         * public/v3/models/data-model.js:
3121         (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them.
3123         * public/v3/remote.js:
3124         (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo.
3126         * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to
3127         use new query parameters and added more test cases.
3129         * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer
3130         includes from/to values. They're computed in ChartRevisionRange instead.
3132 2017-03-20  Ryosuke Niwa  <rniwa@webkit.org>
3134         Fix os-build-fetcher.js and subprocess.js to make them work
3135         https://bugs.webkit.org/show_bug.cgi?id=169844
3137         Reviewed by Antti Koivisto.
3139         The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel.
3140         Some commands to poll the lsit of system components is not desirable to be ran in parallel.
3142         * server-tests/resources/mock-subprocess.js:
3143         (MockSubprocess): Use const declaration.
3144         (MockSubprocess.resetAndWaitForInvocation): Added.
3145         (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb.
3146         See https://webkit.org/code-style-guidelines/#names-verb
3147         (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array
3148         regardless of whether reset is called or when it's called.
3150         * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now
3151         expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting
3152         them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve,
3153         its subcommand to run, and then move onto the second top-level command. Also use a local reference
3154         to MockSubprocess.invocations instead of using the fully qualified name.
3156         * tools/js/os-build-fetcher.js:
3157         (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array
3158         in serial (not asynchronous) is a very common pattern in this class.
3159         (OSBuildFetcher.fetchAndReportAllInOrder): Added.
3160         (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted.
3161         (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result
3162         in each top-level command to be execued in parallel. Since each subcommand is executed as soon as
3163         its parent command is executed, this results in commands to be executed in parallel.
3164         Added a whole bunch of logging so that we can at least detect a bug like this in the future.
3165         (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style.
3166         (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion
3167         about the content returned by a subcommand.
3169         * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess.
3170         execFile is defined on require('child_process') itself.
3171         (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist.
3172         (Subprocess):
3174         * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js.
3175         (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep.
3177 2017-03-16  Ryosuke Niwa  <rniwa@webkit.org>
3179         Add the file uploading capability to the perf dashboard.
3180         https://bugs.webkit.org/show_bug.cgi?id=169737
3182         Reviewed by Chris Dumez.
3184         Added /privileged-api/upload-file to upload a file, and /api/uploaded-file/ to download the file
3185         and retrieve its meta data based on its SHA256. We treat two files with the identical SHA256 as
3186         identical since anyone who can upload a file using this mechanism can execute arbitrary code in
3187         our bots anyway. This is important for avoiding uploading a large darwinup roots multiple times
3188         to the server, saving both user's time/bandwidth and server's disk space.
3190         * config.json: Added uploadDirectory, uploadFileLimitInMB, and uploadUserQuotaInMB as options.
3191         * init-database.sql: Added uploaded_files table.
3193         * public/api/uploaded-file.php: Added.
3194         (main): /api/uploaded-file/N would download uploaded_file with id=N. /api/uploaded-file/?sha256=X
3195         would return the meta data for uploaded_file with sha256=X.
3196         (stream_file_content): Streams the file content in 64KB chunks. We support Range & If-Range HTTP
3197         request headers so that browsers can pause and resume downloading of a large root file.
3198         (parse_range_header): Parses Range HTTP request header.
3200         * public/include/json-header.php:
3201         (remote_user_name): Use the default argument of NULL.
3203         * public/include/manifest-generator.php:
3204         (ManifestGenerator::generate): Include the maximum upload size in the manifest file to let the
3205         frontend code preemptively check the file size before attempting to submit a file.
3207         * public/include/uploaded-file-helpers.php: Added.
3208         (format_uploaded_file):
3209         (uploaded_file_path_for_row):
3211         * public/privileged-api/upload-file-form.html: Added. For debugging purposes.
3212         (fetchCSRFfToken):
3213         (upload):
3215         * public/privileged-api/upload-file.php: Added.
3216         (main):
3217         (query_total_file_size):
3218         (create_uploaded_file_from_form_data):
3220         * public/shared/common-remote.js:
3221         (CommonRemoteAPI.prototype.postFormData): Added.
3222         (CommonRemoteAPI.prototype.postFormDataWithStatus): Added.
3223         (CommonRemoteAPI.prototype.sendHttpRequestWithFormData): Added.
3224         (CommonRemoteAPI.prototype._asJSON): Throw an exception instead of calling a non-existent reject.
3226         * public/v3/models/uploaded-file.js: Added.
3227         (UploadedFile): Added.
3228         (UploadedFile.uploadFile): Added.
3229         (UploadedFile.fetchUnloadedFileWithIdenticalHash): Added. Finds the file with the same SHA256 in
3230         the server to avoid uploading a large custom root multiple times.
3231         (UploadedFile._computeSHA256Hash): Added.
3233         * public/v3/privileged-api.js:
3234         (PrivilegedAPI.prototype.sendRequest): Added the options dictionary as a third argument. For now,
3235         only support useFormData boolean.
3237         * public/v3/remote.js:
3238         (BrowserRemoteAPI.prototype.sendHttpRequestWithFormData): Added.
3240         * server-tests/api-manifest.js: Updated per the inclusion of fileUploadSizeLimit in the manifest.
3241         * server-tests/api-uploaded-file.js: Added.
3242         * server-tests/privileged-api-upload-file-tests.js: Added.
3244         * server-tests/resources/temporary-file.js: Added.
3245         (TemporaryFile): Added. A helper class for creating a temporary file to upload.
3246         (TemporaryFile.makeTemporaryFileOfSizeInMB):
3247         (TemporaryFile.makeTemporaryFile):
3248         (TemporaryFile.inject):
3250         * server-tests/resources/test-server.conf: Set upload_max_filesize and post_max_size for testing.
3251         * server-tests/resources/test-server.js:
3252         (TestServer.prototype.testConfig): Use uploadFileLimitInMB and uploadUserQuotaInMB of 2MB and 5MB.
3253         (TestServer.prototype._ensureDataDirectory): Create a directory to store uploaded files inside
3254         the data directory. In a production server, we can place it outside ServerRoot / DocumentRoot.
3255         (TestServer.prototype.cleanDataDirectory): Delete the aforementioned directory as needed.
3257         * tools/js/database.js:
3258         (tableToPrefixMap): Added uploaded_files.
3260         * tools/js/remote.js:
3261         (NodeRemoteAPI.prototype.sendHttpRequest): Added a dictionary to specify request headers and
3262         a callback to process the response as arguments. Fixed the bug that any 2xx code other than 200
3263         was resulting in a rejected promise. Also include the response headers in the result for tests.
3264         Finally, when content is a function, call that instead of writing the content since FormData
3265         requires a custom logic.
3266         (NodeRemoteAPI.prototype.sendHttpRequestWithFormData): Added.
3268         * tools/js/v3-models.js: Include uploaded-file.js.
3270         * tools/run-tests.py:
3271         (main): Add form-data as a new dependency.
3273 2017-03-15  Dewei Zhu  <dewei_zhu@apple.com>
3275         Fix unit test and bug fix for 'pull-os-versions.js' script.
3276         https://bugs.webkit.org/show_bug.cgi?id=169701
3278         Reviewed by Ryosuke Niwa.
3280         Fix unit tests warnings on node-6.10.0.
3281         Fix 'pull-os-versions.js' does not fetch new builds and report.
3283         * server-tests/tools-os-build-fetcher-tests.js:
3284         (then):
3285         (beforeEach):
3286         (afterEach):
3287         * tools/pull-os-versions.js:
3288         (syncLoop):
3290 2017-03-15  Ryosuke Niwa  <rniwa@webkit.org>
3292         In-browser and node.js implementations of RemoteAPI should share some code
3293         https://bugs.webkit.org/show_bug.cgi?id=169695
3295         Rubber-stamped by Antti Koivisto.
3297         Extracted CommonRemoteAPI out of RemoteAPI implementations for node.js and browser. 
3299         * public/shared/common-remote.js: Added.
3300         (CommonRemoteAPI): Added.
3301         (CommonRemoteAPI.prototype.postJSON): Extracted from RemoteAPI.
3302         (CommonRemoteAPI.prototype.postJSONWithStatus): Ditto.
3303         (CommonRemoteAPI.prototype.getJSON): Ditto.
3304         (CommonRemoteAPI.prototype.getJSONWithStatus): Ditto.
3305         (CommonRemoteAPI.prototype.sendHttpRequest): Added. Needs to implemented by a subclass.
3306         (CommonRemoteAPI.prototype._asJSON): Added.
3307         (CommonRemoteAPI.prototype._checkStatus): Added.
3309         * public/v3/index.html: Include common-remote.js.
3311         * public/v3/privileged-api.js:
3312         (PrivilegedAPI): Use class now that we don't include data.js.
3313         (PrivilegedAPI.sendRequest): Modernized the code.
3314         (PrivilegedAPI.requestCSRFToken): Ditto.
3316         * public/v3/remote.js:
3317         (BrowserRemoteAPI): Renamed from RemoteAPI. window.RemoteAPI is now an instance of this class.
3318         (BrowserRemoteAPI.prototype.sendHttpRequest): Moved from RemoteAPI.sendHttpRequest.
3319         (BrowserRemoteAPI.prototype.sendHttpRequest):
3321         * server-tests/privileged-api-create-analysis-task-tests.js: Updated tests since NodeJSRemoteAPI
3322         now throws the JSON status as an error to be consistent with BrowserRemoteAPI.
3323         * server-tests/privileged-api-create-test-group-tests.js: Ditto.
3324         * server-tests/privileged-api-upate-run-status.js: Ditto.
3326         * tools/js/buildbot-triggerable.js:
3327         (BuildbotTriggerable.prototype.syncOnce): Just use postJSONWithStatus instead of manually
3328         checking the status.
3330         * tools/js/remote.js:
3331         (NodeRemoteAPI): Renamed from RemoteAPI. Still exported as RemoteAPI.
3332         (NodeRemoteAPI.prototype.constructor):
3333         (NodeRemoteAPI.prototype.sendHttpRequest): Modernized the code.
3335 2017-03-15  Ryosuke Niwa  <rniwa@webkit.org>
3337         Fix server tests after r213998 and r213969
3338         https://bugs.webkit.org/show_bug.cgi?id=169690
3340         Reviewed by Antti Koivisto.
3342         Fixed the existing server tests.
3344         * public/v3/models/analysis-task.js:
3345         (AnalysisTask.prototype._updateRemoteState): Use the relative path from the root so that it works inside tests.
3346         (AnalysisTask.prototype.associateBug): Ditto.
3347         (AnalysisTask.prototype.dissociateBug): Ditto.
3348         (AnalysisTask.prototype.associateCommit): Ditto.
3349         (AnalysisTask.prototype.dissociateCommit): Ditto.
3350         (AnalysisTask._fetchSubset): Ditto.
3351         (AnalysisTask.fetchAll): Ditto.
3352         * public/v3/models/test-group.js:
3353         (TestGroup.prototype.updateName): Ditto.
3354         (TestGroup.prototype.updateHiddenFlag): Ditto.
3355         (TestGroup.createAndRefetchTestGroups): Ditto.
3356         (TestGroup.cachedFetch): Ditto.
3357         * server-tests/api-manifest.js: Reverted an inadvertant change in r213969.
3358         * tools/js/database.js:
3359         (tableToPrefixMap): Added analysis_strategies.
3360         * unit-tests/analysis-task-tests.js: Updated expectations per changes to AnalysisTask.
3362 2017-03-15  Ryosuke Niwa  <rniwa@webkit.org>
3364         Add tests for privileged-api/create-analysis-task and privileged-api/create-test-group
3365         https://bugs.webkit.org/show_bug.cgi?id=169688
3367         Rubber-stamped by Antti Koivisto.
3369         Added tests for privileged-api/create-analysis-task and privileged-api/create-test-group, and fixed newly found bugs.
3371         * public/privileged-api/create-analysis-task.php:
3372         (main): Fixed the bug that we were not explicitly checking whether start_run and end_run were integers or not.
3373         Also return InvalidTimeRange when start and end times are identical as that makes no sense for an analysis task.
3375         * public/privileged-api/create-test-group.php:
3376         (main): Fixed a bug that we were not explicitly checking task and repetitionCount to be an integer.
3377         (ensure_commit_sets): Fixed the bug that the number of commit sets weren't checked. 
3379         * server-tests/privileged-api-create-analysis-task-tests.js: Added.
3380         * server-tests/privileged-api-create-test-group-tests.js: Added.
3382         * server-tests/resources/common-operations.js:
3383         (prepareServerTest): Increase the timeout from 1s to 5s.
3385         * server-tests/resources/mock-data.js:
3386         (MockData.addMockData): Use a higher database ID of 20 for a mock build_slave to avoid a conflict with auto-generated IDs.
3388 2017-03-15  Ryosuke Niwa  <rniwa@webkit.org>
3390         Make unit tests return a promise instead of manually calling done
3391         https://bugs.webkit.org/show_bug.cgi?id=169663
3393         Reviewed by Antti Koivisto.
3395         Make the existing unit tests always reutrn a promise instead of manually calling "done" callback as done
3396         in r213969. The promise tests are a lot more stable and less error prone.
3398         Also use MockRemoteAPI.waitForRequest() instead of chaining two resolved promises where appropriate.
3400         * unit-tests/analysis-task-tests.js:
3401         * unit-tests/buildbot-syncer-tests.js:
3402         * unit-tests/checkconfig.js:
3403         * unit-tests/privileged-api-tests.js:
3405 2017-03-15  Dewei Zhu  <dewei_zhu@apple.com>
3407         Rewrite 'pull-os-versions' script in Javascript to add support for reporting os revisions with sub commits.
3408         https://bugs.webkit.org/show_bug.cgi?id=169542
3410         Reviewed by Ryosuke Niwa.
3412         Extend '/api/commits/<repository>/last-reported' to accept a range and return last reported commits in given range.
3413         Rewrite 'pull-os-versions' in JavaScript and add unit tests for it.
3414         Instead of writing query manually while searching criteria contains null columns, use the methods provided in 'db.php'.
3415         Add '.gitignore' file to ommit files generated by while running tests/instances locally.
3417         * .gitignore: Added.
3418         * public/api/commits.php:
3419         * public/api/report-commits.php:
3420         * public/include/commit-log-fetcher.php:
3421         * public/include/db.php: 'null_columns' of prepare_params should be a reference.
3422         * public/include/report-processor.php:
3423         * server-tests/api-commits.js:
3424         (then):
3425         * server-tests/api-report-commits-tests.js:
3426         * server-tests/resources/mock-logger.js: Added.
3427         (MockLogger):
3428         (MockLogger.prototype.log):
3429         (MockLogger.prototype.error):
3430         * server-tests/resources/mock-subprocess.js: Added.
3431         (MockSubprocess.call):
3432         (MockSubprocess.waitingForInvocation):
3433         (MockSubprocess.inject):
3434         (MockSubprocess.reset):
3435         * server-tests/tools-buildbot-triggerable-tests.js:
3436         (MockLogger): Deleted.
3437         (MockLogger.prototype.log): Deleted.
3438         (MockLogger.prototype.error): Deleted.
3439         * server-tests/tools-os-build-fetcher-tests.js: Added.
3440         (beforeEach):
3441         (return.waitingForInvocationPromise.then):
3442         (then):
3443         (string_appeared_here.return.waitingForInvocationPromise.then):
3444         (return.addSlaveForReport.emptyReport.then):
3445         * tools/js/os-build-fetcher.js: Added.
3446         (OSBuildFetcher):
3447         (OSBuildFetcher.prototype._fetchAvailableBuilds):
3448         (OSBuildFetcher.prototype._computeOrder):
3449         (OSBuildFetcher.prototype._commitsForAvailableBuilds.return.this._subprocess.call.then.):
3450         (OSBuildFetcher.prototype._commitsForAvailableBuilds):
3451         (OSBuildFetcher.prototype._addSubCommitsForBuild):
3452         (OSBuildFetcher.prototype._submitCommits):
3453         (OSBuildFetcher.prototype.fetchAndReportNewBuilds):
3454         * tools/js/subprocess.js: Added.
3455         (const.childProcess.require.string_appeared_here.Subprocess.prototype.call):
3456         (const.childProcess.require.string_appeared_here.Subprocess):
3457         * tools/pull-os-versions.js: Added.
3458         (main):
3459         (syncLoop):
3460         * tools/sync-commits.py:
3461         (Repository.fetch_commits_and_submit):
3463 2017-03-14  Ryosuke Niwa  <rniwa@webkit.org>
3465         Make server tests return a promise instead of manually calling done
3466         https://bugs.webkit.org/show_bug.cgi?id=169648
3468         Rubber-stamped by Chris Dumez.
3470         Make the existing server tests always reutrn a promise instead of manually calling "done" callback.
3471         The promise tests are a lot more stable and less error prone.
3473         Also use arrow functions everywhere and use prepareServerTest, renamed from connectToDatabaseInEveryTest,
3474         in more tests instead of manually connecting to database in every test, and reset v3 models.
3476         * server-tests/admin-platforms-tests.js:
3477         * server-tests/admin-reprocess-report-tests.js:
3478         * server-tests/api-build-requests-tests.js:
3479         * server-tests/api-manifest.js:
3480         * server-tests/api-measurement-set-tests.js:
3481         (.postReports): Deleted. Not used in any test.
3482         * server-tests/api-report-commits-tests.js:
3483         * server-tests/api-report-tests.js:
3484         * server-tests/api-update-triggerable.js:
3485         * server-tests/privileged-api-upate-run-status.js:
3486         * server-tests/resources/common-operations.js:
3487         (prepareServerTest): Renamed from connectToDatabaseInEveryTest. Increase the timeout and reset v3 models.
3488         * server-tests/tools-buildbot-triggerable-tests.js:
3490 2017-03-12  Ryosuke Niwa  <rniwa@webkit.org>
3492         Rename RootSet to CommitSet
3493         https://bugs.webkit.org/show_bug.cgi?id=169580
3495         Rubber-stamped by Chris Dumez.
3497         Renamed root_sets to commit_sets and roots to commit_set_relationships in the database schema, and renamed
3498         related classes in public/v3/ and tools accordingly.
3500         RootSet, MeasurementRootSet, and CustomRootSet are respectively renamed to CommitSet, MeasurementCommitSet,
3501         and CustomCommitSet.
3503         In order to migrate the database, run:
3504         ```
3505         BEGIN;
3506         ALTER TABLE root_sets RENAME TO commit_sets;
3507         ALTER TABLE commit_sets RENAME COLUMN rootset_id TO commitset_id;
3508         ALTER TABLE roots RENAME TO commit_set_relationships;
3509         ALTER TABLE commit_set_relationships RENAME COLUMN root_set TO commitset_set;
3510         ALTER TABLE commit_set_relationships RENAME COLUMN root_commit TO commitset_commit;
3511         ALTER TABLE build_requests RENAME COLUMN request_root_set TO request_commit_set;
3512         END;
3513         ```
3515         * browser-tests/index.html:
3516         * init-database.sql:
3517         * public/api/build-requests.php:
3518         (main):
3519         * public/api/test-groups.php:
3520         (main):
3521         (format_test_group):
3522         * public/include/build-requests-fetcher.php:
3523         (BuildRequestsFetcher::__construct):
3524         (BuildRequestsFetcher::results_internal):
3525         (BuildRequestsFetcher::commit_sets): Renamed from root_sets.
3526         (BuildRequestsFetcher::commits): Renamed from roots.
3527         (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Renamed from fetch_roots_for_set_if_needed.
3528         * public/privileged-api/create-test-group.php:
3529         (main):
3530         (ensure_commit_sets): Renamed from commit_sets_from_root_sets.
3531         * public/v3/components/analysis-results-viewer.js:
3532         (AnalysisResultsViewer.prototype.buildRowGroups):
3533         (AnalysisResultsViewer.prototype._collectCommitSetsInTestGroups): Renamed from _collectRootSetsInTestGroups.
3534         (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
3535         (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
3536         (AnalysisResultsViewer.CommitSetInTestGroup): Renamed from RootSetInTestGroup.
3537         (AnalysisResultsViewer.CommitSetInTestGroup.prototype.constructor):
3538         (AnalysisResultsViewer.CommitSetInTestGroup.prototype.commitSet): Renamed from rootSet.
3539         (AnalysisResultsViewer.CommitSetInTestGroup.prototype.succeedingCommitSet): Renamed from succeedingRootSet.
3540         (AnalysisResultsViewer.TestGroupStackingBlock.prototype.constructor):
3541         (AnalysisResultsViewer.TestGroupStackingBlock.prototype.addRowIndex):
3542         (AnalysisResultsViewer.TestGroupStackingBlock.prototype.isComplete):
3543         (AnalysisResultsViewer.TestGroupStackingBlock.prototype.startRowIndex):
3544         (AnalysisResultsViewer.TestGroupStackingBlock.prototype.endRowIndex):
3545         (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
3546         * public/v3/components/chart-revision-range.js:
3547         (ChartRevisionRange.prototype._revisionForPoint):
3548         (ChartRevisionRange.prototype._computeRevisionList):
3549         * public/v3/components/customizable-test-group-form.js:
3550         (CustomizableTestGroupForm.prototype.constructor):
3551         (CustomizableTestGroupForm.prototype.setCommitSetMap): Renamed from setRootSetMap.
3552         (CustomizableTestGroupForm.prototype._submitted):
3553         (CustomizableTestGroupForm.prototype._computeCommitSetMap): Renamed from _computeRootSetMap.
3554         (CustomizableTestGroupForm.prototype.render): Renamed from render.
3555         (CustomizableTestGroupForm.prototype._constructRevisionRadioButtons):
3556         * public/v3/components/results-table.js:
3557         (ResultsTable.prototype.render):
3558         (ResultsTable.prototype._createRevisionListCells):
3559         (ResultsTable.prototype._computeRepositoryList):
3560         (ResultsTableRow.prototype.constructor):
3561         (ResultsTableRow.prototype.commitSet): Renamed from rootSet.
3562         * public/v3/components/test-group-results-table.js:
3563         (TestGroupResultsTable.prototype.buildRowGroups):
3564         * public/v3/index.html:
3565         * public/v3/models/build-request.js:
3566         (BuildRequest.prototype.constructor):
3567         (BuildRequest.prototype.updateSingleton):
3568         (BuildRequest.prototype.commitSet): Renamed from rootSet.
3569         (BuildRequest.constructBuildRequestsFromData):
3570         * public/v3/models/commit-set.js: Renamed from public/v3/models/root-set.js.
3571         (CommitSet): Renamed from RootSet.
3572         (CommitSet.containsMultipleCommitsForRepository):
3573         (MeasurementCommitSet): Renamed from MeasurementRootSet.
3574         (MeasurementCommitSet.prototype.namedStaticMap):
3575         (MeasurementCommitSet.prototype.ensureNamedStaticMap):
3576         (MeasurementCommitSet.namedStaticMap):
3577         (MeasurementCommitSet.ensureNamedStaticMap):
3578         (MeasurementCommitSet.ensureSingleton):
3579         (CustomCommitSet): Renamed from CustomRootSet.
3580         * public/v3/models/measurement-adaptor.js:
3581         (MeasurementAdaptor.prototype.applyTo):
3582         * public/v3/models/test-group.js:
3583         (TestGroup.prototype.constructor):
3584         (TestGroup.prototype.addBuildRequest):
3585         (TestGroup.prototype.repetitionCount):
3586         (TestGroup.prototype.requestedCommitSets): Renamed from requestedRootSets.
3587         (TestGroup.prototype.requestsForCommitSet): Renamed from requestsForRootSet.
3588         (TestGroup.prototype.labelForCommitSet): Renamed from labelForRootSet.
3589         (TestGroup.prototype.didSetResult):
3590         (TestGroup.prototype.compareTestResults):
3591         (TestGroup.prototype._valuesForCommitSet): Renamed from _valuesForRootSet.
3592         (TestGroup.prototype.createAndRefetchTestGroups):
3593         * public/v3/pages/analysis-task-page.js:
3594         (AnalysisTaskPage.prototype.render):
3595         (AnalysisTaskPage.prototype._retryCurrentTestGroup):
3596         (AnalysisTaskPage.prototype._createNewTestGroupFromChart):
3597         (AnalysisTaskPage.prototype._createNewTestGroupFromViewer):
3598         (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingCommitSetList):
3599         * server-tests/api-build-requests-tests.js:
3600         * server-tests/resources/mock-data.js:
3601         (MockData.resetV3Models):
3602         (MockData.addMockData):
3603         (MockData.addAnotherMockTestGroup):
3604         * tools/detect-changes.js:
3605         (createAnalysisTaskAndNotify):
3606         * tools/js/buildbot-syncer.js:
3607         (BuildbotSyncer.prototype._propertiesForBuildRequest):
3608         (BuildbotSyncer.prototype._revisionSetFromCommitSetWithExclusionList):
3609         * tools/js/database.js:
3610         (tableToPrefixMap):
3611         * tools/js/v3-models.js:
3612         * tools/sync-buildbot.js:
3613         (syncLoop):
3614         * tools/sync-with-buildbot.py: Deleted. No longer used.
3615         * unit-tests/analysis-task-tests.js:
3616         * unit-tests/build-request-tests.js:
3617         (sampleBuildRequestData):
3618         * unit-tests/buildbot-syncer-tests.js:
3619         (sampleCommitSetData):
3620         * unit-tests/measurement-adaptor-tests.js:
3621         * unit-tests/measurement-set-tests.js:
3622         * unit-tests/resources/mock-v3-models.js:
3623         (MockModels.inject):
3624         * unit-tests/test-groups-tests.js:
3625         (sampleTestGroup):
3627 2017-03-13  Ryosuke Niwa  <rniwa@webkit.org>
3629         Database's query functions should support querying for a row with NULL value
3630         https://bugs.webkit.org/show_bug.cgi?id=169504
3632         Reviewed by Antti Koivisto.
3634         Add the support for calling select_* with one of column values set to NULL.
3635         This feature is useful in webkit.org/b/146374 and webkit.org/b/168962.
3637         * public/include/db.php:
3638         (Database::prepare_params): Added $null_columns as an optional argument.
3639         (Database::select_conditions_with_null_columns): Added. Builds up a query string by appending AND x is NULL
3640         to match columns whose value must be NULL.
3641         (Database::_select_update_or_insert_row):
3642         (Database::select_rows):
3644 2017-03-13  Dewei Zhu  <dewei_zhu@apple.com>
3646         Add the ability to report a commit with sub-commits.
3647         https://bugs.webkit.org/show_bug.cgi?id=168962
3649         Reviewed by Ryosuke Niwa.
3651         Introduce 'commit_ownerships' which records ownership between commits.
3652         On existing production server, run ```
3653             CREATE TABLE commit_ownerships (
3654                 commit_owner integer NOT NULL REFERENCES commits ON DELETE CASCADE,
3655                 commit_ownee integer NOT NULL REFERENCES commits ON DELETE CASCADE,
3656                 PRIMARY KEY (commit_owner, commit_ownee)
3657             );
3658             ALTER TABLE repositories RENAME repository_parent TO repository_owner;
3659             ALTER TABLE repositories DROP repository_name_must_be_unique;
3660             CREATE UNIQUE INDEX repository_name_owner_unique_index ON repositories (repository_owner, repository_name) WHERE repository_owner IS NOT NULL;
3661             CREATE UNIQUE INDEX repository_name_unique_index ON repositories (repository_name) WHERE repository_owner IS NULL;
3662         ``` to update database.
3663         Add unit-tests to cover this change.
3665         * init-database.sql:
3666         * public/api/report-commits.php:
3667         * public/include/commit-log-fetcher.php:
3668         * public/include/db.php:
3669         * public/include/manifest-generator.php:
3670         * public/include/report-processor.php:
3671         * public/v3/models/repository.js:
3672         (Repository):
3673         (Repository.prototype.owner):
3674         * server-tests/admin-reprocess-report-tests.js:
3675         (addBuilderForReport.simpleReportWithRevisions.0.then):
3676         (then):
3677         * server-tests/api-manifest.js:
3678         (then):
3679         * server-tests/api-report-commits-tests.js:
3680         (addSlaveForReport.sameRepositoryNameInSubCommitAndMajorCommit.then):
3681         (then):
3682         (addSlaveForReport.systemVersionCommitWithSubcommits.then):
3683         (addSlaveForReport.multipleSystemVersionCommitsWithSubcommits.then):
3684         (addSlaveForReport.systemVersionCommitWithEmptySubcommits.then):
3685         (addSlaveForReport.systemVersionCommitAndSubcommitWithTimestamp.then):
3686         * tools/js/database.js:
3688 2017-03-07  Ryosuke Niwa  <rniwa@webkit.org>
3690         Update ReadMe.md to use directory format for backing up & restoring the database
3691         https://bugs.webkit.org/show_bug.cgi?id=169263
3693         Reviewed by Joseph Pecoraro.
3695         Update ReadMe.md's instruction to backup and restore the database to use directory format instead of
3696         piping it to gzip. The new command will backup and restore the database with multiple concurrent processes
3697         with a custom compression level.
3699         * ReadMe.md:
3701 2017-03-02  Ryosuke Niwa  <rniwa@webkit.org>
3703         Make baseline data points selectable
3704         https://bugs.webkit.org/show_bug.cgi?id=169069
3705         <rdar://problem/29209427>
3707         Reviewed by Antti Koivisto.
3709         Add the capability to select data points other than "current" configuration type.
3711         This patch refactors the way the "chart status" is computed. Before this patch, ChartStatusView was
3712         responsible for determining two data points for which to compute the status, and computing the status
3713         between two data points. ChartPaneStatusView which inherits from ChartStatusView and used in the charts
3714         page relied upon ChartStatusView to compute these values, and computed the list of revision ranges for
3715         each relevant repository between the data points. ChartPane then had callbacks on ChartPaneStatusView
3716         to know whenever these values changed. Because of this entangled mess, ChartStatusView had to be aware
3717         of InteractiveTimeSeriesChart even though only ChartPaneStatusView could be used with it.
3719         This patch dramatically simplifies the situation by adding referencePoints() on TimeSeriesChart and
3720         InteractiveTimeSeriesChart which returns the current point, the previous point if there is any, and
3721         their time series view. It also extracts ChartStatusEvaluator which computes the current status values
3722         and ChartRevisionRange which computes a list of revision differences both based on the referencePoints.
3723         As a result, ChartPaneStatusView no longer inherits from ChartStatusView, and ChartStatusView has been
3724         renamed to DashboardChartStatusView to reflect its purpose. Furthermore, ChartPane which used to rely on
3725         ChartPaneStatusView's revisionCallback to update the commit log viewer simply uses another instance of
3726         ChartRevisionRange, eliminating the need for the callback.
3728         To implement these classes easily, this patch also introduces a new class, LazilyEvaluatedFunction to
3729         memoize the return value of a function when called with the same arguments. Delaying the computation of
3730         a value and avoiding the work when the values are the same is a very common pattern in the perf dashboard
3731         so I expect this class would be used in a lot more places in the future.
3733         * browser-tests/chart-revision-range-tests.js: Added. Tests for ChartRevisionRange.
3734         * browser-tests/chart-status-evaluator-tests.js: Added. Tests for ChartStatusEvaluator.
3736         * browser-tests/index.html:
3737         (BrowsingContext):
3738         (BrowsingContext.importScripts): Fixed the bug that calling importScripts twice results in MockRemoteAPI
3739         being loaded twice.
3740         (ChartTest.importChartScripts): Import more model objects.
3741         (ChartTest.sampleCluster): Made this a getter.
3742         (ChartTest.makeModelObjectsForSampleCluster):
3743         (ChartTest.makeSampleCluster): Added. Cutomizes the valus of baseline / target based on options.
3744         (ChartTest.respondWithSampleCluster): Now takes an options argument for makeSampleCluster.
3746         * public/v3/components/chart-pane-base.js:
3747         (ChartPaneBase): Added _openRepository to keep track of the currently open repository instead of relying
3748         on _mainChartStatus or _commitLogViewer to keep track of it.
3749         (ChartPaneBase.prototype.configure):  The callback for when the user clicked on a repository name in
3750         ChartPaneStatusView has been replaced by "openRepository" action.
3751         (ChartPaneBase.prototype.setOpenRepository): Moved from ChartPane.
3752         (ChartPaneBase.prototype._mainSelectionDidChange):
3753         (ChartPaneBase.prototype._indicatorDidChange):
3754         (ChartPaneBase.prototype._didFetchData):
3755         (ChartPaneBase.prototype._updateCommitLogViewer): Renamed from _updateStatus.
3756         (ChartPaneBase.prototype.openNewRepository): Renamed from _requestOpeningCommitViewer. Fixed a bug that
3757         clicking on the repository name inside ChartPaneStatusView would not focus the pane, which resulted in
3758         arrow keys to be ignored instead of moving the main chart's indicator or the currently open repository.
3759         (ChartPaneBase.prototype._keyup):
3760         (ChartPaneBase.prototype._moveOpenRepository): Moved from ChartPaneStatusView's
3761         moveRepositoryWithNotification. Used when changing the open repository by up/down arrow keys.
3763         * public/v3/components/chart-revision-range.js: Added. Extracted from ChartPaneStatusView.
3764         (ChartRevisionRange): Added.
3765         (ChartRevisionRange.prototype.revisionList): Added.
3766         (ChartRevisionRange.prototype.rangeForRepository): Added.
3767         (ChartRevisionRange._revisionForPoint): Added. Extracted from ChartPaneStatusView's
3768         _updateRevisionListForNewCurrentRepository.
3769         (ChartRevisionRange._computeRevisionList): Ditto from computeChartStatusLabels.
3771         * public/v3/components/chart-status-evaluator.js: Added.
3772         (ChartStatusEvaluator): Added.
3773         (ChartStatusEvaluator.prototype.status): Added.
3774         (ChartStatusEvaluator.computeChartStatus): Added. Extracted from ChartStatusView's updateStatusIfNeeded.
3776         * public/v3/components/chart-status-view.js: Removed.
3777         (ChartStatusView): Deleted. Split into ChartStatusEvaluator and DashboardChartStatusView.
3779         * public/v3/components/chart-styles.js:
3780         (ChartStyles.baselineStyle): Make baseline data points interactive. This single line change is what
3781         enables the user to interact with the data points. The rest of changes in this patch mostly deals with
3782         the status text such as "5% worse than baseline" and the list of revisions shown in the commit log viewer
3783         which would have shown the wrong range without these changes.
3785         * public/v3/components/dashboard-chart-status-view.js: Added. Extracted from ChartStatusView.
3786         (DashboardChartStatusView): Added.
3787         (DashboardChartStatusView.prototype.render): Added.
3788         (DashboardChartStatusView.htmlTemplate): Added.
3789         (DashboardChartStatusView.cssTemplate): Added.
3791         * public/v3/components/interactive-time-series-chart.js:
3792         (InteractiveTimeSeriesChart.prototype.referencePoints): Added. Return the first point and the last point
3793         as the reference points when there is a selection. Only report the previous point if they are distinct as
3794         showing a range of revisions from a data point to itself makes no sense. When there is a indicator simply
3795         return it and its previous point as reference points. Otherwise return null unlike TimeSeriesChart's
3796         referencePoints which always returns the latest point as the reference point.
3798         * public/v3/components/time-series-chart.js:
3799         (TimeSeriesChart.prototype.referencePoints): Added. Return the latest point as the reference point. It
3800         never returns the previous point even if there were more data points as there is no way for the user to
3801         specify which data points to compare.
3803         * public/v3/index.html: Include newly added files.
3805         * public/v3/lazily-evaluated-function.js: Added.
3806         (LazilyEvaluatedFunction): Added.
3807         (LazilyEvaluatedFunction.prototype.evaluate): Added.
3809         * public/v3/models/commit-log.js:
3810         (CommitLog.prototype.diff): Fixed a bug that computing the diff of two Subversion-like revisions results
3811         in "from" field to be unexpectedly an integer instead of a string.
3813         * public/v3/models/metric.js:
3814         (Metric): Moved the code to compute the unit from the metric name from v2's RunsData class. This makes
3815         writing tests easier since it eliminates the need to load v2's data.js.
3816         (Metric.prototype.unit):
3817         (Metric.prototype.isSmallerBetter): Ditto for determining whether the unit is smaller-is-better.
3819         * public/v3/pages/analysis-task-page.js:
3820         (AnalysisTaskChartPane.prototype._updateStatus): Deleted the unused code.
3822         * public/v3/pages/chart-pane-status-view.js:
3823         (ChartPaneStatusView): No longer inherits from ChartStatusView. Uses ChartStatusEvaluator and
3824         ChartRevisionRange to to compute the chart status and the list of revision changes.
3825         (ChartPaneStatusView.prototype.pointsRangeForAnalysis): Deleted.
3826         (ChartPaneStatusView.prototype.render): Split it into _renderStatus and _renderBuildRevisionTable using
3827         LazilyEvaluatedFunction.
3828         (ChartPaneStatusView.prototype._renderStatus): Added.
3829         (ChartPaneStatusView.prototype._renderBuildRevisionTable): Added.
3830         (ChartPaneStatusView.prototype.setCurrentRepository): _updateRevisionListForNewCurrentRepository has been
3831         moved into ChartRevisionRange. Just enqueue itself to re-render.
3832         (ChartPaneStatusView.prototype._setRevisionRange): Deleted.
3833         (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Deleted.
3834         (ChartPaneStatusView.prototype.updateRevisionList): Deleted.
3835         (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Deleted.
3836         (ChartPaneStatusView.prototype.computeChartStatusLabels): Deleted.
3837         (ChartPaneStatusView.htmlTemplate):
3838         (ChartPaneStatusView.cssTemplate):
3840         * public/v3/pages/chart-pane.js:
3841         (ChartPane.prototype.openNewRepository): Overrides the one in ChartPaneBase, which has been renamed from
3842         _requestOpeningCommitViewer.
3843         (ChartPane.prototype._analyzeRange):
3844         (ChartPane.prototype._renderActionToolbar): Use the main chart's selection directly to determine whether
3845         an analysis task can be created for the currenty selected range.
3847         * public/v3/pages/dashboard-page.js:
3848         (DashboardPage.prototype._createChartForCell):
3850         * unit-tests/lazily-evaluated-function-tests.js: Added. Tests for LazilyEvaluatedFunction.
3852 2017-03-01  Ryosuke Niwa  <rniwa@webkit.org>
3854         Build fix after r212853. Make creating an analysis task work again.
3856         * public/v3/pages/analysis-task-page.js:
3857         (AnalysisTaskPage.prototype.render):
3859 2017-02-27  Ryosuke Niwa  <rniwa@webkit.org>
3861         Fix tests after r213119 and r213120.
3863         * browser-tests/time-series-chart-tests.js:
3864         (return.ChartTest.importChartScripts.context.then):
3865         (string_appeared_here.then): Deleted.
3867 2017-02-27  Ryosuke Niwa  <rniwa@webkit.org>
3869         Removed the unused code that was supposed to be removed in the previous commit.
3871         * browser-tests/time-series-chart-tests.js:
3873 2017-02-27  Ryosuke Niwa  <rniwa@webkit.org>
3875         Split tests for InteractiveTimeSeriesChart into a separate test file.
3876         https://bugs.webkit.org/show_bug.cgi?id=168960
3878         Reviewed by Joseph Pecoraro.
3880         Extracted the test cases for InteractiveTimeSeriesChart charts from time-series-chart-tests.js
3881         into interactive-time-series-chart-tests.js now that the former file has gotten really big over time.
3883         Also extracted a bunch of helper functions time-series-chart-tests.js as ChartTest in index.html.
3884         Any test which instantiates a time series chart can use this helper class.
3886         * browser-tests/index.html:
3887         (ChartTest.importChartScripts): Ditto.
3888         (ChartTest.posixTime): Moved from time-series-chart-tests.js.
3889         (ChartTest.sampleCluster): Ditto.
3890         (ChartTest.createChartWithSampleCluster): Ditto.
3891         (ChartTest.createInteractiveChartWithSampleCluster): Ditto.
3892         (ChartTest.respondWithSampleCluster):
3893         * browser-tests/interactive-time-series-chart-tests.js: Extracted from time-series-chart-tests.js.
3894         * browser-tests/time-series-chart-tests.js:
3895         (posixTime): Moved.
3896         (dayInMilliseconds): Moved.
3897         (sampleCluster): Moved.
3898         (createChartWithSampleCluster): Moved.
3899         (createInteractiveChartWithSampleCluster): Moved.
3900         (respondWithSampleCluster): Moved.
3901         * unit-tests/analysis-task-tests.js: Fixed a typo. s/adopter/adapter/.
3903 2017-02-27  Ryosuke Niwa  <rniwa@webkit.org>
3905         Calling build() on a baseline point results in an exception
3906         https://bugs.webkit.org/show_bug.cgi?id=168959
3908         Reviewed by Joseph Pecoraro.
3910         Some baseline points may lack the build information. e.g. A custom data point made by an user.
3911         Only instantiate Build object in a point object returned by MeasurementAdaptor when the builder id
3912         is available so that we don't hit an assertion inside Build's constructor.
3914         * public/v3/models/measurement-adaptor.js:
3915         (MeasurementAdaptor.prototype.applyTo..build): Only instantiate Build when builderId is set.
3916         * unit-tests/measurement-adaptor-tests.js: Added a test case.
3918 2017-02-27  Ryosuke Niwa  <rniwa@webkit.org>
3920         Arrow key shouldn't move the indicator beyond the visible points
3921         https://bugs.webkit.org/show_bug.cgi?id=168956
3923         Reviewed by Joseph Pecoraro.
3925         The bug was caused by moveLockedIndicatorWithNotification using the full sampled time series view
3926         instead of the one constrained by the domain. Since the time series chart expands the visible domain
3927         to include at least one point before the start time and one point after the end tiem to draw lines
3928         extending beyond the visible region (otherwise it looks as though the graph ends there), we need to
3929         use a view constrained by the start time and the end time before looking for a next/previous point.
3931         * browser-tests/time-series-chart-tests.js: Added test cases for moveLockedIndicatorWithNotification.
3932         * public/v3/components/interactive-time-series-chart.js:
3933         (InteractiveTimeSeriesChart.prototype.moveLockedIndicatorWithNotification): Fixed the bug. Also
3934         enqueue itself to render instead of relying on a parent component to do it.
3936 2017-02-27  Ryosuke Niwa  <rniwa@webkit.org>
3938         A Locked indicator should be visually distinct from an unlocked indicator
3939         https://bugs.webkit.org/show_bug.cgi?id=168868
3940         <rdar://problem/29666054>
3942         Reviewed by Antti Koivisto.
3944         Added the support for specifying options.lockedIndicator in addition to options.indicator to style
3945         an locked indicator differently from an unlocked one.
3947         * browser-tests/time-series-chart-tests.js: Added new test cases for indicators.
3948         (createChartWithSampleCluster): Renamed and swapped the order of arguments to better match
3949         TimeSeriesChart's constructor. Now the second argument is an array of source as is in the constructor.
3950         (createInteractiveChartWithSampleCluster): Added.
3952         * public/v3/components/chart-styles.js:
3953         (ChartStyles.overviewChartOptions): Changed the color of a selection to blue.
3954         (ChartStyles.mainChartOptions): Ditto. Also use a different style for a locked indicator.
3956         * public/v3/components/interactive-time-series-chart.js:
3957         (InteractiveTimeSeriesChart.prototype._layout): Removed the unused variable.
3958         (InteractiveTimeSeriesChart.prototype._renderChartContent): Use options.lockedIndicator when rendering
3959         a locked indicator. Also stroke the circle in addition to filling it so that we can use a blue circle
3960         with a white hole for a locked indicator to make it even more visually distinctive from an unlocked one.
3962 2017-02-25  Dewei Zhu  <dewei_zhu@apple.com>
3964         Commit should order by 'commit_order' as secondary key.
3965         https://bugs.webkit.org/show_bug.cgi?id=168866
3967         Reviewed by Ryosuke Niwa.
3969         Currently, commits are sorted by 'commit_time' only.
3970         We should use 'commit_order' as secondary key when 'commit_time' is equal or null.
3972         * public/include/commit-log-fetcher.php:
3973         * public/include/db.php:
3974         * server-tests/api-commits.js:
3975         (return.addSlaveForReport.subversionCommits.then):
3976         (then):
3978 2017-02-24  Ryosuke Niwa  <rniwa@webkit.org>
3980         REGRESSION(r212853): Comparisons to baseline no longer shows up
3981         https://bugs.webkit.org/show_bug.cgi?id=168863
3983         Reviewed by Joseph Pecoraro.
3985         The bug was caused by ChartStatusView's code not being updated to use TimeSeriesView's.
3986         Updated the code to use TimeSeriesView's methods to fix the bug.
3988         Also made InteractiveTimeSeriesChart's currentPoint to return a (TimeSeriesView, point, isLocked) tuple
3989         to consolidate it with lockedIndicator() to work towards making the baseline data points selectable.
3991         * browser-tests/time-series-chart-tests.js: Updated the test cases to use currentIndicator, and added
3992         test cases for newly added lastPointInTimeRange.
3994         * public/v3/components/chart-pane.js:
3995         (ChartPane.prototype.serializeState): Updated to use currentIndicator.
3996         (ChartPane.prototype._renderFilteringPopover): Ditto.
3998         * public/v3/components/chart-status-view.js:
3999         (ChartStatusView.prototype.updateStatusIfNeeded): Use currentIndicator for an interative time series.
4000         Fixed the non-interactive chart's code path for TimeSeriesView.
4001         (ChartStatusView.prototype._computeChartStatus): Modernized the code.
4002         (ChartStatusView.prototype._findLastPointPriorToTime): Deleted. Replaced by TimeSeriesView's
4003         lastPointInTimeRange.
4005         * public/v3/components/interactive-time-series-chart.js:
4006         (InteractiveTimeSeriesChart.prototype.currentIndicator):
4007         (InteractiveTimeSeriesChart.prototype.moveLockedIndicatorWithNotification):
4008         (InteractiveTimeSeriesChart.prototype._renderChartContent):
4009         (InteractiveTimeSeriesChart):
4011         * public/v3/models/time-series.js:
4012         (TimeSeriesView.prototype.lastPointInTimeRange): Added.
4013         (TimeSeriesView.prototype._reverse): Added. Traverses the view in the reverse order.
4014         * unit-tests/time-series-tests.js:
4016 2017-02-23  Dewei Zhu  <dewei_zhu@apple.com>
4018         Rename 'commit_parent' in 'commits' table to 'commit_previous_commit'.
4019         https://bugs.webkit.org/show_bug.cgi?id=168816
4021         Reviewed by Ryosuke Niwa.
4023         Rename 'commit_parent' to avoid ambiguity in the coming feature.
4024         For exisiting database, run
4025             "ALTER TABLE commits RENAME commit_parent TO commit_previous_commit;"
4026         to update the database.
4028         * init-database.sql:
4029         * public/api/report-commits.php:
4030         * public/include/commit-log-fetcher.php:
4031         * server-tests/api-commits.js:
4032         (then):
4033         * server-tests/api-report-commits-tests.js:
4034         (then):
4035         * tools/sync-commits.py:
4036         (main):
4037         (Repository.fetch_commits_and_submit):
4038         (GitRepository._revision_from_tokens):
4039         * unit-tests/analysis-task-tests.js:
4040         (sampleAnalysisTask):
4042 2017-02-23  Ryosuke Niwa  <rniwa@webkit.org>
4044         New sampling algorithm shows very few points when zoomed out
4045         https://bugs.webkit.org/show_bug.cgi?id=168813
4047         Reviewed by Saam Barati.
4049         When a chart is zoomed out to a large time interval, the new sampling algorithm introduced in r212853 can
4050         hide most of the data points because the difference between the preceding point's time and the succeeding
4051         point's time of most points will be below the threshold we computed.
4053         Instead, rank each data point based on the aforementioned time interval difference, and pick the first M data
4054         points when M data points are to be shown.
4056         This makes the new algorithm behave like our old algorithm while keeping it stable still. Note that this
4057         algorithm still biases data points without a close neighboring point but this seems to work out in practice
4058         because such a point tends to be an important sample anyway, and we don't have a lot of space between
4059         data points since we aim to show about one point per pixel.
4061         * browser-tests/index.html:
4062         (CanvasTest.canvasContainsColor): Extracted from one of the test cases and generalized. Returns true when
4063         the specified region of the canvas contains a specified color (alpha is optional).
4064         * browser-tests/time-series-chart-tests.js: Added a test case for sampling. It checks that sampling happens
4065         and that we always show some data point even when zoomed out to a large time interval.
4066         (createChartWithSampleCluster):
4068         * public/v3/components/interactive-time-series-chart.js:
4069         (InteractiveTimeSeriesChart.prototype._sampleTimeSeries):
4070         * public/v3/components/time-series-chart.js:
4071         (TimeSeriesChart.prototype._ensureSampledTimeSeries): M, the number of data points we pick must be computed
4072         based on the width of data points we're about to draw constrained by the canvas size. e.g. when the canvas
4073         is only half filled, we shouldn't be showing two points per pixel in the filled region.
4074         (TimeSeriesChart.prototype._sampleTimeSeries): Refined the algorithm. First, compute the time difference or
4075         the rank for each N data points. Sort those ranks in descending order (in the order we prefer), and include
4076         all data points above the M-th rank in the sample.
4077         (TimeSeriesChart.prototype.computeTimeGrid): Revert the inadvertent change in r212935.
4079         * public/v3/models/time-series.js:
4080         (TimeSeriesView.prototype.filter): Fixed a bug that the indices passed onto the callback were shifted by the
4081         starting index.
4082         * unit-tests/time-series-tests.js: Added a test case to ensure callbacks are called with correct data points
4083         and indices.
4085 2017-02-23  Ryosuke Niwa  <rniwa@webkit.org>
4087         REGRESSION(r212542): Make TimeSeriesChart.computeTimeGrid stops x-axis grid prematurely
4088         https://bugs.webkit.org/show_bug.cgi?id=168812
4090         Reviewed by Joseph Pecoraro.
4092         Add time iterator of two months, three months, and four months with some tests.
4094         Also for one-month time iterator, round the day of month to 1 or 15 whichever is closer.
4096         * browser-tests/time-series-chart-tests.js: Added more tests.
4097         * public/v3/components/time-series-chart.js:
4098         (TimeSeriesChart._timeIterators.next):
4099         (TimeSeriesChart._timeIterators):
4101 2017-02-22  Ryosuke Niwa  <rniwa@webkit.org>
4103         Add tests for InteractiveTimeSeriesChart and adopt actions
4104         https://bugs.webkit.org/show_bug.cgi?id=168750
4106         Reviewed by Chris Dumez.
4108         Added tests for InteractiveTimeSeriesChart.
4110         Also replaced selection.onchange, selection.onzoom, indicator.onchange, annotations.onclick callbacks
4111         by "selectionChange", "zoom", "indicatorChange", and "annotationClick" actions respectively.
4113         Also fixed various bugs and bad code I encountered while writing these tests.
4115         * browser-tests/index.html:
4116         (waitForComponentsToRender): Delay the call to enqueueToRender until the next run loop because there
4117         might be outstanding promises that just got resolved. e.g. for fetching measurement sets JSONs. Let
4118         all those promises get resolved first. Otherwise, some tests become racy.
4119         (canvasImageData): Extracted from time-series-chart-tests.js.
4120         (canvasRefTest): Ditto.
4121         (CanvasTest): Ditto.
4122         (CanvasTest.fillCanvasBeforeRedrawCheck): Ditto.
4123         (CanvasTest.hasCanvasBeenRedrawn): Ditto.
4124         (CanvasTest.canvasImageData): Ditto.
4125         (CanvasTest.expectCanvasesMatch): Ditto.
4126         (CanvasTest.expectCanvasesMismatch): Ditto.
4128         * browser-tests/time-series-chart-tests.js: Fixed some test cases where dpr multipler was not doing
4129         the right thing anymore in Safari under a high DPI screen. Also added a lot of test cases for interactive
4130         time series chart and one for rendering annotations.
4131         (scripts): Moved.
4132         (posixTime): Added. A helper function for sampleCluster.
4133         (dayInMilliseconds): Ditto.
4134         (sampleCluster): Moved here. Made the same cluster more artifical for an easier testing.
4135         (createChartWithSampleCluster): Moved out of one of the tests.
4136         (respondWithSampleCluster): Ditto.
4138         * public/v3/components/chart-pane-base.js:
4139         (ChartPaneBase.prototype.configure): Adopted new actions in InteractiveTimeSeriesChart.
4141         * public/v3/components/chart-status-view.js:
4142         (ChartStatusView.prototype.updateStatusIfNeeded): Removed a superflous console.log.
4144         * public/v3/components/chart-styles.js:
4145         (ChartStyles.mainChartOptions): Set zoomButton to true. InteractiveTimeSeriesChart used to determine
4146         whether to show the zoom button or not based on the precense of the zoom callback. We made it explicit.
4148         * public/v3/components/interactive-time-series-chart.js:
4149         (InteractiveTimeSeriesChart.prototype.setIndicator): Explicitly call _notifySelectionChanged with false
4150         instead of relying on undefined to be treated as falsey.
4151         (InteractiveTimeSeriesChart.prototype._createCanvas): Use id instead of selector to find elements.
4152         (InteractiveTimeSeriesChart.htmlTemplate):
4153         (InteractiveTimeSeriesChart.cssTemplate):
4154         (InteractiveTimeSeriesChart.prototype._mouseMove): Explicitly call _startOrContinueDragging with false
4155         instead of relying on undefined treated as falsey. Also added the missing call to enqueueToRender found
4156         by new tests. This was working fine on the dashboard due to other components invoking enqueueToRender
4157         but won't work in a standalone instance of InteractiveTimeSeriesChart.
4158         (InteractiveTimeSeriesChart.prototype._mouseLeave): Ditto, adding the missing call to enqueueToRender.
4159         (InteractiveTimeSeriesChart.prototype._click): Removed the assignment to _forceRender when calling
4160         _mouseMove in an early exist, which does set this flag and invokes enqueueToRender, and added the missing
4161         call to enqueueToRender in the other code path.
4162         (InteractiveTimeSeriesChart.prototype._startOrContinueDragging): Replaced annotations.onclick callback
4163         by the newly added "annotationClick" action, and added the missing call to enqueueToRender.
4164         (InteractiveTimeSeriesChart.prototype._endDragging): Use arrow function.
4165         (InteractiveTimeSeriesChart.prototype._notifyIndicatorChanged): Replaced indicator.onchange callback by
4166         the newly added "indicatorChange" action.
4167         (InteractiveTimeSeriesChart.prototype._notifySelectionChanged): Replaced selection.onchange callback by
4168         the newly added "selectionChange" action.
4169         (InteractiveTimeSeriesChart.prototype._renderChartContent): Show the zoom button when options.zoomButton
4170         is set instead of relying on the presence of selection.onzoom especially now that the callback has been
4171         replaced by the "zoom" action.
4173         * public/v3/components/time-series-chart.js:
4174         (TimeSeriesChart.prototype.setAnnotations): Added the missing call to enqueueToRender.
4176         * public/v3/main.js:
4178 2017-02-21  Ryosuke Niwa  <rniwa@webkit.org>
4180         Make sampling algorithm more stable and introduce an abstraction for sampled data
4181         https://bugs.webkit.org/show_bug.cgi?id=168693
4183         Reviewed by Chris Dumez.
4185         Before this patch, TimeSeriesChart's resampling resulted in some points poping up and disappearing as
4186         the width of a chart is changed. e.g. when resizing the browser window. The bug was by caused by
4187         the sample for a given width not always including all points for a smaller width so as the width is
4188         expanded, some point may be dropped.
4190         Fixed this by using a much simpler algorithm of always picking a point when the time interval between
4191         the preceding point and the succeeding point is larger than the minimum space we allow for a given width.
4193         Also introduced a new abstraction around the sample data: TimeSeriesView. A TimeSeriesView provides
4194         a similar API to TimeSeries for a subset of the time series filtered by a time range a custom function.
4195         This paves a way to adding the ability to select baseline, etc... on the chart status view.
4197         TimeSeriesView can be in two modes:
4198         Mode 1. The view represents a contiguous subrange of TimeSeries - In this mode, this._data references
4199                 the underlying TimeSeries's _data directly, and we use _startingIndex to adjust index given to
4200                 find the relative index. Finding the next point or the previous point of a given point is done
4201                 via looking up the point's seriesIndex and doing a simple arithmetic. In general, an index is
4202                 converted to the absolute index in the underlying TimeSeries's _data array.
4204         Mode 2. The view represents a filtered non-contiguous subset of TimeSeries -  In this mode, this._data is
4205                 its own array. Finding the next point or the previous point of a given point requires finding
4206                 a sibling point in the underlying TimeSeries which is in this view. Since this may result in O(n)
4207                 traversal and a hash lookup, we lazily build a map of each point to its position in _data instead.
4209         * public/v3/components/chart-status-view.js:
4210         (ChartStatusView.prototype.updateStatusIfNeeded): Call selectedPoints instead of sampledDataBetween for
4211         clarity. This function now returns a TimeSeriesView instead of a raw array.
4213         * public/v3/components/interactive-time-series-chart.js:
4214         (InteractiveTimeSeriesChart.prototype.currentPoint): Updated now that _sampledTimeSeriesData contains
4215         an array of TimeSeriesView's. Note that diff is either 0, -1, or 1.
4216         (InteractiveTimeSeriesChart.prototype.selectedPoints): Ditto. sampledDataBetween no longer exists since
4217         we can simply call viewTimeRange on TimeSeriesView returned by sampledDataBetween.
4218         (InteractiveTimeSeriesChart.prototype.firstSelectedPoint): Ditto.
4219         (InteractiveTimeSeriesChart.prototype._sampleTimeSeries): Use add since excludedPoints is now a Set.
4221         * public/v3/components/time-series-chart.js:
4222         (TimeSeriesChart.prototype.sampledDataBetween): Deleted.
4223         (TimeSeriesChart.prototype.firstSampledPointBetweenTime): Deleted.
4224         (TimeSeriesChart.prototype._ensureSampledTimeSeries): Modernized the code. Use the the time interval of
4225         the chart divided by the number of allowed points as the time interval used in the new sampling algorithm.
4226         (TimeSeriesChart.prototype._sampleTimeSeries): Rewritten. We also create TimeSeriesView here.
4227         (TimeSeriesChart.prototype._sampleTimeSeries.findMedian): Deleted.
4228         (TimeSeriesChart.prototype._updateCanvasSizeIfClientSizeChanged): Fixed a bug that the canvas size wasn't
4229         set to the correct value on Chrome when a high DPI screen is used.
4231         * public/v3/models/time-series.js:
4232         (TimeSeries.prototype.viewBetweenPoints): Renamed from dataBetweenPoints. Now returns a TimeSeriesView.
4233         (TimeSeriesView): Added. This constructor is to be called by viewBetweenPoints, viewTimeRange, and filter.
4234         (TimeSeriesView.prototype._buildPointIndexMap): Added. Used in mode (2).
4235         (TimeSeriesView.prototype.length): Added.
4236         (TimeSeriesView.prototype.firstPoint): Added.
4237         (TimeSeriesView.prototype.lastPoint): Added.
4238         (TimeSeriesView.prototype.nextPoint): Added. Note index is always a position in this._data. In mode (1),
4239         this is the position of the point in the underlying TimeSeries' _data. In mode (2), this is the position
4240         of the point in this._data which is dictinct from the underlying TimeSeries' _data.
4241         (TimeSeriesView.prototype.previousPoint): Ditto.
4242         (TimeSeriesView.prototype.findPointByIndex): Added. Finds the point using the positional index from the
4243         beginning of this view. findPointByIndex(0) on one view may not be same as findPointByIndex(0) of another.
4244         (TimeSeriesView.prototype.findById): Added. This is O(n).
4245         (TimeSeriesView.prototype.values): Added. Returns the value of each point in this view.
4246         (TimeSeriesView.prototype.filter): Added. Creates a new view with a subset of data points the predicate
4247         function returned true.
4248         (TimeSeriesView.prototype.viewTimeRange): Added. Creates a new view with a subset of data points for the
4249         given time ragne. When the resultant view would include all points of this view, it simply returns itself
4250         as an optimization.
4251         (TimeSeriesView.prototype.firstPointInTimeRange): Added. Returns the first point in the view which lies
4252         within the specified time range.
4253         (TimeSeriesView.prototype.Symbol.iterator): Added. Iterates over each point in the view.
4255         * public/v3/pages/analysis-task-page.js:
4256         (AnalysisTaskChartPane.prototype.selectedPoints): Use selectedPoints in lieu of getting selection and then
4257         calling sampledDataBetween with that range.
4259         * public/v3/pages/summary-page.js:
4260         (SummaryPageConfigurationGroup.set _medianForTimeRange): Modernized.
4262         * unit-tests/time-series-tests.js: Added tests for TimeSeries and TimeSeriesView. Already caught bugs!
4263         (addPointsToSeries):
4265 2017-02-17  Ryosuke Niwa  <rniwa@webkit.org>
4267         Add tests for the time series chart and fix bugs I found along the way
4268         https://bugs.webkit.org/show_bug.cgi?id=168499
4270         Reviewed by Antti Koivisto.
4272         Add basic tests for the time series chart.
4274         Replaced the "ondata" callback set in the options by "dataChange" action now that ComponentBase provides
4275         a facility for defining event-like actions.
4277         Also fixed bugs I encountered while writing these tests see below for descriptions.
4279         * browser-tests/editable-text-tests.js:
4280         (waitToRender): Moved to index.html
4281         * browser-tests/index.html:
4282         (waitToRender): Moved from editable-text-tests.js.
4283         (wait): Added.
4284         * browser-tests/time-series-chart-tests.js: Added.
4285         * public/v3/components/chart-pane-base.js:
4286         (ChartPaneBase.prototype.configure):
4287         * public/v3/components/time-series-chart.js:
4288         (TimeSeriesChart): Removed the code to set display and position inline properties. This is now done inside
4289         cssTemplate with :host pseudo class.
4290         (TimeSeriesChart.prototype._ensureCanvas): Don't strech the canvas to 100% of width and height. This was
4291         causing a flush of contents where the canvas is momentarily streched by the browser and the script later
4292         updates with the content with the correct aspect ratio.
4293         (TimeSeriesChart.cssTemplate): Added :host rule to set display: block and position: relative.
4294         (TimeSeriesChart._updateAllCharts): Deleted.
4295         (TimeSeriesChart.prototype.render): Only run the code for axis when options.axis is defined. Also, avoid
4296         setting the fill style because we never fill for axis drawing.
4297         (TimeSeriesChart.prototype._computeHorizontalRenderingMetrics): Ditto. Fallback to sensible values when
4298         options.axis is not defined.
4299         (TimeSeriesChart.prototype._renderYAxis): Now computeValueGrid generates a sequence of {time, label}.
4300         (TimeSeriesChart.prototype._renderTimeSeries): Don't draw the shades for confidence intervals unless its
4301         fill style is defined. Otherwise, we'd end up drawing black shade and mask the actual data points.
4302         (TimeSeriesChart.prototype._ensureSampledTimeSeries): Dispatch newly added "dataChange" action instead of
4303         calling "ondata" callback in options dictionary.
4304         (TimeSeriesChart.computeTimeGrid): Modernized to use const/let. Also fixed the bug that we were emitting
4305         the date even when the entire time range fit within a 24-hour interval.
4306         (TimeSeriesChart.computeValueGrid): Rewritten to make MB/GB use a nice round number instead of 0.98GB.
4307         We were using a power of 10 to round up the stepping value but the value formatter used a power of 1024
4308         to divide byte measurements (e.g. for memory). Use formatter.divisor to find the right scaling factor for
4309         each kind.
4310         * public/v3/models/metric.js:
4311         (Metric.prototype.makeFormatter):
4312         (Metric.makeFormatter): Extracted from the one on the prototype so that tests don't need a metric object
4313         just to test TimeSeriesChart. Added the second argument which specifies the maximum absolute value of the
4314         range we're formatting. This is needed to use the same number of decimal points when the most significant
4315         digit of some value is smaller than that of the biggest one. For example, we were emitting 0.50GB instead
4316         of 0.5G along with 2.0GB. The "adjustment" reduces the number of significant figures in these cases.
4317         * public/v3/pages/dashboard-page.js:
4318         (DashboardPage.prototype._createChartForCell):
4320 2017-02-16  Ryosuke Niwa  <rniwa@webkit.org>
4322         Use expect.js instead of expect in browser tests
4323         https://bugs.webkit.org/show_bug.cgi?id=168492
4325         Reviewed by Joseph Pecoraro.
4327         Use expect.js (https://github.com/Automattic/expect.js) instead of expect (https://github.com/mjackson/expect).
4329         * browser-tests/close-button-tests.js:
4330         * browser-tests/component-base-tests.js:
4331         * browser-tests/editable-text-tests.js:
4332         * browser-tests/index.html:
4334 2017-02-16  Ryosuke Niwa  <rniwa@webkit.org>
4336         Modernize and fix measurement-set tests
4337         https://bugs.webkit.org/show_bug.cgi?id=168484
4339         Reviewed by Joseph Pecoraro.
4341         Modernized and fixed the tests in measurement-set-tests.js.
4343         1. Return a promise instead of manually calling done in then/catch hanlders.
4344         2. Use arrow function everywhere.
4345         3. Explicitly assert the number of calls to callbacks instead of asserting never reached.
4347         The test case labled "should return false when the range ends after the fetched cluster"
4348         was incorrectly asserting that hasFetchedRange returns false when the end time is after
4349         the primary cluster's end time. Test an interval before the primary cluster instead.
4351         Added a test case for hasFetchedRange returning true when the end time appears after
4352         the end of the primary cluster and fixed hasFetchedRange to that end. Since there are
4353         no data points after the primary cluster which is chronologically the last cluster,
4354         there is nothing to fetch beyond its end time.
4356         * public/v3/models/measurement-set.js:
4357         (MeasurementSet.prototype.hasFetchedRange): Fixed the bug that this function returned
4358         false when the end time was after the primary cluster's end by truncating the range by
4359         the end of the primary cluster.
4360         * unit-tests/measurement-set-tests.js:
4361         * unit-tests/resources/mock-remote-api.js:
4362         (assert.notReached.assert.notReached): Deleted. It's no longer used by any tests.
4364 2017-02-15  Ryosuke Niwa  <rniwa@webkit.org>
4366         Update ReadMe.md and merge it with Install.md
4367         https://bugs.webkit.org/show_bug.cgi?id=168405
4369         Reviewed by Michael Catanzaro.
4371         Merged Install.md and ReadMe.md into one file.
4373         * Install.md: Removed.
4374         * ReadMe.md: Merged Install.md at the top and updated the rest of the content.
4376 2017-01-24  Ryosuke Niwa  <rniwa@webkit.org>
4378         Modernize editable-text component and add tests
4379         https://bugs.webkit.org/show_bug.cgi?id=167398
4381         Reviewed by Yusuke Suzuki.
4383         Modernized EditableText component to use the action feature added in r210938.
4385         * browser-tests/editable-text-tests.js: Added. Added tests for EditableText component.
4386         (.waitToRender):
4387         * browser-tests/index.html:
4388         * public/v3/components/base.js:
4389         (ComponentBase.prototype.dispatchAction): Return the result from the callback.
4390         * public/v3/components/editable-text.js:
4391         (EditableText): Removed a bunch of instance variables that are no longer needed.
4392         (EditableText.prototype.didConstructShadowTree): Added. Add event listeners on the Edit/Save button and the host.
4393         (EditableText.prototype.editedText): Return the text field's value directly.
4394         (EditableText.prototype.text): Added.
4395         (EditableText.prototype.setText): Call enqueueToRender automatically instead of relying on the parent component
4396         to do so in _startedEditingCallback, which has been removed.
4397         (EditableText.prototype.render): Modernized the code.
4398         (EditableText.prototype._didClick): No longer prevents the default action manually since that's automatically done
4399         in createEventHandler. Handle the case where the update action is not handled.
4400         (EditableText.prototype._endEditingMode): Renamed from _didUpdate.
4401         (EditableText.htmlTemplate): Added ids on various elements in the shadow tree.
4402         (EditableText.cssTemplate): Updated the CSS selectors per above change.
4403         * public/v3/main.js:
4404         (main): Fixed a typo.
4405         * public/v3/pages/analysis-task-page.js:
4406         (AnalysisTaskPage): Use the action listener instead of manually setting callbacks.
4407         (AnalysisTaskPage.prototype._createTestGroupListItem): Ditto.
4408         (AnalysisTaskPage.prototype._didStartEditingTaskName): Deleted.
4410 2017-01-20  Ryosuke Niwa  <rniwa@webkit.org>
4412         Build fix after r210783. Didn't mean to require custom elements API.
4414         * public/v3/main.js:
4415         (main):
4417 2017-01-20  Ryosuke Niwa  <rniwa@webkit.org>
4419         Make sync-commits.py robust against missing Subversion authors and missing parent Git commits
4420         https://bugs.webkit.org/show_bug.cgi?id=167231
4422         Reviewed by Antti Koivisto.
4424         Fixed a bug that a subversion commit that's missing author name (anonymous commit) results in an out of bound
4425         exception, and a bug that syncing a git repository starts failing once there was a merge commit which pulled
4426         in a commit data earlier than that of the last reported commit.
4428         For the latter fix, added --max-ancestor-fetch-count to specify the number of maximum commits to look back.
4430         * tools/sync-commits.py:
4431         (main): Added --max-ancestor-fetch-count.
4432         (Repository.fetch_commits_and_submit): If submit_commits fails with FailedToFindParentCommit, fetch the parent
4433         commit's information until we've resolved them all.
4434         (Repository.fetch_next_commit): Renamed from fetch_commit.
4435         (SVNRepository.fetch_next_commit): Renamed from fetch_commit. Don't try to get the author name if it's missing
4436         due to an anonymous commit. It's important to never include the "author" field in the JSON submitted to
4437         a dashboard since it rejects when "author" field is not an array (e.g. null). 
4438         (GitRepository.fetch_next_commit): Renamed from fetch_commit.
4439         (GitRepository.fetch_commit): Added. Fetches the commit information for a given git hash. Used to retrieve
4440         missing parent commits.
4441         (GitRepository._revision_from_tokens): Extracted from fetch_commit.
4443         * tools/util.py:
4444         (submit_commits): Optionally takes status_to_accept to avoid throwing in the case of FailedToFindParentCommit
4445         and returns the response JSON.
4447 2017-01-20  Ryosuke Niwa  <rniwa@webkit.org>
4449         REGRESSION(r198234): /api/commits/%revision% always fails
4450         https://bugs.webkit.org/show_bug.cgi?id=167235
4452         Reviewed by Antti Koivisto.
4454         The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on
4455         $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there.
4457         Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest,
4458         and /last-reported would return a commit with all values set to null instead of an empty list.
4460         Finally, added server API tests for /api/commits.
4462         * public/api/commits.php:
4463         (main): Add a comment for APIs that only exist for v2 UI.
4465         * public/include/commit-log-fetcher.php:
4466         (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the
4467         the latest commit as desired.
4468         (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception
4469         because commit_for_revision is defined on $this, not $this->db.
4470         (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with
4471         all values set to null.
4473         * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits.
4474         (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits
4475         to one sent to /api/report-commits.
4477 2017-01-19  Ryosuke Niwa  <rniwa@webkit.org>
4479         measurement-sets API can incorrectly order points with OS version without commit time
4480         https://bugs.webkit.org/show_bug.cgi?id=167227
4482         Reviewed by Chris Dumez.
4484         Ignore revision_order for the purpose of ordering data points in /api/measurement-sets.
4486         These orderings are used in some UI (e.g A/B testing) to order OS build numbers which do not have a timestamp
4487         associated with each "revision".
4489         The baseline measurements made in our internal dashboard were using these ordering numbers before ordering
4490         results with build time. Because those data points don't have an associated Webkit revisions, all data points
4491         were ordered first by macOS's revision_order, then build time. Because v3 UI completely ignores revision_order
4492         for the purpose of plotting data points, this resulted in some data points being plotted in a wrong order
4493         with some lines going backwards in time.
4495         This patch addresses this discrepancy by stop ordering data points with revision_order in the JSON API.
4497         * public/api/measurement-set.php:
4498         (MeasurementSetFetcher::execute_query): Fixed the bug.
4499         * server-tests/api-measurement-set-tests.js: Added a test.
4501 2017-01-19  Ryosuke Niwa  <rniwa@webkit.org>
4503         Build fix after r210626. We need to clear Triggerable's static map in each iteration.
4505         * tools/sync-buildbot.js:
4506         (syncLoop):
4508 2017-01-18  Ryosuke Niwa  <rniwa@webkit.org>
4510         Add a mechanism to dispatch and listen to an action
4511         https://bugs.webkit.org/show_bug.cgi?id=167191
4513         Reviewed by Antti Koivisto.
4515         Added the notion of an action to components. Like DOM events, it can be dispatched or listen to.
4517         Also added ComponentBase.prototype.part which finds a sub-component inside a component's shadow tree,
4518         and made ComponentBase.prototype.content take an id to find an element that matches it.
4520         * browser-tests/close-button-tests.js: Added. Tests for CloseButton.
4521         * browser-tests/component-base-tests.js: Added tests for ComponentBase's part(~), content(id), dispatchEvent.
4522         * browser-tests/index.html:
4523         * public/v3/components/base.js:
4524         (ComponentBase): Added this._actionCallbacks, which is a map of an action name to a callback to be invoked.
4525         (ComponentBase.prototype.content): Return an element of the given id if one is specified.
4526         (ComponentBase.prototype.part): Find a component whose element has the matching id.
4527         (ComponentBase.prototype.dispatchAction): Added.
4528         (ComponentBase.prototype.listenToAction): Added.
4529         (ComponentBase.prototype._ensureShadowTree): Call didConstructShadowTree.
4530         (ComponentBase.prototype.didConstructShadowTree): Added.
4531         (ComponentBase.prototype._recursivelyReplaceUnknownElementsByComponents): Copy attributes when instantiating
4532         an element for a component when the browser doesn't support custom elements API.
4533         (ComponentBase.createLink):
4534         (ComponentBase.prototype.createEventHandler): Added.
4535         (ComponentBase.createEventHandler): Renamed from createActionHandler.
4536         * public/v3/components/button-base.js:
4537         (ButtonBase.prototype.didConstructShadowTree): Added. Dispatch "activate" action when the button is clicked.
4538         (ButtonBase.prototype.setCallback): Deleted.
4539         (ButtonBase.htmlTemplate): Use id instead of class so that this.content() can find it.
4540         (ButtonBase.cssTemplate): Updated style rules.
4541         * public/v3/pages/chart-pane.js:
4542         (ChartPane):
4543         (ChartPane.prototype.didConstructShadowTree): Added. Listen to "activate" action on the close button.
4544         (ChartPane.prototype.render): Fixed a bug that we were never calling enqueueToRender on the close button.
4545         (ChartPane.htmlTemplate): Add the id on the close button.
4547 2017-01-18  Dewei Zhu  <dewei_zhu@apple.com>
4549         'buildbot-syncer.js' should be able to determine force build argument from a list of possible repositories.
4550         https://bugs.webkit.org/show_bug.cgi?id=167152
4552         Reviewed by Ryosuke Niwa.
4554         Add 'rootOptions' key which maps to a list of possible repositories.
4555         For a build request, only one of the repositories in the list is valid.
4557         * tools/js/buildbot-syncer.js:
4558         (BuildbotSyncer.prototype._propertiesForBuildRequest):
4559         (BuildbotSyncer._validateAndMergeProperties):
4560         (BuildbotSyncer):
4561         * unit-tests/buildbot-syncer-tests.js:
4562         (sampleiOSConfig):
4563         (sampleiOSConfigWithExpansions):
4564         (createSampleBuildRequest):
4565         (Promise.resolve.then):
4566         * unit-tests/resources/mock-v3-models.js:
4567         (MockModels.inject):
4569 2017-01-17  Ryosuke Niwa  <rniwa@webkit.org>
4571         Make calls to render() functions async
4572         https://bugs.webkit.org/show_bug.cgi?id=167151
4574         Reviewed by Andreas Kling.
4576         Make calls to render() async by coalescing calls inside enqueueToRender(), which has been renamed from
4577         updateRendering(). We now queue up all the components and wait until the next animation frame to invoke
4578         render() on all those components.
4580         This reduces render() calls in the summary page of our internal dashboard by 15x from ~9400 to ~600 by
4581         eliminating pathological O(n^2) behavior between render() calls.
4583         Consolidated TimeSeriesChart's enqueueRender into this newly added feature of ComponentBase along with
4584         the support to call render() on a resize event. New implementation makes use of connectedCallback and
4585         disconnectedCallback to avoid the work when the component is not in a document tree.
4587         The rest of the patch concerns with renaming updateRendering to enqueueToRender and fixing a few minor bugs
4588         that I encountered while working on this patch.
4590         * browser-tests/component-base-tests.js: Added tests for ComponentBase.enqueueToRender().
4591         * browser-tests/index.html:
4592         (BrowserContext.prototype.importScripts): Renamed from importScript; Now supports loading multiple scripts.
4593         (BrowserContext.prototype.importScript): Added.
4594         (BrowserContext): Removed the unused createWithScripts.
4596         * public/v3/components/analysis-results-viewer.js:
4597         (AnalysisResultsViewer.prototype._expandBetween):
4598         * public/v3/components/bar-graph-group.js:
4599         (BarGraphGroup.prototype.updateGroupRendering):
4601         * public/v3/components/base.js:
4602         (ComponentBase): When the browser doesn't support custom elements and 
4603         (ComponentBase.prototype.enqueueToRender): Renamed from updateRendering. Queues up the component to call
4604         render() instead of immediately invoking it.
4605         (ComponentBase.renderingTimerDidFire): Call render(). Since render() function often calls enqueueToRender
4606         on child components, go ahead and invoke render() on any components enqueued during render() calls.
4607         (ComponentBase._connectedComponentToRenderOnResize): Added.
4608         (ComponentBase._disconnectedComponentToRenderOnResize): Added.
4609         (ComponentBase.defineElement.elementClass.prototype.connectedCallback): Added. This is an optimization to
4610         avoid the work when the component is not in the document; e.g. because the entire page component has been
4611         detached from the document. The old implementation in TimeSeriesChart was not doing this.
4612         (ComponentBase.defineElement.elementClass.prototype.disconnectedCallback): Added.
4613         (ComponentBase): Replaced unused static variables with _componentsToRender and _componentsToRenderOnResize.
4615         * public/v3/components/chart-pane-base.js:
4616         (ChartPaneBase.prototype.fetchAnalysisTasks):
4617         (ChartPaneBase.prototype.didUpdateAnnotations): Added. Addresses the bug that the annotation bars in the
4618         charts shown an an analysis task doesn't update its color when the state is updated in the UI. 
4619         (ChartPaneBase.prototype._mainSelectionDidZoom):
4620         (ChartPaneBase.prototype._updateStatus):
4621         (ChartPaneBase.prototype._requestOpeningCommitViewer):
4622         (ChartPaneBase.prototype._keyup):
4623         (ChartPaneBase.prototype.render):
4624         * public/v3/components/commit-log-viewer.js:
4625         * public/v3/components/customizable-test-group-form.js:
4626         (CustomizableTestGroupForm):
4627         (CustomizableTestGroupForm.prototype._customize):
4628         * public/v3/components/editable-text.js:
4629         (EditableText.prototype._didUpdate):
4630         * public/v3/components/interactive-time-series-chart.js:
4631         * public/v3/components/pane-selector.js:
4632         (PaneSelector.prototype._selectedItem):
4633         * public/v3/components/time-series-chart.js:
4634         (TimeSeriesChart): Removed the logic to update upon resize. See _connectedComponentToRenderOnResize above.
4635         (TimeSeriesChart.prototype.get enqueueToRenderOnResize): Added. Returns true.
4636         (TimeSeriesChart.prototype.enqueueToRender): Deleted.
4637         (TimeSeriesChart._renderEnqueuedCharts): Deleted.
4638         (TimeSeriesChart): Call ComponentBase.defineElement to make this a proper component so that the logic in
4639         connectedCallback to update upon resize event would work.
4640         * public/v3/instrumentation.js:
4641         (Instrumentation.dumpStatistics): Sort results by the key names.
4642         * public/v3/models/time-series.js:
4643         (TimeSeries.prototype.values): Added. This method was never ported to v3 in r198462, and broke the feature
4644         to show moving averages, etc... on the charts page.
4645         * public/v3/pages/analysis-category-page.js:
4646         (AnalysisCategoryPage.prototype.open):
4647         (AnalysisCategoryPage.prototype.updateFromSerializedState):
4648         (AnalysisCategoryPage.prototype.filterDidChange):
4649         (AnalysisCategoryPage.prototype.render):
4650         * public/v3/pages/analysis-task-page.js:
4651         (AnalysisTaskChartPane.prototype._updateStatus):
4652         (AnalysisTaskPage.prototype.updateFromSerializedState):
4653         (AnalysisTaskPage.prototype._didFetchTask):
4654         (AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks):
4655         (AnalysisTaskPage.prototype._didFetchMeasurement):
4656         (AnalysisTaskPage.prototype._didFetchTestGroups):
4657         (AnalysisTaskPage.prototype._showAllTestGroups):
4658         (AnalysisTaskPage.prototype._didFetchAnalysisResults):
4659         (AnalysisTaskPage.prototype.render):
4660         (AnalysisTaskPage.prototype._renderTestGroupList.):
4661         (AnalysisTaskPage.prototype._renderTestGroupList):
4662         (AnalysisTaskPage.prototype._createTestGroupListItem):
4663         (AnalysisTaskPage.prototype._showTestGroup):
4664         (AnalysisTaskPage.prototype._didStartEditingTaskName):
4665         (AnalysisTaskPage.prototype._updateTaskName):
4666         (AnalysisTaskPage.prototype._updateTestGroupName):
4667         (AnalysisTaskPage.prototype._hideCurrentTestGroup):
4668         (AnalysisTaskPage.prototype._updateChangeType): Fixed the bug that we were never updating annotation bars
4669         in the main chart by calling didUpdateAnnotations.
4670         (AnalysisTaskPage.prototype._associateBug):
4671         (AnalysisTaskPage.prototype._dissociateBug):
4672         (AnalysisTaskPage.prototype._associateCommit):
4673         (AnalysisTaskPage.prototype._dissociateCommit):
4674         (AnalysisTaskPage.prototype._chartSelectionDidChange):
4675         (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer):
4676         * public/v3/pages/build-request-queue-page.js:
4677         (BuildRequestQueuePage.prototype.open.):
4678         (BuildRequestQueuePage.prototype.open):
4679         * public/v3/pages/chart-pane.js:
4680         (ChartPane.prototype.setOpenRepository):
4681         (ChartPane.prototype._renderTrendLinePopover): Fixed a race condition. Insert a select element as needed
4682         before trying to assign the current value on it.
4683         (ChartPane.prototype._trendLineTypeDidChange):
4684         (ChartPane.prototype._updateTrendLine):
4685         * public/v3/pages/charts-page.js:
4686         (ChartsPage.prototype.updateFromSerializedState):
4687         (ChartsPage.prototype._updateDomainsFromSerializedState):
4688         (ChartsPage.prototype.setNumberOfDaysFromToolbar):
4689         (ChartsPage.prototype._didMutatePaneList):
4690         (ChartsPage.prototype.render):
4691         * public/v3/pages/charts-toolbar.js:
4692         (ChartsToolbar.prototype.render):
4693         * public/v3/pages/create-analysis-task-page.js:
4694         (CreateAnalysisTaskPage.prototype.updateFromSerializedState):
4695         * public/v3/pages/dashboard-page.js:
4696         (DashboardPage.prototype.updateFromSerializedState):
4697         (DashboardPage.prototype._fetchedData):
4698         * public/v3/pages/heading.js:
4699         (Heading.prototype.render):
4700         * public/v3/pages/page-with-heading.js:
4701         (PageWithHeading.prototype.render):
4702         * public/v3/pages/page.js:
4703         (Page.prototype.open):
4704         * public/v3/pages/summary-page.js:
4705         (SummaryPage.prototype.open):
4706         (SummaryPage.prototype.this._renderQueue.push):
4707         (SummaryPage):
4708         (SummaryPage.prototype._renderCell):
4710 2017-01-15  Ryosuke Niwa  <rniwa@webkit.org>
4712         Add the build fix for browsers that don't yet support custom elements SPI.
4713         It was supposedly to be a part of the previous commit.
4715         * public/v3/components/base.js:
4716         (ComponentBase.defineElement):
4718 2017-01-12  Ryosuke Niwa  <rniwa@webkit.org>
4720         Adopt custom elements API in perf dashboard
4721         https://bugs.webkit.org/show_bug.cgi?id=167045
4723         Reviewed by Darin Adler.
4725         Adopt custom elements API in ComponentBase, and create the shadow tree lazily in content() and render()
4726         instead of eagerly creating it inside the constructor.
4728         For now, create a separate element class for each component in ComponentBase.defineElement instead of
4729         making ComponentBase inherit from HTMLElement to preserve the semantics we have as well as to test
4730         the boundaries of what custom elements API allows for framework authors.
4732         In order to ensure one-to-one correspondence between elements and their components, we use a static map,
4733         ComponentBase._currentlyConstructedByInterface, to remember which element or component is being created
4734         and use that in custom element's constructor to update element.component() and this._element.
4736         Also dropped the support for not having attachShadow as we've shipped this feature in Safari 10.
4738         Finally, added tests to be ran inside a browser to test the front end code in browser-tests.
4740         * browser-tests/component-base-tests.js: Added. Basic tests for ComponentBase.
4741         * browser-tests/index.html: Added.
4743         * public/v3/components/base.js:
4744         (ComponentBase): Don't create the shadow tree. Use the currently constructed element as this._element if
4745         there is one (the custom element's constructor is getting called). Otherwise create a new element but
4746         store this component in the map to avoid creating a new component in the custom element's constructor.
4747         (ComponentBase.prototype.content): Lazily create the shadow tree now.
4748         (ComponentBase.prototype.render): Ditto.
4749         (ComponentBase.prototype._ensureShadowTree): Renamed from _constructShadowTree. Dropped the support for
4750         not having shadow DOM API. This is now required. Also use importNode instead of cloneNode in cloning
4751         the template content since the latter would not get upgraded.
4752         (ComponentBase.prototype._recursivelyReplaceUnknownElementsByComponents): Modernized the code. Don't
4753         re-create a component if its element had already been upgraded by its custom element constructor.
4754         (ComponentBase.defineElement): Add this component to the static maps. _componentByName is used by
4755         _recursivelyReplaceUnknownElementsByComponents to instantiate new components in the browsers that don't
4756         support custom elements API and _componentByClass is used by ComponentBase's constructor to lookup the
4757         element name. The latter should go away once all components fully adopt ComponentBase.defineElement.
4758         (ComponentBase.defineElement.elementClass): A class to define a custom element for the component.
4759         We need to reconfigure the property since class's name is not writable but configurable.
4761         * public/v3/components/button-base.js:
4762         (ButtonBase.htmlTemplate): Added. Extracted the common code from CloseButton and WarningIcon.
4763         (ButtonBase.buttonContent): Added. An abstract method overridden by CloseButton and WarningIcon.
4764         (ButtonBase.sizeFactor): Added. Overridden by WarningIcon.
4765         (ButtonBase.cssTemplate): Updated to use :host.
4766         * public/v3/components/close-button.js:
4767         (CloseButton.buttonContent): Renamed from htmlTemplate.
4768         * public/v3/components/spinner-icon.js:
4769         (SpinnerIcon.cssTemplate): Removed webkit prefixed properties, and updated it to animate stroke instead
4770         of opacity to reduce the power usage.
4771         (SpinnerIcon.htmlTemplate): Factored stroke, stroke-width, and stroke-linecap into cssTemplate.
4772         * public/v3/components/warning-icon.js:
4773         (WarningIcon.cssTemplate): Deleted.
4774         (WarningIcon.sizeFactor): Added.
4775         (WarningIcon.buttonContent): Renamed from htmlTemplate.
4776         * public/v3/pages/summary-page.js:
4777         (SummaryPage._constructRatioGraph): Fixed a bug that we were not never calling spinner.updateRendering().
4778         (SummaryPage.prototype._renderCell):
4780 2017-01-13  Ryosuke Niwa  <rniwa@webkit.org>
4782         Instrument calls to render()
4783         https://bugs.webkit.org/show_bug.cgi?id=167037
4785         Reviewed by Sam Weinig.
4787         Wrap every call to render() by newly added ComponentBase.updateRendering() to instrument it.
4788         Also, use arrow functions instead of this.render.bind or regular closures for simplicity.
4790         Currently, we're making 5100 calls to render() while opening the summary page, and that's way too high.
4792         * public/v3/components/analysis-results-viewer.js:
4793         (AnalysisResultsViewer.prototype._expandBetween):
4794         * public/v3/components/bar-graph-group.js:
4795         (BarGraphGroup.prototype.updateGroupRendering): Renamed form render() as BarGraphGroup is not a component.
4796         * public/v3/components/base.js:
4797         (ComponentBase.prototype.updateRendering): Added. Instruments render() call.
4798         * public/v3/components/chart-pane-base.js:
4799         (ChartPaneBase.prototype.fetchAnalysisTasks):
4800         (ChartPaneBase.prototype._mainSelectionDidZoom):
4801         (ChartPaneBase.prototype._updateStatus):
4802         (ChartPaneBase.prototype._requestOpeningCommitViewer):
4803         (ChartPaneBase.prototype._keyup):
4804         (ChartPaneBase.prototype.render):
4805         * public/v3/components/commit-log-viewer.js:
4806         * public/v3/components/customizable-test-group-form.js:
4807         (CustomizableTestGroupForm):
4808         (CustomizableTestGroupForm.prototype._customize):
4809         * public/v3/components/editable-text.js:
4810         (EditableText.prototype._didUpdate):
4811         * public/v3/components/pane-selector.js:
4812         (PaneSelector.prototype._selectedItem):
4813         * public/v3/components/results-table.js:
4814         (ResultsTable.prototype.render):
4815         * public/v3/components/time-series-chart.js:
4816         (TimeSeriesChart._renderEnqueuedCharts):
4817         * public/v3/pages/analysis-category-page.js:
4818         (AnalysisCategoryPage.prototype.open):
4819         (AnalysisCategoryPage.prototype.updateFromSerializedState):
4820         (AnalysisCategoryPage.prototype.filterDidChange):
4821         (AnalysisCategoryPage.prototype.render):
4822         * public/v3/pages/analysis-task-page.js:
4823         (AnalysisTaskChartPane.prototype._updateStatus):
4824         (AnalysisTaskPage.prototype.updateFromSerializedState):
4825         (AnalysisTaskPage.prototype._didFetchTask):
4826         (AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks):
4827         (AnalysisTaskPage.prototype._didFetchMeasurement):
4828         (AnalysisTaskPage.prototype._didFetchTestGroups):
4829         (AnalysisTaskPage.prototype._showAllTestGroups):
4830         (AnalysisTaskPage.prototype._didFetchAnalysisResults):
4831         (AnalysisTaskPage.prototype.render):
4832         (AnalysisTaskPage.prototype._renderTestGroupList.):
4833         (AnalysisTaskPage.prototype._renderTestGroupList):
4834         (AnalysisTaskPage.prototype._createTestGroupListItem):
4835         (AnalysisTaskPage.prototype._showTestGroup):
4836         (AnalysisTaskPage.prototype._didStartEditingTaskName):
4837         (AnalysisTaskPage.prototype._updateTaskName):
4838         (AnalysisTaskPage.prototype._updateTestGroupName):
4839         (AnalysisTaskPage.prototype._hideCurrentTestGroup):
4840         (AnalysisTaskPage.prototype._updateChangeType):
4841         (AnalysisTaskPage.prototype._associateBug):
4842         (AnalysisTaskPage.prototype._dissociateBug):
4843         (AnalysisTaskPage.prototype._associateCommit):
4844         (AnalysisTaskPage.prototype._dissociateCommit):
4845         (AnalysisTaskPage.prototype._chartSelectionDidChange):
4846         (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer):
4847         * public/v3/pages/build-request-queue-page.js:
4848         (BuildRequestQueuePage.prototype.open.):
4849         (BuildRequestQueuePage.prototype.open):
4850         * public/v3/pages/chart-pane.js:
4851         (ChartPane.prototype.setOpenRepository):
4852         (ChartPane.prototype._trendLineTypeDidChange):
4853         (ChartPane.prototype._updateTrendLine):
4854         * public/v3/pages/charts-page.js:
4855         (ChartsPage.prototype.updateFromSerializedState):
4856         (ChartsPage.prototype._updateDomainsFromSerializedState):
4857         (ChartsPage.prototype.setNumberOfDaysFromToolbar):
4858         (ChartsPage.prototype._didMutatePaneList):
4859         (ChartsPage.prototype.render):
4860         * public/v3/pages/charts-toolbar.js:
4861         (ChartsToolbar.prototype.render):
4862         * public/v3/pages/create-analysis-task-page.js:
4863         (CreateAnalysisTaskPage.prototype.updateFromSerializedState):
4864         * public/v3/pages/dashboard-page.js:
4865         (DashboardPage.prototype.updateFromSerializedState):
4866         (DashboardPage.prototype._fetchedData):
4867         * public/v3/pages/heading.js:
4868         (Heading.prototype.render):
4869         * public/v3/pages/page-with-heading.js:
4870         (PageWithHeading.prototype.render):
4871         * public/v3/pages/page.js:
4872         (Page.prototype.open):
4873         * public/v3/pages/summary-page.js:
4874         (SummaryPage.prototype.open):
4875         (SummaryPage.prototype.this._renderQueue.push):
4876         (SummaryPage):
4877         (SummaryPage.prototype._renderCell):
4879 2017-01-12  Ryosuke Niwa  <rniwa@webkit.org>
4881         Outliers are not hidden in v3 UI
4882         https://bugs.webkit.org/show_bug.cgi?id=166966
4884         Reviewed by Andreas Kling.
4886         Fixed the typo in addToSeries. An outlier has markedOutlier set to true, not isOutlier.
4888         Also fixed a bug unveiled by new tests in MeasurementRootSet.ensureSingleton. It was was creating
4889         a new MeasurementRootSet each time it was called instead of finding an existing instance. Fixed the bug
4890         by merging the static maps of MeasurementRootSet and RootSet.
4892         * public/v3/models/measurement-cluster.js:
4893         (MeasurementCluster.prototype.addToSeries): Fixed the bug.
4894         * public/v3/models/root-set.js:
4895         (MeasurementRootSet.prototype.namedStaticMap): Added.
4896         (MeasurementRootSet.prototype.ensureNamedStaticMap): Added.
4897         (MeasurementRootSet.namedStaticMap): Added.
4898         (MeasurementRootSet.ensureNamedStaticMap): Added.
4899         * unit-tests/measurement-set-tests.js: Added tests for adopting time series data from a cluster.
4901 2017-01-12  Ryosuke Niwa  <rniwa@webkit.org>
4903         Hide the UI to trigger an A/B testing when there are no triggerables
4904         https://bugs.webkit.org/show_bug.cgi?id=166964
4906         Reviewed by Yusuke Suzuki.
4908         Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later
4909         when the user tries to create one it with a TriggerableNotFound error.
4911         Added the list of triggerables to the manifest JSON so that we can determine this condition without
4912         having to fetch /api/triggerable for each analysis task as done in v2 UI.
4914         * public/admin/reprocess-report.php:
4915         * public/api/manifest.php:
4916         * public/api/report.php:
4917         * public/include/admin-header.php:
4918         * public/include/manifest-generator.php: Moved from public/include/manifest.php.
4919         (ManifestGenerator::generate):
4920         (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts
4921         as well as the list of (test, platform) pairs on which this triggerable is available.
4922         Use [testId, platformId] instead of a dictionary to reduce the file size.
4923         * public/v3/components/customizable-test-group-form.js:
4924         (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to
4925         disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute
4926         the visibility of the button in render() function instead.
4927         (CustomizableTestGroupForm.prototype.setRootSetMap):
4928         (CustomizableTestGroupForm.prototype._submitted):
4929         (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed.
4930         The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed.
4931         "Customize" button must be hidden when no range is selected.
4932         * public/v3/components/test-group-form.js:
4933         (TestGroupForm): Removed _disabled since it's no longer used.
4934         (TestGroupForm.prototype.setDisabled): Ditto.
4935         (TestGroupForm.prototype.render): Ditto.
4936         * public/v3/index.html: Include triggerable.js.
4937         * public/v3/models/manifest.js:
4938         (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON.
4939         * public/v3/models/triggerable.js: Added.
4940         (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair.
4941         (Triggerable.prototype.acceptedRepositories): Added.
4942         (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map.
4943         * public/v3/pages/analysis-task-page.js:
4944         (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data
4945         points that were previously not available may have become available. The lack of this update was
4946         causing a race condition in which the "Start A/B Testing" button for the charts is disabled even
4947         after a group name had been specified because setRootSetMap was never called with a valid set.
4948         (AnalysisTaskPage): Added this._triggerable.
4949         (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task.
4950         (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely
4951         when there are no groups to show. Also hide the forms to start A/B testing when there are no matching
4952         triggerable, which is the main feature of this patch.
4953         * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON.
4954         * server-tests/resources/mock-data.js:
4955         (MockData.resetV3Models): Reset Triggerable's static map.
4956         * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are  constructed
4957         with appropriate list of repositories and (test, platform) associations.
4958         * tools/js/database.js:
4959         (tableToPrefixMap): Added triggerable_repositories's prefix.
4960         * tools/js/remote.js:
4961         (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging.
4962         * tools/js/v3-models.js: Import triggerable.js.
4964 2017-01-11  Ryosuke Niwa  <rniwa@webkit.org>
4966         fetch-from-remote doesn’t work with some websites
4967         https://bugs.webkit.org/show_bug.cgi?id=166963
4969         Reviewed by Yusuke Suzuki.
4971         Apparently file_get_contents is not compatible with some SSL/TLS connections.
4972         Use curl_* functions to access remote servers instead.
4974         * public/admin/fetch-from-remote.php:
4975         (fetch_remote):
4977 2017-01-10  Ryosuke Niwa  <rniwa@webkit.org>
4979         Another build fix. Always use UTC when expressing commit times in UNIX-epoch timestamps.
4981         * public/api/measurement-set.php:
4983 2017-01-10  Ryosuke Niwa  <rniwa@webkit.org>
4985         Fix a typo in the previous commit.
4987         * public/api/measurement-set.php:
4989 2017-01-10  Ryosuke Niwa  <rniwa@webkit.org>
4991         Build fixes for older versions of Postgres.
4993         Also redirect / and /# to /v3/ as intended in r200820.
4995         * public/api/measurement-set.php:
4996         * public/api/runs.php:
4997         * public/index.html:
4999 2016-10-18  Dewei Zhu  <dewei_zhu@apple.com>
5001         Update test cases for change r206465.
5002         https://bugs.webkit.org/show_bug.cgi?id=163618
5004         Reviewed by Ryosuke Niwa.
5006         Update test case for change r206465 which added support for multiple summary pages.
5007         Use deepStrictEqual instead of deepEqual as deepEqual will not complain in the case like 'deepEqual([],{})'.
5008         Fix a test failure in tools-buildbot-triggerable-tests.js.
5009         Fix a bug in generating manifest.
5011         * config.json:
5012         * public/include/manifest.php:
5013         * server-tests/api-manifest.js:
5014         (TestServer.remoteAPI.getJSON.string_appeared_here.then):
5015         * server-tests/tools-buildbot-triggerable-tests.js:
5016         (then):
5018 2016-09-27  Dewei Zhu  <dewei_zhu@apple.com>
5020         Extend perf dashboard to support multiple summary pages.
5021         https://bugs.webkit.org/show_bug.cgi?id=162594
5023         Reviewed by Ryosuke Niwa.
5025         Start support multiple summary pages instead of one.
5026         Specify 'summaryPages' as key that map to a list of summaries which follows
5027         current 'summary' format in 'config.json' but with 2 more properties:
5028            'name': specifying the name shows on perf dashboard,
5029            'route': specifying the path to this page.
5031         * public/include/manifest.php:
5032         * public/v3/main.js:
5033         (main):
5034         (main.): Deleted.
5035         * public/v3/models/manifest.js:
5036         (Manifest._didFetchManifest):
5037         (Manifest):
5038         * public/v3/pages/summary-page.js:
5039         (SummaryPage):
5040         (SummaryPage.prototype.routeName):
5042 2016-08-09  Ryosuke Niwa  <rniwa@webkit.org>
5044         Don't filter out the latest data point in chart data sampling
5045         https://bugs.webkit.org/show_bug.cgi?id=160714
5047         Reviewed by Chris Dumez.
5049         Exclude the last data point from sampling so that it's always included in the "sampled" charts data.
5050         Without this, the last data point can change as we zoom out the time domain.
5052         Luckily, we already had a mechanism to exclude the user selected point from sampling. Extend this
5053         feature by supporting an array of point IDs instead of a single ID to exclude from filering.
5055         * public/v3/components/interactive-time-series-chart.js:
5056         (InteractiveTimeSeriesChart.prototype._sampleTimeSeries): Replaced exclusionPointID by excludedPoints. 
5058         * public/v3/components/time-series-chart.js:
5059         (TimeSeriesChart.prototype._ensureSampledTimeSeries): Put the last data point in excludedPoints.
5060         (TimeSeriesChart.prototype._sampleTimeSeries): Check point's id against the list of IDs.
5062 2016-08-09  Ryosuke Niwa  <rniwa@webkit.org>
5064         Build fix after r204187. interval has to be a getter, not a method.
5066         * public/v3/components/time-series-chart.js:
5067         (TimeSeriesChart.prototype._renderTimeSeries):
5068         * public/v3/models/measurement-adaptor.js:
5069         (MeasurementAdaptor.prototype.applyTo):
5071 2016-08-09  Ryosuke Niwa  <rniwa@webkit.org>
5073         Fix a typo that was supposed to be fixed in r204296 before landing.
5075         * public/v3/pages/chart-pane.js:
5076         (ChartPane):
5077         (ChartPane.prototype.updateFromSerializedState):
5078         (ChartPane.prototype._analyzeRange):
5079         (ChartPane.prototype._renderTrendLinePopover):
5080         (ChartPane.prototype._trendLineTypeDidChange):
5082 2016-08-08  Ryosuke Niwa  <rniwa@webkit.org>
5084         Always show segmentation on v3 charts page
5085         https://bugs.webkit.org/show_bug.cgi?id=160576
5087         Rubber-stamped by Chris Dumez.
5089         Added "Trend Lines" popover to select and customize a moving average or a segmentation to show on charts page
5090         and made Schwarz criterion segmentation the default trend line for all charts.
5092         Because computing the segmentation is expensive, we use WebWorker to parallelize the computation via AsyncTask.
5093         We also compute and cache the segmentation for each cluster separately to avoid processing the entire measurement
5094         set as that could take 10-20s total, which was a huge problem in v2 UI. v3 UI's approach is more incremental and
5095         even opens up an opportunity to cache the results in the server side.
5097         Also brought back "shading" for the confidence interval drawing as done in v1 and v2 UI.
5099         * public/shared/statistics.js:
5100         (Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Added segmentCountWeight and gridSize as arguments
5101         to customize the algorithm.
5102         (Statistics.splitIntoSegmentsUntilGoodEnough): Takes segmentCountWeight as BirgeAndMassartC.
5104         * public/v3/async-task.js: Added.
5105         (AsyncTask): Added. This class represents a task such as computing segmentation to be executed in a worker.
5106         (AsyncTask.prototype.execute): Added. Returns a promise that gets resolved when the specified task completes.
5107         (AsyncTaskWorker.waitForAvailableWorker): Added. Calls the given callback with the first available worker. When
5108         all workers are processing some tasks, it waits until one becomes available by putting the callback into a queue.
5109         _didRecieveMessage pops an item out of this queue when a worker completes a task. We don't use a promise here
5110         because calling this function multiple times synchronously could result in all the returned promises getting
5111         resolved with the same worker as none of the callers get to lock away the first available worker until the end
5112         of the current micro-task.
5113         (AsyncTaskWorker._makeWorkerEventuallyAvailable): Added. A helper function for waitForAvailableWorker. Start
5114         a new worker if the number of workers we've started is less than the number of extra cores (e.g. 7 if there are
5115         8 cores on the machine). Avoid starting a new worker if we've started a new worker within the last 50 ms since
5116         starting a new worker takes some time.
5117         (AsyncTaskWorker._findAvailableWorker): Added. Finds a worker that's available right now if there is any.
5118         (AsyncTaskWorker): Added. An instance of AsyncTaskWorker represents a Web worker.
5119         (AsyncTaskWorker.prototype.id): Added.
5120         (AsyncTaskWorker.prototype.sendTask): Added. Sends a task represented by AsyncTask to the worker.
5121         (AsyncTaskWorker.prototype._didRecieveMessage): Added. This function gets called when the current task completes
5122         in the worker. Pop the next callback if some caller of waitForAvailableWorker is still waiting. Otherwise stop
5123         the worker after one second of waiting to avoid worker churning.
5124         (AsyncTaskWorker.workerDidRecieveMessage): Added. Called by onmessage on the worker. Executes the specified task
5125         and sends back a message upon completion with the appropriate timing data.
5127         * public/v3/components/chart-pane-base.js:
5128         (ChartPaneBase.prototype.configure): Uses _createSourceList.
5129         (ChartPaneBase.prototype._createSourceList): Added. Extracted from configure to customize the source list for
5130         the main chart and the overview chart.
5131         (ChartPaneBase.prototype._updateSourceList): Uses _createSourceList.
5133         * public/v3/components/chart-styles.js:
5134         (ChartStyles.createSourceList): Added a boolean showPoint as an extra argument. This specifies whether circles
5135         are drawn for each data point.
5136         (ChartStyles.baselineStyle): Added styles for foreground lines and background lines. They're used for trend lines
5137         and underlying raw data respectively when trend lines are shown.
5138         (ChartStyles.targetStyle): Ditto.
5139         (ChartStyles.currentStyle): Ditto.
5141         * public/v3/components/time-series-chart.js:
5142         (TimeSeriesChart): Added _trendLines, _renderedTrendLines, and _fetchedTimeSeries as instance variables.
5143         (TimeSeriesChart.prototype.setSourceList): Clear _fetchedTimeSeries before calling setSourceList for consistency.
5144         (TimeSeriesChart.prototype.sourceList): Added.
5145         (TimeSeriesChart.prototype.clearTrendLines): Added.
5146         (TimeSeriesChart.prototype.setTrendLine): Added. Preserves the existing trend lines for other sources. This is
5147         necessary because segmentation for "current" and "baseline" lines may become available at different times, and we
5148         don't want to clear one or the other when setting one.
5149         (TimeSeriesChart.prototype._layout): Added a call to _ensureTrendLines.
5150         (TimeSeriesChart.prototype._renderChartContent): Call _renderTimeSeries for trend lines. Trend lines are always
5151         foreground lines and "regular" raw data points are drawn as background if there are trend lines.
5152         (TimeSeriesChart.prototype._renderTimeSeries): Added layerName as an argument. It could be an empty string,
5153         "foreground", or "background". Draw a "shade" just like v1 and v2 UI instead of vertical lines for the confidence
5154         intervals. Pick "foreground", "background", or "regular" chart style based on layerName. Also avoid drawing data
5155         points when *PointRadius is set to zero to reduce the runtime of this function.
5156         (TimeSeriesChart.prototype._sourceOptionWithFallback): Added.
5157         (TimeSeriesChart.prototype._ensureSampledTimeSeries): When *PointRadius is 0, show as many points as there are x
5158         coordinates as a fallback instead of showing every point.
5159         (TimeSeriesChart.prototype._ensureTrendLines): Added. Returns true if the chart contents haven't been re-rendered
5160         since the last update to trend lines. This flag is unset by setTrendLine.
5162         * public/v3/index.html:
5164         * public/v3/models/measurement-cluster.js:
5165         (MeasurementCluster.prototype.addToSeries): Store the data points' index to idMap to help aid MeasurementSet's
5166         _cachedClusterSegmentation efficiently re-create the segmentation from the cache.
5168         * public/v3/models/measurement-set.js:
5169         (MeasurementSet): Added _segmentationCache as an instance variable.
5170         (MeasurementSet.prototype.fetchSegmentation): Added. Calls _cachedClusterSegmentation on each cluster, and
5171         constructs the time series representation of the segmentation from the results.
5172         (MeasurementSet.prototype._cachedClusterSegmentation): Computes and caches the segmentation for each cluster.
5173         The cache of segmentation stores ID of each measurement set at which segment changes instead of its index since
5174         the latter could change in any moment when a new test result is reported, or an existing test result is removed
5175         from the time series; e.g. when it's marked as an outlier.
5176         (MeasurementSet.prototype._validateSegmentationCache): Added. Checks whether the cached segmentation's name and
5177         its parameters match that of the requested one.
5178         (MeasurementSet.prototype._invokeSegmentationAlgorithm): Added. Invokes the segmentation algorithm either in the
5179         main thread or in a Web worker via AsyncTask API based on the size of the time series. While parallelizing the
5180         work is beneficial when the data set is large, the overhead can add up if we keep processing a very small data
5181         set in a worker.
5183         * public/v3/models/time-series.js: Made the file compatible with Node.
5184         (TimeSeries.prototype.length): Added.
5185         (TimeSeries.prototype.valuesBetweenRange): Added.
5187         * public/v3/pages/chart-pane.js:
5188         (createTrendLineExecutableFromAveragingFunction): Added.
5189         (ChartTrendLineTypes): Added. Similar to StatisticsStrategies (statistics-strategies.js) in v2 UI.
5190         (ChartPane): Added _trendLineType, _trendLineParameters, _trendLineVersion, and _renderedTrendLineOptions as
5191         instance variables.
5192         (ChartPane.prototype.serializeState): Serialize the trend line option. This format is compatible with v2 UI.
5193         (ChartPane.prototype.updateFromSerializedState): Ditto. Parsing is compatible with v2 UI except that we now have
5194         the default trend line set when the specified ID doesn't match an existing type ID.
5195         (ChartPane.prototype._renderActionToolbar): Added a call to _renderTrendLinePopover. This is the popover that
5196         specifies the type of a trend line to show as well as its parameters.
5197         (ChartPane.prototype._renderTrendLinePopover): Added. A popover for specifying and customizing a trend line.
5198         (ChartPane.prototype._trendLineTypeDidChange): Added. Called when a new trend line is selected.
5199         (ChartPane.prototype._defaultParametersForTrendLine): Added.
5200         (ChartPane.prototype._trendLineParameterDidChange): Added. Called when the trend lines' parameters are changed.
5201         (ChartPane.prototype._didFetchData): Added. Overrides the one in ChartPaneBase to trigger a trend line update.
5202         (ChartPane.prototype._updateTrendLine): Added. Update the trend line. Since segmentation can take an arbitrary
5203         long time, avoid updating trend lines if this function had been called again (possibly for a different trend line
5204         type or with different parameters) before the results become available; hence the versioning.
5205         (ChartPane.paneHeaderTemplate): Added the trend line popover.
5206         (ChartPane.cssTemplate): Added styles for the trend line popover. Also use a more opaque background color behind
5207         popovers when the -webkit-backdrop-filter property is not supported.
5209         * public/v3/pages/dashboard-page.js:
5210         (DashboardPage.prototype._createChartForCell): Call createSourceList with showPoints set to true to preserve the
5211         existing behavior.
5213         * tools/js/v3-models.js: Include TimeSeries object.
5215         * unit-tests/measurement-set-tests.js: Added two test cases for MeasurementSet's fetchSegmentation.
5217         * unit-tests/resources/almost-equal.js: Added.
5218         (almostEqual): Extracted out of statistics-tests.js.
5220         * unit-tests/statistics-tests.js:
5222 2016-08-05  Ryosuke Niwa  <rniwa@webkit.org>
5224         segmentTimeSeriesByMaximizingSchwarzCriterion returns a bogus result on empty charts
5225         https://bugs.webkit.org/show_bug.cgi?id=160575
5227         Rubber-stamped by Chris Dumez.
5229         The bug was caused by an early return in segmentTimeSeriesByMaximizingSchwarzCriterion.
5230         Removed this early return as the one in splitIntoSegmentsUntilGoodEnough was sufficient.
5232         Also factored out a few functions in findOptimalSegmentation so that they can be better
5233         optimized in JSC's DFG and FTL tiers, and removed unused debuggingTestingRangeNomination.
5235         * public/shared/statistics.js:
5236         (Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Removed an early return.
5237         (Statistics.splitIntoSegmentsUntilGoodEnough):
5238         (.allocateCostUpperTriangularForSegmentation): Extracted from findOptimalSegmentation.
5239         (.allocatePreviousNodeForSegmentation): Ditto.
5240         (.findOptimalSegmentationInternal): Ditto.
5241         (.findOptimalSegmentation):
5243         * unit-tests/statistics-tests.js: Added a test case.
5245 2016-08-05  Ryosuke Niwa  <rniwa@webkit.org>
5247         Perf dashboard sometimes tries to fetch a non-existent measurement-set JSON
5248         https://bugs.webkit.org/show_bug.cgi?id=160577
5250         Rubber-stamped by Chris Dumez.
5252         The bug was caused by findClusters computing the first cluster's endTime incorrectly. Namely, we were
5253         multiplying the number of clusters by clusterStart instead of clusterSize with an off-by-one error.
5255         * public/v3/models/measurement-set.js:
5256         (MeasurementSet.prototype.findClusters): Folded computeClusterStart into where clusterEnd is computed
5257         for clarity. Also fixed a bug that we were not computing the first cluster to fetch correctly when
5258         the fetched time range started before clusterStart (i.e. when startTime - clusterStart is negative).
5259         Finally, fixed the main bug by multiplying the number of clusters by clusterSize instead of
5260         clusterStart to compute the end time of the very first cluster in this measurement set. Because what
5261         we're computing here is the end time of the first cluster, not the start time, we also need to subtract
5262         one from the number of clusters. e.g. if there was exactly one cluster, then firstClusterEndTime is
5263         identically equal to lastClusterEndTime.
5264         (MeasurementSet.prototype.fetchedTimeSeries): Removed the unused argument to TimeSeries's constructor.
5266         * unit-tests/analysis-task-tests.js: Fixed the tests for the latest version of Mocha which complains if
5267         we returned a promise in unit tests when "done" function is used.
5268         * unit-tests/checkconfig.js: Ditto.
5269         * unit-tests/measurement-set-tests.js: Added a test case for findClusters and a test to make sure
5270         fetchBetween doesn't try to fetch a cluster before the first cluster in the set. Also fixed other test
5271         cases which were relying on the bug this patch fixed.
5273 2016-08-04  Ryosuke Niwa  <rniwa@webkit.org>
5275         MeasurementCluster's addToSeries is slow
5276         https://bugs.webkit.org/show_bug.cgi?id=160581
5278         Rubber-stamped by Chris Dumez.
5280         The bulk of time was spent in MeasurementAdaptor.prototype.applyTo where we computed the interval.
5282         Since some of data points are filtered out by TimeSeriesChart component before intervals are used,
5283         we can significantly reduce the CPU time by lazily compute them. This patch reduces the runtime of
5284         applyTo from ~60ms to ~30ms on my machine.
5286         * public/v3/models/measurement-adaptor.js:
5287         (MeasurementAdaptor.prototype.applyTo): Lazily compute and cache the interval. Also cache the build
5288         object instead of always creating a new object.
5289         * public/v3/models/measurement-cluster.js:
5290         (MeasurementCluster.prototype.addToSeries): Call applyTo first before checking whether the point is
5291         an outlier or its id to avoid extracting those values twice since they show up in the profiler. Also
5292         use "of" instead "forEach" since "of" seems to be faster here.
5294 2016-08-04  Ryosuke Niwa  <rniwa@webkit.org>
5296         Syncing script's configuration duplicates a lot of boilerplate
5297         https://bugs.webkit.org/show_bug.cgi?id=160574
5299         Rubber-stamped by Chris Dumez.
5301         This patch makes each configuration accept an array of platforms and types so that we can write:
5303         {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"},
5304         {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"},
5305         {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"},
5306         {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"},
5307         {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"},
5308         {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"},
5309         {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"},
5310         {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"},
5312         more concisely as:
5314         {"builder": "mba", "types": ["speedometer", "jetstream"],
5315             "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]},
5316         {"builder": "mbp", "types": ["speedometer", "jetstream"],
5317             "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]},
5319         * tools/js/buildbot-syncer.js:
5320         (BuildbotSyncer._loadConfig):
5321         (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type
5322         and platform.
5323         (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig.
5324         (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that
5325         shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms',
5326         and merged the code for verify an array of strings. Finally, allow the appearance of 'properties'
5327         since this function can now be called on a cloned configuration in which 'arguments' had already
5328         been renamed to 'properties'.
5330         * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration.
5331         (sampleiOSConfigWithExpansions): Added.
5333         * unit-tests/resources/mock-v3-models.js:
5334         (MockModels.inject): Added a few more mock models for the newly added test.
5336 2016-07-26  Ryosuke Niwa  <rniwa@webkit.org>
5338         REGRESSION: Tooltip for analysis tasks doesn't show up on charts
5339         https://bugs.webkit.org/show_bug.cgi?id=160221
5341         Rubber-stamped by Chris Dumez.
5343         The bug was caused by ChartPaneBase resetting annotation bars every time the current point has moved.
5344         Avoid doing this in ChartPaneBase's _renderAnnotations().
5346         * public/v3/components/chart-pane-base.js:
5347         (ChartPaneBase):
5348         (ChartPaneBase.prototype.fetchAnalysisTasks):
5349         (ChartPaneBase.prototype._renderAnnotations):
5351 2016-07-26  Ryosuke Niwa  <rniwa@webkit.org>
5353         REGRESSION: The arrow indicating the current page doesn't get updated
5354         https://bugs.webkit.org/show_bug.cgi?id=160185
5356         Reviewed by Chris Dumez.
5358         The bug was caused by Heading's render() function not updating the DOM more than once. I don't understand
5359         how this has ever worked. Fixed the bug by rendering DOM whenever the current page has changed.
5361         * public/v3/pages/heading.js:
5362         (Heading):
5363         (Heading.prototype.render):
5365 2016-07-25  Ryosuke Niwa  <rniwa@webkit.org>
5367         Build fix for Safari 9.
5369         * public/v3/models/build-request.js:
5370         (BuildRequest.prototype.waitingTime): Don't use "const" in strict mode.
5372 2016-07-23  Ryosuke Niwa  <rniwa@webkit.org>
5374         Perf dashboard should show the list of a pending A/B testing jobs
5375         https://bugs.webkit.org/show_bug.cgi?id=160138
5377         Rubber-stamped by Chris Dumez.
5379         Add a page to show the list of A/B testing build requests per triggerable. Ideally, we would like to
5380         see a queue per builder but that would require changes to database tables and syncing scripts.
5382         Because this page is most useful when the analysis task with which each build request is associated,
5383         JSON API at /api/build-requests/ has been modified to return the analysis task ID for each request.
5385         Also streamlined the page that shows the list of analysis tasks per Chris' feedback by consolidating
5386         "Bisecting" and "Identified" into "Investigated" and moving the toolbar from the upper left corner
5387         inside the heading to right beneath the heading above the table. Also made the category page serialize
5388         the filter an user had typed in so that reloading the page doesn't clear it.
5390         * public/api/analysis-tasks.php:
5391         (fetch_associated_data_for_tasks): Removed 'category' from the list of columns returned as the notion
5392         of 'category' is only relevant in UI, and it's better computed in the front-end.
5393         (format_task): Ditto.
5394         (determine_category): Deleted.
5396         * public/api/test-groups.php:
5397         (main):
5399         * public/include/build-requests-fetcher.php:
5400         (BuildRequestsFetcher::fetch_for_task): Include the analysis task ID in the rows.
5401         (BuildRequestsFetcher::fetch_for_group): Ditto. Ditto.
5402         (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Ditto.
5403         (BuildRequestsFetcher::results_internal): Ditto.
5405         * public/v3/index.html:
5407         * public/v3/main.js:
5408         (main): Create a newly introduced BuildRequestQueuePage as a subpage of AnalysisCategoryPage.
5410         * public/v3/components/ratio-bar-graph.js:
5411         (RatioBarGraph.prototype.update): Fixed a bogus assertion here. ratio can be any number. The coercion
5412         into [-1, 1] is done inside RatioBarGraph's render() function.
5414         * public/v3/models/analysis-task.js:
5415         (AnalysisTask.prototype.category): Moved the code to compute the analysis task's category from
5416         determine_category in analysis-tasks.php. Also merged "bisecting" and "identified" into "investigated".
5417         (AnalysisTask.categories): Merged "bisecting" and "identified" into "investigated".
5419         * public/v3/models/build-request.js:
5420         (BuildRequest): Remember the triggerable and the analysis task associated with this request as well as
5421         the time at when this request was created.        
5422         (BuildRequest.prototype.analysisTaskId): Added.
5423         (BuildRequest.prototype.statusLabel): Use a shorter label: "Waiting" for "pending" status.
5424         (BuildRequest.prototype.createdAt): Added.
5425         (BuildRequest.prototype.waitingTime): Added. Returns a human readable time duration since the creation
5426         of this build request such as "2 hours 21 minutes" against a reference time.
5427         (BuildRequest.fetchTriggerables): Added.
5428         (BuildRequest.cachedRequestsForTriggerableID): Added. Used when navigating back to 
5430         * public/v3/pages/analysis-category-page.js:
5431         (AnalysisCategoryPage): Construct AnalysisCategoryToolbar and store it in this._categoryToolbar since it
5432         no longer inherits from Toolbar class, which PageWithHeading recognizes and stores.
5433         (AnalysisCategoryPage.prototype.title):
5434         (AnalysisCategoryPage.prototype.serializeState): Added.
5435         (AnalysisCategoryPage.prototype.stateForCategory): Added. Include the filter in the serialization.
5436         (AnalysisCategoryPage.prototype.updateFromSerializedState): Restore the filter from the URL state.
5437         (AnalysisCategoryPage.prototype.filterDidChange): Added. Called by AnalysisCategoryToolbar to update
5438         the URL state in addition to calling render() as done previously via setFilterCallback.
5439         (AnalysisCategoryPage.prototype.render): Always call _categoryToolbar.render() since the hyperlinks for
5440         the category pages now include the filter, which can be updated in each call.
5441         (AnalysisCategoryPage.cssTemplate):
5443         * public/v3/pages/analysis-category-toolbar.js:
5444         (AnalysisCategoryToolbar): Inherits from ComponentBase instead of Toolbar since AnalysisCategoryToolbar
5445         no longer works with Heading class unlike other subclasses of Toolbar class.
5446         (AnalysisCategoryToolbar.prototype.setCategoryPage): Added.
5447         (AnalysisCategoryToolbar.prototype.setFilterCallback): Deleted.
5448         (AnalysisCategoryToolbar.prototype.setFilter): Added. Used to restore from a serialized URL state.
5449         (AnalysisCategoryToolbar.prototype.render): Don't recreate the input element as it clears the value as
5450         well as the selection of the element. Also use AnalysisCategoryPage's stateForCategory to serialize the
5451         category name and the current filter for each hyperlink.
5452         (AnalysisCategoryToolbar.prototype._filterMayHaveChanged): Now takes an boolean argument specifying
5453         whether the URL state should be updated or not. We update the URL only when a change event is fired to
5454         avoid constantly updating it while an user is still typing.
5455         (AnalysisCategoryToolbar.cssTemplate): Added.
5456         (AnalysisCategoryToolbar.htmlTemplate): Added a button to open the newly added queue page.
5458         * public/v3/pages/build-request-queue-page.js:
5459         (BuildRequestQueuePage): Added.
5460         (BuildRequestQueuePage.prototype.routeName): Added.
5461         (BuildRequestQueuePage.prototype.pageTitle): Added.
5462         (BuildRequestQueuePage.prototype.open): Added. Fetch open build requests for every triggerables using
5463         the same API as the syncing scripts.
5464         (BuildRequestQueuePage.prototype.render): Added.
5465         (BuildRequestQueuePage.prototype._constructBuildRequestTable): Added. Construct a table for the list of
5466         pending, scheduled or running build requests in the order syncing scripts would see. Note that the list
5467         of build requests returned by /api/build-requests/* can contain completed, canceled, or failed requests
5468         since the JSON returns all build requests associated with each test group if one of the requests of the
5469         group have not finished. This helps syncing scripts picking the right builder for A/B testing when it
5470         had previously been unloaded or crashed in the middle of processing a test group. This characteristics
5471         of the API actually helps us here because we can reliably compute the total number of build requests in
5472         the group. The first half of this function does this counting as well as collapses all but the first
5473         unfinished build requests into a "contraction" row, which just shows the number of build requests that
5474         are remaining in the group.
5475         (BuildRequestQueuePage.cssTemplate): Added.
5476         (BuildRequestQueuePage.htmlTemplate): Added.
5478         * public/v3/pages/summary-page.js:
5479         (SummaryPage.prototype.open): Use one-day median instead of seven-day median to compute the status.
5480         (SummaryPageConfigurationGroup): Initialize _ratio to NaN. This was causing assertion failures in
5481         RatioBarGraph's update() while measurement sets are being fetched.
5483         * server-tests/api-build-requests-tests.js: Updated the tests per change in BuildRequest's statusLabel.
5484         * unit-tests/analysis-task-tests.js: Ditto.
5485         * unit-tests/test-groups-tests.js: Ditto.
5486         * unit-tests/build-request-tests.js: Added tests for BuildRequest's waitingTime.
5488 2016-07-22  Ryosuke Niwa  <rniwa@webkit.org>
5490         REGRESSION(r203035): Marking points as an outlier no longer updates charts
5491         https://bugs.webkit.org/show_bug.cgi?id=160106
5493         Reviewed by Darin Adler.
5495         The bug was caused by MeasurementSet's fetchBetween clearing previously registered callbacks when noCache
5496         option is specified.
5498         * public/v3/components/time-series-chart.js:
5499         (TimeSeriesChart.prototype.setSourceList): Clear this._fetchedTimeSeries when changing chart options.
5500         e.g. need to start including or excluding outliers.
5501         (TimeSeriesChart.prototype.fetchMeasurementSets): Don't skip the fetching when noCache is true.
5503         * public/v3/models/measurement-set.js:
5504         (MeasurementSet): Added this._callbackMap as an instance variable to keep track of all callbacks on every
5505         cluster since we may need to call each callback multiple times per cluster when noCache option is used.
5506         (MeasurementSet.prototype.fetchBetween): Moved the code to add _primaryClusterPromise to _allFetches here
5507         so that now this function and _ensureClusterPromise are only functions that touch _allFetches.
5508         (MeasurementSet.prototype._ensureClusterPromise): Extracted out of fetchBetween. Queue up all callbacks
5509         for each cluster when creating a new promise.
5510         (MeasurementSet.prototype._fetchPrimaryCluster): Removed the code to add _primaryClusterPromise now that
5511         it's done in fetchBetween.
5513         * public/v3/remote.js:
5514         (RemoteAPI.postJSONWithStatus): Removed superfluous call to console.log.
5516         * unit-tests/measurement-set-tests.js: Updated the test case for noCache. The callback registered before
5517         fetchBetween is called with noCache=true is now invoked so callCount must be 3 instead of 2.
5519 2016-07-19  Ryosuke Niwa  <rniwa@webkit.org>
5521         Perf dashboard always re-generate measurement set JSON
5522         https://bugs.webkit.org/show_bug.cgi?id=159951
5524         Reviewed by Chris Dumez.
5526         The bug was caused by manifest.json reporting the last modified date of a measurement set in floating point,
5527         and a measurement set JSON reporting it as an integer. Fixed the bug by always using an integer.
5529         * public/api/measurement-set.php:
5530         (main): Return 404 when the results is empty.
5531         (MeasurementSetFetcher::execute_query): Use "extract(epoch from commit_time)" like ManifestGenerator to improve
5532         the generation speed. This is ~10% runtime improvement.
5533         (MeasurementSetFetcher::format_map): Updated to reflect the above change.
5534         (MeasurementSetFetcher::parse_revisions_array): Ditto.
5536         * public/include/manifest.php:
5537         (ManifestGenerator::platforms): Fixed the bug by coercing lastModified to integer (instead of float).
5539         * server-tests/api-measurement-set-tests.js: Added a test case for returning empty results, and a test case for
5540         making sure lastModified dates in manifest.json and measurement sets match.
5542         * tools/js/remote.js:
5543         (RemoteAPI.prototype.sendHttpRequest): Reject the promise when HTTP status code is not 200.
5545 2016-07-09  Ryosuke Niwa  <rniwa@webkit.org>
5547         Perf dashboard can consume 50-70% of CPU on MacBook even if user is not interacting at all
5548         https://bugs.webkit.org/show_bug.cgi?id=159597
5550         Reviewed by Chris Dumez.
5552         TimeSeriesChart and InteractiveTimeSeriesChart had been relying on continually polling on requestAnimationFrame
5553         to update itself in response to its canvas resizing. Even though there as an early exit in the case there was
5554         nothing to update, this is still causing a significant power drain when the user is not interacting at all.
5556         Let TimeSeriesChart use the regular top-down render path like other components with exceptions of listening to
5557         window's resize eventas well as when new JSONs are fetched from the server. The render() call to the latter case
5558         will be coerced into a single callback on requestAnimationFrame to avoid DOM-mutation-layout churn.
5560         * public/v3/components/base.js:
5561         (ComponentBase.isElementInViewport): Deleted.
5562         * public/v3/components/chart-pane-base.js:
5563         (ChartPaneBase.prototype.render): Enqueue charts to render.
5564         * public/v3/components/chart-styles.js:
5565         (ChartStyles.dashboardOptions): Removed updateOnRequestAnimationFrame which is no longer an available option.
5566         * public/v3/components/time-series-chart.js:
5567         (TimeSeriesChart): Replaced the code to register itself for rAF by the code to listen to resize events on window.
5568         (TimeSeriesChart._updateOnRAF): Deleted.
5569         (TimeSeriesChart._updateAllCharts): Added.
5570         (TimeSeriesChart.prototype._enqueueToRender): Added.
5571         (TimeSeriesChart._renderEnqueuedCharts): Added.
5572         (TimeSeriesChart.prototype.fetchMeasurementSets): Avoid calling fetchBetween when the range had been fetched.
5573         Without this change, we can incur a significant number of redundant calls to render() when adjusting the domain
5574         in charts page by the slider. When no new JSON is fetched, simply enqueue this chart to render on rAF.
5575         (TimeSeriesChart.prototype._didFetchMeasurementSet): Enqueue this chart to render on rAF.
5576         (TimeSeriesChart.prototype.render): Removed the check for isElementInViewport since we no longer get render() call
5577         when this chart moves into the viewport (as we no longer listen to every rAF or scroll event).
5578         * public/v3/models/measurement-set.js:
5579         (MeasurementSet.prototype.hasFetchedRange): Fixed various bugs revealed by the new use in fetchMeasurementSets.
5580         * public/v3/pages/chart-pane-status-view.js:
5581         (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Removed the dead code. It was probably
5582         copied from when this code was in InteractiveTimeSeries chart. There is no this._forceRender in this component.
5583         * public/v3/pages/dashboard-page.js:
5584         (DashboardPage.prototype.render): Enqueue charts to render. 
5585         * public/v3/pages/heading.js:
5586         (SummaryPage.prototype.open): Removed the call to isElementInViewport. This wasn't really doing anything useful in
5587         this component.
5588         * unit-tests/measurement-set-tests.js: Added tests for hasFetchedRange.
5589         (.waitForMeasurementSet): Moved to be used in a newly added test case.
5591 2016-07-09  Ryosuke Niwa  <rniwa@webkit.org>
5593         REGRESSION: manifest.json generation takes multiple seconds on perf dashboard
5594         https://bugs.webkit.org/show_bug.cgi?id=159596
5596         Reviewed by Chris Dumez.
5598         The most of CPU time was spent looking for a duplicate entry in an array of metrics by array_search.
5599         This patch moves to postgres by using aggregate functions in the query. Also moved the code to convert
5600         datetime to UNIX epoch timestamp from PHP to within postgres query.
5602         These improvements reduce total runtime of Manifest::generate from ~4s to ~350ms on my machine.
5604         * public/include/manifest.php:
5605         (Manifest::generate): No longer fetches test_configurations table as this is done in Manifest::platforms now.
5606         Also moved calls to each method in the class to separate lines for easier instrumentation.
5607         (Manifest::platforms): Group test configurations (current, baseline, target) by platform and metric.
5608         Use the max of the last modified dates in UNIX epoch timestamps (ms to be compatible with JS's representation).
5609         A given platform, metric pair is considered to be in the v1 dashboard if any test configuration is in.
5611 2016-07-08  Ryosuke Niwa  <rniwa@webkit.org>
5613         bundle-v3-scripts.py should compress HTML/CSS templates
5614         https://bugs.webkit.org/show_bug.cgi?id=159582
5616         Reviewed by Joseph Pecoraro.
5618         Strip leading and trailing whitespaces from HTML and CSS templates. This is a 8% progression on the file size.
5620         * Install.md: Updated the list of MIME types to apply deflate for newer versions of Apache.
5621         * tools/bundle-v3-scripts.py:
5622         (main):
5623         (compress_template): Added.
5625 2016-06-13  Ryosuke Niwa  <rniwa@webkit.org>
5627         Build fix. Strip out "use strict" everywhere so that the perf dashboard works on the shipping Safari.
5629         * tools/bundle-v3-scripts.py:
5630         (main):
5632 2016-06-13  Ryosuke Niwa  <rniwa@webkit.org>
5634         Invalid token error when trying to create an A/B analysis for a range
5635         https://bugs.webkit.org/show_bug.cgi?id=158679
5637         Reviewed by Chris Dumez.
5639         The problem in this particular case was due to another website overriding cookies for our subdomain.
5640         Make PrivilegedAPI robust against its token becoming invalid in general to fix the bug since the cookie
5641         is only available under /privileged-api/ and the v3 UI can't access it for security reasons.
5643         This patch factors out PrivilegedAPI out of remote.js so that it can be tested separately in server tests
5644         as well as unit tests even though RemoteAPI itself is implemented differently in each case.
5646         * init-database.sql: Added a forgotten default value "false" to run_marked_outlier.
5647         * public/v3/index.html:
5648         * public/v3/privileged-api.js: Added. Extracted out of public/v3/remote.js.
5649         (PrivilegedAPI.sendRequest): Fixed the bug. When the initial request fails with "InvalidToken" error,
5650         re-generate the token and re-issue the request.
5651         (PrivilegedAPI.requestCSRFToken):
5652         * public/v3/remote.js:
5653         (RemoteAPI.postJSON): Added to match tools/js/remote.js.
5654         (RemoteAPI.postJSONWithStatus): Ditto.
5655         (PrivilegedAPI): Moved to privileged-api.js.
5656         * server-tests/api-measurement-set-tests.js: Removed the unused require for crypto.
5657         * server-tests/privileged-api-upate-run-status.js: Added tests for /privileged-api/update-run-status.
5658         * server-tests/resources/test-server.js:
5659         (TestServer.prototype.inject): Clear the cookies as well as tokens in PrivilegedAPI.
5660         * tools/js/remote.js:
5661         (RemoteAPI): Added the support for PrivilegedAPI by making cookie set by the server persist.
5662         (RemoteAPI.prototype.clearCookies): Added for tests.
5663         (RemoteAPI.prototype.postJSON): Make sure sendHttpRequest always sends a valid JSON.
5664         (RemoteAPI.prototype.postJSONWithStatus): Added since this API is used PrivilegedAPI.
5665         (RemoteAPI.prototype.sendHttpRequest): Retain the cookie set by the server and send it back in each request.
5666         * tools/js/v3-models.js:
5667         * unit-tests/privileged-api-tests.js: Added unit tests for PrivilegedAPI.
5668         * unit-tests/resources/mock-remote-api.js:
5669         (MockRemoteAPI.postJSON): Added for unit testing.
5670         (MockRemoteAPI.postJSONWithStatus): Ditto.
5672 2016-06-13  Ryosuke Niwa  <rniwa@webkit.org>
5674         /admin/tests is very slow
5675         https://bugs.webkit.org/show_bug.cgi?id=158682
5677         Reviewed by Chris Dumez.
5679         The slowness came from TestNameResolver::__construct, which was fetching the entire table of test_configurations,
5680         which at this point contains more than 32,000 rows. Don't fetch the entire table in the constructor. Instead,
5681         fetch a subset of rows as needed in configurations_for_metric_and_platform. Even though this results in many SQL
5682         queries being issued, that's a lot more efficient in practice because we only fetch a few dozen rows in practice.
5684         Also removed a whole bunch of features from /admin/tests to simplify the page. In particular, the ability to update
5685         the list of triggerables has been removed now that sync-buildbot.js automatically updates that for us. This removed
5686         the last use of test_exists_on_platform, which was also dependent on fetching test_configurations upfront.
5688         * public/admin/tests.php:
5689         * public/include/test-name-resolver.php:
5690         (TestNameResolver::__construct): Don't fetch the entire table of test_configurations.
5691         (TestNameResolver::configurations_for_metric_and_platform): Just issue a SQL query for the specified platform and metric.
5692         (TestNameResolver::test_exists_on_platform): Removed.
5694 2016-06-08  Ryosuke Niwa  <rniwa@webkit.org>
5696         sync-buildbot.js should update the list of tests and platforms associated with a triggerable
5697         https://bugs.webkit.org/show_bug.cgi?id=158406
5699         Reviewed by Chris Dumez.
5701         Add /api/update-triggerable and a test for it, which were supposed to be added in r201718
5702         but for which I forgot to run svn add.
5704         * public/api/update-triggerable.php: Added.
5705         (main):
5706         * server-tests/api-update-triggerable.js: Added.
5708 2016-06-07  Ryosuke Niwa  <rniwa@webkit.org>
5710         Build fix after r201739. attachShadow was throwing an exception on this component.
5712         * public/v3/pages/analysis-category-toolbar.js:
5713         (AnalysisCategoryToolbar):
5715 2016-06-06  Ryosuke Niwa  <rniwa@webkit.org>
5717         sync-buildbot.js should update the list of tests and platforms associated with a triggerable
5718         https://bugs.webkit.org/show_bug.cgi?id=158406
5719         <rdar://problem/26185737>
5721         Reviewed by Darin Adler.
5723         Added /api/update-triggerable to update the list of configurations (platform and test pairs)
5724         associated with a given triggerable, and make sync-buildbot.js use this JSON API before each
5725         syncing cycle so that the association gets updated automatically by simply updating the JSON.
5727         * server-tests/api-manifest.js: Use const for imported modules.
5728         * server-tests/api-report-commits-tests.js: Removed unnecessary importing of crypto.
5729         * server-tests/resources/mock-data.js:
5730         (MockData.someTestId): Added.
5731         (MockData.somePlatformId): Added.
5732         (MockData.addMockData):
5733         * server-tests/tools-buildbot-triggerable-tests.js: Use const for imported modules. Also added
5734         a test for BuildbotTriggerable's updateTriggerable.
5735         * tools/js/buildbot-triggerable.js:
5736         (BuildbotTriggerable.prototype.updateTriggerable): Added. Find the list of all configurations
5737         associated with this triggeerable and post it to /api/update-triggerable.
5738         * tools/js/database.js: Added triggerable_configurations to the list of tables.
5739         * tools/js/remote.js:
5740         (RemoteAPI.prototype.postJSON): Print the whole response when JSON parsing fails for debugging.
5741         * tools/sync-buildbot.js:
5742         (syncLoop): Call BuildbotTriggerable's updateTriggerable before syncing.
5744 2016-06-02  Ryosuke Niwa  <rniwa@webkit.org>
5746         Build fix after r201564.
5748         * public/v3/pages/analysis-category-page.js:
5749         (AnalysisCategoryPage.prototype.updateFromSerializedState):
5750         * public/v3/pages/create-analysis-task-page.js:
5751         (CreateAnalysisTaskPage.prototype.updateFromSerializedState):
5752         (CreateAnalysisTaskPage.prototype.render):
5754 2016-05-31  Ryosuke Niwa  <rniwa@webkit.org>
5756         v3 UI should support marking and unmarking outliers as well as hiding them
5757         https://bugs.webkit.org/show_bug.cgi?id=158248
5759         Rubber-stamped by Chris Dumez.
5761         Added the support for marking and unmarking a sequence of points as outliers. Unlike v2, we now support marking
5762         multiple points as outliers in a single click. Also fixed a bug that outliers are never explicitly hidden in v3 UI.
5764         This patch splits ChartStyles.createChartSourceList into two functions: resolveConfiguration and createSourceList
5765         to separate the work of resolving platform and metric IDs to their respective model objects, and creating a source
5766         list used by TimeSeriesChart to fetch measurement sets. createSourceList is called again when filtering options are
5767         changed.
5769         It also adds noCache option to TimeSeriesChart's fetchMeasurementSets, MeasurementSet's fetchBetween and
5770         _fetchPrimaryCluster to update the measurement sets after marking or unmarking points as outliers. In addition, it
5771         fixes a bug that the annotation bars for analysis tasks are not updated in charts page after creating an analysis
5772         task by adding noCache option to ChartPaneBase's fetchAnalysisTasks, AnalysisTask's fetchByPlatformAndMetric and
5773         _fetchSubset.
5775         Finally, this patch splits ChartPane._makeAnchorToOpenPane into _makePopoverActionItem, _makePopoverOpenOnHover and
5776         _setPopoverVisibility for clarity.
5778         * public/v3/components/chart-pane-base.js:
5779         (ChartPaneBase): Added _disableSampling and _showOutliers as instance variables.
5780         (ChartPaneBase.prototype.configure):
5781         (ChartPaneBase.prototype.isSamplingEnabled): Added.
5782         (ChartPaneBase.prototype.setSamplingEnabled): Added. When a filtering option is updated, recreate the source list
5783         so that TimeSeriesChart.setSourceList can re-fetch the measurement set JSONs.
5784         (ChartPaneBase.prototype.isShowingOutliers): Added.
5785         (ChartPaneBase.prototype.setShowOutliers): Added. Ditto for calling _updateSourceList.
5786         (ChartPaneBase.prototype._updateSourceList): Added.
5787         (ChartPaneBase.prototype.fetchAnalysisTasks): Renamed from _fetchAnalysisTasks. Now takes noCache as an argument
5788         instead of platform and metric IDs since they're on instance variables.
5790         * public/v3/components/chart-styles.js:
5791         (ChartStyles.resolveConfiguration): Renamed from createChartSourceList. Just resolves platform and metric IDs.
5792         (ChartStyles.createSourceList): Extracted from createChartSourceList since it needs to be called when a filtering
5793         option is changed as well as when ChartPaneBase.prototype.configure is called.
5794         (ChartStyles.baselineStyle): Now takes filtering options.
5795         (ChartStyles.targetStyle): Ditto.
5796         (ChartStyles.currentStyle): Ditto.
5798         * public/v3/components/interactive-time-series-chart.js:
5799         (InteractiveTimeSeriesChart.prototype.currentPoint): Find the point in _fetchedTimeSeries when
5800         _sampledTimeSeriesData hasn't been computed yet as a fallback (e.g. when the chart hasn't been rendered yet).
5801         (InteractiveTimeSeriesChart.prototype.selectedPoints): Added.
5802         (InteractiveTimeSeriesChart.prototype.firstSelectedPoint): Added.
5803         (InteractiveTimeSeriesChart.prototype.lockedIndicator): Added. Returns the current point if it's locked.
5805         * public/v3/components/time-series-chart.js:
5806         (TimeSeriesChart.prototype.setDomain):
5807         (TimeSeriesChart.prototype.setSourceList): Added. Re-create _fetchedTimeSeries when filtering options have changed.
5808         Don't re-fetch measurement set JSONs here since showing outliers can be done entirely in the front end.
5809         (TimeSeriesChart.prototype.fetchMeasurementSets): Extracted out of setDomain. Now takes noCache as an argument.
5810         ChartPane._markAsOutlier
5811         (TimeSeriesChart.prototype.firstSampledPointBetweenTime): Added.
5813         * public/v3/models/analysis-task.js:
5814         (AnalysisTask.fetchByPlatformAndMetric): Added noCache as an argument.
5815         (AnalysisTask._fetchSubset): Ditto.
5817         * public/v3/models/measurement-adaptor.js:
5818         (MeasurementAdaptor.prototype.isOutlier): Added.
5819         (MeasurementAdaptor.prototype.applyToAnalysisResults): Add markedOutlier as a property on each point.
5821         * public/v3/models/measurement-cluster.js:
5822         (MeasurementCluster.prototype.addToSeries): Fixed the bug that filtering outliers was broken as _markedOutlierIndex
5823         is undefined here. Use MeasurementAdaptor's isOutlier instead.
5825         * public/v3/models/measurement-set.js:
5826         (MeasurementSet.prototype.fetchBetween): Added noCache as an argument. Reset _primaryClusterPromise and _allFetches
5827         when noCache is true since we need to re-fetch the primary cluster as well as all secondary clusters now.
5828         (MeasurementSet.prototype._fetchPrimaryCluster): Added noCache as an argument. Directly invoke the JSON API at
5829         /api/measurement-set to re-generate all clusters' JSON files instead of first fetching the cached version.
5830         (MeasurementSet.prototype._fetchSecondaryCluster):
5831         (MeasurementSet.prototype._didFetchJSON): Removed a bogus assertion since this function is called on secondary
5832         clusters as well as primary clusters.
5833         (MeasurementSet.prototype._addFetchedCluster): Reimplemented this function using an insertion sort. Also remove the
5834         existing entry if the fetch cluster should replace it.
5836         * public/v3/models/time-series.js:
5837         (TimeSeries.prototype.dataBetweenPoints): Removed the dead code to filter out outliers. This is done in addToSeries
5838         of MeasurementCluster instead.
5840         * public/v3/pages/chart-pane.js:
5841         (ChartPane): Renamed pane to popover since it was confusing to have a pane inside a pane class. As such, renamed
5842         _paneOpenedByClick to _lockedPopover.
5843         (ChartPane.prototype.serializeState): Added the code to serialize filtering options in the serialized state URL.
5844         (ChartPane.prototype.updateFromSerializedState): Ditto for parsing.
5845         (ChartPane.prototype._analyzeRange): Extracted out of render(). Also fixed a bug that the charts page don't show
5846         the newly created analysis task by invoking fetchAnalysisTasks with noCache set to true.
5847         (ChartPane.prototype._markAsOutlier): Added.
5848         (ChartPane.prototype._renderActionToolbar): A bunch of changes due to pane -> popover rename. Also added a popover
5849         for filtering options.
5850         (ChartPane.prototype._makePopoverActionItem): Extracted from _makeAnchorToOpenPane.
5851         (ChartPane.prototype._makePopoverOpenOnHover): Ditto.
5852         (ChartPane.prototype._setPopoverVisibility): Ditto.
5853         (ChartPane.prototype._renderFilteringPopover): Added.
5854         (ChartPane.htmlTemplate): Added a popover for specifying filtering options. Also added .popover on each popover.
5855         (ChartPane.cssTemplate): Updated the style to make use of .popover.
5857         * public/v3/pages/charts-page.js:
5858         (ChartsPage.prototype.graphOptionsDidChange): Added. Updates the URL state when a filtering option is modified.
5860         * public/v3/pages/dashboard-page.js:
5861         (DashboardPage.prototype._createChartForCell):
5863         * public/v3/pages/page-router.js:
5864         (PageRouter.prototype._serializeHashQueryValue): Serialize a set of strings as | separated tokens.
5865         (PageRouter.prototype._deserializeHashQueryValue): Rewrote the function as the serialized URL can no longer be
5866         parsed as a JSON as | separated tokens can't be converted into a valid JSON construct with a simple regex.
5868         * unit-tests/measurement-set-tests.js: Added a test case for fetchBetween with noCache=true.
5870 2016-05-24  Ryosuke Niwa  <rniwa@webkit.org>
5872         Another build fix after r201307.
5874         * public/v3/pages/page-router.js:
5875         (PageRouter.prototype._deserializeHashQueryValue):
5876         (PageRouter.prototype._countOccurrences): Moved from _deserializeHashQueryValue.
5878 2016-05-23  Ryosuke Niwa  <rniwa@webkit.org>
5880         Build fix after r201307.
5882         * public/v3/pages/chart-pane.js:
5883         (ChartPane.prototype.serializeState):
5885 2016-05-23  Ryosuke Niwa  <rniwa@webkit.org>
5887         Some applications truncates the last closing parenthesis in perf dashboard URL
5888         https://bugs.webkit.org/show_bug.cgi?id=157976
5890         Reviewed by Tim Horton.
5892         Unfortunately, different applications use different heuristics to determine the end of each URL. Two trailing
5893         parentheses, for example, is just fine in Radar as well as Apple Mail if the URL is short enough. Using other
5894         characters such as ] and } wouldn't work either because they would be %-escaped. At that point, we might as well
5895         as %-escape everything.
5897         Work around the bug by parsing the URL as if it had one extra ')' if the parsing had failed. Also shorten the charts
5898         page's URL by avoid emitting "-null" for each pane when the pane doesn't have a currently selected point or selection.
5899         This improves the odds of the entire URL being recognized by various applications.
5901         We could, in theory, implement some sort of a URL shorter but that can wait until when we support real user accounts.
5903         * public/v3/pages/chart-pane.js:
5904         (ChartPane.prototype.serializeState): Don't serialize the selection or the current point if nothing is selected.
5905         * public/v3/pages/page-router.js:
5906         (PageRouter.prototype._deserializeHashQueryValue): Try parsing the value again with one extra ] at the end if
5907         the JSON parsing had failed.
5909 2016-05-18  Ryosuke Niwa  <rniwa@webkit.org>
5911         Perf dashboard "Add pane" should list first by test, then by machine
5912         https://bugs.webkit.org/show_bug.cgi?id=157880
5914         Reviewed by Stephanie Lewis.
5916         Reversed the order which tests and platforms are selected. Also split .pane-selector-container into #tests and
5917         #platform for the ease of DOM node manipulations.
5919         * public/v3/components/pane-selector.js:
5920         (PaneSelector):
5921         (PaneSelector.prototype._renderPlatformList): Renamed from _renderPlatformLists since there is a single list
5922         for platforms. This list now disappears while a non-metric item is selected in the collection of test lists.
5923         e.g. "Speedometer" instead of its "Score" metric. Remember the last metric we rendered to avoid churning.
5924         (PaneSelector.prototype._renderTestLists): Render the top level tests once. The index of lists have been
5925         decreased by one since test lists are now inside #tests instead of appearing after the platform list.
5926         (PaneSelector.prototype._buildTestList): Don't filter tests since platform is chosen after tests now.
5927         (PaneSelector.prototype._replaceList):
5928         (PaneSelector.prototype._selectedItem): Don't reset the test path (specifies which subtest or metric is picked)
5929         when a platform is selected since it happens after a test metric is chosen now.
5930         (PaneSelector.prototype._clickedItem): Add a pane when a platform is clicked, not when a metric is clicked.
5931         (PaneSelector.cssTemplate):
5933 2016-05-18  Ryosuke Niwa  <rniwa@webkit.org>
5935         Analysis task should look for a git commit based on abridged hashes
5936         https://bugs.webkit.org/show_bug.cgi?id=157877
5937         <rdar://problem/26254374>
5939         Reviewed by Chris Dumez.
5941         Made /privileged-api/associate-commit look for commits using LIKE instead of an exact match.
5942         Associate the commit when there is exactly one match.
5944         * public/include/commit-log-fetcher.php:
5945         (CommitLogFetcher::fetch_between):
5946         * public/include/db.php:
5947         (Database::escape_for_like): Extracted from CommitLogFetcher::fetch_between.
5948         * public/privileged-api/associate-commit.php:
5949         (main): Look for the commits using LIKE. Reject whenever there are multiple commits. We limit the number of
5950         matches to two for performance when the user specifies something that almost thousands of commits: e.g. "1".
5951         * public/v3/pages/analysis-task-page.js:
5952         (AnalysisTaskPage.prototype._associateCommit): Added human friendly error messages for mismatching commits.
5954 2016-05-18  Ryosuke Niwa  <rniwa@webkit.org>
5956         Unreviewed build fix. Use --date-order so that every child commit appears after its parent.
5957         Otherwise we'll hit a FailedToFindParentCommit error while submitting a commit that appears before its parent.
5959         * tools/sync-commits.py:
5960         (GitRepository._fetch_all_hashes):
5962 2016-05-18  Ryosuke Niwa  <rniwa@webkit.org>
5964         Removed the erroneously committed debug code.
5966         * tools/sync-commits.py:
5967         (GitRepository.fetch_commit):
5969 2016-05-18  Ryosuke Niwa  <rniwa@webkit.org>
5971         Perf dashboard should have a script to sync git commits
5972         https://bugs.webkit.org/show_bug.cgi?id=157867
5974         Reviewed by Chris Dumez.
5976         Added the support to pull from a Git repo to pull-svn.py and renamed it to sync-commits.py.
5978         Added two classes SVNRepository and GitRepository which inherits from an abstract class, Repository.
5979         The code that fetches commit and format revision number / git hash is specialized in each.
5981         * Install.md:
5982         * tools/pull-svn.py: Removed.
5983         * tools/sync-commits.py: Renamed from Websites/perf.webkit.org/tools/pull-svn.py.
5984         (main): Renamed --svn-config-json to --repository-config-json. Also made it robust against exceptions
5985         inside fetch_commits_and_submit of each Repository class.
5986         (load_repository): A factory function for SVNRepository and GitRepository.
5987         (Repository): Added.
5988         (Repository.__init__): Added.
5989         (Repository.fetch_commits_and_submit): Extracted from standalone fetch_commits_and_submit.
5990         (Repository.fetch_commit): Added. Implemented by a subclass.
5991         (Repository.format_revision): Ditto.
5992         (Repository.determine_last_reported_revision): Extracted from alonealone
5993         determine_first_revision_to_fetch. The fallback to use "oldest" has been moved to SVNRepository's
5994         fetch_commit since it doesn't work in Git.
5995         (Repository.fetch_revision_from_dasbhoard): Extracted from fetch_revision_from_dasbhoard.
5996         (SVNRepository): Added.
5997         (SVNRepository.__init__): Added.
5998         (SVNRepository.fetch_commit): Extracted from standalone fetch_commit_and_resolve_author and fetch_commit.
5999         (SVNRepository._resolve_author_name): Renamed from resolve_author_name_from_account.
6000         (SVNRepository.format_revision): Added.
6001         (GitRepository): Added.
6002         (GitRepository.__init__):
6003         (GitRepository.fetch_commit): Added. Fetches the list of all git hashes if needed, and finds the next hash.
6004         (GitRepository._find_next_hash): Added. Finds the first commit that appears after the specified hash.
6005         (GitRepository._fetch_all_hashes): Added. Gets the list of all git hashs chronologically (old to new).
6006         (GitRepository._run_git_command): Added.
6007         (GitRepository.format_revision): Added. Use the first 8 characters of the hash.
6009 2016-05-17  Ryosuke Niwa  <rniwa@webkit.org>
6011         Add a subtitle under platform name in the summary page
6012         https://bugs.webkit.org/show_bug.cgi?id=157809
6014         Reviewed by Chris Dumez.
6016         Add a description beneath the platform names.
6018         * public/v3/pages/summary-page.js:
6019         (SummaryPage.prototype._constructTable): Add a br and a span if subtitle is present.
6020         (SummaryPage.cssTemplate): Added CSS rules for .subtitle.
6022 2016-05-13  Ryosuke Niwa  <rniwa@webkit.org>
6024         v3 UI shows full git hash instead of the first 8 characters for a blame range
6025         https://bugs.webkit.org/show_bug.cgi?id=157691
6027         Reviewed by Stephanie Lewis.
6029         Fixed the bug that v3 UI shows the full 40 character git hash instead of the first 8 character as done in v2 UI.
6031         * public/v3/models/commit-log.js:
6032         (CommitLog.prototype.diff): Fixed the bug.
6033         * tools/run-tests.py:
6034         (main): Add the support for running a subset of tests as mocha does.
6035         * unit-tests/commit-log-tests.js: Added.
6037 2016-05-13  Ryosuke Niwa  <rniwa@webkit.org>
6039         Unreviewed. Added the missing executable bits.
6041         * tools/bundle-v3-scripts.py: Added property svn:executable.
6042         * tools/detect-changes.js: Added property svn:executable.
6043         * tools/process-maintenance-backlog.py: Added property svn:executable.
6045 2016-05-13  Ryosuke Niwa  <rniwa@webkit.org>
6047         Summary page doesn't report some missing platforms
6048         https://bugs.webkit.org/show_bug.cgi?id=157670
6050         Reviewed by Darin Adler.
6052         This patch improves the warning text for missing platforms and fixes the bug that platforms that don't have
6053         any data reported for a given test would not be reported as missing.
6055         * public/v3/pages/summary-page.js:
6056         (SummaryPage.prototype.render): Added instrumentations.
6057         (SummaryPage.prototype._constructRatioGraph): Always create both the ratio bar graph and the spinner icon.
6058         (SummaryPage.prototype._renderCell): Extracted from _constructRatioGraph. Toggle the displayed-ness of the
6059         spinner and the ratio bar graph in the cell by CSS for better performance.
6060         (SummaryPage.prototype._warningTextForGroup): Extracted from _constructRatioGraph. Rephrased warning text
6061         for clarity and adopted new API of SummaryPageConfigurationGroup.
6062         (SummaryPage.prototype._warningTextForGroup.mapAndSortByName): Added.
6063         (SummaryPage.prototype._warningTextForGroup.pluralizeIfNeeded): Added.
6064         (SummaryPage.cssTemplate): Added rules to toggle the visibility of spinner icons and bar graphs.
6065         (SummaryPageConfigurationGroup): Replaced this._warnings by more explicitly named this._missingPlatforms
6066         and this._platformsWithoutBaseline. Also add a platform to this._missingPlatforms if it didn't appear in
6067         any metrics. Note that adding a platform whenever it doesn't in any one metric would be incorrect since
6068         some tests uses a different test name on different platforms: e.g. PLT-Mac and PLT-iPhone.
6069         (SummaryPageConfigurationGroup.prototype.missingPlatforms): Added.
6070         (SummaryPageConfigurationGroup.prototype.platformsWithoutBaseline): Added.
6071         (SummaryPageConfigurationGroup.prototype._fetchAndComputeRatio):
6073 2016-05-13  Ryosuke Niwa  <rniwa@webkit.org>
6075         Always use v3 UI for dashboards and analysis task pages
6076         https://bugs.webkit.org/show_bug.cgi?id=157647
6078         Reviewed by Darin Adler.
6080         Redirect dashboard pages from v1 and v2 to v3's summary page. Also redirect v1 UI's charts page and v2 UI's
6081         analysis task pages to the corresponding v3 pages.
6083         Keep v2's charts page accessible since some features such as segmentation is still only available on v2 UI.
6085         * public/index.html:
6086         (init.showCharts): Redirect to v3 UI once the chart list has been parsed.
6087         (init.redirectChartsToV3): Added.
6088         * public/v2/index.html:
6090 2016-05-13  Ryosuke Niwa  <rniwa@webkit.org>
6092         Show a spinner while fetching data on summary page
6093         https://bugs.webkit.org/show_bug.cgi?id=157658
6095         Reviewed by Darin Adler.
6097         Show a spinner while fetching JSON files on the summary page.
6099         * public/v3/components/base.js:
6100         (ComponentBase.prototype.renderReplace): Added a new implementation that simply calls the static version.
6101         (ComponentBase.renderReplace): Made this static.
6103         * public/v3/pages/summary-page.js:
6104         (SummaryPage.prototype._constructRatioGraph): Show a spinner icon when SummaryPageConfigurationGroup's
6105         isFetching returns true.
6106         (SummaryPage.cssTemplate): Force the height of each cell to be 2.5rem so that the height of cell doesn't
6107         change when a spinner is replaced by a ratio bar graph.
6109         (SummaryPageConfigurationGroup): Added this._isFetching as an instance variable.
6110         (SummaryPageConfigurationGroup.prototype.isFetching): Added.
6111         (SummaryPageConfigurationGroup.prototype.fetchAndComputeSummary): Set this._isFetching while waiting for
6112         the promises to resolve after 50ms. We don't immediately set this._isFetching to avoid FOC when all JSON
6113         files have been cached.
6115 2016-05-07  Ryosuke Niwa  <rniwa@webkit.org>
6117         Add horizontal between categories of tests
6118         https://bugs.webkit.org/show_bug.cgi?id=157386
6120         Reviewed by Darin Adler.
6122         Wrap tests in each category by tbody and add a horizontal bar between each category.
6124         * public/v3/pages/summary-page.js:
6125         (SummaryPage.prototype._constructTable):
6126         (SummaryPage.cssTemplate):
6128 2016-05-04  Dewei Zhu  <dewei_zhu@apple.com>
6130         Summary page should show warnings when current or baseline data is missing.
6131         https://bugs.webkit.org/show_bug.cgi?id=157339
6133         Reviewed by Ryosuke Niwa.
6135         Set summary page to be the default page of v3 UI.
6136         Show warning icon when either baseline or current data is missing.
6137         Make fetchBetween returns a promise.
6138         Update unit tests for MeasurementSet.fetchBetween since it returns a promise now.
6139         Add a workaround to skip some platform and metric configurations.
6141         * public/v3/components/ratio-bar-graph.js:
6142         (RatioBarGraph):
6143         (RatioBarGraph.prototype.update): Add showWarningIcon flag to indicate whether we should show warning icon.
6144         (RatioBarGraph.prototype.render): Show warning icon when showWarningIcon is true.
6145         (RatioBarGraph.cssTemplate): Add style for warning icon.
6146         * public/v3/components/warning-icon.js: Add warning icon.
6147         (WarningIcon):
6148         (WarningIcon.cssTemplate):
6149         * public/v3/index.html:
6150         * public/v3/main.js:
6151         (main): Set summary page to be the default page of v3 UI.
6152         * public/v3/models/measurement-set.js:
6153         (MeasurementSet):
6154         (MeasurementSet.prototype.fetchBetween): Returns a promise. Fix the bug in previous implementation that we miss
6155         some callbacks sometimes. Basically, we will fetch primary cluster first, then secondary clusters. For each
6156         secondary cluster fetch, we will always invoke callback even when it fails.
6157         (MeasurementSet.prototype._fetchSecondaryClusters): Deleted.
6158         (MeasurementSet.prototype._fetch.else.url.api.measurement.set platform): Deleted.
6159         * public/v3/pages/summary-page.js:
6160         (SummaryPage): Add a variable for excluded configurations.
6161         (SummaryPage.prototype._createConfigurationGroup): Pass excluded configurations while building config groups.
6162         (SummaryPage.prototype._constructTable): Remove the logic for unified header since it breaks consistency of the table appearance.
6163         (SummaryPage.prototype.this._renderQueue.push): Show warning message when baseline/current data is missing.
6164         (SummaryPageConfigurationGroup): Add a variable to keep track of the warnings while computing summary.
6165         (SummaryPageConfigurationGroup.prototype.warnings): A getter for warnings.
6166         (SummaryPageConfigurationGroup._computeSummary): Fix a bug in calculating ratios. We should always use
6167         current/baseline for ratio and present the difference between ratio and 1 in the summary page.
6168         (SummaryPageConfigurationGroup.set then): Deleted.
6169         (SummaryPageConfigurationGroup.set var): Deleted.
6170         * unit-tests/measurement-set-tests.js: Add a helper function to wait for fetchBetween. Update unit tests since fetchBetween returns a promise now.
6171         (promise.set fetchBetween):
6172         (set MeasurementSet):
6173         (set fetchBetween): Deleted.
6175 2016-04-26  Ryosuke Niwa  <rniwa@webkit.org>
6177         Chart status should always be computed against prior values
6178         https://bugs.webkit.org/show_bug.cgi?id=157014
6180         Reviewed by Darin Adler.
6182         Compare the current value against the last baseline or target value that appear before the current value in time
6183         so that the comparison stay the same even when new baseline and target values are reported. Also include the compared
6184         baseline or target value in the label for clarity.
6186         * public/v3/components/chart-status-view.js:
6187         (ChartStatusView.prototype._computeChartStatus):
6188         (ChartStatusView.prototype._computeChartStatus.labelForDiff):
6189         (ChartStatusView.prototype._findLastPointPriorToTime): Extracted from _relativeDifferenceToLaterPointInTimeSeries.
6190         Now finds the last point before the current point's time if there is any, or the last point in baseline / target.
6191         (ChartStatusView.prototype._relativeDifferenceToLaterPointInTimeSeries): Deleted.
6192         * public/v3/models/metric.js:
6193         (Metric.prototype.makeFormatter): Don't use SI units for unit-less metrics.
6195 2016-04-13  Ryosuke Niwa  <rniwa@webkit.org>
6197         REGRESSION(r199444): Perf dashboard always fetches all measurement sets
6198         https://bugs.webkit.org/show_bug.cgi?id=156534
6200         Reviewed by Darin Adler.
6202         The bug was cased by SummaryPage's constructor fetching all measurement sets. Since each page is always
6203         constructed in main(), this resulted in all measurement sets being fetched on all pages.
6205         * public/v3/pages/summary-page.js:
6206         (SummaryPage):
6207         (SummaryPage.prototype.open): Fetch measurement set JSONs here.
6208         (SummaryPage.prototype._createConfigurationGroup): Renamed from _createConfigurationGroupAndStartFetchingData.
6210 2016-04-12  Ryosuke Niwa  <rniwa@webkit.org>
6212         Add a summary page to v3 UI
6213         https://bugs.webkit.org/show_bug.cgi?id=156531
6215         Reviewed by Stephanie Lewis.
6217         Add new "Summary" page, which shows the average difference (better or worse) from the baseline across
6218         multiple platforms and tests by a single number.
6220         * public/include/manifest.php:
6221         (ManifestGenerator::generate): Include "summary" in manifest.json.
6222         * public/shared/statistics.js:
6223         (Statistics.mean): Added.
6224         (Statistics.median): Added.
6225         * public/v3/components/ratio-bar-graph.js: Added.
6226         (RatioBarGraph): Shows a horizontal bar graph that visualizes the relative difference (e.g. 3% better).
6227         (RatioBarGraph.prototype.update):
6228         (RatioBarGraph.prototype.render):
6229         (RatioBarGraph.cssTemplate):
6230         (RatioBarGraph.htmlTemplate):
6231         * public/v3/index.html:
6232         * public/v3/main.js:
6233         (main): Instantiate SummaryPage and add it to the navigation bar and the router.
6234         * public/v3/models/manifest.js:
6235         (Manifest._didFetchManifest): Let "summary" pass through from manifest.json to main().
6236         * public/v3/models/measurement-set.js:
6237         (MeasurementSet.prototype._failedToFetchJSON): Invoke the callback with an error or true in order for
6238         the callback can detect a failure.
6239         (MeasurementSet.prototype._invokeCallbacks): Ditto.
6240         * public/v3/pages/charts-page.js:
6241         (ChartsPage.createStateForConfigurationList): Added to add a hyperlink from summary page to charts page.
6242         * public/v3/pages/summary-page.js: Added.
6243         (SummaryPage): Added.
6244         (SummaryPage.prototype.routeName): Added.
6245         (SummaryPage.prototype.open): Added.
6246         (SummaryPage.prototype.render): Added.
6247         (SummaryPage.prototype._createConfigurationGroupAndStartFetchingData): Added.
6248         (SummaryPage.prototype._constructTable): Added.
6249         (SummaryPage.prototype._constructRatioGraph): Added.
6250         (SummaryPage.htmlTemplate): Added.
6251         (SummaryPage.cssTemplate): Added.
6252         (SummaryPageConfigurationGroup): Added. Represents a set of platforms and tests shown in a single cell.
6253         (SummaryPageConfigurationGroup.prototype.ratio): Added.
6254         (SummaryPageConfigurationGroup.prototype.label): Added.
6255         (SummaryPageConfigurationGroup.prototype.changeType): Added.
6256         (SummaryPageConfigurationGroup.prototype.configurationList): Added.
6257         (SummaryPageConfigurationGroup.prototype.fetchAndComputeSummary): Added.
6258         (SummaryPageConfigurationGroup.prototype._computeSummary): Added.
6259         (SummaryPageConfigurationGroup.prototype._fetchAndComputeRatio): Added. Invoked for each time series in
6260         the set, and stores the computed ratio of the current values to the baseline in this._setToRatio.
6261         The results are aggregated by _computeSummary as a single number later.
6262         (SummaryPageConfigurationGroup._medianForTimeRange): Added.
6263         (SummaryPageConfigurationGroup._fetchData): A thin wrapper to make MeasurementSet.fetchBetween promise
6264         friendly since MeasurementSet doesn't support Promise at the moment (but it should!).
6265         * server-tests/api-manifest.js: Updated a test case.
6267 2016-04-12  Ryosuke Niwa  <rniwa@webkit.org>
6269         Make sync-buildbot.js fault safe
6270         https://bugs.webkit.org/show_bug.cgi?id=156498
6272         Reviewed by Chris Dumez.
6274         Fixed a bug that sync-buildbot.js will continue to schedule build requests from multiple test groups
6275         if multiple test groups are simultaneously in-progress on the same builder. Also fixed a bug that if
6276         a build request had failed without leaving a trace (i.e. no entry on any of the builders we know of),
6277         sync-buildbot.js throws an exception.
6279         * server-tests/tools-buildbot-triggerable-tests.js: Added test cases.
6280         * tools/js/buildbot-syncer.js:
6281         (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Renamed. Optionally takes the slave name.
6282         When this parameter is specified, schedule the request only if the specified slave is available.
6283         * tools/js/buildbot-triggerable.js:
6284         (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Always use
6285         scheduleRequestInGroupIfAvailable to schedule a new build request. Using scheduleRequest for non-first
6286         build requests was problematic when there were multiple test groups with pending requests because then
6287         we would schedule those pending requests without checking whether there is already a pending job or if
6288         we have previously scheduled a job. Also fallback to use any syncer / builder when groupInfo.syncer is
6289         not set even if the next request was not the first one in the test group since we can't determine on
6290         which builder preceding requests are processed in such cases.
6291         * unit-tests/buildbot-syncer-tests.js:
6293 2016-04-11  Ryosuke Niwa  <rniwa@webkit.org>
6295         Replace script runner to use mocha.js tests
6296         https://bugs.webkit.org/show_bug.cgi?id=156490
6298         Reviewed by Chris Dumez.
6300         Replaced run-tests.js, which was a whole test harness for running legacy tests by tools/run-tests.py
6301         which is a thin wrapper around mocha.js.
6303         * run-tests.js: Removed.
6304         * tests: Removed.
6305         * tools/run-tests.py: Added.
6306         (main):
6308 2016-04-11  Ryosuke Niwa  <rniwa@webkit.org>
6310         New syncing script sometimes schedules a build request on a wrong builder
6311         https://bugs.webkit.org/show_bug.cgi?id=156489
6313         Reviewed by Stephanie Lewis.
6315         The bug was caused by _scheduleNextRequestInGroupIfSlaveIsAvailable scheduling the next build request on
6316         any available syncer regardless of whether the request is the first one in the test group or not because
6317         BuildRequest.order was returning a string instead of a number.
6319         Also fixed a bug that BuildbotTriggerable.syncOnce was re-ordering test groups by their id's instead of
6320         respecting the order in which the perf dashboard returned.
6322         * public/v3/models/build-request.js:
6323         (BuildRequest.prototype.order): Force the order to be a number.
6324         * server-tests/api-build-requests-tests.js: Assert the order as numbers.
6325         * server-tests/resources/mock-data.js:
6326         (MockData.addAnotherMockTestGroup): Changed the test group id to 601, which is after the first mock data.
6327         The old number was masking a bug in BuildbotTriggerable that it was re-ordering test groups by their id's
6328         instead of using the order set forth by the perf dashboard.
6329         (MockData.mockTestSyncConfigWithSingleBuilder):
6330         * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for scheduling two build requests in
6331         a single call to syncOnce. Each build request should be scheduled on the same builder as the previous build
6332         requests in the same test group.
6333         * tools/js/buildbot-triggerable.js:
6334         (BuildbotTriggerable.prototype.syncOnce): Order test groups by groupOrder, which is the index at which first
6335         build request in the group appeared.
6336         (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Don't re-order build requests
6337         as they're already sorted on the server side.
6338         (BuildbotTriggerable._testGroupMapForBuildRequests): Added groupOrder to test group info 
6340 2016-04-09  Ryosuke Niwa  <rniwa@webkit.org>
6342         Build fix. Don't treat a build number 0 as a pending build.
6344         * tools/js/buildbot-syncer.js:
6345         (BuildbotBuildEntry.prototype.isPending):
6347 2016-04-08  Ryosuke Niwa  <rniwa@webkit.org>
6349         Escape builder names in url* and pathFor* methods of BuildbotSyncer
6350         https://bugs.webkit.org/show_bug.cgi?id=156427
6352         Reviewed by Darin Adler.
6354         The build fix in r199251 breaks other usage of RemoteAPI. Fix it properly by escaping builder names in
6355         various methods of BuildbotSyncer.
6357         Also fixed a typo in the logging and a bug that the new syncing script never updated "scheduled" to "running".
6359         * server-tests/resources/mock-data.js:
6360         (MockData.mockTestSyncConfigWithTwoBuilders): Renamed "some-builder-2" to "some builder 2" to test the
6361         new escaping behavior in tools-buildbot-triggerable-tests.js and buildbot-syncer-tests.js.
6363         * server-tests/tools-buildbot-triggerable-tests.js: Added tests for status url, and added a new test case
6364         for updating "scheduled" to "running".
6366         * tools/js/buildbot-syncer.js:
6367         (BuildbotBuildEntry.buildRequestStatusIfUpdateIsNeeded): Update the status to "running" when the request's
6368         status is "scheduled" and the buildbot's build is currently in progress.
6369         (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Escape the builder name.
6370         (BuildbotSyncer.prototype.pathForBuildJSON): Ditto.
6371         (BuildbotSyncer.prototype.pathForForceBuild): Ditto.
6372         (BuildbotSyncer.prototype.url): Ditto.
6373         (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
6375         * tools/js/buildbot-triggerable.js:
6376         (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers):
6377         (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Fixed a typo. We are
6378         scheduling new build requests, not syncing them.
6379         * tools/js/remote.js:
6380         (RemoteAPI.sendHttpRequest): Reverted r199251.
6381         * unit-tests/buildbot-syncer-tests.js:
6383 2016-04-08  Ryosuke Niwa  <rniwa@webkit.org>
6385         Build fix. We need to escape the path or http.request would fail.
6387         * tools/js/remote.js:
6389 2016-04-08  Ryosuke Niwa  <rniwa@webkit.org>
6391         Fix various bugs in the new syncing script
6392         https://bugs.webkit.org/show_bug.cgi?id=156393
6394         Reviewed by Darin Adler.
6396         * server-tests/resources/common-operations.js: Added. This file was supposed to be added in r199191.
6397         (addBuilderForReport):
6398         (addSlaveForReport):
6399         (connectToDatabaseInEveryTest):
6400         (submitReport):
6401         * tools/js/buildbot-triggerable.js:
6402         (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Don't log every time we pull from buildbot
6403         builder as this dramatically increases the amount of log we generate.
6404         * tools/js/parse-arguments.js:
6405         (parseArguments): Fixed a typo. This should be parseArgument*s*, not parseArgument.
6406         * tools/js/remote.js:
6407         (RemoteAPI.prototype.url): Fixed a bug that portSuffix wasn't being expanded in the template literal.
6408         (RemoteAPI.prototype.configure): Added more validations with nice error messages.
6409         (RemoteAPI.prototype.sendHttpRequest): Falling back to port 80 isn't right when scheme is https. Compute
6410         the right port in configure instead based on the scheme.
6411         * tools/sync-buildbot.js:
6412         (syncLoop): Fixed the bug that syncing multiple times fail because Manifest.fetch() create new Platform
6413         and Test objects. This results in various references in BuildRequest objects to get outdated. Fixing this
6414         properly in Manifest.fetch() because we do need to "forget" about some tests and platforms in some cases.
6415         For now, delete all v3 model objects and start over in each syncing cycle.
6416         * unit-tests/tools-js-remote-tests.js: Added. Unit tests for the aforementioned changes to RemoteAPI.
6418 2016-04-07  Ryosuke Niwa  <rniwa@webkit.org>
6420         sync-buildbot.js doesn't mark disappeared builds as failed
6421         https://bugs.webkit.org/show_bug.cgi?id=156386
6423         Reviewed by Chris Dumez.
6425         Fix a bug that new syncing script doesn't mark builds that it scheduled but doesn't appear when queried
6426         by buildbot's JSON API. These are builds that got canceled by humans (e.g. buildbot was restarted, data
6427         loss, pending build was canceled, etc...)
6429         * server-tests/tools-buildbot-triggerable-tests.js: Added a test case.
6430         * tools/js/buildbot-triggerable.js:
6431         (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added a set of build requests we've matched
6432         against BuildbotBuildEntry's. Mark build requests that didn't have any entry but supposed to be in either
6433         'scheduled' or 'running' status as failed.
6435 2016-04-07  Ryosuke Niwa  <rniwa@webkit.org>
6437         A/B testing bots should prioritize user created test groups
6438         https://bugs.webkit.org/show_bug.cgi?id=156375
6440         Reviewed by Chris Dumez.
6442         Order build requests preferring user created ones over ones automatically created by detect-changes.js.
6444         Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new
6445         build request on a builder/slave even when we had previously scheduled another build request.
6447         * public/include/build-requests-fetcher.php:
6448         (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on
6449         author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js.
6450         Since we're using ascending order, this would put user created test groups first.
6451         * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case
6452         for testing that build requests for an user created test group shows up first.
6453         * server-tests/resources/mock-data.js:
6454         (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name.
6455         * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests
6456         for an user created test group shows up first.
6457         * tools/js/buildbot-syncer.js:
6458         (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already
6459         scheduled new build requests. Don't schedule more requests on these slaves.
6460         (BuildbotSyncer.prototype.scheduleRequest):
6461         (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null
6462         when slaveList is not specified) to _slavesWithNewRequests.
6463         (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request
6464         we have previously scheduled should be included in one of the entires now.
6465         * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug.
6466         (sampleiOSConfig): Added a second slave for new test cases.
6468 2016-04-07  Ryosuke Niwa  <rniwa@webkit.org>
6470         Migrate legacy perf dashboard tests to mocha.js based tests
6471         https://bugs.webkit.org/show_bug.cgi?id=156335
6473         Reviewed by Chris Dumez.
6475         Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise
6476         for most of asynchronous operations, refactored the tests to use Promises as well, and added more
6477         assertions where appropriate.
6479         Also consolidated common helper functions into server-tests/resources/common-operations.js.
6480         Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were
6481         taking an array of reports while others were taking a single report. New shared implementation in
6482         common-operations.js now takes a single report.
6484         Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout.
6485         Most of tests are passing under 100ms on my computer so 1s should be plenty still.
6487         * run-tests.js: Removed.
6488         * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js.
6489         (reportsForDifferentPlatforms):
6490         * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js.
6491         (.addBuilder): Moved to common-operations.js.
6492         * server-tests/api-build-requests-tests.js:
6493         * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps.
6494         * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js.
6495         (.queryPlatformAndMetric):
6496         (.format):
6497         * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js.
6498         * server-tests/api-report-tests.js: Moved from tests/api-report.js.
6499         (.emptyReport):
6500         (.emptySlaveReport):
6501         (.reportWithSameSubtestName):
6502         * server-tests/resources/common-operations.js: Added.
6503         (addBuilderForReport): Extracted from tests.
6504         (addSlaveForReport): Ditto.
6505         (connectToDatabaseInEveryTest): Added.
6506         (submitReport): Extracted from admin-platforms-tests.js.
6507         * server-tests/resources/test-server.js:
6508         (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start
6509         its own Apache instance (that would certainly will fail).
6510         * server-tests/tools-buildbot-triggerable-tests.js:
6511         * tests: Removed.
6512         * tools/js/database.js:
6513         (Database.prototype.selectAll): Added.
6514         (Database.prototype.selectFirstRow): Added.
6515         (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments.
6517 2016-04-05  Ryosuke Niwa  <rniwa@webkit.org>
6519         New buildbot syncing scripts that supports multiple builders and slaves
6520         https://bugs.webkit.org/show_bug.cgi?id=156269
6522         Reviewed by Chris Dumez.
6524         Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves.
6525         The old python script (sync-with-buildbot.py) could only support a single builder and slave
6526         for each platform, test pair.
6528         The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added
6529         throughout the codebase and tests have been refactored.
6531         BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible
6532         for syncing everything on each builder (on a buildbot).
6534         Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored
6535         test helpers and mocks as needed.
6537         * public/v3/models/build-request.js:
6538         (BuildRequest.prototype.status): Added.
6539         (BuildRequest.prototype.isScheduled): Added.
6540         * public/v3/models/metric.js:
6541         (Metric.prototype.fullName): Added.
6542         * public/v3/models/platform.js:
6543         (Platform): Added the map based on platform name.
6544         (Platform.findByName): Added.
6545         * public/v3/models/test.js:
6546         (Test.topLevelTests):
6547         (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would
6548         find the test whose name is "B" which has a parent test named "A".
6549         (Test.prototype.fullName): Added.
6550         * server-tests/api-build-requests-tests.js:
6551         (addMockData): Moved to resources/mock-data.js.
6552         (addAnotherMockTestGroup): Ditto.
6553         * server-tests/resources/mock-data.js: Added.
6554         (MockData.resetV3Models): Added.
6555         (MockData.addMockData): Moved from api-build-requests-tests.js.
6556         (MockData.addAnotherMockTestGroup): Ditto.
6557         (MockData.mockTestSyncConfigWithSingleBuilder): Added.
6558         (MockData.mockTestSyncConfigWithTwoBuilders): Added.
6559         (MockData.pendingBuild): Added.
6560         (MockData.runningBuild): Added.
6561         (MockData.finishedBuild): Added.
6562         * server-tests/resources/test-server.js:
6563         (TestServer):
6564         (TestServer.prototype.remoteAPI):
6565         (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit.
6566         (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever.
6567         (TestServer.prototype._waitForPid): Increase the timeout.
6568         (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards.
6569         * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce.
6570         (MockLogger): Added.
6571         (MockLogger.prototype.log): Added.
6572         (MockLogger.prototype.error): Added.
6573         * tools/detect-changes.js:
6574         (parseArgument): Moved to js/parse-arguments.js.
6575         * tools/js/buildbot-syncer.js:
6576         (BuildbotBuildEntry):
6577         (BuildbotBuildEntry.prototype.syncer): Added.
6578         (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status
6579         for a build request (of the matching build request ID) if it needs to be updated in the server.
6580         (BuildbotSyncer): This class 
6581         (BuildbotSyncer.prototype.addTestConfiguration): Added.
6582         (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations.
6583         (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on
6584         this builder.
6585         (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request.
6586         (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for
6587         the specified build request on the first slave that's available.
6588         (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object.
6589         Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it.
6590         (BuildbotSyncer.prototype._pullRecentBuilds):
6591         (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now
6592         only returns the path instead of the full URL since RemoteAPI takes a path, not full URL.
6593         (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON.
6594         (BuildbotSyncer.prototype.pathForForceBuild): Added.
6595         (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL.
6596         (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
6597         (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test
6598         configurations associated with it, find the one matching for this request.
6599         (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it.
6600         (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of
6601         slave names present on this builder.
6602         * tools/js/buildbot-triggerable.js: Added.
6603         (BuildbotTriggerable): Added.
6604         (BuildbotTriggerable.prototype.name): Added.
6605         (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls
6606         existing build requests from the perf dashboard, pulls buildbot for pending and running/completed
6607         builds on each builder (represented by each syncer), schedules build requests on buildbot if there
6608         is any builder/slave available, and updates the status of build requests in the database.
6609         (BuildbotTriggerable.prototype._validateRequests): Added.
6610         (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added.
6611         (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added.
6612         (BuildbotTriggerable._testGroupMapForBuildRequests): Added.
6613         * tools/js/database.js:
6614         * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js.
6615         (parseArguments):
6616         * tools/js/remote.js:
6617         (RemoteAPI): Now optionally takes the server configuration.
6618         (RemoteAPI.prototype.url): Added.
6619         (RemoteAPI.prototype.getJSON): Removed the code for specifying request content.
6620         (RemoteAPI.prototype.getJSONWithStatus): Ditto.
6621         (RemoteAPI.prototype.postJSON): Added.
6622         (RemoteAPI.prototype.postFormUrlencodedData): Added.
6623         (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth.
6624         * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host.
6625         * tools/sync-buildbot.js: Added.
6626         (main): Added. Parse the arguments and start the loop.
6627         (syncLoop): Added.
6628         * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as
6629         scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed.
6630         (sampleiOSConfig):
6631         (smallConfiguration): Added.
6632         (smallPendingBuild): Added.
6633         (smallInProgressBuild): Added.
6634         (smallFinishedBuild): Added.
6635         (createSampleBuildRequest): Create a unique build request for each platform.
6636         (samplePendingBuild): Optionally specify build time and slave name.
6637         (sampleInProgressBuild): Optionally specify slave name.
6638         (sampleFinishedBuild): Ditto.
6639         * unit-tests/resources/mock-remote-api.js:
6640         (assert.notReached.assert.notReached):
6641         (MockRemoteAPI.url): Added.
6642         (MockRemoteAPI.postFormUrlencodedData): Added.
6643         (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus.
6644         (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we
6645         need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI.
6646         (MockRemoteAPI.inject):
6647         (MockRemoteAPI.reset): Added.
6649 2016-03-30  Ryosuke Niwa  <rniwa@webkit.org>
6651         Simplify API of Test model by removing Test.setParentTest
6652         https://bugs.webkit.org/show_bug.cgi?id=156055
6654         Reviewed by Joseph Pecoraro.
6656         Removed Test.setParentTest. Keep track of the child-parent relationship using the static map instead.
6658         Now each test only stores parent's id and uses the ID static map in Test.parentTest().
6660         * public/v3/models/manifest.js:
6661         (Manifest._didFetchManifest.buildObjectsFromIdMap): Removed the code to create the map of child-parent
6662         relationship and call setParentTest.
6663         * public/v3/models/test.js:
6664         (Test): Updated a static map by the name of "childTestMap" to store itself. We should probably sort
6665         child tests using some fixed criteria in the future instead of relying on the creation order but
6666         preserve the old code's ordering for now.
6667         (Test.prototype.parentTest): Look up the static map by the parent test's id.
6668         (Test.prototype.onlyContainsSingleMetric):
6669         (Test.prototype.setParentTest): Deleted.
6670         (Test.prototype.childTests): Look up the child test map.
6672 2016-03-30  Ryosuke Niwa  <rniwa@webkit.org>
6674         BuildRequest should have associated platform and test
6675         https://bugs.webkit.org/show_bug.cgi?id=156054
6677         Reviewed by Joseph Pecoraro.
6679         Added methods to retrieve the platform and the test associated with a build request with tests.
6681         * public/v3/models/build-request.js:
6682         (BuildRequest):
6683         (BuildRequest.prototype.platform): Added.
6684         (BuildRequest.prototype.test): Added.
6685         * server-tests/api-build-requests-tests.js:
6686         * server-tests/api-manifest.js: Fixed a typo. This tests /api/manifest, not /api/build-requests.
6687         * unit-tests/buildbot-syncer-tests.js:
6688         (.createSampleBuildRequest): Now takes Platform and Test objects to avoid hitting assertions in
6689         BuildRequest's constructor.
6691 2016-03-30  Ryosuke Niwa  <rniwa@webkit.org>
6693         BuildRequest should have a method to fetch all in-progress and pending requests for a triggerable
6694         https://bugs.webkit.org/show_bug.cgi?id=156008
6696         Reviewed by Darin Adler.
6698         Add a method to BuildRequest that fetches all pending and in-progress requests for a triggerable.
6700         Now, new syncing scripts must be able to figure out the build slave the first build requests in
6701         a given test group had used in order to schedule subsequent build requests in the test group.
6703         For this purpose, /api/build-requests has been modified to return all build requests whose test
6704         group had not finished yet. A test group is finished if all build requests in the test group had
6705         finished (completed, failed, or canceled).
6707         * public/include/build-requests-fetcher.php:
6708         (BuildRequestFetcher::fetch_incomplete_requests_for_triggerable): Return all build requests in test
6709         groups that have not been finished.
6710         * public/v3/models/build-request.js:
6711         (BuildRequest):
6712         (BuildRequest.prototype.testGroupId): Added.
6713         (BuildRequest.prototype.isPending): Renamed from hasPending to fix a bad grammar.
6714         (BuildRequest.fetchForTriggerable): Added.
6715         (BuildRequest.constructBuildRequestsFromData): Extracted from _createModelsFromFetchedTestGroups in
6716         TestGroup.
6717         * public/v3/models/manifest.js:
6718         (Manifest.fetch): Use the full path from root so that it works in server tests.
6719         * public/v3/models/test-group.js:
6720         (TestGroup.hasPending):
6721         (TestGroup._createModelsFromFetchedTestGroups):
6722         * server-tests/api-build-requests-tests.js: Added tests to ensure all build requests for a test group
6723         is present in the response returned by /api/build-requests iff any build request in the group had not
6724         finished yet.
6725         (.addMockData):
6726         (.addAnotherMockTestGroup): Added.
6727         * unit-tests/test-groups-tests.js:
6729 2016-03-29  Ryosuke Niwa  <rniwa@webkit.org>
6731         Make dependency injection in unit tests more explicit
6732         https://bugs.webkit.org/show_bug.cgi?id=156006
6734         Reviewed by Joseph Pecoraro.
6736         Make the dependency injection of model objects in unit tests explicit so that server tests that create
6737         "real" model objects won't create these mock objects. Now each test that uses mock model objects would call
6738         MockModels.inject() to inject before / beforeEach and access each object using a property on MockModels
6739         instead of them being implicitly defined on the global object.
6741         Similarly, MockRemoteAPI now only replaces global.RemoteAPI during each test so that server tests can use
6742         real RemoteAPI to access the test Apache server.
6744         * unit-tests/analysis-task-tests.js:
6745         * unit-tests/buildbot-syncer-tests.js:
6746         (createSampleBuildRequest):
6747         * unit-tests/measurement-adaptor-tests.js:
6748         * unit-tests/measurement-set-tests.js:
6749         * unit-tests/resources/mock-remote-api.js:
6750         (MockRemoteAPI.getJSONWithStatus):
6751         (MockRemoteAPI.inject): Added. Override RemoteAPI on the global object during each test.
6752         * unit-tests/resources/mock-v3-models.js:
6753         (MockModels.inject): Added. Create mock model objects before each test, and clear all static maps of
6754         various v3 model classes (to remove all singleton objects for those model classes).
6755         * unit-tests/test-groups-tests.js:
6757 2016-03-29  Ryosuke Niwa  <rniwa@webkit.org>
6759         BuildbotSyncer should be able to fetch JSON from buildbot
6760         https://bugs.webkit.org/show_bug.cgi?id=155921
6762         Reviewed by Joseph Pecoraro.
6764         Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot
6765         with lots of unit tests as this has historically been a source of subtle bugs in the old script.
6767         New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that
6768         the state of some builds may change between each HTTP request. In the old script, we fetched the list
6769         of the pending builds, and requested -1, -2, etc... builds for N times. But between each request,
6770         a pending build may start running or an in-progress build finish and shift the offset by one. The new
6771         script avoids this problem by first requesting all pending builds, then all in-progress and finished
6772         builds in a single HTTP request. The results are then merged so that entries for in-progress and
6773         finished builds would override the entries for pending builds if they overlap.
6775         Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes
6776         the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js).
6778         * server-tests/api-build-requests-tests.js:
6779         * server-tests/api-manifest.js:
6780         * tools/js/buildbot-syncer.js:
6781         (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as
6782         we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished
6783         builds as 'currentStep' is always defined but null in those builds.
6784         (BuildbotBuildEntry.prototype.buildNumber): Added.
6785         (BuildbotBuildEntry.prototype.isPending): Added.
6786         (BuildbotBuildEntry.prototype.hasFinished): Added.
6787         (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds.
6788         (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds.
6789         (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added.
6790         (BuildbotSyncer.prototype.urlForBuildJSON): Added.
6791         (BuildbotSyncer.prototype.url): Added.
6792         (BuildbotSyncer.prototype.urlForBuildNumber): Added.
6793         * tools/js/remote.js:
6794         (RemoteAPI.prototype.getJSON): Renamed from fetchJSON.
6795         (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus.
6796         * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node.
6797         * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot
6798         (samplePendingBuild):
6799         (sampleInProgressBuild): Added.
6800         (sampleFinishedBuild): Added.
6801         * unit-tests/resources/mock-remote-api.js:
6802         (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus.
6804 2016-03-24  Ryosuke Niwa  <rniwa@webkit.org>
6806         Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code
6807         https://bugs.webkit.org/show_bug.cgi?id=155863
6809         Reviewed by Joseph Pecoraro.
6811         Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability
6812         added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed
6813         /admin/regenerate-manifest since it has been superseded by /api/manifest.
6815         This patch also extracts manifest.js out of main.js so that it could be used and tested without the
6816         DOM support in node.
6818         * public/admin/regenerate-manifest.php: Deleted.
6819         * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with
6820         a trailing backslash.
6821         * public/include/manifest.php:
6822         (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories.
6823         * public/v3/index.html:
6824         * public/v3/main.js:
6825         (main):
6826         * public/v3/models/bug-tracker.js:
6827         (BugTracker.prototype.newBugUrl): Added.
6828         (BugTracker.prototype.repositories): Added.
6829         * public/v3/models/manifest.js: Added. Extracted from main.js.
6830         (Manifest.fetch): Moved from main.js' fetchManifest.
6831         (Manifest._didFetchManifest): Moved from main.js' didFetchManifest.
6832         * public/v3/models/platform.js:
6833         (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of
6834         the same name. This is tested by the newly added test cases.
6835         * server-tests/api-build-requests-tests.js:
6836         * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js
6837         with additional assertions for v3 UI model objects.
6838         * server-tests/resources/test-server.js:
6839         (TestServer.prototype.start):
6840         (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API.
6841         Also no longer takes dataDirectory as an argument since it's always the same.
6842         (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data.
6843         (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests.
6844         (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an
6845         unintended side effect of slowing down unit tests even through they don't need Postgres or Apache.
6846         * tests/admin-regenerate-manifest.js: Removed.
6847         * tools/js/database.js:
6848         * tools/js/v3-models.js:
6850 2016-03-23  Ryosuke Niwa  <rniwa@webkit.org>
6852         Add mocha server tests for /api/build-requests
6853         https://bugs.webkit.org/show_bug.cgi?id=155831
6855         Reviewed by Chris Dumez.
6857         Added the new mocha.js based server-tests for /api/build-requests. The new harness automatically:
6858          - starts a new Apache instance
6859          - switches the database during testing via setting an environmental variable 
6860          - backups and restores public/data directory during testing
6862         As a result, developer no longer has to manually setup Apache, edit config.json manually to use
6863         a testing database, or run /api/manifest.php to re-generate the manifest file after testing.
6865         This patch also makes ID resolution optional on /api/build-requests so that v3 model based syncing
6866         scripts can re-use the same code as the v3 UI to process the JSON. tools/sync-with-buildbot.py has
6867         been modified to use this option (useLegacyIdResolution).
6869         * config.json: Added configurations for the test httpd server.
6870         * init-database.sql: Don't error when tables and types don't exist (when database is empty).
6871         * public/api/build-requests.php:
6872         (main): Made the ID resolution optional with useLegacyIdResolution. Also removed "updates" from the
6873         results JSON since it's never used.
6874         * public/include/build-requests-fetcher.php:
6875         (BuildRequestsFetcher::__construct):
6876         (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Fixed the bug that we would include the same
6877         commit multiple times for each root set.
6878         * public/include/db.php:
6879         (config): If present, use ORG_WEBKIT_PERF_CONFIG_PATH instead of Websites/perf.webkit.org/config.json.
6880         * server-tests: Added.
6881         * server-tests/api-build-requests-tests.js: Added. Tests for /api/build-requests.
6882         (.addMockData):
6883         * server-tests/resources: Added.
6884         * server-tests/resources/test-server.conf: Added. Apache configuration file for testing.
6885         * server-tests/resources/test-server.js: Added.
6886         (TestSever): Added.
6887         (TestSever.prototype.start): Added.
6888         (TestSever.prototype.stop): Added.
6889         (TestSever.prototype.remoteAPI): Added. Configures RemoteAPI to be used with the test sever.
6890         (TestSever.prototype.database): Added. Returns Database configured to use the test database.
6891         (TestSever.prototype._constructTestConfig): Creates config.json for testing. The file is generated by
6892         _start and db.php's config() reads it from the environmental variable: ORG_WEBKIT_PERF_CONFIG_PATH.
6893         (TestSever.prototype._ensureDataDirectory): Renames public/data to public/original-data if exists,
6894         and creates a new empty public/data.
6895         (TestSever.prototype._restoreDataDirectory): Deletes public/data and renames public/original-data
6896         back to public/data.
6897         (TestSever.prototype._ensureTestDatabase): Drops the test database if exists and creates a new one.
6898         (TestSever.prototype.initDatabase): Run init-database.sql to start each test with a consistent state.
6899         (TestSever.prototype._executePgsqlCommand): Executes a postgres command line tool such as psql.
6900         (TestSever.prototype._determinePgsqlDirectory): Finds the directory that contains psql.
6901         (TestSever.prototype._startApache): Starts an Apache instance for testing.
6902         (TestSever.prototype._stopApache): Stops the Apache instance for testing.
6903         (TestSever.prototype._waitForPid): Waits for the Apache pid file to appear or disappear.
6904         (before): Start the test server at the beginning.
6905         (beforeEach): Re-initialize all tables before each test.
6906         (after): Stop the test server at the end.
6907         * tools/js/config.js:
6908         (Config.prototype.path):
6909         (Config.prototype.serverRoot): Added. The path to Websites/perf.webkit.org/public/.
6910         (Config.prototype.pathFromRoot): Added. Resolves a path from Websites/perf.webkit.org.
6911         * tools/js/database.js:
6912         (Database): Now optionally takes the database name to use a different database during testing.
6913         (Database.prototype.connect):
6914         (Database.prototype.query): Added.
6915         (Database.prototype.insert): Added.
6916         (tableToPrefixMap): Maps table name to its prefix. Used by Database.insert.
6917         * tools/js/remote.js: Added.
6918         (RemoteAPI): Added. This is node.js equivalent of RemoteAPI in public/v3/remote.js.
6919         (RemoteAPI.prototype.configure): Added.
6920         (RemoteAPI.prototype.fetchJSON): Added.
6921         (RemoteAPI.prototype.fetchJSONWithStatus): Added.
6922         (RemoteAPI.prototype.sendHttpRequest): Added.
6923         * tools/sync-with-buildbot.py:
6924         (main): Use useLegacyIdResolution as this script relies on the legacy behavior.
6925         * unit-tests/checkconfig.js: pg was never directly used in this test.
6927 2016-03-23  Ryosuke Niwa  <rniwa@webkit.org>
6929         Delete a file that was supposed to be removed in r198614 for real.
6931         * unit-tests/resources/v3-models.js: Removed.
6933 2016-03-23  Ryosuke Niwa  <rniwa@webkit.org>
6935         Add a model for parsing buildbot JSON with unit tests
6936         https://bugs.webkit.org/show_bug.cgi?id=155814
6938         Reviewed by Joseph Pecoraro.
6940         Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests.
6941         They will be used in the new syncing scripts to improve A/B testing.
6943         * public/v3/models/build-request.js:
6944         (BuildRequest):
6945         * tools/js/buildbot-syncer.js: Added.
6946         (BuildbotBuildEntry): Added.
6947         (BuildbotBuildEntry.prototype.slaveName): Added.
6948         (BuildbotBuildEntry.prototype.buildRequestId): Added.
6949         (BuildbotBuildEntry.prototype.isInProgress): Added.
6950         (BuildbotSyncer): Added.
6951         (BuildbotSyncer.prototype.testPath): Added.
6952         (BuildbotSyncer.prototype.builderName): Added.
6953         (BuildbotSyncer.prototype.platformName): Added.
6954         (BuildbotSyncer.prototype.fetchPendingRequests): Added.
6955         (BuildbotSyncer.prototype._propertiesForBuildRequest): Added.
6956         (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added.
6957         (BuildbotSyncer._loadConfig): Added.
6958         (BuildbotSyncer._validateAndMergeConfig): Added.
6959         (BuildbotSyncer._validateAndMergeProperties): Added.
6960         * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js.
6961         (beforeEach): Deleted since this only defined inside mocha.
6962         * unit-tests/analysis-task-tests.js:
6963         * unit-tests/buildbot-syncer-tests.js: Added.
6964         (sampleiOSConfig):
6965         (createSampleBuildRequest):
6966         (.smallConfiguration):
6967         * unit-tests/measurement-adaptor-tests.js:
6968         * unit-tests/measurement-set-tests.js:
6969         * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js.
6970         (beforeEach):
6971         * unit-tests/test-groups-tests.js:
6972         (sampleTestGroup):
6974 2016-03-22  Ryosuke Niwa  <rniwa@webkit.org>
6976         Add unit tests for test-group.js
6977         https://bugs.webkit.org/show_bug.cgi?id=155781
6979         Reviewed by Joseph Pecoraro.
6981         Added unit tests for test-group.js that would have caught regressions fixed in r198503.
6983         * public/v3/components/chart-pane-base.js:
6984         (ChartPaneBase.prototype._renderAnnotations): Added a forgotten break statement.
6985         * public/v3/models/build-request.js:
6986         (BuildRequest.prototype.setResult):
6987         (BuildRequest):
6988         * public/v3/models/test-group.js:
6989         * unit-tests/measurement-set-tests.js: Use ./resources/v3-models.js to reduce the code duplication.
6990         * unit-tests/resources/v3-models.js: Import more stuff from v3 models.
6991         (beforeEach):
6992         * unit-tests/test-groups-tests.js: Added. Added some unit tests for TestGroup.
6993         (sampleTestGroup):
6994         (.testGroupWithStatusList):
6996 2016-03-22  Ryosuke Niwa  <rniwa@webkit.org>
6998         Fix a typo.
7000         * config.json:
7002 2016-03-21  Ryosuke Niwa  <rniwa@webkit.org>
7004         Commit log viewer repaints too frequently after r198499
7005         https://bugs.webkit.org/show_bug.cgi?id=155732
7007         Reviewed by Joseph Pecoraro.
7009         The bug was caused by InteractiveTimeSeriesChart invoking onchange callback whenever mouse moved even
7010         if the current point didn't change. Fixed the bug by avoiding the work if the indicator hadn't changed
7011         and avoiding work in the commit log viewer when the requested repository and the revision range were
7012         the same as those of the last request.
7014         * public/v3/components/commit-log-viewer.js:
7015         (CommitLogViewer):
7016         (CommitLogViewer.prototype.currentRepository): Exit early when repository and the revision range are
7017         identical to the one we already have to avoid repaints and issuing multiple network requests.
7018         * public/v3/components/interactive-time-series-chart.js:
7019         (InteractiveTimeSeriesChart.prototype._mouseMove): Don't invoke _notifyIndicatorChanged if the current
7020         indicator hadn't changed.
7021         * public/v3/pages/chart-pane.js:
7022         (ChartPane.prototype._indicatorDidChange): Fixed the bug that unlocking the indicator wouldn't update
7023         the URL. We need to check whether the lock state had changed. The old condition was also redundant
7024         since _mainChartIndicatorWasLocked is always identically equal to isLocked per the prior assignment.
7026 2016-03-21  Ryosuke Niwa  <rniwa@webkit.org>
7028         Fix A/B testing after r198503.
7030         * public/include/build-requests-fetcher.php:
7032 2016-03-21  Ryosuke Niwa  <rniwa@webkit.org>
7034         Analysis task page is broken after r198479
7035         https://bugs.webkit.org/show_bug.cgi?id=155735
7037         Rubber-stamped by Chris Dumez.
7039         * public/api/measurement-set.php:
7040         (AnalysisResultsFetcher::fetch_commits): We need to emit the commit ID as done for regular data.
7041         * public/include/build-requests-fetcher.php:
7042         (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Ditto. Don't use a fake ID after r198479.
7043         * public/v3/models/commit-log.js:
7044         (CommitLog): Assert that all commit log IDs are integers to catch regressions like this in future.
7045         * public/v3/models/root-set.js:
7046         (RootSet): Don't resolve Repository here as doing so would modify the shared "root" entry in the JSON
7047         we fetched, and subsequent construction of RootSet would fail since this line would blow up trying to
7048         find the repository with "[object]" as the ID.
7049         * public/v3/models/test-group.js:
7050         (TestGroup._createModelsFromFetchedTestGroups): Resolve Repository here.
7052 2016-03-21  Ryosuke Niwa  <rniwa@webkit.org>
7054         v3 UI sometimes don't update the list of revisions on the commit log viewer
7055         https://bugs.webkit.org/show_bug.cgi?id=155729
7057         Rubber-stamped by Chris Dumez.
7059         Fixed multiple bugs that were affecting the list of blame range and commit logs for the range weren't
7060         updated in some cases on v3 UI. Also, the commit log viewer state is now a part of the URL state so
7061         opening and closing the commit log viewer will persist across page loads.
7063         Also fixed a regression from r198479 that Test object can't be created for a top level test.
7065         * public/v3/components/chart-pane-base.js:
7066         (ChartPaneBase.prototype.configure):
7067         (ChartPaneBase.prototype._mainSelectionDidChange): Fixed the bug that the list of blame range nor the
7068         commit log viewer don't get updated when the selected range changes.
7069         (ChartPaneBase.prototype._indicatorDidChange):
7070         (ChartPaneBase.prototype._didFetchData):
7071         (ChartPaneBase.prototype._updateStatus): Extracted from _indicatorDidChange and _didFetchData.
7072         (ChartPaneBase.prototype._requestOpeningCommitViewer): Renamed from _openCommitViewer.
7074         * public/v3/components/chart-status-view.js:
7075         (ChartStatusView.prototype.updateStatusIfNeeded): Fixed the bug that the blame range doesn't get set
7076         on the initial page load when the selection range is set but the chart data hadn't been fetched yet.
7078         * public/v3/components/commit-log-viewer.js:
7079         (CommitLogViewer.prototype.view): Fixed the bug that we don't clear out the old list of commits while
7080         loading the next set of commits to show as it looked as if the list was never updated.
7081         (CommitLogViewer.prototype.render): Fixed the bug that the view always show the last repository name
7082         even if there were nothing being fetched or commits to show.
7084         * public/v3/components/pane-selector.js:
7085         (PaneSelector.prototype.focus): Removed superfluous call to console.log.
7087         * public/v3/models/data-model.js:
7088         (DataModelObject.listForStaticMap): Generalized the code for all to fix the bug in Test.
7089         (DataModelObject.all):
7091         * public/v3/models/test.js:
7092         (Test): Fixed the bug that this code was relying on the static map to be an array.
7093         (Test.topLevelTests): Use newly added listForStaticMap to convert the dictionary to an array.
7095         * public/v3/pages/chart-pane-status-view.js:
7096         (ChartPaneStatusView): Always initialize _usedRevisionRange as a triple to simplify code elsewhere.
7097         (ChartPaneStatusView.prototype.render): Invoke _revisionCallback when user clicks on a repository
7098         expansion mark (>>). Also fixed click handler from the row since this made selecting revision range
7099         on the view cumbersome. Now user has to explicitly click on the expansion mark (>>).
7100         (ChartPaneStatusView.prototype._setRevisionRange): Now takes shouldNotify, from, and to as arguments
7101         as this function must not invoke_revisionCallback inside _updateRevisionListForNewCurrentRepository.
7102         (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Use newly added setCurrentRepository
7103         instead of manually invoking setCurrentRepository and updateRevisionListWithNotification.
7104         (ChartPaneStatusView.prototype.setCurrentRepository): Fixed the bug that we weren't updating the
7105         blame list here.
7106         (ChartPaneStatusView.prototype.updateRevisionList): Renamed from updateRevisionListWithNotification
7107         since we no longer call _revisionCallback. In general, callbacks are only meant to communicate user
7108         initiated actions, and not program induced updates like this API so this was a bad pattern anyway.
7109         ChartPane now explicitly updates the commit log viewer instead of relying on this function calling
7110         _requestOpeningCommitViewer implicitly.
7111         (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Extracted from
7112         updateRevisionListWithNotification so that setCurrentRepository can also call this function.
7114         * public/v3/pages/chart-pane.js:
7115         (ChartPane.prototype._requestOpeningCommitViewer): Overrides ChartPaneBase's method. Open the same
7116         repository in other panes via ChartsPage.setOpenRepository.
7117         (ChartPane.prototype.setOpenRepository): This method is called when the user selected a repository in
7118         another pane. Open the same repository in this pane if it wasn't already open.
7120         * public/v3/pages/charts-page.js:
7121         (ChartsPage): Added this._currentRepositoryId.
7122         (ChartsPage.prototype.serializeState): Serialize _currentRepositoryId.
7123         (ChartsPage.prototype.updateFromSerializedState): Set the commit log viewer's 
7124         (ChartsPage.prototype.setOpenRepository): Added.
7126         * tests/api-measurement-set.js: Fixed a test after r198479.
7128 2016-03-21  Ryosuke Niwa  <rniwa@webkit.org>
7130         V3 Perf Dashboard should automatically select initial range when creating a new task
7131         https://bugs.webkit.org/show_bug.cgi?id=155677
7133         Reviewed by Joseph Pecoraro.
7135         Select the entire range of points for which the analysis task is created by default so that creating
7136         a test group to confirm the regression / progression is easy.
7138         * public/v3/pages/analysis-task-page.js:
7139         (AnalysisTaskPage): Added a boolean flag which indicates the user had modified main chart's selection.
7140         * public/v3/pages/analysis-task-page.js:
7141         (AnalysisTaskPage.prototype.render): Set the main chart's selection to the entire range of points in
7142         the analysis task if the user had never modified selection.
7143         (AnalysisTaskPage.prototype._chartSelectionDidChange): This callback is invoked only when the user had
7144         modified the selection so set _selectionWasModifiedByUser true here unconditionally.
7146 2016-03-19  Ryosuke Niwa  <rniwa@webkit.org>
7148         Associated commits don't immediately show up on an analysis task page
7149         https://bugs.webkit.org/show_bug.cgi?id=155692
7151         Reviewed by Darin Adler.
7153         The bug was caused by resolveCommits in AnalysisTask._constructAnalysisTasksFromRawData not being
7154         able to find the matching commit log if the commit log had been created by the charts which don't
7155         set the remote identifiers on each CommitLog objects.
7157         Fixed the bug by modifying /api/measurement-set to include the commit ID, and making CommitLog
7158         use the real database ID as its ID instead of a fake ID we create from repository and revision.
7160         Also added a bunch of Mocha unit tests for AnalysisTask.fetchAll.
7162         * public/api/measurement-set.php:
7163         (MeasurementSetFetcher::execute_query): Fetch commit_id.
7164         (MeasurementSetFetcher::format_run): Use pass-by-reference to avoid making a copy of the row.
7165         (MeasurementSetFetcher::parse_revisions_array): Include commit_id as the first item in the result.
7166         * public/v3/instrumentation.js:
7167         * public/v3/models/analysis-task.js:
7168         (AnalysisTask): Fixed a bug that _buildRequestCount and _finishedBuildRequestCount could be kept
7169         as strings and hasPendingRequests() could return a wrong result because it would perform string
7170         inequality instead of numerical inequality.
7171         (AnalysisTask.prototype.updateSingleton): Ditto.
7172         (AnalysisTask.prototype.dissociateCommit):
7173         (AnalysisTask._constructAnalysisTasksFromRawData):
7174         (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Use findById now that CommitLog
7175         objects all use the same id as the database id.
7176         * public/v3/models/commit-log.js:
7177         (CommitLog):
7178         (CommitLog.prototype.remoteId): Deleted since we no longer create a fake id for commit logs for
7179         measurement sets.
7180         (CommitLog.findByRemoteId): Deleted.
7181         (CommitLog.ensureSingleton): Deleted.
7182         (CommitLog.fetchBetweenRevisions):
7184         * public/v3/models/data-model.js:
7185         (DataModelObject.clearStaticMap): Added to aid unit testing.
7186         (DataModelObject.ensureNamedStaticMap): Fixed a typo. Each map is a dictionary, not an array.
7187         * public/v3/models/metric.js:
7188         * public/v3/models/platform.js:
7189         * public/v3/models/root-set.js:
7190         (RootSet): Updated per the interface change in CommitLog.ensureSingleton.
7191         (MeasurementRootSet): Updated per /api/measurement-set change. Use the first value as the id.
7192         * public/v3/models/test.js:
7193         * unit-tests/analysis-task-tests.js: Added.
7194         (sampleAnalysisTask):
7195         (measurementCluster):
7196         * unit-tests/checkconfig.js: Added some assertion message to help aid diagnosing the failure.
7197         * unit-tests/measurement-adaptor-tests.js: Updated the sample data per the API change in
7198         /api/measurement-set and also added assertions for commit log ids.
7199         * unit-tests/measurement-set-tests.js:
7200         (beforeEach):
7201         * unit-tests/resources: Added.
7202         * unit-tests/resources/mock-remote-api.js: Added. Extracted from measurement-set-tests.js to be
7203         used in analysis-task-tests.js.
7204         (assert.notReached.assert.notReached):
7205         (global.RemoteAPI.getJSON):
7206         (global.RemoteAPI.getJSONWithStatus):
7207         (beforeEach):
7208         * unit-tests/resources/v3-models.js: Added. Extracted from measurement-set-tests.js to be used in
7209         analysis-task-tests.js and added more imports as needed.
7210         (importFromV3):
7211         (beforeEach):
7213 2016-03-18  Ryosuke Niwa  <rniwa@webkit.org>
7215         Build fix after r198464.
7217         * public/v3/components/analysis-results-viewer.js:
7218         (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
7220 2016-03-18  Ryosuke Niwa  <rniwa@webkit.org>
7222         Build fix after r198234.
7224         * public/api/commits.php:
7225         (main): Typo: fetch_latest_reported -> fetch_last_reported.
7226         * public/include/commit-log-fetcher.php:
7227         (CommitLogFetcher::format_single_commit): commits should be an array.
7229 2016-03-18  Ryosuke Niwa  <rniwa@webkit.org>
7231         Perf Dashboard v3 confuses better and worse on A/B task page
7232         https://bugs.webkit.org/show_bug.cgi?id=155675
7233         <rdar://problem/25208723>
7235         Reviewed by Joseph Pecoraro.
7237         The analysis results viewer on v3 UI sometimes treats regressions as progressions and vice versa when
7238         the first set (i.e. set A) of the revisions used in an A/B testing never appears in the original graph,
7239         and its latest commit time matches that of the second set, which appears in the original graph.
7241         Because the analysis results viewer compares results in the increasing row number, this results in
7242         B to be compared to A instead of A to be compared to B. Fixed the bug by preventing the wrong ordering
7243         to occur in _buildRowsForPointsAndTestGroups by always inserting a root set A before B when B appears
7244         and A doesn't appear in the original graph.
7246         * public/v3/components/analysis-results-viewer.js:
7247         (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Remember the succeeding root set B
7248         when creating an entry for root set A.
7249         (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Fixed the bug. Also un-duplicated
7250         the code to create a new row.
7251         (AnalysisResultsViewer.RootSetInTestGroup): Now takes a succeeding root set. e.g. it's B for A and
7252         undefined for B in A/B testing.
7253         (AnalysisResultsViewer.RootSetInTestGroup.prototype.succeedingRootSet): Added.
7254         * public/v3/components/time-series-chart.js:
7255         (TimeSeriesChart.computeTimeGrid): Fixed the bug that we would end up showing 0 AM instead of dates
7256         when both dates and months change.
7258 2016-03-18  Ryosuke Niwa  <rniwa@webkit.org>
7260         Add unit tests for measurement-set.js and measurement-adapter.js
7261         https://bugs.webkit.org/show_bug.cgi?id=155673
7263         Reviewed by Daniel Bates.
7265         Add tests which were supposed to be added in r198462.
7267         * unit-tests/measurement-adaptor-tests.js: Added.
7268         * unit-tests/measurement-set-tests.js: Added.
7269         (assert.notReached): Added.
7270         (global.RemoteAPI.getJSON): Added.
7271         (global.RemoteAPI.getJSONWithStatus): Added. A mock.
7273 2016-03-18  Ryosuke Niwa  <rniwa@webkit.org>
7275         Add unit tests for measurement-set.js and measurement-adapter.js
7276         https://bugs.webkit.org/show_bug.cgi?id=155673
7278         Reviewed by Darin Adler.
7280         Added mocha unit tests for MeasurementSet and MeasurementAdapter classes along with the necessary
7281         refactoring to run these tests in node.
7283         getJSON and getJSONStatus are now under RemoteAPI so that unit tests can mock them.
7285         Removed the dependency on v2 UI's TimeSeries and Measurement class by adding a new implementation
7286         of TimeSeries in v3 and removing the dependency on Measurement in chart-pane-status-view.js with
7287         new helper methods on Build and CommitLog.
7289         Many js files now use 'use strict' (node doesn't support class syntax in non-strict mode) and
7290         module.exports to export symbols in node's require function.
7292         * public/v3/index.html:
7293         * public/v3/main.js:
7294         * public/v3/models/analysis-results.js:
7295         (AnalysisResults.fetch):
7296         * public/v3/models/analysis-task.js:
7297         (AnalysisTask.fetchAll):
7298         * public/v3/models/builder.js:
7299         (Build):
7300         (Build.prototype.builder): Added. Used by ChartPaneStatusView.
7301         (Build.prototype.buildNumber): Ditto.
7302         (Build.prototype.buildTime): Ditto.
7303         * public/v3/models/commit-log.js:
7304         (CommitLog.prototype.diff): Ditto.
7305         (CommitLog.fetchBetweenRevisions):
7306         * public/v3/models/data-model.js:
7307         (DataModelObject.cachedFetch):
7308         * public/v3/models/measurement-adaptor.js:
7309         (MeasurementAdaptor.prototype.applyToAnalysisResults): Renamed from adoptToAnalysisResults.
7310         (MeasurementAdaptor.prototype.applyTo): Renamed from adoptToSeries. Now shares a lot more
7311         code with applyToAnalysisResults. The code to set 'series' and 'seriesIndex' has been moved
7312         to TimeSeries.append. 'measurement' is no longer needed as this patch removes its only use
7313         in ChartPaneStatusView.
7314         * public/v3/models/measurement-cluster.js:
7315         (MeasurementCluster.prototype.addToSeries): Use TimeSeries.append instead of directly mutating
7316         series._series.
7317         * public/v3/models/measurement-set.js:
7318         (Array.prototype.includes): Added a polyfill for node.
7319         (MeasurementSet.prototype._fetchSecondaryClusters): Removed a bogus assertion. When fetchBetween
7320         is called with a mixture of clusters that have been fetched and not fetched, this assertion fails.
7321         (MeasurementSet.prototype._fetch):
7322         (TimeSeries.prototype.findById): Moved to time-series.js.
7323         (TimeSeries.prototype.dataBetweenPoints): Ditto.
7324         (TimeSeries.prototype.firstPoint): Ditto.
7325         (TimeSeries.prototype.fetchedTimeSeries): Moved the code to extend the last point to TimeSeries'
7326         extendToFuture.
7327         * public/v3/models/repository.js:
7328         * public/v3/models/root-set.js:
7329         (MeasurementRootSet): Ignore repositories that had not been defined (e.g. it could be added after
7330         manifest.json had been downloaded but before a given root set is created for an A/B testing).
7331         * public/v3/models/time-series.js:
7332         (TimeSeries): Added.
7333         (TimeSeries.prototype.append): Added.
7334         (TimeSeries.prototype.extendToFuture): Added.
7335         (TimeSeries.prototype.firstPoint): Moved from measurement-set.js.
7336         (TimeSeries.prototype.lastPoint): Added.
7337         (TimeSeries.prototype.previousPoint): Added.
7338         (TimeSeries.prototype.nextPoint): Added.
7339         (TimeSeries.prototype.findPointByIndex): Added.
7340         (TimeSeries.prototype.findById): Moved from measurement-set.js.
7341         (TimeSeries.prototype.findPointAfterTime): Added.
7342         (TimeSeries.prototype.dataBetweenPoints): Moved from measurement-set.js.
7343         * public/v3/pages/chart-pane-status-view.js:
7344         (ChartPaneStatusView.prototype.render): Use newly added helper functions on Build.
7345         (ChartPaneStatusView.prototype._formatTime): Added.
7346         (ChartPaneStatusView.prototype.setCurrentRepository):
7347         (ChartPaneStatusView.prototype.computeChartStatusLabels): Rewrote the code using RootSet object on
7348         currentPoint and previousPoint instead of Measurement class from v2 UI. Also sort the results using
7349         sortByNamePreferringOnesWithURL.
7350         * public/v3/remote.js:
7351         (RemoteAPI.getJSON): Moved under RemoteAPI.
7352         (RemoteAPI.getJSONWithStatus): Ditto.
7353         (PrivilegedAPI):
7354         (PrivilegedAPI.requestCSRFToken):
7356 2016-03-17  Ryosuke Niwa  <rniwa@webkit.org>
7358         Add unit tests for config.json and statistics.js
7359         https://bugs.webkit.org/show_bug.cgi?id=155626
7361         Reviewed by Darin Adler.
7363         Added mocha unit tests for statistics.js and validating config.json. For segmentations, I've extracted
7364         real data from our internal perf dashboard.
7366         Also fixed some bugs covered by these new tests.
7368         * public/shared/statistics.js:
7369         (Statistics.movingAverage): Fixed a bug that forwardWindowSize was never used.
7370         (Statistics.exponentialMovingAverage): Fixed the bug that the moving average starts at 0. It should
7371         start at the first value instead.
7372         (.splitIntoSegmentsUntilGoodEnough): Fixed the bug that we may try to segment a time series into
7373         more parts than there are data points. Clearly, that doesn't make any sense.
7374         (.findOptimalSegmentation): Renamed local variables so that they're more descriptive, and rewrote
7375         the debugging code was the old code was emitting some useless data. Also fixed the bug that the length
7376         of "segmentation" was off by one (we need segmentCount + 1 elements in the array sine we always
7377         include the start of the first segment = 0 and the end of the last segment = values.length).
7378         (.SampleVarianceUpperTriangularMatrix):
7379         (Statistics): Modernized the export code.
7380         * tools/js: Added.
7381         * tools/js/config.js: Added.
7382         (Config): Added.
7383         (Config.prototype.configFilePath): Added.
7384         (Config.prototype.value): Added.
7385         (Config.prototype.path): Added.
7386         * tools/js/database.js: Added.
7387         (Database): Added.
7388         (Database.prototype.connect): Added.
7389         (Database.prototype.disconnect): Added.
7390         * unit-tests: Added.
7391         * unit-tests/checkconfig.js: Added. Validates config.json. This is useful while setting up
7392         a local instance of the perf dashboard.
7393         * unit-tests/statistics-tests.js: Added.
7394         (assert.almostEqual): Added. Asserts that two floating values are within a given significant digits.
7395         (.stdev):
7396         (.delta):
7397         (.computeWelchsT):
7399 2016-03-17  Ryosuke Niwa  <rniwa@webkit.org>
7401         Fix a typo which was supposed to be fixed in r198351.
7403         * public/v3/pages/analysis-task-page.js:
7404         (AnalysisTaskPage.prototype.render):
7406 2016-03-17  Ryosuke Niwa  <rniwa@webkit.org>
7408         An analysis task should be closed if a progression cause is identified
7409         https://bugs.webkit.org/show_bug.cgi?id=155549
7411         Reviewed by Chris Dumez.
7413         Since a progression is desirable, we should close an analysis task once its cause is identified.
7415         Also fix some typos.
7417         * init-database.sql: Fixed a typo.
7418         * public/api/analysis-tasks.php:
7419         * public/v3/models/analysis-task.js:
7420         (AnalysisTask.prototype.dissociateBug): Renamed from dissociateBug.
7421         * public/v3/pages/analysis-task-page.js:
7422         (AnalysisTaskPage.prototype.render):
7423         (AnalysisTaskPage.prototype._dissociateBug): Renamed from _dissociateBug.
7424         (AnalysisTaskPage.prototype._dissociateCommit): Fixed the typo in the alert.
7426 2016-03-16  Ryosuke Niwa  <rniwa@webkit.org>
7428         Analysis task page should allow specifying commits that caused or fixed a regression or a progression
7429         https://bugs.webkit.org/show_bug.cgi?id=155529
7431         Reviewed by Chris Dumez.
7433         Added the capability to associate revisions that caused or fixed a progression or a regression for which
7434         an analysis task was created. Added task_commits that stores this relationship and added the backend
7435         support to retrieve this table in /api/analysis-tasks and an privileged API to update this table at
7436         /privileged-api/associate-commit.
7438         Also extracted a new component, MutableListView, out of AnalysisTaskPage to render and manipulate a list
7439         of mutable items, and used it to render the list of associated bugs and commits. The view takes a list of
7440         kinds (e.g. repositories or bug trackers), and accepts a pair of a kind and arbitrary text as a new item
7441         value.
7443         * init-database.sql: Added task_commits table.
7445         * public/api/analysis-tasks.php:
7446         (main):
7447         (fetch_associated_data_for_tasks): Renamed from fetch_and_push_bugs_to_tasks now that it also fetches
7448         the list of commits associated with each analysis task by calling CommitLogFetcher::fetch_for_tasks.
7449         Also fixe the bug that we were not taking 
7450         (format_task): No longer sets 'category' since the computation of category now depends on the list of
7451         commits associated with this analysis task which aren't available until fetch_associated_data_for_tasks.
7452         (determine_category): Added. Categorize any analysis tasks with "fixes" commits as "closed" and "causes"
7453         commits as "identified".
7455         * public/include/commit-log-fetcher.php:
7456         (CommitLogFetcher::__construct): Remove the unused instance variable.
7457         (CommitLogFetcher::fetch_for_tasks): Added. Fetches all commits associated with a list of analysis tasks.
7458         Assumes the caller (fetch_associated_data_for_tasks) had setup "fixes" and "causes" fields on each task.
7460         * public/privileged-api/associate-commit.php: Added. Updates task_commits table to associate or disassociate
7461         a commit with an analysis task. When the specified analysis task and the specified commit are already
7462         associated, we simply update the table instead of adding a duplicating entry or error. For dissociation,
7463         the front-end specifies the commit ID.
7464         (main): Added.
7466         * public/v3/index.html:
7467         * public/v3/components/mutable-list-view.js: Added. Used by the list associated bugs and commits.
7468         (MutableListView): Added.
7469         (MutableListView.prototype.setList): Added.
7470         (MutableListView.prototype.setKindList): Added.
7471         (MutableListView.prototype.setAddCallback): Added. This callback is invoked when the user tries to add
7472         a new item to the list.
7473         (MutableListView.prototype.render): Added.
7474         (MutableListView.prototype._submitted): Added.
7475         (MutableListView.cssTemplate):
7476         (MutableListView.htmlTemplate):
7477         (MutableListItem): Added. RemovalLink could be a hyperlink or a callback and gets involved when the user
7478         tries to delete this item.
7479         (MutableListItem.prototype.content):
7481         * public/v3/models/analysis-task.js:
7482         (AnalysisTask): Added the support of the list of commits that fixed and caused changes.
7483         (AnalysisTask.prototype.updateSingleton): Ditto.
7484         (AnalysisTask.prototype.causes): Added.
7485         (AnalysisTask.prototype.fixes): Added.
7486         (AnalysisTask.prototype.associateCommit): Added. Use the API added at /privileged-api/associate-commit
7487         to associate a new commit with this analysis task. Each commit has either caused or fixed the change.
7488         (AnalysisTask.prototype.dissociateCommit): Added. Use the same API to disassociate each commit.
7489         (AnalysisTask._constructAnalysisTasksFromRawData): Find all commits associated with each analysis task.
7490         Because commit log objects use a fake ID fdue to /api/measurement-set not providing commit IDs, we must
7491         use CommitLog.findByRemoteId to find each commit instead of usual CommitLog.findById.
7492         (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Added.
7494         * public/v3/models/build-request.js:
7495         (BuildRequest.prototype.hasFinished): Renamed from hasCompleted since it was confusing for this._status
7496         being "completed" wasn't a necessary condition for this function to return true.
7498         * public/v3/models/commit-log.js:
7499         (CommitLog): Added the static map for actual commit ID instead of a fake ID created in ensureSingleton.
7500         (CommitLog.prototype.remoteId): Added. Returns the real commit ID.
7501         (CommitLog.findByRemoteId): Added. Finds an CommitLog object using the real ID.
7503         * public/v3/models/test-group.js:
7504         (TestGroup.prototype.hasFinished): Renamed from hasCompleted to match the rename in BuildRequest.
7506         * public/v3/pages/analysis-task-page.js:
7507         (AnalysisTaskPage): Added lists for the commits that fixed and caused the change using MutableListView.
7508         Also adopted MutableListView for the list of associated bugs.
7509         (AnalysisTaskPage.prototype.render): Added the code to populate the newly added lists.
7510         (AnalysisTaskPage.prototype._makeCommitListItem): Added.
7511         (AnalysisTaskPage.prototype._associateBug): Now this is a callback from MutableListView.
7512         (AnalysisTaskPage.prototype._associateCommit): Added.
7513         (AnalysisTaskPage.prototype._dissociateCommit): Added.
7514         (AnalysisTaskPage.htmlTemplate):
7515         (AnalysisTaskPage.cssTemplate):
7517         * public/v3/remote.js:
7518         (getJSON): Spit out the entire responseText when JSON failed to parse to make debugging easier.
7520 2016-03-15  Ryosuke Niwa  <rniwa@webkit.org>
7522         Extract the code to format commit logs into its own PHP file
7523         https://bugs.webkit.org/show_bug.cgi?id=155514
7525         Rubber-stamped by Chris Dumez.
7527         Extracted CommitLogFetcher out of /api/commits so that it could be used in analysis-tasks.php
7528         in the future to support associating cause/fix for each analysis task.
7530         * public/api/commits.php:
7531         * public/include/commit-log-fetcher.php: Added.
7532         (CommitLogFetcher)
7533         (CommitLogFetcher::__construct): Added.
7534         (CommitLogFetcher::repository_id_from_name): Added.
7535         (CommitLogFetcher::fetch_between): Added.
7536         (CommitLogFetcher::fetch_oldest): Added.
7537         (CommitLogFetcher::fetch_latest): Added.
7538         (CommitLogFetcher::fetch_last_reported): Added.
7539         (CommitLogFetcher::fetch_revision): Added.
7540         (CommitLogFetcher::commit_for_revision): Added.
7541         (CommitLogFetcher::format_single_commit): Added.
7542         (CommitLogFetcher::format_commit): Added.
7544 2016-03-09  Ryosuke Niwa  <rniwa@webkit.org>
7546         Build fix after r196870.
7548         * public/include/report-processor.php:
7550 2016-03-09  Ryosuke Niwa  <rniwa@webkit.org>
7552         Add Size metric to perf dashboard
7553         https://bugs.webkit.org/show_bug.cgi?id=155266
7555         Reviewed by Chris Dumez.
7557         Added the "Size" metric and use bytes as its unit.
7559         * public/js/helper-classes.js:
7560         (PerfTestRuns):
7561         * public/v2/data.js:
7562         (RunsData.unitFromMetricName):
7564 2016-02-20  Ryosuke Niwa  <rniwa@webkit.org>
7566         Add the support for universal slave password
7567         https://bugs.webkit.org/show_bug.cgi?id=154476
7569         Reviewed by David Kilzer.
7571         Added the support for universalSlavePassword.
7573         * config.json:
7574         * public/include/report-processor.php:
7575         (ReportProcessor::process):
7576         (ReportProcessor::authenticate_and_construct_build_data): Extracted from process().
7578 2016-02-19  Ryosuke Niwa  <rniwa@webkit.org>
7580         Analysis tasks page complains about missing repository but with a wrong name
7581         https://bugs.webkit.org/show_bug.cgi?id=154468
7583         Reviewed by Chris Dumez.
7585         Fixed the bug by using the right variable in the template literal.
7587         * public/v3/components/customizable-test-group-form.js:
7588         (CustomizableTestGroupForm.prototype._computeRootSetMap): Use querySelector here since Chrome doesn't have
7589         getElementsByClassName on ShadowRoot.
7590         * public/v3/pages/analysis-task-page.js:
7591         (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Use name which is the name of
7592         repository here.
7594 2016-02-18  Ryosuke Niwa  <rniwa@webkit.org>
7596         Revert an unintended change made in the previous commit.
7598         * init-database.sql:
7600 2016-02-18  Ryosuke Niwa  <rniwa@webkit.org>
7602         Perf dashboard should let user cancel pending A/B testing and hide failed ones
7603         https://bugs.webkit.org/show_bug.cgi?id=154433
7605         Reviewed by Chris Dumez.
7607         Added a button to hide a test group in the details view (the bottom table) in the analysis task page, and
7608         "Show hidden tests" link to show the hidden test groups on demand. When a test group is hidden, all pending
7609         requests in the group will also be canceled since a common scenario of using this feature is that the user
7610         had triggered an useless A/B testing; e.g. all builds will fail, wrong, etc... We can revisit and add the
7611         capability to just cancel the pending requests and leaving the group visible later if necessary.
7613         Run `ALTER TYPE build_request_status_type ADD VALUE 'canceled';` to add the new type.
7615         * init-database.sql: Added testgroup_hidden column to analysis_test_groups table and added 'canceled'
7616         as a value to build_request_status_type table.
7617         * public/api/test-groups.php:
7618         (format_test_group): Added 'hidden' field in the JSON result.
7619         * public/privileged-api/update-test-group.php:
7620         (main): Added the support for updating testgroup_hidden column. When this column is set to true, also
7621         cancel all pending build requests (by setting its request_status to 'canceled' which will be ignore by
7622         the syncing script).
7623         * public/v3/components/test-group-results-table.js:
7624         (TestGroupResultsTable.prototype.setTestGroup): Reset _renderedTestGroup here so that the next call to
7625         render() will update the table; e.g. when build requests' status change from 'Pending' to 'Canceled'.
7626         * public/v3/models/build-request.js:
7627         (BuildRequest.prototype.hasCompleted): A build request is considered complete/finished if it's canceled.
7628         (BuildRequest.prototype.hasPending): Added.
7629         (BuildRequest.prototype.statusLabel): Handle 'canceled' status.
7630         * public/v3/models/test-group.js:
7631         (TestGroup):
7632         (TestGroup.prototype.updateSingleton): Added to update 'hidden' field.
7633         (TestGroup.prototype.isHidden): Added.
7634         (TestGroup.prototype.hasPending): Added.
7635         (TestGroup.prototype.hasPending): Added.
7636         (TestGroup.prototype.updateHiddenFlag): Added. Uses the privileged API to update testgroup_hidden column.
7637         The JSON API also updates the status of the 'pending' build requests in the group to 'canceled'.
7638         * public/v3/pages/analysis-task-page.js:
7639         (AnalysisTaskPage): Added _showHiddenTestGroups and _filteredTestGroups as instance variables.
7640         (AnalysisTaskPage.prototype._didFetchTestGroups):
7641         (AnalysisTaskPage.prototype._showAllTestGroups): Added.
7642         (AnalysisTaskPage.prototype._didUpdateTestGroupHiddenState): Extracted from _didFetchTestGroups.
7643         (AnalysisTaskPage.prototype._renderTestGroupList): Use the filtered list of test groups to show the list
7644         of test groups. When all test groups are shown, we would first show the hidden ones after the regular ones.
7645         (AnalysisTaskPage.prototype._createTestGroupListItem): Extracted from _renderTestGroupList.
7646         (AnalysisTaskPage.prototype._renderTestGroupDetails): Update the text inside the button to hide the test
7647         group. Also show a warning text that the pending requests will be canceled if there are any.
7648         (AnalysisTaskPage.prototype._hideCurrentTestGroup): Added.
7649         (AnalysisTaskPage.cssTemplate): Updated the style.
7651 2016-02-18  Ryosuke Niwa  <rniwa@webkit.org>
7653         The rows in the analysis results table should be expandable
7654         https://bugs.webkit.org/show_bug.cgi?id=154427
7656         Reviewed by Chris Dumez.
7658         Added "(Expand)" link between rows that have hidden points. Upon click it inserts the hidden rows.
7660         We insert around five rows at a time when there are hundreds of hidden points but we also avoid leaving
7661         behind expandable rows of less than two rows.
7663         Also fixed a bug in CustomizableTestGroupForm that getElementsById would throw in the shipping Safari
7664         because getElementsById doesn't exist on Element.prototype by using class name instead.
7666         * public/v3/components/analysis-results-viewer.js:
7667         (AnalysisResultsViewer):
7668         (AnalysisResultsViewer.prototype.setCurrentTestGroup): Removed superfluous call to render().
7669         (AnalysisResultsViewer.prototype.setPoints): Always show the start and the end points.
7670         (AnalysisResultsViewer.prototype.buildRowGroups):
7671         (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Add an instance of ExpandableRow which
7672         shows a "(Expand)" link to show hidden rows here.
7673         (AnalysisResultsViewer.prototype._expandBetween): Added. Expands rows between two points.
7674         (AnalysisResultsViewer.cssTemplate): Added rules for "(Expand)" links.
7675         (AnalysisResultsViewer.ExpandableRow): Added.
7676         (AnalysisResultsViewer.ExpandableRow.prototype.resultContent): Added. Overrides what's in the results column.
7677         (AnalysisResultsViewer.ExpandableRow.prototype.heading): Added. Generates "(Expand)" link.
7679         * public/v3/components/customizable-test-group-form.js:
7680         (CustomizableTestGroupForm.prototype._computeRootSetMap): Use getElementsByClassName instead of
7681         getElementById.
7682         (CustomizableTestGroupForm.prototype._classForLabelAndRepository): Renamed from _idForLabelAndRepository.
7683         (CustomizableTestGroupForm._constructRevisionRadioButtons): Set class name instead of id.
7685         * public/v3/components/results-table.js:
7686         (ResultsTable.prototype.render): Don't generate radio buttons to select a row when root set is missing;
7687         e.g. for rows that show "(Expand)" links.
7689 2016-02-18  Ryosuke Niwa  <rniwa@webkit.org>
7691         Statistically significant A/B testing results should be color coded in details view
7692         https://bugs.webkit.org/show_bug.cgi?id=154414
7694         Reviewed by Chris Dumez.
7696         Color code the statistically significant comparisions in TestGroupResultsTable as done in the analysis
7697         results viewer.
7699         * public/v3/components/customizable-test-group-form.js:
7700         (CustomizableTestGroupForm.cssTemplate): Build fix after r196768.
7701         * public/v3/components/test-group-results-table.js:
7702         (TestGroupResultsTable.prototype.buildRowGroups): Add the status as a class name.
7703         (TestGroupResultsTable.cssTemplate): Added styles to color-code statistically significant results.
7705 2016-02-17  Ryosuke Niwa  <rniwa@webkit.org>
7707         v3 UI should allow custom revisions for A/B testing
7708         https://bugs.webkit.org/show_bug.cgi?id=154379
7710         Reviewed by Chris Dumez.
7712         Added the capability to customize revisions selected in the overview chart and the results viewer.
7714         Newly added CustomizableTestGroupForm is responsible for allowing users to modify the set of revisions in
7715         a new A/B testing group. Unlike TestGroupForm which doesn't know anything about which revisions are selected
7716         for each project/repository, CustomizableTestGroupForm is aware of the list of revisions used in each set.
7718         The list of revisions used in each set is represented by RootSet if users had not customized them, and
7719         CustomRootSet otherwise; the latter was added since regular RootSet object requires CommitLog and other
7720         DataModelObjects which are hard to create without corresponding database entries.
7722         * public/v3/components/customizable-test-group-form.js: Added.
7723         (CustomizableTestGroupForm): Added.
7724         (CustomizableTestGroupForm.prototype.setRootSetMap): Added.
7725         (CustomizableTestGroupForm.prototype._submitted): Overrides the superclass' method.
7726         (CustomizableTestGroupForm.prototype._customize): Ditto. Unlike TestGroupForm's callback, this class'
7727         callback passes in a root set map as the third argument.
7728         (CustomizableTestGroupForm.prototype._computeRootSetMap): Added. Returns this._rootSetMap, which is set by
7729         AnalysisTaskPage if user had not customized the root sets. Otherwise return a new map with CustomRootSet's.
7730         (CustomizableTestGroupForm.prototype.render): Added. Creates a table to allow customization of root sets.
7731         (CustomizableTestGroupForm._constructRevisionRadioButtons): Added.
7732         (CustomizableTestGroupForm._createRadioButton): Added.
7733         (CustomizableTestGroupForm.cssTemplate): Added.
7734         (CustomizableTestGroupForm.formContent): Added. This method is called by TestGroupForm.htmlTemplate.
7735         * public/v3/components/test-group-form.js:
7736         (TestGroupForm): Updated the various methods to not directly mutate DOM. Store the state in instance
7737         variables and update DOM in render() as done elsewhere.
7738         (TestGroupForm.prototype.setNeedsName): Deleted. We no longer need this flag since TestGroupForm which is
7739         used for retries never needs a name and CustomizableTestGroupForm which is used to create a new test group
7740         always requires a name.
7741         (TestGroupForm.prototype.setDisabled):
7742         (TestGroupForm.prototype.setLabel):
7743         (TestGroupForm.prototype.setRepetitionCount):
7744         (TestGroupForm.prototype.render): Added.
7745         (TestGroupForm.prototype._submitted): Moved the code to prevent the default action has been moved to the
7746         constructor since this method is overridden by CustomizableTestGroupForm.
7747         (TestGroupForm.cssTemplate): Added.
7748         (TestGroupForm.htmlTemplate):
7749         (TestGroupForm.formContent): Extracted from htmlTemplate.
7750         * public/v3/index.html:
7751         * public/v3/models/repository.js:
7752         (Repository.sortByNamePreferringOnesWithURL): Added.
7753         * public/v3/models/root-set.js:
7754         (RootSet.prototype.revisionForRepository): Added so that _createTestGroupAfterVerifyingRootSetList can retrieve
7755         the revision information from CustomRootSet without going through CommitLog objects since CustomRootSet doesn't
7756         have associated CommitLog objects.
7757         (CustomRootSet): Added. Used by CustomizableTestGroupForm to create a custom root map since regular RootSet
7758         requires CommitLog and other related objects which are hard to create without database entries.
7759         (CustomRootSet.prototype.setRevisionForRepository): Added.
7760         (CustomRootSet.prototype.repositories): Added.
7761         (CustomRootSet.prototype.revisionForRepository): Added.
7762         * public/v3/pages/analysis-task-page.js:
7763         (AnalysisTaskPage):
7764         (AnalysisTaskPage.prototype.render): Removed the reference to v2 UI since v3 UI is now strictly more powerful
7765         than v2 UI. Also update the root set maps in each form here.
7766         (AnalysisTaskPage.prototype._retryCurrentTestGroup): No longer takes unused name argument as it got removed
7767         from TestGroupForm.
7768         (AnalysisTaskPage.prototype._chartSelectionDidChange): No longer updates the disabled-ness here since it's now
7769         done in render() via setRootSetMap().
7770         (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Now takes rootSetMap as an argument.
7771         (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): No longer updates the disabled-ness here
7772         since it's now done in render() via setRootSetMap().
7773         (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Now takes rootSetMap as an argument.
7774         (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Take a dictionary of root set labels
7775         such as A and B, which maps to a RootSet or a newly-added CustomRootSet.
7776         (AnalysisTaskPage.htmlTemplate): Use customizable-test-group-form for creating a new A/B testing group. Retry
7777         form will continue to use TestGroupForm since customizing revisions is non-sensical in retries.
7778         (AnalysisTaskPage.cssTemplate): Updated the style.
7780 2016-02-16  Ryosuke Niwa  <rniwa@webkit.org>
7782         v3 UI has the capability to schedule an A/B testing in a specific range
7783         https://bugs.webkit.org/show_bug.cgi?id=154329
7785         Reviewed by Chris Dumez.
7787         Extended AnalysisTaskChartPane and ResultsTable so that users can select a range of points in either
7788         the overview chart pane and the results viewer table. Extracted TestGroupForm out of the analysis task
7789         page and used right below those two components in the analysis task page.
7791         * public/v3/components/results-table.js:
7792         (ResultsTable):
7793         (ResultsTable.prototype.setRangeSelectorLabels): Added.
7794         (ResultsTable.prototype.setRangeSelectorCallback): Added.
7795         (ResultsTable.prototype.selectedRange): Added.
7796         (ResultsTable.prototype._rangeSelectorClicked): Added.
7797         (ResultsTable.prototype.render): Generate radio boxes to select a range.
7799         * public/v3/components/test-group-form.js:
7800         (TestGroupForm):
7801         (TestGroupForm.prototype.setStartCallback): Added.
7802         (TestGroupForm.prototype.setNeedsName): Added.
7803         (TestGroupForm.prototype.setDisabled): Added.
7804         (TestGroupForm.prototype.setLabel): Added.
7805         (TestGroupForm.prototype.setRepetitionCount): Added.
7806         (TestGroupForm.prototype._submitted): Added.
7807         (TestGroupForm.htmlTemplate): Extracted from AnalysisTaskPage.htmlTemplate.
7809         * public/v3/index.html:
7811         * public/v3/pages/analysis-task-page.js:
7812         (AnalysisTaskChartPane.prototype._mainSelectionDidChange): Added. Delegates the work to AnalysisTaskPage.
7813         (AnalysisTaskChartPane.prototype.selectedPoints): Added.
7814         (AnalysisTaskPage):
7815         (AnalysisTaskPage.prototype.title):
7816         (AnalysisTaskPage.prototype.render):
7817         (AnalysisTaskPage.prototype._renderTestGroupDetails): Use TestGroupForm's methods instead of mutating DOM. 
7818         (AnalysisTaskPage.prototype._retryCurrentTestGroup):
7819         (AnalysisTaskPage.prototype._chartSelectionDidChange): Added.
7820         (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Added.
7821         (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): Added.
7822         (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Added.
7823         (AnalysisTaskPage.prototype._createRetryNameForTestGroup):
7824         (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Extracted from _retryCurrentTestGroup
7825         so that we can call it in _createNewTestGroupFromChart and _createNewTestGroupFromViewer.
7826         (AnalysisTaskPage.htmlTemplate):
7828 2016-02-15  Ryosuke Niwa  <rniwa@webkit.org>
7830         Extract the code specific to v2 UI out of shared statistics.js
7831         https://bugs.webkit.org/show_bug.cgi?id=154277
7833         Reviewed by Chris Dumez.
7835         Extracted statistics-strategies.js out of statistics.js for v2 UI and detect-changes.js. The intent is to
7836         deprecate this file once we implement refined statistics tools in v3 UI and adopt it in detect-changes.js.
7838         * public/shared/statistics.js:
7839         (Statistics.movingAverage): Extracted from the "Simple Moving Average" strategy.
7840         (Statistics.cumultaiveMovingAverage): Extracted from the "Cumulative Moving Average" strategy.
7841         (Statistics.exponentialMovingAverage): Extracted from the "Exponential Moving Average" strategy.
7842         Use a temporary "movingAverage" to keep the last moving average instead of relying on the previous
7843         entry in "averages" array to avoid special casing an array of length 1 and starting the loop at i = 1.
7844         (Statistics.segmentTimeSeriesGreedyWithStudentsTTest): Extracted from "Segmentation: Recursive t-test"
7845         strategy. Don't create the list of averages to match segmentTimeSeriesByMaximizingSchwarzCriterion here.
7846         It's done in newly added averagesFromSegments.
7847         (Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Extracted from
7848         "Segmentation: Schwarz criterion" strategy.
7849         (.recursivelySplitIntoTwoSegmentsAtMaxTIfSignificantlyDifferent): Just store the start index to match
7850         * public/v2/app.js:
7851         (App.Pane.updateStatisticsTools):
7852         (App.Pane._computeMovingAverageAndOutliers):
7853         * public/v2/data.js:
7854         * public/v2/index.html:
7855         * public/v2/statistics-strategies.js: Added.
7856         (StatisticsStrategies.MovingAverageStrategies): Added.
7857         (averagesFromSegments): Extracted from "Segmentation: Schwarz criterion" strategy. Now used by both
7858         "Segmentation: Recursive t-test" and "Segmentation: Schwarz criterion" strategies.
7859         (StatisticsStrategies.EnvelopingStrategies): Moved from Statistics.EnvelopingStrategies.
7860         (StatisticsStrategies.TestRangeSelectionStrategies): Moved from Statistics.TestRangeSelectionStrategies.
7861         (createWesternElectricRule): Moved from statistics.js.
7862         (countValuesOnSameSide): Ditto.
7863         (StatisticsStrategies.executeStrategy): Moved from Statistics.executeStrategy.
7864         * tools/detect-changes.js:
7865         (computeRangesForTesting):
7867 2016-02-15  Ryosuke Niwa  <rniwa@webkit.org>
7869         v1 UI and v2 UI should share statistics.js
7870         https://bugs.webkit.org/show_bug.cgi?id=154262
7872         Reviewed by Chris Dumez.
7874         Share statistics.js between v1 and v2 UI.
7876         * public/index.html:
7877         * public/js/shared.js: Deleted.
7878         * public/js/statistics.js: Removed.
7879         * public/shared: Added.
7880         * public/shared/statistics.js: Moved from Websites/perf.webkit.org/public/v2/js/statistics.js.
7881         * public/v2/index.html:
7882         * public/v2/js/statistics.js: Removed.
7883         * public/v3/index.html:
7884         * tools/detect-changes.js:
7886 2016-02-13  Ryosuke Niwa  <rniwa@webkit.org>
7888         v3 UI sometimes shows same dates twice on the x-axis of time series charts
7889         https://bugs.webkit.org/show_bug.cgi?id=154210
7891         Reviewed by Chris Dumez.
7893         The bug was caused by the label generation code in TimeSeriesChart.computeTimeGrid never emitting hours.
7895         Use hours instead of dates as labels when the current time's date is same as the previous label's date.
7896         Always include dates before entering this mode to avoid just having hours as labels on the entire x-axis.
7898         * public/v3/components/time-series-chart.js:
7899         (TimeSeriesChart.prototype._renderXAxis): Slightly increase the "average" width of x-axis label.
7900         (TimeSeriesChart.computeTimeGrid): See above. Also assert that the number of labels we generate never
7901         exceeds maxLabels as a sanity check.
7902         (TimeSeriesChart._timeIterators): Added an iterator that increments by two hours for zoomed graphs.
7904 2016-02-13  Ryosuke Niwa  <rniwa@webkit.org>
7906         v3 UI should show status and associated bugs on analysis task pages
7907         https://bugs.webkit.org/show_bug.cgi?id=154212
7909         Reviewed by Chris Dumez.
7911         Added the capability to see and modify the status and the list of associated of bugs on analysis task pages.
7913         Also added the list of related tasks, which are analysis tasks associated with the same bug or have
7914         overlapping time ranges with the same test metric but on a potentially different platform.
7916         In addition, categorize analysis tasks with the status of "no change" or "inconclusive" as "closed" as no
7917         further action can be taken (users can bring them back to non-closed state without any restrictions).
7919         * public/api/analysis-tasks.php:
7920         (format_task): Categorize 'unchanged' and 'inconclusive' analysis tasks as closed.
7922         * public/privileged-api/associate-bug.php:
7923         (main): Added shouldDelete as a new mechanism to disassociate a bug since v3 UI shares a single Bug object
7924         between multiple analysis tasks (as it should have been in the first place).
7926         * public/v3/components/chart-pane-base.js:
7927         (ChartPaneBase):
7928         (ChartPaneBase.prototype._fetchAnalysisTasks): Since each analysis task's change type (status/result) could
7929         change, we need to create annotation objects during each render() call.
7930         (ChartPaneBase.prototype.render):
7931         (ChartPaneBase.prototype._renderAnnotations): Extracted from ChartPaneBase.prototype._fetchAnalysisTasks to
7932         do that. I was afraid of the perf impact of this but it doesn't seem to be an issue in my testing.
7933         (ChartPaneBase.cssTemplate): Removed superfluous margins (moved to ChartPane.cssTemplate) around the charts
7934         since they are only useful in the charts page.
7936         * public/v3/models/analysis-task.js:
7937         (AnalysisTask):
7938         (AnalysisTask.prototype.updateSingleton): Added a comment as to why object.result cannot be renamed to
7939         object.changeType in the JSON API.
7940         (AnalysisTask.prototype.updateName): Added.
7941         (AnalysisTask.prototype.updateChangeType): Added.
7942         (AnalysisTask.prototype._updateRemoteState): Added.
7943         (AnalysisTask.prototype.associateBug): Added.
7944         (AnalysisTask.prototype.disassociateBug): Added.
7945         (AnalysisTask.fetchRelatedTasks): Added. See above for the criteria of related-ness.
7947         * public/v3/pages/analysis-task-page.js:
7948         (AnalysisTaskPage):
7949         (AnalysisTaskPage.prototype.updateFromSerializedState):
7950         (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): Extracted from updateFromSerializedState.
7951         (AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks): Added.
7952         (AnalysisTaskPage.prototype.render): Render the list of associated bugs, the list of bug trackers (so that
7953         users can use it to associate with a new bug), and the list of related analysis tasks.
7954         (AnalysisTaskPage.prototype._renderTestGroupList): Extracted from render since it was getting too long.
7955         (AnalysisTaskPage.prototype._renderTestGroupDetails): Ditto.
7956         (AnalysisTaskPage.prototype._updateChangeType): Added.
7957         (AnalysisTaskPage.prototype._associateBug): Added.
7958         (AnalysisTaskPage.prototype._disassociateBug): Added.
7959         (AnalysisTaskPage.htmlTemplate): Added various elements to show and modify the status, associate bugs,
7960         and a list of related analysis tasks.
7961         (AnalysisTaskPage.cssTemplate): Added various styles for those form controls.
7963         * public/v3/pages/chart-pane.js:
7964         (ChartPane.cssTemplate): Moved the margins from ChartPaneBase.cssTemplate.
7966 2016-02-12  Ryosuke Niwa  <rniwa@webkit.org>
7968         Perf dashboard should allow renaming analysis tasks and test groups
7969         https://bugs.webkit.org/show_bug.cgi?id=154200
7971         Reviewed by Chris Dumez.
7973         Allow editing names of analysis tasks and A/B testing groups in the v3 UI.
7975         Added the support for updating the name to the privileged API at /privileged-api/update-analysis-task
7976         and added a new prevailed API to update A/B testing groups at /privileged-api/update-test-group.
7978         * public/privileged-api/update-analysis-task.php: Added the support for renaming the analysis task.
7979         (main):
7981         * public/privileged-api/update-test-group.php: Added. Supports updating the test group's name.
7982         (main):
7984         * public/v3/components/editable-text.js: Added.
7985         (EditableText): Added. A new editable text label control. It looks like a text node with "(Edit)" link
7986         at the end which allow users to go into the "editing mode", which reveals an input element.
7987         The user can exit the editing mode by either moving the focus away from the control or clicking on
7988         "(Save)" at the end. It calls _updateCallback in the latter case.
7989         (EditableText.prototype.editedText): Returns the current value of the input element user.
7990         (EditableText.prototype.setText): Sets the label. This does not live-update the input element until
7991         the user exists the current editing mode and re-enters it.
7992         (EditableText.prototype.setStartedEditingCallback): Sets a callback which gets called when the user
7993         requested to enter the editing mode. Since EditableText relies on AnalysisTaskPage to render, this
7994         callback only exits to call EditableText.render() in AnalysisTask._didStartEditingTaskName.
7995         (EditableText.prototype.setUpdateCallback): Sets a callback which gets called when the user exits
7996         the editing mode by activating the "(Save)" link. This callback MUST return a promise upon resolution
7997         of which the control gets out of the editing mode. While the promise is in flight, the input element
7998         becomes readonly.
7999         (EditableText.prototype.render): Updates various states of the elements. When _updatingPromise is not
8000         falsy, we make the input element readonly and show '(...)' on the link. Don't show the action link
8001         if the label is empty (e.g. analysis task or test group is still being fetched).
8002         (EditableText.prototype._didClick): Called when the user clicked on the action link. Enter the editing
8003         mode or save the edited label via _updateCallback.
8004         (EditableText.prototype._didBlur): Exit the editing mode without saving if the input element is not
8005         focused, there is no inflight promise returned by _updateCallback, and the action link "(Save)" does
8006         not have the focus.
8007         (EditableText.prototype._didUpdate): Called when exiting the editing mode.
8008         (EditableText.htmlTemplate):
8009         (EditableText.cssTemplate):
8011         * public/v3/index.html: Include newly added editable-text.js.
8013         * public/v3/models/analysis-task.js:
8014         (AnalysisTask.prototype.updateSingleton): Added.
8015         (AnalysisTask.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
8016         the analysis task from the sever.
8017         (AnalysisTask._constructAnalysisTasksFromRawData): Use ensureSingleton instead of manually calling
8018         findById since we need to update the name of the singleton object we found (via updateSingleton).
8020         * public/v3/models/bug.js:
8021         (Bug.ensureSingleton): Moved the code to compute the synthetic id from AnalysisTask's
8022         _constructAnalysisTasksFromRawData.
8023         (Bug.prototype.updateSingleton): Added. Just assert that nothing changes.
8025         * public/v3/models/build-request.js:
8026         (BuildRequest.prototype.updateSingleton): Added. Assert that the intrinsic values of a build request
8027         doesn't change and update status text, status url, and build id as they could change.
8029         * public/v3/models/commit-log.js:
8030         (CommitLog): Made the constructor argument conform to the convention of id, object pair so that we can
8031         use DataModelObject.ensureSingleton.
8032         (CommitLog.ensureSingleton): 
8033         (CommitLog.prototype.updateSingleton): Extracted from CommitLog.ensureSingleton.
8035         * public/v3/models/data-model.js:
8036         (DataModelObject.ensureSingleton): Call newly added updateSingleton.
8037         (DataModelObject.prototype.updateSingleton):
8038         (LabeledObject): Removed the name map since it's never used (findByName is never called anywhere).
8039         (LabeledObject.prototype.updateSingleton): Added. Updates _name.
8040         (LabeledObject.findByName): Deleted.
8042         * public/v3/models/test-group.js:
8043         (TestGroup.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
8044         the test group from the sever.
8045         (TestGroup._createModelsFromFetchedTestGroups): Removed bogus code. A root set doesn't have a test
8046         group associated with it since multiple test groups can share a single root set (this property doesn't
8047         even exist).
8049         * public/v3/pages/analysis-task-page.js:
8050         (AnalysisTaskPage): Removed useless _taskId and added this._testGroupLabelMap and this._taskNameLabel.
8051         (AnalysisTaskPage.prototype.updateFromSerializedState): Cleanup.
8052         (AnalysisTaskPage.prototype._didFetchTask): Assert that this function is called exactly once.
8053         (AnalysisTaskPage.prototype.render): Use this._task.id() to show the v2 link. Use EditableText to show
8054         the names of the analysis task and the associated test groups. Hide the overview chart and the list of
8055         test groups (along with the retry/confirm button) when the analysis task failed to fetch. We always
8056         update the names of the analysis task and the associated test groups since they could be updated by
8057         the server.
8058         (AnalysisTaskPage.prototype._didStartEditingTaskName): Added.
8059         (AnalysisTaskPage.prototype._updateTaskName): Added.
8060         (AnalysisTaskPage.prototype._updateTestGroupName): Added.
8061         (AnalysisTaskPage.htmlTemplate): Updated the style.
8063 2016-02-11  Ryosuke Niwa  <rniwa@webkit.org>
8065         Land the change that was supposed to be the part of r196463.
8067         * public/v3/pages/analysis-task-page.js:
8068         (AnalysisTaskPage.prototype._didFetchTestGroups): Select the latest test group by default.
8070 2016-02-11  Ryosuke Niwa  <rniwa@webkit.org>
8072         Refine v3 UI's analysis task page
8073         https://bugs.webkit.org/show_bug.cgi?id=154152
8075         Reviewed by Chris Dumez.
8077         This patch makes the following refinements to the analysis task page:
8078          - Always show the relative different of in-progress A/B testing.
8079          - Make the annotations (colored bars) in the chart open other analysis tasks.
8080          - Order the A/B testing groups in the reverse chronological order.
8081          - Select the time range corresponding to the current test group.
8083         * public/v3/components/analysis-results-viewer.js:
8084         (AnalysisResultsViewer.cssTemplate): Fixed the bug that pending and running testing groups are no longer
8085         colored after r196440. Use a slightly more opaque color for currently running groups compared to pending ones.
8087         * public/v3/components/chart-pane-base.js:
8088         (ChartPaneBase.prototype.setMainSelection): Added.
8089         (ChartPaneBase.prototype._openAnalysisTask): Moved the code from ChartPane._openAnalysisTask so that it can be
8090         reused in both AnalysisTaskChartPane and ChartPane (in charts page).
8091         (ChartPaneBase.prototype.router): Added. Overridden by each subclass.
8093         * public/v3/components/test-group-results-table.js:
8094         (TestGroupResultsTable.prototype.buildRowGroups): Always show the summary (relative difference of A to B) as
8095         long as there are some results in each set.
8097         * public/v3/models/test-group.js:
8098         (TestGroup.prototype.compareTestResults): Always set .label and .fullLabel with the relative change as long as
8099         there are some values. Keep using "pending" and "running" in .status since that would determine the color of
8100         stacking blocks representing those A/B testing groups. 
8102         * public/v3/pages/analysis-task-page.js:
8103         (AnalysisTaskChartPane):
8104         (AnalysisTaskChartPane.prototype.setPage): Added.
8105         (AnalysisTaskChartPane.prototype.router): Added.
8106         (AnalysisTaskPage):
8107         (AnalysisTaskPage.prototype.render): Show the list of A/B testing groups in the reverse chronological order.
8108         Also set the main chart's selection to the time range of the current test group.
8110         * public/v3/pages/chart-pane.js:
8111         (ChartPane.prototype.router): Added.
8112         (ChartPane.prototype._openAnalysisTask): Moved to ChartPaneBase.prototype._openAnalysisTask.
8114 2016-02-11  Ryosuke Niwa  <rniwa@webkit.org>
8116         Add a script to process backlogs created while perf dashboard was in the maintenance mode
8117         https://bugs.webkit.org/show_bug.cgi?id=154140
8119         Reviewed by Chris Dumez.
8121         Added a script to process the backlog JSONs created while the perf dashboard was put in the maintenance mode.
8122         It re-submits each JSON file to the perf dashboard using the same server config file used by syncing scripts.
8124         * public/include/report-processor.php:
8125         (TestRunsGenerator::test_value_list_to_values_by_iterations): Fixed a bug in the error message code. It was
8126         referencing an undeclared variable.
8127         * tools/process-maintenance-backlog.py: Added.
8129 2016-02-11  Ryosuke Niwa  <rniwa@webkit.org>
8131         AnalysisResultsViewer never uses this._smallerIsBetter
8132         https://bugs.webkit.org/show_bug.cgi?id=154134
8134         Reviewed by Chris Dumez.
8136         Removed the unused instance variable _smallerIsBetter from AnalysisResultsViewer and TestGroupStackingBlock.
8138         * public/v3/components/analysis-results-viewer.js:
8139         (AnalysisResultsViewer): Removed the unused _smallerIsBetter.
8140         (AnalysisResultsViewer.prototype.setSmallerIsBetter): Deleted.
8141         (AnalysisResultsViewer.prototype.buildRowGroups):
8142         (AnalysisResultsViewer.TestGroupStackingBlock): Removed the unused _smallerIsBetter.
8143         * public/v3/pages/analysis-task-page.js:
8144         (AnalysisTaskPage.prototype._didFetchTask):
8146 2016-02-11  Ryosuke Niwa  <rniwa@webkit.org>
8148         Build fix after r196440.
8150         * public/v3/models/test-group.js:
8151         (TestGroup.prototype.addBuildRequest): Clear the map instead of setting the property to null.
8153 2016-02-10  Ryosuke Niwa  <rniwa@webkit.org>
8155         Perf dashboard should have UI to retry A/B testing
8156         https://bugs.webkit.org/show_bug.cgi?id=154090
8158         Reviewed by Chris Dumez.
8160         Added a button to re-try an existing A/B testing group with a custom repetition count. The same button functions
8161         as a way of confirming the progression/regression when there have been no A/B testing scheduled in the task.
8163         Also fixed the bug that A/B testing groups that have been waiting for other test groups will be shown as "running".
8165         * public/v3/components/results-table.js:
8166         (ResultsTable.cssTemplate): Don't pad the list of extra repositories when it's empty.
8168         * public/v3/components/test-group-results-table.js:
8169         (TestGroupResultsTable.prototype.buildRowGroups): Use TestGroup.labelForRootSet instead of manually
8170         computing the letter for each configuration set.
8172         * public/v3/models/build-request.js:
8173         (BuildRequest.prototype.hasStarted): Added.
8175         * public/v3/models/data-model.js:
8176         (DataModelObject.ensureSingleton): Added.
8177         (DataModelObject.cachedFetch): Added noCache option. This is used when re-fetching the test groups after
8178         creating one.
8180         * public/v3/models/measurement-cluster.js:
8181         (MeasurementCluster.prototype.startTime): Added.
8183         * public/v3/models/measurement-set.js:
8184         (MeasurementSet.prototype.hasFetchedRange): Added. Returns true only if there are no "holes" (cluster
8185         yet to be fetched) between the specified time range. This was added to fix a bug in AnalysisTaskPage's
8186         _didFetchMeasurement.
8188         * public/v3/models/test-group.js:
8189         (TestGroup): Added this._rootSetToLabel.
8190         (TestGroup.prototype.addBuildRequest): Reset this._rootSetToLabel along with this._requestedRootSets. 
8191         (TestGroup.prototype.repetitionCount): Added. Returns the number of iterations executed per set. We assume that
8192         every root set in the test group shares a single repetition count.
8193         (TestGroup.prototype.requestedRootSets): Now populates this._rootSetToLabel for labelForRootSet.
8194         (TestGroup.prototype.labelForRootSet): Added.
8195         (TestGroup.prototype.hasStarted): Added.
8196         (TestGroup.prototype.compareTestResults): Use 'running' and 'pending' to differentiate test groups that are waiting
8197         for other groups to finish running from the ones that are actually running ('incomplete' before this patch).
8198         (TestGroup.fetchByTask):
8199         (TestGroup.createAndRefetchTestGroups): Added. Creates a new test group using the privileged-api/create-test-group
8200         and fetches the list of test groups for the specified analysis task.
8201         (TestGroup._createModelsFromFetchedTestGroups): Extracted from TestGroup.fetchByTask.
8203         * public/v3/pages/analysis-task-page.js:
8204         (AnalysisTaskPage): Initialize _renderedCurrentTestGroup to undefined so that we'd always can differentiate
8205         the initial call to AnalysisTaskPage.render and subsequent calls in which it's identical to _currentTestGroup.
8206         (AnalysisTaskPage.prototype._didFetchMeasurement): Fixed a bug that we don't exit early even when some
8207         clusters in between startPoint and endPoint are still being fetched via newly added hasFetchedRange.
8208         (AnalysisTaskPage.prototype.render): Update the default repetition count based on the current test group.
8209         Also update the label of the button to "Confirm the change" if there is no A/B testing in this task.
8210         (AnalysisTaskPage.prototype._retryCurrentTestGroup): Added. Re-triggers an existing A/B testing group or creates
8211         the A/B testing for the entire range of the analysis task.
8212         (AnalysisTaskPage.prototype._hasDuplicateTestGroupName): Added.
8213         (AnalysisTaskPage.prototype._createRetryNameForTestGroup): Added.
8214         (AnalysisTaskPage.htmlTemplate): Added form controls to re-trigger A/B testing.
8215         (AnalysisTaskPage.cssTemplate): Updated the style.
8217 2016-02-10  Ryosuke Niwa  <rniwa@webkit.org>
8219         Removed the duplicated definition of ChartPaneBase.
8221         * public/v3/components/chart-pane-base.js:
8223 2016-02-09  Ryosuke Niwa  <rniwa@webkit.org>
8225         Analysis task page on v3 UI should show charts
8226         https://bugs.webkit.org/show_bug.cgi?id=154057
8228         Reviewed by Chris Dumez.
8230         Extracted ChartPaneBase out of ChartPane and added an instance of its new subclass, AnalysisTaskChartPane,
8231         to the analysis task page. The main difference is that ChartPaneBase doesn't depend on the presence of
8232         this._chartsPage unlike ChartPane. It also doesn't have the header with toolbar (to show breakdown, etc...).
8234         * public/v3/components/base.js:
8235         (ComponentBase.prototype._constructShadowTree): Call htmlTemplate() and cssTemplate() with the right "this".
8237         * public/v3/components/chart-pane-base.js: Added.
8238         (ChartPaneBase): Extracted from ChartPane.
8239         (ChartPaneBase.prototype.configure): Extracted from the constructor. Separating this function allows the
8240         component to be instantiated inside a HTML template.
8241         (ChartPaneBase.prototype._fetchAnalysisTasks): Moved from ChartPane._fetchAnalysisTasks.
8242         (ChartPaneBase.prototype.platformId): Ditto.
8243         (ChartPaneBase.prototype.metricId): Ditto.
8244         (ChartPaneBase.prototype.setOverviewDomain): Ditto.
8245         (ChartPaneBase.prototype.setMainDomain): Ditto.
8246         (ChartPaneBase.prototype._overviewSelectionDidChange): Extracted from the constructor. This is overridden in
8247         ChartPane and unused in AnalysisTaskChartPane.
8248         (ChartPaneBase.prototype._mainSelectionDidChange): Extracted from ChartPane._mainSelectionDidChange.
8249         (ChartPaneBase.prototype._mainSelectionDidZoom): Extracted from ChartPane._mainSelectionDidZoom.
8250         (ChartPaneBase.prototype._indicatorDidChange): Extracted from ChartPane._indicatorDidChange.
8251         (ChartPaneBase.prototype._didFetchData): Moved from ChartPane._fetchAnalysisTasks.
8252         (ChartPaneBase.prototype._openAnalysisTask): Ditto.
8253         (ChartPaneBase.prototype._openCommitViewer): Ditto. Also fixed a bug that we don't show the spinner while
8254         waiting for the data to be fetched by calling this.render() here.
8255         (ChartPaneBase.prototype._keyup): Moved from ChartPane._keyup. Also fixed the bug that the revisions list
8256         doesn't update by calling this.render() here.
8257         (ChartPaneBase.prototype.render): Extracted from ChartPane.render.
8258         (ChartPaneBase.htmlTemplate): Extracted from ChartPane.htmlTemplate.
8259         (ChartPaneBase.paneHeaderTemplate): Added. This is overridden in ChartPane and unused in AnalysisTaskChartPane.
8260         (ChartPaneBase.cssTemplate): Extracted from ChartPane.htmlTemplate.
8262         * public/v3/components/chart-styles.js: Renamed from public/v3/pages/page-with-charts.js.
8263         (PageWithCharts): Renamed from PageWithCharts since it no longer extends PageWithHeading.
8264         (ChartStyles.createChartSourceList):
8266         * public/v3/components/commit-log-viewer.js:
8267         (CommitLogViewer.prototype.view): Set this._repository right away instead of waiting for the fetched data
8268         so that spinner will be shown while the data is being fetched.
8270         * public/v3/index.html:
8272         * public/v3/pages/analysis-task-page.js:
8273         (AnalysisTaskChartPane): Added extends ChartPaneBase.
8274         (AnalysisTaskPage): Added. this._chartPane.
8275         (AnalysisTaskPage.prototype._didFetchTask): Initialize this._chartPane with a domain.
8276         (AnalysisTaskPage.prototype.render): Render this._chartPane.
8277         (AnalysisTaskPage.htmlTemplate):
8279         * public/v3/pages/chart-pane-status-view.js:
8280         (ChartPaneStatusView): Removed the unused router from the argument list.
8281         (ChartPaneStatusView.prototype.pointsRangeForAnalysis): Renamed from analyzeData() since it was ambiguous.
8282         (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Fixed the bug that we don't update the list
8283         of the revisions here.
8284         (ChartPaneStatusView.prototype.computeChartStatusLabels):
8286         * public/v3/pages/chart-pane.js:
8287         (ChartPane): Now extends ChartPaneBase. 
8288         (ChartPane.prototype._overviewSelectionDidChange): Extracted from the constructor.
8289         (ChartPane.prototype._mainSelectionDidChange): 
8290         (ChartPane.prototype._mainSelectionDidZoom):
8291         (ChartPane.prototype._indicatorDidChange):
8292         (ChartPane.prototype.render):
8293         (ChartPane.prototype._renderActionToolbar):
8294         (ChartPane.paneHeaderTemplate): Extracted from htmlTemplate.
8295         (ChartPane.cssTemplate):
8296         (ChartPane.overviewOptions.selection.onchange): Deleted.
8297         (ChartPane.prototype._fetchAnalysisTasks): Deleted.
8298         (ChartPane.prototype.platformId): Deleted.
8299         (ChartPane.prototype.metricId): Deleted.
8300         (ChartPane.prototype.setOverviewDomain): Deleted.
8301         (ChartPane.prototype.setMainDomain): Deleted.
8302         (ChartPane.prototype._openCommitViewer): Deleted.
8303         (ChartPane.prototype._didFetchData): Deleted.
8304         (ChartPane.prototype._keyup): Deleted.
8306         * public/v3/pages/charts-page.js:
8307         (ChartsPage):
8308         (ChartsPage.createDomainForAnalysisTask): Extracted by createDomainForAnalysisTask; used to set the domain
8309         of the charts in the analysis task page.
8310         (ChartsPage.createStateForAnalysisTask):
8312         * public/v3/pages/dashboard-page.js:
8313         (DashboardPage):
8314         (DashboardPage.prototype._createChartForCell):
8316 2016-02-10  Ryosuke Niwa  <rniwa@webkit.org>
8318         Add the support for maintenance mode
8319         https://bugs.webkit.org/show_bug.cgi?id=154072
8321         Reviewed by Chris Dumez.
8323         Added the crude support for maintenance mode whereby which the reports are stored in the filesystem
8324         instead of the database.
8326         * config.json: Added maintenanceMode and maintenanceDirectory as well as forgotten siteTitle and
8327         remoteServer.httpdMutexDir.
8328         * public/api/report.php:
8329         (main): Don't connect to the database or modify database when maintenanceMode is set.
8330         * public/include/json-header.php:
8331         (ensure_privileged_api_data): Exit with InMaintenanceMode when maintenanceMode is set. This prevents
8332         privileged API such as creating analysis tasks and new A/B testing groups from modifying the database.
8334 2016-02-09  Ryosuke Niwa  <rniwa@webkit.org>
8336         Analysis task page on v3 show progression as regressions
8337         https://bugs.webkit.org/show_bug.cgi?id=154045
8339         Reviewed by Chris Dumez.
8341         The bug was caused by TestGroup.compareTestResults referring to undefined _smallerIsBetter.
8342         Retrieve it from the associated metric object via the owner analysis task.
8344         * public/v3/models/test-group.js:
8346 2016-02-05  Ryosuke Niwa  <rniwa@webkit.org>
8348         Testing with remote server cache is unusably slow
8349         https://bugs.webkit.org/show_bug.cgi?id=153928
8351         Reviewed by Chris Dumez.
8353         Don't use the single process mode of httpd as it's way too slow even for testing.
8354         Also we'll hit a null pointer crash (http://svn.apache.org/viewvc?view=revision&revision=1711479)
8356         Since httpd exits immediately when launched in multi-process mode, remote-cache-server.py (renamed from
8357         run-with-remote-server.py) now has "start" and "stop" commands to start/stop the Apache. Also added
8358         "reset" command to reset the cache for convenience.
8360         * Install.md: Updated the instruction.
8361         * config.json: Fixed a typo: httpdErro*r*Log.
8362         * tools/remote-cache-server.py: Copied from Websites/perf.webkit.org/tools/run-with-remote-server.py.
8363         Now takes one of the following commands: "start", "stop", and "reset".
8364         (main):
8365         (start_httpd): Extracted from main.
8366         (stop_httpd): Added.
8367         * tools/remote-server-relay.conf: Removed redundant (duplicate) LoadModule's.
8368         * tools/run-with-remote-server.py: Removed.
8370 2016-02-04  Ryosuke Niwa  <rniwa@webkit.org>
8372         Perf dashboard should have a script to setup database
8373         https://bugs.webkit.org/show_bug.cgi?id=153906
8375         Reviewed by Chris Dumez.
8377         Added tools/setup-database.py to setup the database. It retrieves the database name, username, password
8378         and initializes a database at the specified location.
8380         * Install.md: Updated instruction to setup postgres to use setup-database.py.
8381         * tools/setup-database.py: Added.
8382         (main):
8383         (load_database_config):
8384         (determine_psql_dir):
8385         (start_or_stop_database):
8386         (execute_psql_command):
8388 2016-01-12  Ryosuke Niwa  <rniwa@webkit.org>
8390         buildbot syncing scripts sometimes schedule more than one requests per builder
8391         https://bugs.webkit.org/show_bug.cgi?id=153047
8393         Reviewed by Chris Dumez.
8395         The bug was caused by the check for singularity of scheduledRequests being conducted per configuration
8396         instead of per builder. So if there were multiple test configurations (e.g. Speedometer and Octane) that
8397         both used the same builder, then we may end up scheduling both at once.
8399         Fixed the bug by sharing a single set to keep track of the scheduled requests for all configurations per
8400         builder.
8402         * tools/sync-with-buildbot.py:
8403         (load_config): Share a set amongst test configurations for each builder.
8404         (find_request_updates): Instead of creating a new set for each configuration, reuse the existing sets to
8405         share a single set agmonst test configurations for each builder.
8407 2016-01-12  Ryosuke Niwa  <rniwa@webkit.org>
8409         Analysis results viewer sometimes doesn't show the correct relative difference
8410         https://bugs.webkit.org/show_bug.cgi?id=152930
8412         Reviewed by Chris Dumez.
8414         The bug was caused by single A/B testing result associated with multiple rows when there are multiple data
8415         points with the same root set which matches that of an A/B testing.
8417         Fixed the bug by detecting such a case, and only associating each A/B testing result with the row created
8418         for the first matching point.
8420         * public/v3/components/analysis-results-viewer.js:
8421         (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
8423 2016-01-08  Ryosuke Niwa  <rniwa@webkit.org>
8425         Make v3 UI analysis task page is hard to understand
8426         https://bugs.webkit.org/show_bug.cgi?id=152917
8428         Reviewed by Antti Koivisto.
8430         Add a dark gray border around the selected block in the analysis results viewer instead of using darker
8431         shades since that looks as if they were bigger regression/progression.
8433         Explicitly show "Failed" as the label instead of omitting with "-" when all build requests in an A/B
8434         testing group fails.
8436         * public/v3/components/analysis-results-viewer.js:
8437         (AnalysisResultsViewer.cssTemplate): Tweaked the style to underline text in the hovered blocks and the
8438         selected blocks and show a dark gray border around the selected blocks.
8439         (AnalysisResultsViewer.TestGroupStackingBlock):
8440         (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): Use this._title for title.
8441         (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
8442         (AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForRootSet): Deleted.
8444         * public/v3/components/results-table.js:
8445         (ResultsTable.prototype.render):
8446         (ResultsTable.prototype._createRevisionListCells): Extracted from ResultsTable.prototype.render.
8447         (ResultsTable.cssTemplate): Tweaked the style.
8448         (ResultsTableRow):
8449         (ResultsTableRow.prototype.constructor): Added _labelForWholeRow to store the label for the entire row.
8450         This is used to show the comparison result of two root sets (e.g. A vs B).
8451         (ResultsTableRow.prototype.setLabelForWholeRow): Added.
8452         (ResultsTableRow.prototype.labelForWholeRow): Added.
8453         (ResultsTableRow.prototype.resultContent): Extracted from buildHeading. Creates a hyperlinked bar graph
8454         used for each A/B testing result.
8455         (ResultsTableRow.prototype.buildHeading): Deleted since we need to set colspan on the second table cell
8456         when we're creating a row with _labelForWholeRow.
8458         * public/v3/components/test-group-results-table.js:
8459         (TestGroupResultsTable.prototype.buildRowGroups): Added rows to show relative differences and statistical
8460         significance between root sets (e.g. A vs B).
8462         * public/v3/models/build-request.js:
8463         (BuildRequest.prototype.hasCompleted): Added.
8465         * public/v3/models/test-group.js:
8466         (TestGroup.prototype.compareTestResults): Extracted from AnalysisResultsViewer.TestGroupStackingBlock's
8467         _computeTestGroupStatus and generalized to be reused in TestGroupResultsTable.
8468         (TestGroup.prototype._valuesForRootSet): Moved from AnalysisResultsViewer.TestGroupStackingBlock.
8470         * public/v3/pages/analysis-task-page.js:
8471         (AnalysisTaskPage.cssTemplate): Tweaked the style.
8473 2016-01-07  Ryosuke Niwa  <rniwa@webkit.org>
8475         Perf dashboard should automatically add aggregators
8476         https://bugs.webkit.org/show_bug.cgi?id=152818
8478         Reviewed by Chris Dumez.
8480         When an aggregator entry is missing in aggregators table, automatically insert it in /api/report.
8482         In a very early version of the perf dashboard, we had the ability to define a custom aggregator
8483         in an admin page. In practice, nobody used or needed this feature so we got rid of it even before
8484         the dashboard was landed into WebKit repository. This patch cleans up that mess.
8486         * run-tests.js:
8487         (main): Added the filtering capability.
8488         (TestEnvironment): Expose the config JSON in the test environment.
8490         * public/include/report-processor.php:
8491         (ReportProcessor): Renamed name_to_aggregator now that it only contains ID.
8492         (ReportProcessor::__construct): No longer fetches the aggregator table. An equivalent work is done
8493         in newly added ensure_aggregators.
8494         (ReportProcessor::process): Calls ensure_aggregators which populates name_to_aggregator_id.
8495         (ReportProcessor::ensure_aggregators): Added. Add the builtin aggregators: Arithmetic, Geometric,
8496         Harmonic, and Total.
8497         (TestRunsGenerator): Renamed name_to_aggregator now that it only contains ID.
8498         (TestRunsGenerator::__construct):
8499         (TestRunsGenerator::add_aggregated_metric): Don't include aggregator_definition here since it's
8500         never used now that all the aggregations are done natively in PHP.
8501         (TestRunsGenerator::$aggregators): Added. We don't include SquareSum since it's only used for
8502         computing run_square_sum_cache in test_runs table and it's useless elsewhere.
8503         (TestRunsGenerator::aggregate_values): Add a comment about that.
8505         * tests/api-report.js: Updated a test case to reflect the change.
8507 2016-01-06  Ryosuke Niwa  <rniwa@webkit.org>
8509         Perf dashboard JSON API should fail gracefully when postgres is down
8510         https://bugs.webkit.org/show_bug.cgi?id=152812
8512         Reviewed by Chris Dumez.
8514         Even though all JSON APIs returned DatabaseConnectionFailure as the status when Database::connect
8515         returned a falsy value, PHP was spitting out warnings and producing HTTP responses that cannot be
8516         parsed as a JSON when pg_connect failed.
8518         Fixed the bug by suppressing warning messages in pg_connect.
8520         * public/include/db.php:
8521         (Database::connect): Use '@' prefix to suppress warning messages.
8523 2016-01-06  Ryosuke Niwa  <rniwa@webkit.org>
8525         Perf dashboard should auto-generate manifest file when one is missing
8526         https://bugs.webkit.org/show_bug.cgi?id=152813
8528         Reviewed by Chris Dumez.
8530         When /data/manifest.json is missing, fall back to newly added /api/manifest instead of
8531         silently failing to show the UI. This will make the initial setup easier.
8533         * public/api/manifest.php: Added.
8534         (main):
8535         * public/include/manifest.php:
8536         (Manifest::manifest): Added.
8537         * public/v3/main.js:
8538         (fetchManifest):
8539         (didFetchManifest): Extracted from fetchManifest.
8541 2016-01-06  Ryosuke Niwa  <rniwa@webkit.org>
8543         Commit another forgotten change, this time, for r194653.
8545         * public/v3/models/measurement-set.js:
8547 2016-01-06  Ryosuke Niwa  <rniwa@webkit.org>
8549         The sampling of time series on v3 UI is too aggressive
8550         https://bugs.webkit.org/show_bug.cgi?id=152804
8552         Reviewed by Chris Dumez.
8554         Fixed a bug that we were always halving the number of data points in _sampleTimeSeries
8555         and increased the number of data points allowed to make the sampling less aggressive.
8557         * public/v3/components/time-series-chart.js:
8558         (TimeSeriesChart.prototype._ensureSampledTimeSeries): Increase the number of maximum points
8559         to 2x the number of pixels divided by the radius of each point.
8560         (TimeSeriesChart.prototype._sampleTimeSeries.findMedian): Changed the semantics of endIndex
8561         to mean the index after the last point and renamed it to indexAfterEnd.
8562         (TimeSeriesChart.prototype._sampleTimeSeries): Fixed a bug that this code always coerced two
8563         data points into one sampled data point despite of the fact i and j are sufficiently apart
8564         since data[j].time - data[i].time > timePerSample by definition.
8566 2016-01-06  Ryosuke Niwa  <rniwa@webkit.org>
8568         Commit the forgotten change for r194651.
8570         * public/v3/pages/domain-control-toolbar.js:
8571         (DomainControlToolbar.prototype.setStartTime):
8573 2016-01-05  Ryosuke Niwa  <rniwa@webkit.org>
8575         The right hand side of main chart appears to be cut off as you zoom out on v3 UI
8576         https://bugs.webkit.org/show_bug.cgi?id=152778
8578         Reviewed by Antti Koivisto.
8580         Add a padding on x-axis after the end time to make the main chart more easily interactive.
8582         * public/v3/components/time-series-chart.js:
8583         (TimeSeriesChart.prototype._computeHorizontalRenderingMetrics):
8585         * public/v3/pages/page-with-charts.js:
8586         (PageWithCharts.mainChartOptions): Add a padding of 5px at the end of x-axis.
8588 2016-01-06  Ryosuke Niwa  <rniwa@webkit.org>
8590         v3 UI should use four sig-figs to label y-axis of the main charts
8591         https://bugs.webkit.org/show_bug.cgi?id=152779
8593         Reviewed by Antti Koivisto.
8595         Increase the number of significant figures used in the main charts to four as done in v2 UI.
8597         * public/v3/pages/chart-pane.js:
8598         (ChartPane.constructor): Create a formatter with four significant figures.
8599         * public/v3/pages/page-with-charts.js:
8600         (PageWithCharts.mainChartOptions): Increase the width of y-axis labels.
8602 2016-01-05  Ryosuke Niwa  <rniwa@webkit.org>
8604         v3 UI's time range slider is harder to use than that of v2 UI
8605         https://bugs.webkit.org/show_bug.cgi?id=152780
8607         Reviewed by Antti Koivisto.
8609         Improved the time range slider by using a cubic mapping to time range and providing a text field
8610         to directly edit the number of days to show.
8612         Now an user can enter the text mode to directly edit the number of days to show by clicking on
8613         the number of days (text field is always there with opacity=0).
8615         * public/v3/pages/charts-toolbar.js:
8616         (ChartsToolbar): Store the minimum and maximum number of days allowed. Also rename _inputElement
8617         to _slider and added a new type=number text field as _editor. 
8618         (ChartsToolbar.prototype.render):
8619         (ChartsToolbar.prototype.setStartTime): Exit the text mode when the number of days is changed by
8620         an URL state transition (i.e. back/forward navigation).
8621         (ChartsToolbar.prototype._setInputElementValue): Added. Updates the values of _slider and _editor.
8622         (ChartsToolbar.prototype._enterTextMode): Added. Hide the elements used by the slider mode and
8623         show the text field.
8624         (ChartsToolbar.prototype._exitTextMode): Added. Does the opposite.
8625         (ChartsToolbar.prototype._sliderValueMayHaveChanged): Renamed from _inputValueMayHaveChanged.
8626         (ChartsToolbar.prototype._editorValueMayHaveChanged): Added. Similar to _sliderValueMayHaveChanged
8627         but also corrects the value of _editor if needed.
8628         (ChartsToolbar.prototype._callNumberOfDaysCallback): Extracted from _inputValueMayHaveChanged.
8629         Also fixed a bug that we didn't update the URL state when the change event was fired without
8630         modifying the effective number of days.
8631         (ChartsToolbar.cssTemplate): Tweaked the style to support the new mode. Also set a fixed width on
8632         the span showing the number of days in the slider mode.
8634 2016-01-06  Ryosuke Niwa  <rniwa@webkit.org>
8636         Zooming button is broken on v3 UI
8637         https://bugs.webkit.org/show_bug.cgi?id=152777
8639         Reviewed by Chris Dumez.
8641         Bring up the zoom button in z-index so that users can click it.
8643         * public/v3/components/interactive-time-series-chart.js:
8644         (InteractiveTimeSeriesChart.cssTemplate):
8646 2016-01-06  Ryosuke Niwa  <rniwa@webkit.org>
8648         v3 UI doesn't preserve the time range when charts page is opened from a dashboard
8649         https://bugs.webkit.org/show_bug.cgi?id=152776
8651         Reviewed by Chris Dumez.
8653         Fixed the bug by moving the construction of charts URL from DashboardPage.prototype.open to
8654         DashboardPage.prototype.render and re-rendering the entire page upon an URL state transition.
8656         * public/v3/pages/charts-page.js:
8657         (ChartsPage.createStateForDashboardItem): Takes the start time for the charts page.
8659         * public/v3/pages/dashboard-page.js:
8660         (DashboardPage.prototype.updateFromSerializedState): Merged _numberOfDaysDidChange and
8661         _updateChartsDomainFromToolbar into this function since they're not used elsewhere. Also re-render
8662         the entire page when transition between different number of days to show.
8663         (DashboardPage.prototype._numberOfDaysDidChange): Deleted.
8664         (DashboardPage.prototype._updateChartsDomainFromToolbar): Deleted.
8665         (DashboardPage.prototype.render): Construct URL for each charts here.
8666         (DashboardPage.prototype._createChartForCell): Don't construct URL here since this function is
8667         called once when the dashboard page is opened, and not when the time range is changed.
8669 2016-01-05  Ryosuke Niwa  <rniwa@webkit.org>
8671         Build fix for an old version of PHP after r194618.
8673         * public/api/measurement-set.php:
8675 2016-01-05  Ryosuke Niwa  <rniwa@webkit.org>
8677         A/B testing results should be visualized intuitively on v3 UI
8678         https://bugs.webkit.org/show_bug.cgi?id=152496
8680         Rubber-stamped by Chris Dumez.
8682         Add the "stacking block" view of A/B testing results to the analysis task page on v3 UI.
8684         The patch enhances JSON APIs at /api/analysis-task /api/measurement-set/ to reduce the number of
8685         HTTP requests, and adds two UI components: TestGroupResultsTable and AnalysisResultsViewer both
8686         of which inherits from an abstract superclass: ResultsTable.
8688         ResultsTable provides a tabular presentation of measured values in regular measurement sets and
8689         A/B testing results using groups of bar graphs created by BarGraphGroup. TestGroupResultsTable
8690         inherits from this class to display A/B testing configurations and the averaged results for each
8691         configuration, and AnalysisResultsViewer inherits from it to provide an intuitive visualization
8692         of the outcomes of all A/B testing results associated with a given analysis task.
8694         * public/api/analysis-tasks.php:
8695         (main): Add the capability to find the analysis task based on its build request.
8696         This allows /v3/#/analysis/task/?buildRequest=<id> to be hyperlinked on buildbot page.
8698         * public/api/measurement-set.php:
8699         (main): Removed the unused startTime and endTime, and added "analysisTask" to query parameters.
8700         (AnalysisResultsFetcher): Added. Used to fetch measured data associated with every build request
8701         on an analysis task.
8702         (AnalysisResultsFetcher::__construct):
8703         (AnalysisResultsFetcher::fetch): Unlike MeasurementSetFetcher, we fetch the list of commits and
8704         list of measurements separately since there will be a lot less builds and commits than measured
8705         data (since we're fetching measured values for all tests and their metrics).
8706         (AnalysisResultsFetcher::fetch_commits): Fetches commits.
8707         (AnalysisResultsFetcher::format_measurement): Like MeasurementSetFetcher::format_measurement but
8708         with config_type and config_metric since we're returning measured data for all metrics and test
8709         configurations.
8710         (AnalysisResultsFetcher::format_map): Similar to MeasurementSetFetcher::format_map.
8712         * public/v3/components/analysis-results-viewer.js: Added.
8713         (AnalysisResultsViewer): Added. 
8714         (AnalysisResultsViewer.prototype.didUpdateResults): This callback is called by AnalysisTaskPage
8715         when A/B testing results become available.
8716         (AnalysisResultsViewer.prototype.render): Overrides ResultsTable's render to highlight the block
8717         representing the currently selected test group.
8719         (AnalysisResultsViewer.prototype.buildRowGroups): Creates a list of rows with "stacking blocks"
8720         that visualizes A/B testing results. The algorithm works as follows: 1. Create all table rows.
8721         2. Find which row is associated with each set in each test group. 3. Layout "blocks".
8723         (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Collects root sets from all data
8724         in the measurement set as well as A/B testing **requests** (results may contain more repositories
8725         than requested but they aren't interesting for the purpose of visualizing results for the entire
8726         analysis task).
8728         (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Create table rows. First,
8729         create table rows for measurement set points that have a matching test group (i.e. either set A
8730         or set B of an A/B testing uses the same root set as a point). Second, insert a new row for each
8731         root set in each test group which didn't find a matching measurement set point. There is a little
8732         subtlety that some A/B testing may specify revisions for a subset of repositories and/or some A/B
8733         testing results may appear as if it goes back in time with respect to other A/B testing results.
8734         For example, consider creating two A/B test groups for WebKit changes and OS changes separately.
8735         There could be no coherent linearization of those two A/B testing in which both WebKit and OS
8736         versions move forward.
8738         (AnalysisResultsViewer.RootSetInTestGroup): Added. Represents a pair (test group, root set) since
8739         a root set could be shared by multiple test groups.
8740         (AnalysisResultsViewer.TestGroupStackingBlock): Added. A stacked block representing a test group.
8741         (AnalysisResultsViewer.TestGroupStackingBlock.prototype.addRowIndex): Associates a row number with
8742         either set A or set B.
8743         (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): Creates a table cell
8744         for this block.
8745         (AnalysisResultsViewer.TestGroupStackingBlock.prototype.isThin): Returns true if this test group
8746         has failed and this block should look "thin" without any label.
8747         (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus): Computes the
8748         status for this test group.
8750         (AnalysisResultsViewer.TestGroupStackingGrid): Added. AnalysisResultsViewer uses this class to
8751         layout blocks representing test groups.
8752         (AnalysisResultsViewer.TestGroupStackingGrid.prototype.insertBlockToColumn): Inserts a new block
8753         to layout. We keep all test groups doing the same A/B test next to each other.
8754         (AnalysisResultsViewer.TestGroupStackingGrid.prototype.layout): Layouts each block / test group
8755         in the order they are created.
8756         (AnalysisResultsViewer.TestGroupStackingGrid.prototype._layoutBlock): Places the block in the
8757         left-most column that can accommodate it while avoiding columns of a different thin-ness. A column
8758         is thin if its A/B testing has failed, and not thin otherwise.
8759         (AnalysisResultsViewer.TestGroupStackingGrid.prototype.createCellsForRow): Creates table cells for
8760         a given row. For each column, generate a table cell if we're in the first row and the first block
8761         starts in a later row, a block starts in the current row, or the last block ended in the previous
8762         row and the next block or the last row appears later.
8764         * public/v3/components/bar-graph-group.js: Added. A component for showing a group of bar graphs.
8765         (BarGraphGroup): Added. Creates a group of bar graphs with the same value range. It's used by
8766         AnalysisResultsViewer and ResultsTable to show bar graphs to compare values.
8767         (SingleBarGraph): A component created and collectively controlled by BarGraphGroup.
8769         * public/v3/components/results-table.js: Added.
8770         (ResultsTable): An abstract superclass for TestGroupResultsTable and AnalysisResultsViewer.
8772         (ResultsTable.prototype.render): Renders the table. 1. Call "buildRowGroups()" implemented by
8773         a subclass to obtain the list of rows. 2. Compute the list of repositories to show. 3. For each
8774         cell in the table, compute the number of rows to show the same value (for rowspan). 4. Render the
8775         table with an extra list of repositories if exists.
8777         (ResultsTable.prototype._computeRepositoryList): Compute the list of repositories to list
8778         revisions in the table. Omit repositories not present in any row or for which all rows have the
8779         same revision. In the latter case, include it in the extra repositories listed below the table.
8780         This minimizes the amount of redundant information presented to the user.
8782         (ResultsTableRow): Added. Represents a single row in the table. ResultsTable constructs necessary
8783         table cells to tabulate the associated root sets, and shows the associated result using a grouped
8784         bar graph. Additional columns are used by AnalysisResultsViewer to show stacked blocks for A/B
8785         testing groups.
8787         * public/v3/components/test-group-results-table.js: Added.
8788         (TestGroupResultsTable):
8789         (TestGroupResultsTable.prototype.didUpdateResults):
8790         (TestGroupResultsTable.prototype.setTestGroup):
8791         (TestGroupResultsTable.prototype.heading):
8792         (TestGroupResultsTable.prototype.render):
8793         (TestGroupResultsTable.prototype.buildRowGroups):
8795         * public/v3/index.html:
8796         * public/v3/models/analysis-results.js: Added.
8797         (AnalysisResults): Added. Like MeasurementSet, this class represents a set of measured values
8798         associated with a given analysis task.
8799         (AnalysisResults.prototype.find): Returns a measured valued for a given build and metric.
8800         (AnalysisResults.prototype.add): Adds a new measured value. Used by AnalysisResults.fetch.
8801         (AnalysisResults.fetch): Fetches data and creates AnalysisResults for a given analysis task.
8803         * public/v3/models/analysis-task.js:
8804         (AnalysisTask.prototype.startMeasurementId): Added.
8805         (AnalysisTask.prototype.endMeasurementId): Added.
8806         (AnalysisTask.fetchByBuildRequestId): Added.
8807         (AnalysisTask._fetchSubset): Uses DataModelObject.cachedFetch.
8809         * public/v3/models/build-request.js: Added.
8810         (BuildRequest): Added. Represents a single A/B testing request associated with a test group.
8812         * public/v3/models/builder.js:
8813         (Build): Added. Represents a build associated with a given A/B testing result.
8815         * public/v3/models/commit-log.js:
8816         (CommitLog): Made this class inherit from DataModelObject.
8817         (CommitLog.ensureSingleton): Added. Finds the singleton object created for a given revision
8818         in the specified repository. This helps RootSet and other classes compare commits fast.
8819         (CommitLog.prototype.repository): Added.
8820         (CommitLog.fetchBetweenRevisions): Uses CommitLog.ensureSingleton.
8822         * public/v3/models/data-model.js:
8823         (DataModelObject):
8824         (DataModelObject.namedStaticMap): Added.
8825         (DataModelObject.ensureNamedStaticMap): Renamed from namedStaticMap instead of implicitly
8826         assuming that the non-static version always creates the map.
8827         (DataModelObject.prototype.namedStaticMap): Added.
8828         (DataModelObject.cachedFetch): Extracted from AnalysisTask._fetchSubset so that TestGroup's
8829         fetchByTask could also use it.
8830         (LabeledObject):
8832         * public/v3/models/measurement-adaptor.js: Added.
8833         (MeasurementAdaptor): Extracted from MeasurementCluster. This class is responsible for
8834         re-formatting the data received via /api/measurement-set JSON API inside the v3 UI.
8835         (MeasurementAdaptor.prototype.extractId): Added.
8836         (MeasurementAdaptor.prototype.adoptToAnalysisResults): Added. Used by AnalysisResults.
8837         (MeasurementAdaptor.aggregateAnalysisResults): Added. Used by TestGroupResultsTable to
8838         aggregate results for each test configuration; e.g. computing the average for set A.
8839         (MeasurementAdaptor.prototype.adoptToSeries): Extracted from MeasurementCluster.addToSeries.
8840         Added rootSet() to each point. This allows AnalysisResultsViewer to compare them against root
8841         sets associated with A/B testing results.
8842         (MeasurementAdaptor.computeConfidenceInterval): Moved from MeasurementCluster.
8844         * public/v3/models/measurement-cluster.js:
8845         (MeasurementCluster):
8846         (MeasurementCluster.prototype.addToSeries):
8848         * public/v3/models/repository.js:
8849         (Repository.prototype.hasUrlForRevision): Added.
8851         * public/v3/models/root-set.js: Added.
8852         (RootSet): Added. Represents a set of commits in measured results.
8853         (MeasurementRootSet): Added. Ditto for results associated with A/B testing.
8855         * public/v3/models/test-group.js: Added.
8856         (TestGroup): Added. Represents a A/B testing on analysis task.
8857         (TestGroup.prototype.createdAt): Added.
8858         (TestGroup.prototype.buildRequests): Returns the list of build requests associated with this
8859         A/B testing.
8860         (TestGroup.prototype.addBuildRequest): Added. Used by BuildRequest's constructor to associate
8861         itself with this group.
8862         (TestGroup.prototype.didSetResult): Added. Called by BuildRequest.setResult when measured
8863         values are fetched and associated with a build request in this group.
8865         * public/v3/models/test.js:
8866         (Test):
8868         * public/v3/pages/analysis-task-page.js:
8869         (AnalysisTaskPage):
8870         (AnalysisTaskPage.prototype.updateFromSerializedState): Fetch the analysis task, test groups
8871         associated with it, and all A/B testing results based on the task id or the build request id
8872         specified in the URL.
8873         (AnalysisTaskPage.prototype._didFetchTask): Added. Start fetching the measured data. This is
8874         the data on charts page for which this analysis task was created, not results of A/B testing.
8875         (AnalysisTaskPage.prototype._didFetchMeasurement): Added. Display the fetched data in a table
8876         inside AnalysisResultsViewer.
8877         (AnalysisTaskPage.prototype._didFetchTestGroups): Added. Display the list of A/B test groups
8878         as well as the results of the first A/B testing.
8879         (AnalysisTaskPage.prototype._didFetchAnalysisResults): Added.
8880         (AnalysisTaskPage.prototype._assignTestResultsIfPossible): Added. Once both the analysis task,
8881         A/B test groups as well as their results are fetched, update build requests in each test group
8882         with their results.
8883         (AnalysisTaskPage.prototype.render): Show the list of test groups and highlight the currently
8884         selected one.
8885         (AnalysisTaskPage.prototype._showTestGroup): Added. A callback used by AnalysisResultsViewer
8886         and TestGroupResultsTable to notify this class when the user selects a new test group.
8887         (AnalysisTaskPage.htmlTemplate): Updated the template.
8888         (AnalysisTaskPage.cssTemplate): Ditto.
8890         * public/v3/pages/charts-page.js:
8891         (ChartsPage.createStateForAnalysisTask): Added. Creates a URL state object for opening a chart
8892         associated with an analysis task.
8894 2015-12-22  Ryosuke Niwa  <rniwa@webkit.org>
8896         Analysis task page is slow to load
8897         https://bugs.webkit.org/show_bug.cgi?id=152517
8899         Reviewed by Andreas Kling.
8901         The slowness comes from r194130 which made the JSON API at /api/analysis-tasks to report the start
8902         and the end of each analysis task. This query was adding ~2s to the total JSON generation time.
8904         Cache these values on analysis_task table since they never change once an analysis task is created.
8906         * init-database.sql: Added columns task_start_run_time and task_end_run_time to analysis_task table.
8907         Also added the missing drop statements at the top.
8909         * public/api/analysis-tasks.php:
8910         (fetch_and_push_bugs_to_tasks): Don't fetch the latest commit time of the start and the end.
8911         (format_task): Report task_start_run_time and task_end_run_time as startRunTime and endRunTime.
8913         * public/privileged-api/create-analysis-task.php:
8914         (main): Set start_run_time and end_run_time when creating an analysis task.
8915         (time_for_run): Added.
8917 2015-12-17  Ryosuke Niwa  <rniwa@webkit.org>
8919         v3 UI shouldn't open/close pane selector by mouseenter/leave
8920         https://bugs.webkit.org/show_bug.cgi?id=152399
8922         Reviewed by Andreas Kling.
8924         Removed the code to open and close the pane selector by mouseenter and mouseleave
8925         since multiple people have complained about the behavior.
8927         * public/v3/pages/charts-toolbar.js:
8928         (ChartsToolbar): Removed the event listeners.
8929         (ChartsToolbar.prototype._addPane): Don't close the pane selector when adding a new pane
8930         to better support the use case of adding multiple panes.
8931         (ChartsToolbar.cssTemplate): Tweaked CSS.
8933 2015-12-17  Ryosuke Niwa  <rniwa@webkit.org>
8935         Popover for analysis tasks shows up at the left edge of annotation bars in the v3 UI
8936         https://bugs.webkit.org/show_bug.cgi?id=152389
8938         Reviewed by Darin Adler.
8940         Compute the x coordinate of the popover from the center of each annotation bar.
8942         Also adjust the x coordinate to keep the popover within the charts.
8944         * public/v3/components/interactive-time-series-chart.js:
8945         (InteractiveTimeSeriesChart.prototype._renderChartContent):
8947 2015-12-17  Ryosuke Niwa  <rniwa@webkit.org>
8949         Dashboard charts should have uniform widths on v3 UI
8950         https://bugs.webkit.org/show_bug.cgi?id=152395
8952         Reviewed by Chris Dumez.
8954         Fix the bug by applying table-layout: fixed on the dashboard table.
8956         * public/v3/pages/dashboard-page.js:
8957         (DashboardPage.prototype.render): Added header-column as a class name to explicitly set the header column with.
8958         (DashboardPage.cssTemplate): Adjusted CSS accordingly.
8960 2015-12-17  Ryosuke Niwa  <rniwa@webkit.org>
8962         Closing a pane on v3 UI always closes the last pane
8963         https://bugs.webkit.org/show_bug.cgi?id=152388
8965         Reviewed by Chris Dumez.
8967         The bug was caused by closePane being called without arguments. (The first argument to bind is "this" value.)
8968         Fixed it by passing in "this" pane object to the first argument.
8970         * public/v3/pages/chart-pane.js:
8971         (ChartPane):
8973 2015-12-16  Ryosuke Niwa  <rniwa@webkit.org>
8975         Perf Dashboard v3 UI doesn't show recent data points on v2 UI
8976         https://bugs.webkit.org/show_bug.cgi?id=152368
8978         Reviewed by Chris Dumez.
8980         The bug was caused by the last modified date in measurement set JSON being a string instead of a POSIX timestamp,
8981         which prevented the v3 UI from invalidating the cache. Specifically, the following boolean logic always evaluated
8982         to false because +data['lastModified'] was NaN in MeasurementSet.prototype._fetch (/v3/models/measurement-set.js):
8984         !clusterEndTime && useCache && +data['lastModified'] < self._lastModified
8986         Fixed the bug by calling Database::to_js_time on the last modified date fetched from the database.
8988         * public/api/measurement-set.php:
8989         (MeasurementSetFetcher::fetch_config_list): Convert the string returned by the database to a POSIX timestamp.
8990         * tests/api-measurement-set.js: Added a test to ensure the last modified date in JSON is numeric. Since the value
8991         of the last modified date depends on when tests run, we can't assert it to be a certain value.
8993 2015-12-16  Ryosuke Niwa  <rniwa@webkit.org>
8995         v3 UI should show and link the build number on charts page
8996         https://bugs.webkit.org/show_bug.cgi?id=152359
8998         Reviewed by Chris Dumez.
9000         Show the hyperlinked build number in the v3 UI.
9002         * public/v3/models/builder.js:
9003         (Builder): Renamed _buildURL to _buildUrlTemplate.
9004         (Builder.prototype.urlForBuild): Added.
9005         * public/v3/pages/chart-pane-status-view.js:
9006         (ChartPaneStatusView):
9007         (ChartPaneStatusView.prototype.render): Added the code to render hyperlinked build number when one is available.
9008         (ChartPaneStatusView.prototype.computeChartStatusLabels): Store currentPoint's measurement object as _buildInfo
9009         if the current point is set by an indicator (not by a selection).
9011 2015-12-16  Ryosuke Niwa  <rniwa@webkit.org>
9013         v3 dashboard doesn't stretch charts to fill the screen
9014         https://bugs.webkit.org/show_bug.cgi?id=152354
9016         Reviewed by Chris Dumez.
9018         The bug was caused by a workaround to avoid canvas stretching table cell too much.
9020         Fix the problem instead by making the canvas absolutely positioned inside the "time-series-chart" element
9021         so that it does not contribute to the intrinsic/natural width of the cell.
9023         * public/v3/components/time-series-chart.js:
9024         (TimeSeriesChart.prototype._ensureCanvas): Make the canvas absolutely positioned inside the shadow root.
9025         (TimeSeriesChart.prototype._updateCanvasSizeIfClientSizeChanged): Use the container element's size now that
9026         the canvas does not resize with it.
9027         * public/v3/pages/dashboard-page.js:
9028         (DashboardPage.cssTemplate): Updated the CSS so that the chart stretches all the way.
9030 2015-12-16  Ryosuke Niwa  <rniwa@webkit.org>
9032         The chart status on v3 UI sometimes show wrong revision ranges
9033         https://bugs.webkit.org/show_bug.cgi?id=152331
9035         Reviewed by Chris Dumez.
9037         The bug was caused by the status view not taking the data sampling that happens in TimeSeriesChart into account
9038         when finding the previous point. Take this into account by using InteractiveTimeSeries.currentPoint(-1) which
9039         finds the sampled data point immediately preceding the current point (at which the indicator is shown).
9041         * public/v3/components/chart-status-view.js:
9042         (ChartStatusView.prototype.updateStatusIfNeeded):
9044 2015-12-15  Ryosuke Niwa  <rniwa@webkit.org>
9046         Perf dashboard's cycler page should use v3 UI
9047         https://bugs.webkit.org/show_bug.cgi?id=152324
9049         Reviewed by Chris Dumez.
9051         Use the v3 UI in cycler.html after r194130.
9053         * public/cycler.html:
9054         * public/v3/index.html: Removed the reference to a non-existent platform-selector.js.
9056 2015-12-15  Ryosuke Niwa  <rniwa@webkit.org>
9058         Add v3 UI to perf dashboard
9059         https://bugs.webkit.org/show_bug.cgi?id=152311
9061         Reviewed by Chris Dumez.
9063         Add the third iteration of the perf dashboard UI. UI for viewing and modifying analysis tasks is coming soon.
9064         The v3 UI is focused on speed, and removes all third-party script dependencies including jQuery, d3, and Ember.
9065         Both the DOM-based UI and graphing are implemented manually.
9068         The entire app is structured using new component library implemented in components/base.js. Each component is
9069         an instance of a subclass of ComponentBase which owns a single DOM element. Each subclass may supply static
9070         methods named htmlTemplate and cssTemplate as the template for a component instance. ComponentBase automatically
9071         clones the templates inside the associated element (or its shadow root on the supported browsers). Each subclass
9072         must supply a method called "render()" which constructs and updates the DOM as needed.
9074         There is a special component called Page, which represents an entire page. Each Page is opened by PageRouter's
9075         "route()" function. Each subclass of Page supplies "open()" for initialization and "updateFromSerializedState()"
9076         for a hash URL transition.
9079         The key feature of the v3 UI is the split of time series into chunks called clusters (see r194120). On an internal
9080         instance of the dashboard, the v2 UI downloads 27MB of data whereas the same page loads only 3MB of data in the v3.
9081         The key logic for fetching time series in chunks is implemented by MeasurementSet in /v3/models/measurement-set.js.
9082         We first fetch the cached primary cluster (the cluster that contains the newest data) at:
9083         /data/measurement-set-<platform-id>-<metric-id>.json
9085         If that's outdated according to lastModified in manifest.json, then we immediately re-fetch the primary cluster at:
9086         /api/measurement-set/?platform=<platform-id>&metric=<metric-id>
9088         Once the up-to-date primary cluster is fetched, we fetch all "secondary" clusters. For each cluster being fetched,
9089         including the primary, we invoke registered callbacks.
9092         In addition, the v3 UI reduces the initial page load time by loading a single bundled JS file generated by
9093         tools/bundle-v3-scripts.py. index.html has a fallback to load all 44 JS files individually during development.
9095         * public/api/analysis-tasks.php:
9096         (fetch_and_push_bugs_to_tasks): Added the code to fetch start and end run times. This is necessary in V3 UI
9097         because no longer fetch the entire time series. See r194120 for the new measurement set JSON API.
9098         (format_task): Compute the category of an analysis task based on "result" value. This will be re-vamped once
9099         I add the UI for the analysis task page in v3.
9101         * public/include/json-header.php:
9102         (require_format): CamelCase the name.
9103         (require_match_one_of_values): Ditto.
9104         (validate_arguments): Renamed from require_existence_of and used in measurement-set.php landed in r194120.
9106         * public/v3: Added.
9107         * public/v3/components: Added.
9109         * public/v3/components/base.js: Added.
9110         (ComponentBase): The base component class.
9111         (ComponentBase.prototype.element): Returns the DOM element associated with the DOM element.
9112         (ComponentBase.prototype.content): Returns the shadow root if one exists and the associated element otherwise.
9113         (ComponentBase.prototype.render): To be implemented by a subclass.
9114         (ComponentBase.prototype.renderReplace): A helper function to "render" DOM contents.
9115         (ComponentBase.prototype._constructShadowTree): Called inside the constructor to instantiate the templates.
9116         (ComponentBase.prototype._recursivelyReplaceUnknownElementsByComponents): Instantiates components referred by
9117         its element name inside the instantiated content.
9118         (ComponentBase.isElementInViewport): A helper function. Returns true if the element is in the viewport and it has
9119         non-zero width and height.
9120         (ComponentBase.defineElement): Defines a custom element that can be automatically instantiated from htmlTemplate.
9121         (ComponentBase.createElement): A helper function to create DOM tree to be used in "render()" method.
9122         (ComponentBase._addContentToElement): A helper for "createElement".
9123         (ComponentBase.createLink): A helper function to create a hyperlink or another clickable element (via callback).
9124         (ComponentBase.createActionHandler): A helper function to create an event listener that prevents the default action
9125         and stops the event propagation.
9127         * public/v3/components/button-base.js: Added.
9129         * public/v3/components/chart-status-view.js: Added.
9130         (ChartStatusView): A component that reports the current status of time-series-chart. It's subclasses by
9131         ChartPaneStatusView to provide additional information in the charts page's panes.
9133         * public/v3/components/close-button.js: Added.
9134         (CloseButton):
9135         * public/v3/components/commit-log-viewer.js: Added.
9136         (CommitLogViewer): A component that lists commit revisions along with commit messages for a range of data points.
9138         * public/v3/components/interactive-time-series-chart.js: Added.
9139         (InteractiveTimeSeriesChart): A subclass of InteractiveTimeSeriesChart with interactivity (selection & indicator).
9140         Selection and indicator are mutually exclusive.
9142         * public/v3/components/pane-selector.js: Added.
9143         (PaneSelector): A component for selecting (platform, metric) pair to add in the charts page.
9145         * public/v3/components/spinner-icon.js: Added.
9147         * public/v3/components/time-series-chart.js: Added.
9148         (TimeSeriesChart): A canvas-based chart component without interactivity. It takes a source list and options as
9149         the constructor arguments. A source list is a list of measurement sets (measurement-set.js) with drawing options.
9150         This component fetches data via MeasurementSet.fetchBetween inside TimeSeriesChart.prototype.setDomain and
9151         progressively updates the charts as more data arrives. The canvas is updated on animation frame via rAF and all
9152         layout and rendering metrics are lazily computed in _layout. In addition, this component samples data before
9153         rendering the chart when there are more data points per pixel in _ensureSampledTimeSeries.
9155         * public/v3/index.html: Added. Loads bundled-scripts.js if it exists, or individual script files otherwise.
9157         * public/v3/instrumentation.js: Added. This class is used to gather runtime statistics of v3 UI. (It measures
9158         the performance of the perf dashboard UI).
9160         * public/v3/main.js: Added. Bootstraps the app.
9161         (main):
9162         (fetchManifest):
9164         * public/v3/models: Added.
9165         * public/v3/models/analysis-task.js: Added.
9166         * public/v3/models/bug-tracker.js: Added.
9167         * public/v3/models/bug.js: Added.
9168         * public/v3/models/builder.js: Added.
9169         * public/v3/models/commit-log.js: Added.
9170         * public/v3/models/data-model.js: Added.
9171         (DataModelObject): The base class for various data objects that correspond to database tables. It supplies static
9172         hash map to find entries by id as well as other keys.
9173         (LabeledObject): A subclass of DataModelObject with the capability to find an object via its name.
9175         * public/v3/models/measurement-cluster.js: Added.
9176         (MeasurementCluster): Represents a single cluster or a chunk of data in a measurement set.
9178         * public/v3/models/measurement-set.js: Added.
9179         (MeasurementSet): Represents a measurement set.
9180         (MeasurementSet.findSet): Returns the singleton set given (metric, platform). We use singleton to avoid issuing
9181         multiple HTTP requests for the same JSON when there are multiple TimeSeriesChart that show the same graph (e.g. on
9182         charts page with overview and main charts).
9183         (MeasurementSet.prototype.findClusters): Finds the list of clusters to fetch in a given time range.
9184         (MeasurementSet.prototype.fetchBetween): Fetch clusters for a given time range and calls callback whenever new data
9185         arrives. The number of callbacks depends on the how many clusters need to be newly fetched.
9186         (MeasurementSet.prototype._fetchSecondaryClusters): Fetches non-primary (non-latest) clusters.
9187         (MeasurementSet.prototype._fetch): Issues a HTTP request to fetch a cluster.
9188         (MeasurementSet.prototype._didFetchJSON): Called when a cluster is fetched.
9189         (MeasurementSet.prototype._failedToFetchJSON): Called when the fetching of a cluster has failed.
9190         (MeasurementSet.prototype._invokeCallbacks): Invokes callbacks upon an approval of a new cluster.
9191         (MeasurementSet.prototype._addFetchedCluster): Adds the newly fetched cluster in the order.
9192         (MeasurementSet.prototype.fetchedTimeSeries): Returns a time series that contains data from all clusters that have
9193         been fetched.
9194         (TimeSeries.prototype.findById): Additions to TimeSeries defined in /v2/data.js.
9195         (TimeSeries.prototype.dataBetweenPoints): Ditto.
9196         (TimeSeries.prototype.firstPoint): Ditto.
9198         * public/v3/models/metric.js: Added.
9199         * public/v3/models/platform.js: Added.
9200         * public/v3/models/repository.js: Added.
9201         * public/v3/models/test.js: Added.
9203         * public/v3/pages: Added.
9204         * public/v3/pages/analysis-category-page.js: Added. The "Analysis" page that lists the analysis tasks.
9205         * public/v3/pages/analysis-category-toolbar.js: Added. The toolbar to filter analysis tasks based on its category
9206         (unconfirmed, bisecting, identified, closed) and a keyword.
9208         * public/v3/pages/analysis-task-page.js: Added. Not implemented yet. It just has the hyperlink to the v2  UI.
9210         * public/v3/pages/chart-pane-status-view.js: Added.
9211         (ChartPaneStatusView): A subclass of ChartStatusView used in the charts page. In addition to the current value,
9212         comparison to baseline/target, it shows the list of repository revisions (e.g. WebKit revision, OS version).
9214         * public/v3/pages/chart-pane.js: Added.
9215         (ChartPane): A component a pane in the charts page. Each pane has the overview chart and the main chart. The zooming
9216         is synced across all panes in the charts page.
9218         * public/v3/pages/charts-page.js: Added. Charts page.
9219         * public/v3/pages/charts-toolbar.js: Added. The toolbar to set the number of days to show. This affects the overview
9220         chart's domain in each pane.
9222         * public/v3/pages/create-analysis-task-page.js: Added.
9223         (CreateAnalysisTaskPage): A page that gets shown momentarily while creating a new analysis task.
9225         * public/v3/pages/dashboard-page.js: Added. A dashboard page.
9226         * public/v3/pages/dashboard-toolbar.js: Added. Its toolbar with buttons to select the number of days to show.
9227         * public/v3/pages/domain-control-toolbar.js: Added. An abstract superclass of charts and dashboard toolbars.
9229         * public/v3/pages/heading.js: Added. A component for displaying the header and toolbar, if exists, on each page.
9230         * public/v3/pages/page-router.js: Added. This class is responsible for updating the URL hashes as well as opening
9231         and updating each page when the hash changes (via back/forward navigation).
9232         * public/v3/pages/page-with-charts.js: Added. An abstract subclass of page used by dashboards and charts page.
9233         Supplies helper functions for creating TimeSeriesChart options.
9234         * public/v3/pages/page-with-heading.js: Added. An abstract subclass of page that uses the heading component.
9235         * public/v3/pages/page.js: Added. The Page component.
9236         * public/v3/pages/toolbar.js: Added. An abstract toolbar component.
9238         * public/v3/remote.js: Added.
9239         (getJSON): Fetches JSON from the remote server.
9240         (getJSONWithStatus): Ditto. Rejects the response if the status is not "OK".
9241         (PrivilegedAPI.sendRequest): Posts a HTTP request to a privileged API in /privileged-api/.
9242         (PrivilegedAPI.requestCSRFToken): Creates a new CSRF token to request a privileged API post.
9244         * tools/bundle-v3-scripts.py: Added.
9245         (main): Bundles js files together and minifies them by jsmin.py for the v3 UI. Without this script, we're forced to
9246         download 44 JS files or making each JS file contain multiple classes.
9248         * tools/jsmin.py: Copied from WebInspector / JavaScriptCore code.
9250 2015-12-15  Ryosuke Niwa  <rniwa@webkit.org>
9252         Fix v2 UI after r194093.
9254         * public/v2/data.js:
9256 2015-12-15  Ryosuke Niwa  <rniwa@webkit.org>
9258         Add /api/measurement-set for v3 UI
9259         https://bugs.webkit.org/show_bug.cgi?id=152312
9261         Rubber-stamped by Chris Dumez.
9263         The new API JSON allows the front end to fetch measured data in chunks called a "cluster" as specified
9264         in config.json for each measurement set specified by the pair of a platform and a metric.
9266         When the front end needs measured data in a given time range (t_0, t_1) for a measurement set, it first
9267         fetches the primary cluster by /api/measurement-set/?platform=<platform-id>&metric=<metric-id>.
9268         The primary cluster is the last cluster in the set (returning the first cluster here is not useful
9269         since we don't typically show very old data), and provides the information needed to fetch other clusters.
9271         Fetching the primary cluster also creates JSON files at:
9272         /data/measurement-set-<platform-id>-<metric-id>-<cluster-end-time>.json
9273         to allow latency free access for secondary clusters. The front end code can also fetch the cache of
9274         the primary cluster at: /data/measurement-set-<platform-id>-<metric-id>.json.
9276         Because the front end code has to behave as if all data is fetched, each cluster contains one data point
9277         immediately before the first data point and one immediately after the last data point. This avoids having
9278         to fetch multiple empty clusters for manually specified baseline data. To support this behavior, we generate
9279         all clusters for a given measurement set at once when the primary cluster is requested.
9281         Furthermore, all measurement sets are divided at the same time into clusters so that the boundary of clusters
9282         won't shift as more data are reported to the server.
9284         * config.json: Added clusterStart and clusterSize as options.
9285         * public/api/measurement-set.php: Added.
9286         (main):
9287         (MeasurementSetFetcher::__construct):
9288         (MeasurementSetFetcher::fetch_config_list): Finds configurations that belongs to this (platform, metric) pair.
9289         (MeasurementSetFetcher::at_end): Returns true if we've reached the end of all clusters for this set.
9290         (MeasurementSetFetcher::fetch_next_cluster): Generates the JSON data for the next cluster. We generate clusters
9291         in increasing chronological order (the oldest first and the newest last).
9292         (MeasurementSetFetcher::execute_query): Executes the main query.
9293         (MeasurementSetFetcher::format_map): Returns the mapping of a measurement field to an array index. This removes
9294         the need to have key names for each measurement and reduces the JSON size by ~10%.
9295         (MeasurementSetFetcher::format_run): Creates an array that contains data for a single measurement. The order
9296         matches that of keys in format_map.
9297         (MeasurementSetFetcher::parse_revisions_array): Added. Copied from runs.php.
9298         * tests/api-measurement-set.js: Added. Added tests for /api/measurement-set.
9300 2015-12-14  Ryosuke Niwa  <rniwa@webkit.org>
9302         Using fake timestamp in OS version make some results invisible
9303         https://bugs.webkit.org/show_bug.cgi?id=152289
9305         Reviewed by Stephanie Lewis.
9307         Fix various bugs after r194088.
9309         * public/api/commits.php:
9310         (format_commit): Include the commit order.
9311         * public/v2/data.js:
9312         (CommitLogs._cacheConsecutiveCommits): Sort by commit order when commit time is missing.
9313         * tools/pull-os-versions.py:
9314         (OSBuildFetcher._assign_order): Use integer instead of fake time for commit order.
9315         (available_builds_from_command): Exit early when an exception is thrown.
9317 2015-12-14  Ryosuke Niwa  <rniwa@webkit.org>
9319         Fix a typo in the previous commit.
9321         * public/include/report-processor.php:
9323 2015-12-14  Ryosuke Niwa  <rniwa@webkit.org>
9325         Build fix after r192965. Suppress a warning about log being referred to as a closure variable.
9327         * public/include/report-processor.php:
9329 2015-12-14  Ryosuke Niwa  <rniwa@webkit.org>
9331         Using fake timestamp in OS version make some results invisible
9332         https://bugs.webkit.org/show_bug.cgi?id=152289
9334         Reviewed by Stephanie Lewis.
9336         Added commit_order column to explicitly order OS versions. This fixes the bug whereby which
9337         baseline results reported with only OS versions are shown with x coordinate set to 10 years ago.
9339         To migrate the existing database, run:
9340             ALTER TABLE commits ADD COLUMN commit_order integer;
9341             CREATE INDEX commit_order_index ON commits(commit_order);
9343         Then for each repository $1,
9344             UPDATE commits SET (commit_time, commit_order) = (NULL, CAST(EXTRACT(epoch from commit_time) as integer))
9345             WHERE commit_repository = $1;
9348         * init-database.sql: Added the column.
9349         * public/api/commits.php:
9350         (fetch_commits_between): Use commit_order to order commits when commit_time is missing.
9351         * public/api/report-commits.php:
9352         (main): Set commit_order.
9353         * tools/pull-os-versions.py:
9354         (OSBuildFetcher.fetch_and_report_new_builds):
9355         (OSBuildFetcher._assign_order): Renamed from _assign_fake_timestamps. Set the order instead of a fake timestmap.
9357 2015-12-14  Ryosuke Niwa  <rniwa@webkit.org>
9359         Perf dashboard can't merge when the destination platform is missing baseline/target
9360         https://bugs.webkit.org/show_bug.cgi?id=152286
9362         Reviewed by Stephanie Lewis.
9364         The bug was caused by the query to migrate test configurations to new platform checking
9365         configuration type and metric separately; that is, it assumes the configuration exists
9366         only if either the same type or the same metric exists in the destination.
9368         Fixed the bug by checking both conditions simultaneously for each configuration.
9370         * public/admin/platforms.php:
9371         * tests/admin-platforms.js: Added a test.
9373 2015-12-11  Ryosuke Niwa  <rniwa@webkit.org>
9375         Perf dashboard's buildbot sync config JSON duplicates too much information
9376         https://bugs.webkit.org/show_bug.cgi?id=152196
9378         Reviewed by Stephanie Lewis.
9380         Added shared, per-builder, and per-test (called type) configurations.
9382         * tools/sync-with-buildbot.py:
9383         (load_config):
9384         (load_config.merge):
9386 2015-12-02  Ryosuke Niwa  <rniwa@webkit.org>
9388         Perf dashboard should avoid overflow during geometric mean computation
9389         https://bugs.webkit.org/show_bug.cgi?id=151773
9391         Reviewed by Chris Dumez.
9393         * public/include/report-processor.php:
9395 2015-11-30  Ryosuke Niwa  <rniwa@webkit.org>
9397         Perf dashboard should extend baseline and target to the future
9398         https://bugs.webkit.org/show_bug.cgi?id=151511
9400         Reviewed by Darin Adler.
9402         * public/v2/data.js:
9403         (RunsData.prototype.timeSeriesByCommitTime): Added extendToFuture as an argument.
9404         (RunsData.prototype.timeSeriesByBuildTime): Ditto.
9405         (RunsData.prototype._timeSeriesByTimeInternal): Ditto.
9406         (TimeSeries): Add a new point to the end if extendToFuture is set and the series is not empty.
9407         * public/v2/manifest.js:
9408         (App.Manifest._formatFetchedData): Set extendToFuture to true for baselines and targets.
9410 2015-11-30  Ryosuke Niwa  <rniwa@webkit.org>
9412         Perf dashboard should always show comparison to baseline and target even if one is missing
9413         https://bugs.webkit.org/show_bug.cgi?id=151510
9415         Reviewed by Darin Adler.
9417         Show the comparison status against the baseline when baseline is present but target is missing.
9419         To make the code more readable, this patch splits the logic into three cases:
9420         1. Both baseline and target are present
9421         2. Only baseline is present
9422         3. Only target is present
9424         Also extracted a helper function to construct the label.
9426         * public/v2/app.js:
9427         (.labelForDiff): Added.
9428         (App.Pane.computeStatus):
9430 2015-11-23  Commit Queue  <commit-queue@webkit.org>
9432         Unreviewed, rolling out r192716 and r192717.
9433         https://bugs.webkit.org/show_bug.cgi?id=151582
9435         The patch was incorrect. We always need at least one data
9436         point in each configuration (Requested by rniwa on #webkit).
9438         Reverted changesets:
9440         "Perf dashboard's should not include results more than 366
9441         days old in JSON"
9442         https://bugs.webkit.org/show_bug.cgi?id=151529
9443         http://trac.webkit.org/changeset/192716
9445         "Build fix for old version of PHP."
9446         http://trac.webkit.org/changeset/192717
9448 2015-11-20  Ryosuke Niwa  <rniwa@webkit.org>
9450         Build fix for old version of PHP.
9452         * public/api/runs.php:
9454 2015-11-20  Ryosuke Niwa  <rniwa@webkit.org>
9456         Perf dashboard's should not include results more than 366 days old in JSON
9457         https://bugs.webkit.org/show_bug.cgi?id=151529
9459         Reviewed by Timothy Hatcher.
9461         Don't return results more than 366 days old in /api/runs/ JSON API.
9462         This is a ~5% runtime improvement and reduces the JSON file size by 20-50% in the internal perf dashboard.
9464         * public/api/runs.php:
9465         (main): Added the support for "?noResults" to avoid echoing results. This is useful for debugging.
9466         Also instantiate RunsGenerator before issuing the query to find all configurations so that the runtime cost
9467         of doing so will be included in elapsedTime.
9468         (RunsGenerator::fetch_runs): Skip a row when its build and commit times are more than 366 days old.
9469         (RunsGenerator::format_run): Takes build_time and revisions as arguments since fetch_runs uses them now.
9470         (RunsGenerator::parse_revisions_array): Compute the max of commit times.
9472 2015-11-20  Ryosuke Niwa  <rniwa@webkit.org>
9474         Remove chartPointRadius from interactive chart component
9475         https://bugs.webkit.org/show_bug.cgi?id=151480
9477         Reviewed by Darin Adler.
9479         Replaced the parameter by CSS rules.
9481         * public/v2/chart-pane.css:
9482         (.chart .dot):
9483         (.chart .dot.foreground):
9484         (.chart .highlight):
9485         (.chart .extent):
9486         * public/v2/index.html:
9487         * public/v2/interactive-chart.js:
9488         (App.InteractiveChartComponent.Ember.Component.extend._constructGraphIfPossible):
9489         (App.InteractiveChartComponent.Ember.Component.extend._highlightedItemsChanged):
9491 2015-11-20  Ryosuke Niwa  <rniwa@webkit.org>
9493         Perf dashboard's runs API uses more than 128MB of memory
9494         https://bugs.webkit.org/show_bug.cgi?id=151478
9496         Reviewed by Andreas Kling.
9498         Don't fetch all query results at once to avoid using twice as much memory as needed.
9499         Use iterative API to format each result at a time.
9501         This change is also a 5% runtime performance gain.
9503         * public/api/runs.php:
9504         (RunsGenerator::__construct): Takes a Database instance instead of a list of configurations. The latter is
9505         no longer needed as we pass in each configuration type explicitly to fetch_runs.
9506         (RunsGenerator::fetch_runs): Renamed from add_runs since it now executes the database query via execute_query.
9507         Also moved the logic to compute the last modified time here.
9508         (RunsGenerator::execute_query): Moved from fetch_runs_for_config. Use Database::query instead of query_and_fetch_all.
9509         (RunsGeneratorForTestGroup):
9510         (RunsGeneratorForTestGroup::__construct):
9511         (RunsGeneratorForTestGroup::execute_query): Moved from fetch_runs_for_config_and_test_group.
9513         * public/include/db.php:
9514         (generate_data_file): Lock the file to avoid corruption.
9516 2015-11-19  Ryosuke Niwa  <rniwa@webkit.org>
9518         Perf dashboard always fetches charts JSON twice
9519         https://bugs.webkit.org/show_bug.cgi?id=151483
9521         Reviewed by Andreas Kling.
9523         Only re-generate "runs" JSON via /api/runs/ when the cache doesn't exist in /data/ or the cached JSON is
9524         obsolete (shouldRefetch is set true) or corrupt (the second closure).
9526         * public/v2/app.js:
9527         (App.Pane._fetch):
9529 2015-11-18  Ryosuke Niwa  <rniwa@webkit.org>
9531         Internal perf dashboard takes forever to load
9532         https://bugs.webkit.org/show_bug.cgi?id=151430
9534         Rubber-stamped by Antti Koivisto.
9536         Fix a few performance problems with the perf dashboard v2 UI.
9538         * public/v2/app.js:
9539         (App.DashboardRow._createPane): Set "inDashboard" to true.
9540         (App.Pane._fetch): Immediately show the cached chart instead of waiting for the refetched data which invokes
9541         a PHP JSON API. Also don't fetch the analysis tasks when the chart is shown in the dashboard since we don't
9542         show annotate charts in the dashboard.
9544 2015-10-15  Ryosuke Niwa  <rniwa@webkit.org>
9546         Unreviewed fix of a test after r190687.
9548         * tests/admin-regenerate-manifest.js:
9550 2015-10-12  Ryosuke Niwa  <rniwa@webkit.org>
9552         Perf dashboard tools shouldn't require server credentials in multiple configuration files
9553         https://bugs.webkit.org/show_bug.cgi?id=149994
9555         Reviewed by Chris Dumez.
9557         Made detect-changes.js and pull-svn.py pull username and passwords from the server config JSON to reduce
9558         the number of JSON files that need to include credentials.
9560         Also made each script reload the server config after sleep to allow dynamic credential updates.
9562         In addition, change the server config JSON's format to include scheme, host, and port numbers separately
9563         instead of a url since detect-changes.js needs each value separately.
9565         This reduces the number of JSONs with credentials to two for our internal dashboard.
9567         * tools/detect-changes.js:
9568         (main): Added a property argument parsing. Now takes --server-config-json, --change-detection-config-json,
9569         and --seconds-to-sleep like other scripts.
9570         (parseArgument): Added.
9571         (fetchManifestAndAnalyzeData): Reload the server config JSON.
9572         (loadServerConfig): Added. Set settings.perfserver and settings.slave from the server config JSON. Also
9573         add settings.perfserver.host to match the old format.
9574         (configurationsForTesting): Fixed a bug that we throw an exception when a dashboard contains an empty cell.
9576         * tools/pull-os-versions.py:
9577         (main): Use load_server_config after each sleep.
9579         * tools/pull-svn.py:
9580         (main): Use load_server_config after each sleep.
9581         (fetch_commits_and_submit): Use the perf dashboard's auth as subversion credential when useServerAuth is set.
9583         * tools/sync-with-buildbot.py:
9584         (main): Use load_server_config after each sleep.
9586         * tools/util.py:
9587         (load_server_config): Extracted from python scripts. Computes server's url from scheme, host, and port number
9588         to match the old format python scripts except.
9590 2015-10-11  Ryosuke Niwa  <rniwa@webkit.org>
9592         Build fix after r190817.  Now that pull-os-versions store fake timestamps, we need to bypass timestamp
9593         checks for OS versions when bots try to report new results. Otherwise, we fail to process the reports
9594         with a MismatchingCommitTime error.
9596         * public/include/report-processor.php:
9597         (ReportProcessor::resolve_build_id):
9599 2015-10-08  Ryosuke Niwa  <rniwa@webkit.org>
9601         Perf dashboard erroneously shows an old OS build in A/B testing range
9602         https://bugs.webkit.org/show_bug.cgi?id=149942
9604         Reviewed by Darin Adler.
9606         Ordering OS builds lexicologically turned out be a bad idea since 15A25 falls between 15A242 and 15A251.
9607         Use a fake/synthetic timestamp to force the commonly understood total order instead.
9609         Refactored pull-os-versions.py to share the server config JSON with other scripts. Also made the script
9610         support pulling multiple sources; e.g. both OS X and iOS.
9612         Also removed superfluous feature to submit results in chunks. The perf dashboard can handle thousands of
9613         revisions being submitted at once just fine.
9615         * public/api/commits.php:
9616         (main): A partial revert of r185574 since we no longer need to order builds lexicologically.
9618         * tools/pull-os-versions.py:
9619         (main): Takes --os-config-json, --server-config-json, and --seconds-to-sleep as arguments instead of
9620         a single --config argument to share the server config JSON with other scripts.
9621         (OSBuildFetcher): Extracted out of main. This class is instantiated for each OS kind (e.g. OS X).
9622         (OSBuildFetcher.__init__): Added.
9623         (OSBuildFetcher._fetch_available_builds): Extracted out of main. Fetches available builds from a website
9624         or custom commands.
9625         (OSBuildFetcher.fetch_and_report_new_builds): Extracted out of main. Submits the fetched builds after
9626         filtering out the ones we've already reported.
9627         (OSBuildFetcher._assign_fake_timestamps): Creates a fake timestamp to establish a total order amongst each
9628         OS X / iOS style build number such as 12A3456b.
9630 2015-10-08  Ryosuke Niwa  <rniwa@webkit.org>
9632         pull-svn.py fails to sync revisions when SVN credentials is not setup
9633         https://bugs.webkit.org/show_bug.cgi?id=149941
9635         Reviewed by Chris Dumez.
9637         Added the support for specifying subversion credentials.
9639         Also added the support for pulling from multiple subversion servers. Subversion servers are specified
9640         in a JSON configuration file specified by --svn-config formatted as follows:
9642         [
9643             {
9644                 "name": "WebKit",
9645                 "url": "http://svn.webkit.org/repository/webkit",
9646                 "username": "webkitten",
9647                 "password": "webkitten's password",
9648                 "trustCertificate": true,
9649                 "accountNameFinderScript":
9650                     ["python", "/Volumes/Data/WebKit/Tools/Scripts/webkit-patch", "find-users"]
9651             },
9652             ...
9653         ]
9655         In addition, refactored it to use the shared server config JSON for the dashboard access.
9657         * tools/pull-svn.py:
9658         (main): Now takes --svn-config-json, --server-config-json, --seconds-to-sleep and --max-fetch-count
9659         as required options instead of seven unnamed arguments.
9660         (fetch_commits_and_submit): Extracted from main. Fetches at most max_fetch_count new revisions from
9661         the subversion server, and submits them in accordance with server_config.
9662         (fetch_commit_and_resolve_author): Now takes a single repository dictionary instead of two separate
9663         arguments for name and URL to pass down the repository's authentication info to fetch_commit.
9664         (fetch_commit): Ditto. Add appropriate arguments when username and passwords are specified.
9665         (resolve_author_name_from_account): Use a list argument instead of a single string argument now that
9666         the argument comes from a JSON instead of sys.argv.
9668 2015-10-07  Ryosuke Niwa  <rniwa@webkit.org>
9670         Unreviewed race condition fix. Exit early when xScale or yScale is not defined.
9672         * public/v2/interactive-chart.js:
9673         (App.InteractiveChartComponent._updateRangeBarRects):
9675 2015-10-07  Ryosuke Niwa  <rniwa@webkit.org>
9677         Add a page that cycles through v2 dashboards
9678         https://bugs.webkit.org/show_bug.cgi?id=149907
9680         Reviewed by Chris Dumez.
9682         Add cycler.html that goes through each dashboard on v2 UI.
9684         This allows the dashboards to be cycled through on a TV screen.
9686         * public/cycler.html: Added.
9687         (loadURLAt): Appends a new iframe to load the next URL (i is the index of the dashboard to be shown)
9688         at the end of body. We don't immediately show the new iframe since it might take a while to load.
9689         (showNewFrameIfLoaded): Remove the current iframe and show the next iframe if the next dashboard has
9690         finished loading. We can't rely on DOMContentLoaded or load events because we use asynchronous XHR to
9691         load each chart's data. Instead, wait until some chart becomes available or fails to load and none of
9692         charts are still in progress to be shown.
9694 2015-10-07  Ryosuke Niwa  <rniwa@webkit.org>
9696         Allow custom revisions to be specified in A/B testing
9697         https://bugs.webkit.org/show_bug.cgi?id=149905
9699         Reviewed by Chris Dumez.
9701         Allow custom revision number on each "repository" when creating a test group.
9703         * public/v2/app.css:
9704         (form .analysis-group [name=customValue]): Added.
9706         * public/v2/app.js:
9707         (App.AnalysisTaskController._createConfiguration): Added "Custom" as a revision option.
9708         Also added point labels such as (point 3) on "None" for when some points are missing revision info.
9709         (App.AnalysisTaskController._labelForPoints): Extracted from _createConfiguration.
9710         (App.AnalysisTaskController.actions.createTestGroup): Respect the custom revision number when custom
9711         revision option is selected.
9713         * public/v2/index.html: Added a text field for specifying a custom revision number.
9715 2015-10-07  Ryosuke Niwa  <rniwa@webkit.org>
9717         Make the site name configurable in perf dashboard
9718         https://bugs.webkit.org/show_bug.cgi?id=149894
9720         Reviewed by Chris Dumez.
9722         Added "siteTitle" as a new configuration key to specify the site name.
9724         * public/include/db.php:
9725         (config): Now takes the default value as an argument.
9726         * public/include/manifest.php:
9727         (ManifestGenerator::generate): Include siteTitle in the manifest.
9728         * public/index.html: Update the title and the heading when the manifest is loaded.
9729         * public/v2/index.html: Use App.Manifest.siteTitle as the heading. document.title needs to be updated manually.
9730         * public/v2/manifest.js: 
9731         (App.MetricSerializer.normalizePayload): Update document.title and App.Manifest.siteTitle.
9733 2015-10-07  Ryosuke Niwa  <rniwa@webkit.org>
9735         Perf dashboard doesn't show analysis tasks anchored at outliers
9736         https://bugs.webkit.org/show_bug.cgi?id=149870
9738         Reviewed by Chris Dumez.
9740         The bug was caused by the computation of start and end times of analysis tasks being dependent on
9741         time series provided to the interactive chart component even though they are already filtered.
9743         Since the interactive chart component shouldn't be messing with the underlying data models, moved
9744         the code to compute start and end times to App.Pane, to where it belongs, and made the moved code use
9745         the unfiltered time series newly exposed on ChartData.
9747         Also fixed a bug in fetch-from-remote.php which resulted in Ember endlessly fetching same JSON files.
9749         * public/admin/fetch-from-remote.php:
9750         (.): Use the full request URI for HTTP requests and caching. Otherwise, we're going to mix up caches
9751         and Ember can start hanging browsers (took me three hours to debug this).
9753         * public/v2/app.js:
9754         (App.Pane._showOutlierChanged): Added. Resets chartData when showOutlier flag has been changed.
9755         (App.Pane.fetchAnalyticRanges): The old code wasn't filtering analysis tasks by platforms and metrics
9756         at all since it relied on the server-side REST API to do the filtering, which I haven't implemented yet.
9757         Filter the results manually instead.
9758         (App.Pane.ranges): Moved the logic to compute startTime and endTime here from InteractiveChartComponent.
9759         (App.PaneController.toggleShowOutlier): Now that App.Pane responds to showOutlier changes, we don't
9760         need to call a private method on it.
9761         (App.AnalysisTaskController._chartDataChanged): When end points are not found, try showing outliers.
9762         This will cause chartData to be modified so just exit early and wait for getting called again.
9764         * public/v2/interactive-chart.js:
9765         (App.InteractiveChartComponent._rangesChanged): The code to compute start and end time has been moved
9766         to App.Pane.ranges.
9768         * public/v2/manifest.js:
9769         (App.Manifest._formatFetchedData): Added unfiltered time series as new properties as they are now used
9770         to compute the end points of analysis tasks when their end points are outliers.
9772 2015-10-07  Ryosuke Niwa  <rniwa@webkit.org>
9774         Unreviewed. Fix a typo in r190645.
9776         * public/include/db.php:
9778 2015-10-06  Ryosuke Niwa  <rniwa@webkit.org>
9780         V2 UI shouldn't sort dashboards lexicologically
9781         https://bugs.webkit.org/show_bug.cgi?id=149856
9783         Reviewed by Chris Dumez.
9785         Don't sort the dashboards by name in App.Manifest.
9787         * public/v2/app.js:
9788         (App.IndexRoute.beforeModel): Don't transition to "undefined" (string) dashboard.
9789         * public/v2/manifest.js:
9790         (App.Manifest.._fetchedManifest):
9792 2015-10-06  Ryosuke Niwa  <rniwa@webkit.org>
9794         V2 UI fails to show the data for the very first point in charts
9795         https://bugs.webkit.org/show_bug.cgi?id=149857
9797         Reviewed by Chris Dumez.
9799         The bug was caused by seriesBetweenPoints returning null for when point.seriesIndex is 0.
9800         Explicitly check the type of this property instead.
9802         * public/v2/data.js:
9803         (TimeSeries.prototype.seriesBetweenPoints):
9805 2015-10-06  Ryosuke Niwa  <rniwa@webkit.org>
9807         Perf dashboard should have the capability to test local UI with production data
9808         https://bugs.webkit.org/show_bug.cgi?id=149834
9810         Reviewed by Chris Dumez.
9812         Added tools/run-with-remote-server.py which runs a local httpd server and pulls data from a remote server.
9814         * Install.md: Added the instruction on how to use the script. Also updated the remaining instructions
9815         for El Capitan.
9816         * config.json: Added remote server configurations.
9817         * public/admin/fetch-from-remote.php: Added. This script fetches JSON from the remote server specified in
9818         config.json and caches the results in the location specified as "cacheDirectory" in config.json.
9819         (main):
9820         (fetch_remote):
9821         * public/include/db.php:
9822         (config_path): Extracted from generate_data_file.
9823         (generate_data_file):
9824         * tools/remote-server-relay.conf: Added. Apache 2.4 configuration file for a local http server launched by
9825         run-with-remote-server.py.
9826         * tools/run-with-remote-server.py: Added. Launches Apache with the right set of directives.
9827         (main):
9828         (abspath_from_root):
9830 2015-07-13  Ryosuke Niwa  <rniwa@webkit.org>
9832         Fix a typo.
9834         * public/js/helper-classes.js:
9836 2015-06-27  Ryosuke Niwa  <rniwa@webkit.org>
9838         build-requests should use conform to JSON API format
9839         https://bugs.webkit.org/show_bug.cgi?id=146375
9841         Reviewed by Stephanie Lewis.
9843         Instead of returning single dictionary that maps root set id to a dictionary of repository names
9844         to revisions, timestamps, simply return root sets and roots "rows" or "objects" as defined in
9845         JSON API (http://jsonapi.org/). This API change makes it easier to resolve the bug 146374 and
9846         matches what we do in /api/test-groups.
9848         Also add the support for /api/build-requests/?id=<id> to fetch the build request with <id>.
9849         This is useful for debugging purposes.
9851         * public/api/build-requests.php:
9852         (main): Added the support for $_GET['id']. Also return "rootSets" and "roots".
9853         (update_builds): Extracted from main.
9855         * public/include/build-requests-fetcher.php:
9856         (BuildRequestFetcher::fetch_request): Added. Used for /api/build-requests/?id=<id>.
9857         (BuildRequestFetcher::results_internal): Always call fetch_roots_for_set_if_needed.
9858         (BuildRequestFetcher::fetch_roots_for_set_if_needed): Renamed from fetch_roots_for_set.
9859         Moved the logic to exit early when the root set had already been fetched here.
9861         * public/v2/analysis.js:
9862         (App.TestGroup._fetchTestResults): Fixed the bug that test groups without any successful results
9863         won't be shown.
9865         * tools/pull-os-versions.py:
9866         (main):
9867         (setup_auth): Moved to util.py
9869         * tools/sync-with-buildbot.py:
9870         (main): Replaced a bunch of perf dashboard related options by --server-config-json.
9871         (update_and_fetch_build_requests): No longer takes build_request_auth since that's now taken care
9872         of by setup_auth.
9873         (organize_root_sets_by_id_and_repository_names): Added. Builds the old rootsSets directory based
9874         on "roots" and "rootSets" dictionaries returned by /api/build-requests.
9875         (config_for_request): Fixed a bug that the script blows up when the build request is missing
9876         the repository specified in the configuration. This tolerance is necessary when a new repository
9877         dependency is added but we want to run A/B tests for old builds without the dependency.
9878         (fetch_json): No longer takes auth.
9880         * tools/util.py:
9881         (setup_auth): Moved from pull-os-versions.py to be shared with sync-with-buildbot.py.
9883 2015-06-23  Ryosuke Niwa  <rniwa@webkit.org>
9885         Build fix. A/B testing is broken when continuous builders report revisions out of order.
9887         * public/v2/app.js:
9888         (App.AnalysisTaskController.Ember.Controller.extend.):
9890 2015-06-22  Ryosuke Niwa  <rniwa@webkit.org>
9892         A/B testing results should be shown even if they were submitted to different platforms
9893         https://bugs.webkit.org/show_bug.cgi?id=146219
9895         Reviewed by Andreas Kling.
9897         Fetch A/B testing results regardless of the platform to which results are submitted
9898         by providing the platform ID to which the results were submitted for each test group.
9900         * public/api/test-groups.php:
9901         (main): Include the platform id in the test groups.
9902         * public/v2/analysis.js:
9903         (App.TestGroup._fetchTestResults): Fetch results from the platform associated with the group.
9905 2015-06-19  Csaba Osztrogonác  <ossy@webkit.org>
9907         Remove unnecessary svn:executable flags
9908         https://bugs.webkit.org/show_bug.cgi?id=146107
9910         Reviewed by Alexey Proskuryakov.
9912         * public/js/helper-classes.js: Removed property svn:executable.
9913         * public/js/jquery.flot.plugins.js: Removed property svn:executable.
9914         * public/v2/app.css: Removed property svn:executable.
9915         * public/v2/app.js: Removed property svn:executable.
9916         * public/v2/chart-pane.css: Removed property svn:executable.
9917         * public/v2/data.js: Removed property svn:executable.
9918         * public/v2/index.html: Removed property svn:executable.
9919         * public/v2/js/d3/LICENSE: Removed property svn:executable.
9920         * public/v2/js/d3/d3.js: Removed property svn:executable.
9921         * public/v2/js/d3/d3.min.js: Removed property svn:executable.
9922         * public/v2/js/ember-data.js: Removed property svn:executable.
9923         * public/v2/js/ember.js: Removed property svn:executable.
9924         * public/v2/js/handlebars.js: Removed property svn:executable.
9925         * public/v2/js/jquery.min.js: Removed property svn:executable.
9926         * public/v2/js/statistics.js: Removed property svn:executable.
9927         * public/v2/manifest.js: Removed property svn:executable.
9928         * public/v2/popup.js: Removed property svn:executable.
9930 2015-06-17  Ryosuke Niwa  <rniwa@webkit.org>
9932         Reading the list of analysis tasks is extremely slow
9933         https://bugs.webkit.org/show_bug.cgi?id=146086
9935         Reviewed by Darin Adler.
9937         The bug was caused by Ember data requesting manifest.js hundreds of times.
9938         Fetch it ahead of time in each route instead.
9940         * public/v2/app.js:
9941         (App.AnalysisRoute.model):
9942         (App.AnalysisTaskRoute.model):
9944 2015-06-17  Ryosuke Niwa  <rniwa@webkit.org>
9946         Update ReadMe.md and Install.md per database changes
9947         https://bugs.webkit.org/show_bug.cgi?id=146076
9949         Reviewed by Darin Adler.
9951         Updated.
9953         * Install.md:
9954         * ReadMe.md:
9956 2015-06-17  Ryosuke Niwa  <rniwa@webkit.org>
9958         Increase the popup dismissal time from 100ms to 500ms
9959         https://bugs.webkit.org/show_bug.cgi?id=146077
9961         Rubber-stamped by Andreas Kling.
9963         * public/v2/popup.js:
9964         (App.PopupView.scheduleHiding):
9966 2015-06-16  Ryosuke Niwa  <rniwa@webkit.org>
9968         v2 UI should have buttons to breakdown a test
9969         https://bugs.webkit.org/show_bug.cgi?id=146010
9971         Reviewed by Chris Dumez.
9973         Added buttons beneath each chart pane to add "alternative panes". By default, it shows every platform
9974         as well as "Breakdown" to add all subtests' metrics.
9976         Also removed the metric submenu from tests that had exactly one metric. When a test only measures Time
9977         for example, we make the test itself clickable instead of showing a submenu that only contains one item.
9979         * public/v2/app.js:
9980         (App.ChartsController.addAlternativePanes): Added.
9981         (App.TestProxyForPopup.children): Calls _updateChildren and returns this._children.
9982         (App.TestProxyForPopup.actionName): Added.
9983         (App.TestProxyForPopup.actionArgument): Added.
9984         (App.TestProxyForPopup._updateChildren): Extracted from children. Now also sets _actionName and
9985         _actionArgument in the case there was exactly one metric so that showing submenu is unnecessary.
9986         (App.PaneController.alternativePanes): Added. Returns the list of alternative panes. The platform list
9987         excludes ones that don't have this metric (e.g. iOS doesn't have desktop PLT results) as well as ones
9988         that are already present in the list of panes.
9989         * public/v2/chart-pane.css: Added CSS rules for alternative pane buttons beneath the chart panes.
9990         * public/v2/index.html:
9991         * public/v2/manifest.js:
9992         (App.Metric.childMetrics): Added.
9994 2015-06-15  Ryosuke Niwa  <rniwa@webkit.org>
9996         Build fix after r185574.
9998         * public/v2/app.js:
9999         (set get App.Pane.Ember.Object.extend.):
10001 2015-06-15  Ryosuke Niwa  <rniwa@webkit.org>
10003         Fix a typo.
10005         * tools/pull-os-versions.py:
10006         (main):
10008 2015-06-15  Ryosuke Niwa  <rniwa@webkit.org>
10010         Perf dashboard should be able to list iOS versions as well as OS X versions
10011         https://bugs.webkit.org/show_bug.cgi?id=146003
10013         Reviewed by Stephanie Lewis.
10015         Generalized pull-osx.py so that it can run an arbitrary shell command to fetch OS versions based on
10016         information specified in config.json.
10018         * tools/pull-os-versions.py: Renamed from pull-osx.py.
10019         (main): Use available_builds_from_command when 'customCommands' is specified.
10020         (available_builds_from_command): Added. Executes a shell command to fetch a list of available builds.
10021         (fetch_available_builds): Now takes the repository name.
10023 2015-06-15  Ryosuke Niwa  <rniwa@webkit.org>
10025         Removed a superfluous console.log per Chris's comment.
10027         * public/v2/app.js:
10029 2015-06-15  Ryosuke Niwa  <rniwa@webkit.org>
10031         Analysis task should show all possible revisions for A/B testing
10032         https://bugs.webkit.org/show_bug.cgi?id=145996
10034         Reviewed by Chris Dumez.
10036         * public/api/commits.php:
10037         (fetch_commits_between): When the time stamp is not available for commits, use revision numbers
10038         to find revisions between two ranges. This is necessary for OS X and iOS versions since they don't
10039         have a "commit time".
10041         * public/v2/app.js:
10042         (App.AnalysisTaskController.updateRootConfigurations): Fetch commits between two end points.
10043         (App.AnalysisTaskController._createConfiguration): Extracted from updateRootConfigurations. List
10044         the fetched list of commits if available.
10045         (App.AnalysisTaskController._serializeNumbersSkippingConsecutiveEntries): Added. Serializes an list
10046         of numbers intelligently. For example, [1, 2, 4, 5] turns into "1-2, 4-5". Without this, some lists
10047         of points shown in the A/B testing configurations become too long. 
10049         * public/v2/commits-viewer.js:
10050         (App.CommitsViewerComponent.commitsChanged):
10052         * public/v2/data.js:
10053         (CommitLogs.fetchCommits): Renamed from fetchForTimeRange.
10055 2015-06-13  Ryosuke Niwa  <rniwa@webkit.org>
10057         Add a script to post new OS X builds to perf dashboard
10058         https://bugs.webkit.org/show_bug.cgi?id=145955
10060         Reviewed by Darin Adler.
10062         Added a new script pull-osx.py and relaxed the restrictions on commits accepted by the dashboard API.
10064         * public/api/report-commits.php:
10065         (main): Allow more characters than [A-Za-z0-9] in revision. e.g. "10.10.3 14D136".
10066         Also allow commits without the author, commit time, and commit message as OS versions do not have those.
10068         * tools/pull-osx.py: Added.
10069         (main): Fetch the list of builds from a website and submit them per submissionSize with submissionInterval.
10070         Once all builds have been submitted, wait for a long time as specified by fetchInterval.
10071         (setup_auth): Sets up basic or digest auth to access the dashboard.
10072         (fetch_available_builds): Fetches and parses the XML document from an internal website.
10073         (textContent): A helper function to get the text content out of a XML node.
10074         (submit_commits): Submits commits to the perf dashboard.
10076         * tools/pull-svn.py:
10077         (fetch_commit):
10079         * tools/util.py: Extracted submit_commits and text_content from pull-svn.py to be reused in pull-osx.py.
10081 2015-06-13  Ryosuke Niwa  <rniwa@webkit.org>
10083         Perf dashboard's v2 UI shouldn't hide auto-detected outliers
10084         https://bugs.webkit.org/show_bug.cgi?id=145940
10086         Reviewed by Darin Adler.
10088         Don't fallback to the default strategies for moving averages and envelope when one is not specified.
10089         Also deleted the code to mark points outside the envelop as outliers.
10091         * public/v2/app.js:
10093 2015-06-12  Ryosuke Niwa  <rniwa@webkit.org>
10095         Unreviewed build fix for merging platforms.
10097         * public/admin/platforms.php:
10099 2015-06-09  Ryosuke Niwa  <rniwa@webkit.org>
10101         Unreviewed build fix. Some builder names are really long.
10103         * init-database.sql:
10105 2015-05-22  Ryosuke Niwa  <rniwa@webkit.org>
10107         Show results and status before revisions for A/B testing results
10108         https://bugs.webkit.org/show_bug.cgi?id=145327
10110         Reviewed by Chris Dumez.
10112         Place the results and the status columns before the columns for revisions.
10113         Also show the absolute difference as well as the relative difference between the averages of A and B.
10115         * public/v2/app.js:
10116         (App.TestGroupPane._populate):
10117         (App.TestGroupPane._computeStatisticalSignificance):
10118         * public/v2/index.html:
10120 2015-05-20  Ryosuke Niwa  <rniwa@webkit.org>
10122         Build fix after r184591.
10124         * public/v2/manifest.js:
10126 2015-05-20  Ryosuke Niwa  <rniwa@webkit.org>
10128         Build fix. Use POSIX timestamp instead of human readable string for the commit time.
10130         * public/include/build-requests-fetcher.php:
10132 2015-05-20  Ryosuke Niwa  <rniwa@webkit.org>
10134         UI to associate bugs with an analysis task is crappy
10135         https://bugs.webkit.org/show_bug.cgi?id=145198
10137         Reviewed by Andreas Kling.
10139         Make the UI less crappy by linkifying bug numbers and adding an explicit button to disassociate
10140         a bug and a separate select view with a text field to associate a new bug instead of implicitly
10141         updating or deleting the existing record based on what the user had typed.
10143         * init-database.sql: Removed the constraint that each bug tracker should appear exactly once for
10144         a given analysis task since it's perfectly reasonable for a given task to be associated with
10145         multiple WebKit bugs.
10147         * public/privileged-api/associate-bug.php:
10148         (main): Only remove the bug specified by newly added bugToDelete instead of implicitly deleting
10149         one that matches the analysis task and the bug tracker when the bug number is falsey.
10151         * public/v2/analysis.js:
10152         (App.Bug.url): Added.
10153         (App.BugAdapter.deleteRecord): Added. Uses the privileged API to delete the record.
10155         * public/v2/app.css:
10157         * public/v2/app.js:
10158         (App.AnalysisTaskController.actions.addBug): Added.
10159         (App.AnalysisTaskController.actions.deleteBug): Added.
10160         (App.AnalysisTaskController.associateBug): Deleted.
10162         * public/v2/index.html: Updated the templates.
10164         * public/v2/manifest.js:
10165         (App.BugTracker.urlFromBugNumber): Added.
10167 2015-05-20  Ryosuke Niwa  <rniwa@webkit.org>
10169         A/B testing rootSets should provide commit times as well as revisions
10170         https://bugs.webkit.org/show_bug.cgi?id=145207
10172         Reviewed by Andreas Kling.
10174         Some continuous build systems need the commit time as well as the revision number / hash so provide one
10175         in the root sets but maintain the backwards compatibility with buildbots that use revision number directly.
10177         * public/include/build-requests-fetcher.php:
10178         (BuildRequestsFetcher::fetch_roots_for_set): Made the revision info an associative array that contains
10179         the revision number as well as the commit time.
10180         * tools/sync-with-buildbot.py:
10181         (schedule_request): Removed "replacement" which was a superfluous copy of "roots". Use "revision" values
10182         when the JSON configuration refers to "root". This is necessary in buildbot instances that require WebKit
10183         revision to be specified on its own field instead of it being a JSON that contains "revision" and "time".
10185 2015-05-19  Ryosuke Niwa  <rniwa@webkit.org>
10187         Build fix. Don't fall into an infinite loop when value (renamed from bytes) is zero.
10189         * public/v2/manifest.js:
10190         (App.Manifest.Ember.Controller.extend.):
10191         (App.Manifest.Ember.Controller.extend):
10193 2015-05-19  Ryosuke Niwa  <rniwa@webkit.org>
10195         Don't show unit (bytes) separaetly from SI suffixes (K, M, etc...)
10196         https://bugs.webkit.org/show_bug.cgi?id=145181
10198         Rubber-stamped by Chris Dumez.
10200         Show 'MB' in each y-axis label instead of showing 'bytes' separately and suffixing each label with just 'M'
10201         for clarity. This change also reduces the code complexity.
10203         * public/index.html:
10204         * public/v2/app.js:
10205         (App.AnalysisTaskController._chartDataChanged):
10206         (App.TestGroupPane._createConfigurationSummary):
10207         * public/v2/data.js:
10208         (RunsData.unitFromMetricName): Use 'B' instead of 'bytes' as the unit.
10210         * public/v2/interactive-chart.js: Removed the support for showing units separately.
10211         (App.InteractiveChartComponent._constructGraphIfPossible):
10212         (App.InteractiveChartComponent._relayoutDataAndAxes)
10214         * public/v2/manifest.js:
10215         (App.Manifest._makeFormatter): Renamed from _formatBytes. Support more SI suffixes such as micro and mili.
10216         Now takes the unit as the first argument. Adjust the base unit if it's 'ms'.
10217         (App.Manifest._formatFetchedData): Removed unit and formatWithUnit now that all all formatters would
10218         automatically include unit.
10220 2015-05-18  Ryosuke Niwa  <rniwa@webkit.org>
10222         REGRESSION: v2 UI reports a higher memory usage
10223         https://bugs.webkit.org/show_bug.cgi?id=145151
10225         Reviewed by Chris Dumez.
10227         The bug was caused by v2 UI using 1000 to divide the number of bytes instead of by 1024 as done in v1.
10228         Fixed the bug by manually implementing the formatter as done in v1.
10230         * public/v2/manifest.js:
10231         (App.Manfiest._formatBytes): Added.
10232         (App.Manifest._formatFetchedData): Use _formatByte instead of format('s').
10234 2015-05-11  Ryosuke Niwa  <rniwa@webkit.org>
10236         Unreviewed build fix. Add "Duration" as a time metric.
10238         * public/js/helper-classes.js:
10239         * public/v2/data.js:
10240         (RunsData.unitFromMetricName):
10242 2015-05-06  Ryosuke Niwa  <rniwa@webkit.org>
10244         Perf dashboard treats Speedometer and JetStream as smaller is better
10245         https://bugs.webkit.org/show_bug.cgi?id=144711
10247         Reviewed by Chris Dumez.
10249         Added the support for "Score" metric.
10251         * public/js/helper-classes.js:
10252         (PerfTestRuns):
10253         * public/v2/data.js:
10254         (RunsData.unitFromMetricName):
10255         (RunsData.isSmallerBetter):
10257 2015-04-23  Ryosuke Niwa  <rniwa@webkit.org>
10259         Build fix after r183232.
10261         * public/include/json-header.php:
10263 2015-04-23  Ryosuke Niwa  <rniwa@webkit.org>
10265         Perf dashboard should automatically detect regressions
10266         https://bugs.webkit.org/show_bug.cgi?id=141443
10268         Reviewed by Anders Carlsson.
10270         Added a node.js script detect-changes.js to detect potential regressions and progressions
10271         on the graphs tracked on v2 dashboards.
10273         * init-database.sql: Added analysis_strategies table and task_segmentation and task_test_range
10274         columns to analysis_tasks to keep the segmentation and test range selection strategies used
10275         to create an analysis task.
10277         * public/api/analysis-tasks.php:
10278         (format_task): Include task_segmentation and analysis_tasks in the results.
10280         * public/include/json-header.php:
10281         (remote_user_name): Returns null when the privileged API is authenticated as a slave instead
10282         of a CSRF prevention token.
10283         (should_authenticate_as_slave): Added.
10284         (ensure_privileged_api_data_and_token_or_slave): Added. Authenticate as a slave if slaveName
10285         and slavePassword are specified. Since detect-changes.js and other slaves are not susceptible
10286         to a CSRF attack, we don't need to check a CSRF token.
10288         * public/privileged-api/create-analysis-task.php:
10289         (main): Use ensure_privileged_api_data_and_token_or_slave to let detect-changes.js create new
10290         analysis task. Also add or find segmentation and test range selection strategies if specified.
10292         * public/privileged-api/create-test-group.php:
10293         (main): Use ensure_privileged_api_data_and_token_or_slave.
10295         * public/privileged-api/generate-csrf-token.php:
10297         * public/v2/app.js:
10298         (App.Pane._computeMovingAverageAndOutliers): _executeStrategy has been moved to Statistics.
10300         * public/v2/data.js: Export Measurement, RunsData, TimeSeries. Used in detect-changes.js.
10301         (Array.prototype.find): Added a polyfill to be used in node.js.
10302         (RunsData.fetchRuns):
10303         (RunsData.pathForFetchingRuns): Extracted from fetchRuns. Used in detect-changes.js.
10304         (RunsData.createRunsDataInResponse): Extracted from App.Manifest._formatFetchedData to use it
10305         in detect-changes.js.
10306         (RunsData.unitFromMetricName): Ditto.
10307         (RunsData.isSmallerBetter): Ditto.
10308         (RunsData.prototype._timeSeriesByTimeInternal): Added secondaryTime to sort points when commit
10309         times are identical.
10310         (TimeSeries): When commit times are identical, order points based on build time. This is needed
10311         for when we trigger two builds at two different OS versions with the same WebKit revision since
10312         OS versions don't change the commit times.
10313         (TimeSeries.prototype.findPointByIndex): Added.
10314         (TimeSeries.prototype.rawValues): Added.
10316         * public/v2/js/statistics.js:
10317         (Statistics.TestRangeSelectionStrategies.[0]): Use the 99% two-sided probability as claimed in the
10318         description of this strategy instead of the default probability. Also fixed a bug that debugging
10319         code was referring to non-existent variables.
10320         (Statistics.executeStrategy): Moved from App.Pane (app.js).
10322         * public/v2/manifest.js:
10323         (App.Manifest._formatFetchedData): Various code has been extracted into RunsData in data.js to be
10324         used in detect-changes.js.
10326         * tools/detect-changes.js: Added. The script fetches the manifest JSON, analyzes each graph in
10327         the v2 dashboards, and creates an analysis task for the latest regression or progression detected.
10328         It also schedules an A/B testing if possible and notifies another server; e.g. to send an email. 
10329         (main): Loads the settings JSON specified in the argument.
10330         (fetchManifestAndAnalyzeData): The main loop that periodically wakes up to do the analysis.
10331         (mapInOrder): Executes callback sequentially (i.e. blocking) on each item in the array.
10332         (configurationsForTesting): Finds every (platform, metric) pair to analyze in the v2 dashbaords,
10333         and computes various values for when statistically significant changes are detected later.
10334         (analyzeConfiguration): Finds potential regressions and progression in the last X days where X
10335         is the specified maximum number of days using the specified strategies. Sort the resultant ranges
10336         in chronological order and create a new analysis task for the very last change we detected. We'll
10337         eventually create an analysis task for all detected changes since we're repeating the analysis in
10338         fetchManifestAndAnalyzeData after some time.
10339         (computeRangesForTesting): Fetch measured values and compute ranges to test using the specified
10340         segmentation and test range selection strategies. Once ranges are found, find overlapping analysis
10341         tasks as they need to be filtered out in analyzeConfiguration to avoid creating multiple analysis
10342         tasks for the same range (e.g. humans may create one before the script gets to do it).
10343         (createAnalysisTaskAndNotify): Create a new analysis task for the specified range, trigger an A/B
10344         testing if available, and notify another server with a HTML message as specified.
10345         (findStrategyByLabel):
10346         (changeTypeForRange): A change is a regression if values are getting larger in a smaller-is-better
10347         test or values are getting smaller in a larger-is-better test and vice versa.
10348         (summarizeRange): Create a human readable string that summarizes the change detected. e.g.
10349         "Potential 3.2% regression detected between 2015-04-20 12:00 and 17:00".
10350         (formatTimeRange):
10351         (getJSON):
10352         (postJSON):
10353         (postNotification): Recursively replaces $title and $massage in the specified JSON template.
10354         (instantiateNotificationTemplate):
10355         (fetchJSON):
10357 2015-04-20  Ryosuke Niwa  <rniwa@webkit.org>
10359         Perf dashboard should have UI to set status on analysis tasks
10360         https://bugs.webkit.org/show_bug.cgi?id=143977
10362         Reviewed by Chris Dumez.
10364         Added the UI to set the result of an analysis task to 'progression', 'regression', 'unchanged', and 'inconclusive'
10365         as well as a boolean indicating whether creating the analysis task was the right thing to do or not.
10366         The latter will be a useful metric once we start automatically creating analysis tasks.
10368         * init-database.sql: Added two columns to analysis_tasks table.
10369         * public/api/analysis-tasks.php: Include the added columns in the JSON.
10370         * public/include/db.php:
10371         (Database::to_database_boolean): Added.
10372         * public/include/json-header.php:
10373         (require_match_one_of_values): Added.
10374         * public/privileged-api/update-analysis-task.php: Added. Updates 'result' and 'needed' values of an analysis task.
10375         (main):
10376         * public/v2/analysis.js:
10377         (App.AnalysisTask.result): Added.
10378         (App.AnalysisTask.needed): Added. We don't use DS.attr('boolean') here since that would coerce null into false
10379         and we want to differentiate null from false in order to differentiate the null-ness of the value.
10380         (App.AnalysisTask.saveStatus): Added.
10381         (App.AnalysisTask.statusLabel): Use 'result' as the label if it's set and all build requests have been processed.
10382         * public/v2/app.css:
10383         * public/v2/app.js:
10384         (App.AnalysisTaskController.analysisResultOptions): Added.
10385         (App.AnalysisTaskController.shouldNotHaveBeenCreated): Added.
10386         (App.AnalysisTaskController.needsFeedback): Added. Show the checkbox to indicate the analysis task should not have
10387         been created if 'no change' is selected.
10388         (App.AnalysisTaskController._updateChosenAnalysisResult): Added.
10389         (App.AnalysisTaskController.actions.saveStatus): Added.
10390         * public/v2/index.html: Extracted a partial template for updating the bug numbers. Also added the UI to update
10391         'result' and 'needed' values of the analysis task.
10393 2015-04-10  Ryosuke Niwa  <rniwa@webkit.org>
10395         Unreviewed build fix. Updated config.json after recent changes.
10397         * config.json:
10399 2015-04-10  Ryosuke Niwa  <rniwa@webkit.org>
10401         Make the analysis page more useful
10402         https://bugs.webkit.org/show_bug.cgi?id=143617
10404         Reviewed by Chris Dumez.
10406         * public/api/analysis-tasks.php:
10407         (fetch_and_push_bugs_to_tasks): Added total and finished numbers of build requests associated
10408         with the fetched analysis tasks as buildRequestCount and finishedBuildRequestCount respectively.
10409         * public/v2/analysis.js:
10410         (App.AnalysisTask.formattedCreatedAt): Added.
10411         (App.AnalysisTask._addLeadingZero): Added.
10412         (App.AnalysisTask.buildRequestCount): Added.
10413         (App.AnalysisTask.finishedBuildRequestCount): Added.
10414         (App.AnalysisTask.statusLabel): Added. Status total and finished numbers of build requests.
10415         (App.AnalysisTask.testGroups):
10416         (App.AnalysisTask.triggerable):
10417         (App.AnalysisTask.label):
10419         * public/v2/app.css: Tweaked style rules for the analysis page.
10421         * public/v2/app.js:
10422         (App.buildPopup): Sort the list of platforms by name.
10423         (App.AnalysisRoute.model): Sort the list of analysis tasks by the order they are created.
10424         (App.AnalysisTaskController._fetchedManifest): Added elementId to associate bug tracker names
10425         such as "Bugzilla" with the corresponding text field.
10427         * public/v2/index.html: Added a bunch of columns to the analysis page and also wrapped the table
10428         showing A/B testing results in a div with overflow: scroll so that it always leaves enough space
10429         for the accompanying graph.
10431 2015-04-09  Ryosuke Niwa  <rniwa@webkit.org>
10433         Perf dashboard should automatically select ranges for A/B testing
10434         https://bugs.webkit.org/show_bug.cgi?id=143580
10436         Reviewed by Chris Dumez.
10438         Added a new statistics option for picking a A/B test range selection strategy.
10439         The selected ranges are shown in the graph using the same UI to show analysis tasks.
10441         * public/v2/app.js:
10442         (App.DashboardPaneProxyForPicker._platformOrMetricIdChanged): Updated the query parameters for
10443         charts page used by the dashboard since we've added a new parameter at the end.
10444         (App.Pane.ranges): Added. Merges ranges created for analysis tasks and A/B testing.
10445         (App.Pane.updateStatisticsTools): Clone and set the test range selection strategies.
10446         (App.Pane._cloneStrategy): Copy isSegmentation.
10447         (App.Pane._updateMovingAverageAndEnvelope): Set testRangeCandidates.
10448         (App.Pane._movingAverageOrEnvelopeStrategyDidChange): Update the charts when a new text range
10449         selection strategy is picked by the user.
10450         (App.Pane._computeMovingAverageAndOutliers): Compute the test ranges using the chosen strategy.
10451         Avoid going through isAnomalyArray when no anomaly detection strategy is enabled. Also changed
10452         the return value from the moving average time series to a dictionary that contains the moving
10453         average time series, a dictionary of anomalies, and an array of test ranges.
10454         (App.ChartsController._parsePaneList): Parse the test range selection strategy configuration.
10455         (App.ChartsController._serializePaneList): Ditto for serialization.
10456         (App.ChartsController._scheduleQueryStringUpdate): Update the URL hash when the user picks a new
10457         test range selection strategy.
10459         * public/v2/chart-pane.css: Fixed a typo as well as added a CSS rule for test ranges markers.
10461         * public/v2/index.html: Added UI for selecting a test range selection strategy.
10463         * public/v2/interactive-chart.js:
10464         (App.InteractiveChartComponent._rangesChanged): Pass down "status" to be used as a class name.
10466         * public/v2/js/statistics.js:
10467         (Statistics.MovingAverageStrategies): Added isSegmentation to segmentation strategies.
10468         (Statistics.TestRangeSelectionStrategies): Added.
10470 2015-04-08  Ryosuke Niwa  <rniwa@webkit.org>
10472         The results of A/B testing should state statistical significance
10473         https://bugs.webkit.org/show_bug.cgi?id=143552
10475         Reviewed by Chris Dumez.
10477         Added statistical comparisons between results for each configuration on analysis task page using
10478         Welch's t-test. The probability as well as t-statistics and the degrees of freedoms are reported.
10480         * public/v2/app.js:
10481         (App.TestGroupPane._populate): Report the list of statistical comparison between every pair of
10482         root configurations in the results. e.g. if we've got A, B, C configurations then compare A/B, A/C
10483         and B/C.
10484         (App.TestGroupPane._computeStatisticalSignificance): Compute the statistical significance using
10485         Welch's t-test. Report the probability by which two samples do not come from the same distribution.
10486         (App.TestGroupPane._createConfigurationSummary): Include the array of results for this configuration.
10487         Also renamed "items" to "requests" for clarity.
10489         * public/v2/index.html: Added the template for showing statistical comparisons.
10491         * public/v2/js/statistics.js: Renamed tDistributionQuantiles to tDistributionByOneSidedProbability
10492         for clarity. Also factored out the functions to convert from one-sided probability to two-sided
10493         probability and vice versa.
10494         (Statistics.supportedConfidenceIntervalProbabilities):
10495         (Statistics.confidenceIntervalDelta):
10496         (Statistics.probabilityRangeForWelchsT): Added. Computes the lower bound and the upper bound for
10497         the probability that two values are sampled from distinct distributions using Welch's t-test.
10498         (Statistics.computeWelchsT): This function now takes two-sided probability like all other functions.
10499         (.tDistributionByOneSidedProbability): Renamed from tDistributionQuantiles.
10500         (.oneSidedToTwoSidedProbability): Extracted.
10501         (.twoSidedToOneSidedProbability): Extracted.
10502         (Statistics.MovingAverageStrategies): Converted the one-sided probability to the two-sided probability
10503         now that computeWelchsT takes two-sided probability.
10505 2015-04-08  Ryosuke Niwa  <rniwa@webkit.org>
10507         Unreviewed fix after r182496 for when the cached runs JSON doesn't exist.
10509         * public/v2/app.js:
10510         (App.Pane._fetch):
10511         (App.Pane.refetchRuns):
10513 2015-04-07  Ryosuke Niwa  <rniwa@webkit.org>
10515         Perf dashboard should have a way of marking outliers
10516         https://bugs.webkit.org/show_bug.cgi?id=143466
10518         Reviewed by Chris Dumez.
10520         Address kling's in-person comment to notify users when the new run status is saved in the database.
10522         * public/v2/app.js:
10523         (App.PaneController._selectedItemIsMarkedOutlierDidChange)
10524         * public/v2/chart-pane.css: Fixed a typo.
10526 2015-04-07  Ryosuke Niwa  <rniwa@webkit.org>
10528         Perf dashboard should have a way of marking outliers
10529         https://bugs.webkit.org/show_bug.cgi?id=143466
10531         Reviewed by Chris Dumez.
10533         Added UI to mark a data point as an outlier as well as a button to toggle the visibility of outliers.
10534         Added a new privileged API /privileged-api/update-run-status to store this boolean flag.
10536         * init-database.sql: Added run_marked_outlier column to test_runs table.
10538         * public/admin/tests.php:
10540         * public/api/runs.php:
10541         (main): Only emit Cache-Control and Expires headers in v1 UI.
10542         (RunsGenerator::format_run): Emit markedOutlier.
10544         * public/include/admin-header.php:
10546         * public/include/db.php:
10547         (Database::is_true): Made it static.
10549         * public/include/manifest.php:
10550         (Manifest::platforms):
10552         * public/index.html: Call into /api/runs/ with ?cache=true.
10554         * public/privileged-api/update-run-status.php: Added.
10555         (main): Updates the newly added column in test_runs table.
10557         * public/v2/app.js:
10558         (App.Pane._fetch):
10559         (App.Pane.refetchRuns): Extracted from App.Pane._fetch.
10560         (App.Pane._didFetchRuns): Renamed from _updateChartData.
10561         (App.Pane._setNewChartData): Added. Pick the right time series based based on the value of showOutlier.
10562         Cloning chartData is necessary when toggling the outlier visibility or using statistics tools because
10563         the interactive chart component only observes changes to chartData and not individual properties of it.
10564         (App.Pane._highlightPointsMarkedAsOutlier): Added. Highlight points marked as outliers.
10565         (App.Pane._movingAverageOrEnvelopeStrategyDidChange): Call to _setNewChartData replaced the code to
10566         clone chartData here.
10568         (App.PaneController.actions.toggleShowOutlier): Toggle the visibility of points marked as outliers by
10569         invoking App.Pane._setNewChartData.
10570         (App.PaneController._detailsChanged): Don't hide the analysis pane when details changed since keep
10571         opening the pane for marking points as outliers would be annoying.
10572         (App.PaneController._updateCanAnalyze): Update 'cannotMarkOutlier' as well as 'cannotAnalyze'.
10573         (App.PaneController.selectedMeasurement): Added.
10574         (App.PaneController.showOutlierTitle): Added.
10575         (App.PaneController._selectedItemIsMarkedOutlierDidChange): Added. Call out to setMarkedOutlier to
10576         mark the selected point as an outlier via the newly added privileged API.
10578         * public/v2/chart-pane.css: Updated styles.
10580         * public/v2/data.js:
10581         (PrivilegedAPI._post): Report the semantic errors.
10582         (Measurement.prototype.markedOutlier): Added.
10583         (Measurement.prototype.setMarkedOutlier): Added. Uses PrivilegedAPI to update the database.
10584         (RunsData.prototype.timeSeriesByCommitTime): Added a new argument, includeOutliers, to indicate
10585         whether the time series should include measurements marked as outliers or not.
10586         (RunsData.prototype.timeSeriesByBuildTime): Ditto.
10587         (RunsData.prototype._timeSeriesByTimeInternal): Extracted from timeSeriesByCommitTime and
10588         timeSeriesByBuildTime to share code. Now ignores measurements marked as outliers if needed.
10590         * public/v2/index.html: Added an icon for showing and hiding outliers. Also added a checkbox to
10591         mark individual points as outliers.
10593         * public/v2/interactive-chart.js:
10594         (App.InteractiveChartComponent._selectClosestPointToMouseAsCurrentItem): Re-enable the distance
10595         heuristics that takes vertical closeness into account. This heuristics is more useful when marking
10596         some points as outliers. This heuristics was disabled because the behavior was unpredictable but
10597         with the arrow key navigation support, this is no longer an issue.
10599         * public/v2/manifest.js:
10600         (App.Manifest._formatFetchedData): Added showOutlier to the chart data. This function dynamically
10601         updates the time series in this chart data in order to include or exclude outliers.
10603 2015-04-03  Ryosuke Niwa  <rniwa@webkit.org>
10605         Perf dashboard should be able to trigger A/B testing jobs for iOS
10606         https://bugs.webkit.org/show_bug.cgi?id=143398
10608         Reviewed by Chris Dumez.
10610         Fix various bugs in the perf dashboard so that it can schedule A/B testing jobs for iOS.
10612         Also generalized sync-with-buildbot.py slightly to meet the requirements of iOS builders.
10614         * public/api/triggerables.php:
10615         (main): Avoid spitting a warning when $id_to_triggerable doesn't contain the triggerable.
10616         * public/v2/analysis.js:
10617         (App.AnalysisTask.triggerable): Log an error when failed to fetch triggerables for debugging purposes.
10618         * public/v2/app.js:
10619         (App.AnalysisTaskController.updateRootConfigurations): Show 'None' when a revision is missing from
10620         some of the data points. This will happen when we modify the list of projects we build for iOS.
10621         (App.AnalysisTaskController.actions.createTestGroup): Gracefully fail by showing alerts when an user
10622         attempts to create an invalid test group; when there is already another test group of the same or when
10623         only either configuration specifies the revision for some repository.
10624         (App.AnalysisTaskController._updateRootsBySelectedPoints): Fixed a typo: sets[i] -> set.
10625         * public/v2/index.html: Don't show the form to create a new test group if it's not available.
10626         * tools/sync-with-buildbot.py:
10627         (find_request_updates):
10628         (schedule_request): iOS builders take a JSON that contains the list of roots. Generate this JSON when
10629         a dictionary of the form {rootsExcluding: ["WebKit"]} is specified. Also replaced the way we refer to
10630         a revision from $-based text replacements to an explicit dictionary of the form {root: "WebKit"}.
10631         (request_id_from_build): Don't hard code the parameter name here. Retrieve the name from the config.
10633 2015-04-03  Ryosuke Niwa  <rniwa@webkit.org>
10635         Add time series segmentation algorithms as moving averages
10636         https://bugs.webkit.org/show_bug.cgi?id=143362
10638         Reviewed by Chris Dumez.
10640         This patch implements two preliminary time series segmentation algorithms as moving averages.
10642         Recursive t-test: Compute Welch's t-statistic at each point in a given segment of the time series.
10643         If Welch's t-test implicates a statistically significance difference, then split the segment into two
10644         sub segments with the maximum t-statistic (i.e. the point at which if split would yield the highest
10645         probability that two segments do not share the same "underlying" mean in classical / frequentist sense).
10646         We repeat this process recursively. See [1] for the evaluation of this particular algorithm.
10648         Schwarz criterion: Use Schwarz or Bayesian information criterion to heuristically find the optimal
10649         segmentation. Intuitively, the problem of finding the best segmentation comes down to minimizing the
10650         residual sum of squares in each segment as in linear regressions. That is, for a given segment with
10651         values y_1 through y_n with mean y_avg, we want to minimize the sum of (y_i - y_avg)^2 over i = 1
10652         through i = n. However, we also don't want to split every data point into a separate segment so we need
10653         to account the "cost" of introducing new segments. We use a cost function that's loosely based on two
10654         models discussed in [2] for simplicity. We will tune this cost function further in the future.
10656         The problem of finding the best segmentation then reduces to a search problem. Unfortunately, our problem
10657         space is exponential with respect to the size of the time series since we could split at each data point.
10658         We workaround this problem by first splitting the time series into a manageable smaller grids, and only
10659         considering segmentation of a fixed size (i.e. the number of segments is constant). Since time series
10660         tend to contain a lot more data points than segments, this strategy finds the optimal solution without
10661         exploring much of the problem space.
10663         Finding the optimal segmentation of a fixed size is, itself, another search problem that is equivalent to
10664         finding the shortest path of a fixed length in DAG. Here, we use dynamic programming with a matrix of size
10665         n by n where n is the length of the time series (grid). Each entry in this matrix at (i, k) stores
10666         the minimum cost of segmenting data points 1 through i using k segments. We start our search at i = 1.
10667         Clearly C(1, 0) = 0 (note the actual code uses 0-based index). In i-th iteration, we compute the cost
10668         S(i, j) of each segment starting at i and ending at another point j after i and update C(j, k + 1) by
10669         min( C(j, k + 1), C(i, k) + S(i, j) ) for all values of j above i.
10671         [1] Kensuke Fukuda, H. Eugene Stanley, and Luis A. Nunes Amaral, "Heuristic segmentation of
10672         a nonstationary time series", Physical Review E 69, 021108 (2004)
10674         [2] Marc Lavielle, Gilles Teyssi`ere, "Detection of Multiple Change–Points in Multivariate Time Series"
10675         Lithuanian Mathematical Journal, vol 46, 2006
10677         * public/v2/index.html: Show the optional description for the chosen moving average strategy.
10678         * public/v2/js/statistics.js:
10679         (Statistics.testWelchsT):
10680         (Statistics.computeWelchsT): Extracted from testWelchsT. Generalized to take the offset and the length
10681         of each value array between which Welch's t-statistic is computed. This generalization helps the
10682         Schwarz criterion segmentation algorithm avoid splitting values array O(n^2) times.
10683         (.sampleMeanAndVarianceForValues): Ditto for the generalization.
10684         (.recursivelySplitIntoTwoSegmentsAtMaxTIfSignificantlyDifferent): Added. Implements recursive t-test.
10685         (.splitIntoSegmentsUntilGoodEnough): Added. Implements Schwarz criterion.
10686         (.findOptimalSegmentation): Added. Implements the algorithm to find the optimal segmentation of a fixed
10687         segment count.
10688         (.SampleVarianceUpperTriangularMatrix): Added. Stores S(i, j) used by findOptimalSegmentation.
10689         (.SampleVarianceUpperTriangularMatrix.prototype.costBetween): Added.
10691 2015-04-03  Ryosuke Niwa  <rniwa@webkit.org>
10693         REGRESSION: Perf dashboard sometimes fails to update zooming level
10694         https://bugs.webkit.org/show_bug.cgi?id=143359
10696         Reviewed by Darin Adler.
10698         The bug was caused by various bugs that ended up in an exception.
10700         * public/v2/app.js:
10701         (App.Pane._handleFetchErrors): Removed superfluous console.log.
10702         (App.Pane.computeStatus): Fixed the bug in r182185 that previousPoint could be null.
10703         (App.PaneController.actions.zoomed): Update the overview when the main chart triggered a zoom.
10704         * public/v2/index.html: Replaced all instances of href="#" by href="javascript:false" to avoid navigating
10705         to # when Ember.js fails to attach event listeners on time.
10706         * public/v2/interactive-chart.js:
10707         (App.InteractiveChartComponent._updateDimensionsIfNeeded): Avoid using a negative width or height when
10708         the containing element's size is 0.
10709         (App.InteractiveChartComponent._updateBrush): Ditto.
10711 2015-04-02  Ryosuke Niwa  <rniwa@webkit.org>
10713         Perf dashboard should have UI to test out anomaly detection strategies
10714         https://bugs.webkit.org/show_bug.cgi?id=143290
10716         Reviewed by Benjamin Poulain.
10718         Added the UI to select anomaly detection strategies. The detected anomalies are highlighted in the graph.
10720         Implemented the Western Electric Rules 1 through 4 in http://en.wikipedia.org/wiki/Western_Electric_rules
10721         as well as Welch's t-test that compares the last five points to the prior twenty points.
10723         The latter is what Mozilla uses (or at least did in the past) to detect performance regressions on their
10724         performance tests although they compare medians instead of means.
10726         All of these strategies don't quite work for us since our data points are too noisy but this is a good start.
10728         * public/v2/app.js:
10729         (App.Pane.updateStatisticsTools): Clone anomaly detection strategies.
10730         (App.Pane._updateMovingAverageAndEnvelope): Highlight anomalies detected by the enabled strategies.
10731         (App.Pane._movingAverageOrEnvelopeStrategyDidChange): Observe changes to anomaly detection strategies.
10732         (App.Pane._computeMovingAverageAndOutliers): Detect anomalies by each strategy and aggregate results.
10733         Only report the first data point when multiple consecutive data points are detected as anomalies.
10734         * public/v2/chart-pane.css: Updated styles.
10735         * public/v2/index.html: Added the pane for selecting anomaly detection strategies.
10736         * public/v2/js/statistics.js:
10737         (Statistics.testWelchsT): Added. Implements Welch's t-test.
10738         (.sampleMeanAndVarianceForValues): Added.
10739         (.createWesternElectricRule): Added.
10740         (.countValuesOnSameSide): Added.
10741         (Statistics.AnomalyDetectionStrategy): Added.
10743 2015-03-31  Ryosuke Niwa  <rniwa@webkit.org>
10745         REGRESSION: Searching commits can highlight wrong data points
10746         https://bugs.webkit.org/show_bug.cgi?id=143272
10748         Reviewed by Antti Koivisto.
10750         The bug was caused by /api/commits returning commit times with millisecond precision whereas /api/runs
10751         return commit times with only second precision. This resulted in the frontend code to match a commit
10752         with the data point that included the next commit when the millisecond component of commit's timestamp
10753         wasn't identically 0.
10755         This discrepancy was caused by the fact PHP's strtotime only ignores milliseconds and /api/commits
10756         was returning timestamp as string instead of parsing via Database::to_js_time as done in /api/runs
10757         so miliseconds component was only preserved in /api/commits.
10759         Fixed the bug by always using Database::to_js_time to return commit time. Also fixed to_js_time so that
10760         it returns time in milisecond precision.
10762         * public/api/commits.php:
10763         (fetch_commits_between): Use Database::to_js_time for format commit times.
10764         (format_commit): Ditto.
10765         * public/include/db.php:
10766         (Database::to_js_time): Parse and append millisecond component. Ignore sub-milliseconds for simplicity.
10767         * public/v2/data.js:
10768         (CommitLogs.fetchForTimeRange): The commit time is now an integer so don't call "replace" on it.
10770 2015-03-31  Ryosuke Niwa  <rniwa@webkit.org>
10772         Perf dashboard should show relative change in values
10773         https://bugs.webkit.org/show_bug.cgi?id=143252
10775         Reviewed by Antti Koivisto.
10777         When a range of values are selected, show the percentage difference between the start and the end
10778         in addition to the absolute value difference. When a single point is selected, show the relative
10779         difference with respect to the previous point. Use two significant figures and always show plus sign
10780         when the difference is positive.
10782         * public/v2/app.js: Compute and format the relative difference.
10783         * public/v2/chart-pane.css: Don't let commits view shrink itself when they're all collapsed.
10784         * public/v2/index.html: Show the relative difference.
10786 2015-03-31  Ryosuke Niwa  <rniwa@webkit.org>
10788         REGRESSION(r180000): Changing moving average or enveloping strategy doesn't update the graph
10789         https://bugs.webkit.org/show_bug.cgi?id=143254
10791         Reviewed by Antti Koivisto.
10792         
10793         The bug was caused by App.Pane no longer replacing 'chartData' property when updating the moving average
10794         or the enveloping values. Fixed the bug by creating a new chartData object when the strategy is changed
10795         so that the interactive chart component will observe a change to 'chartData'.
10797         * public/v2/app.js:
10798         (App.Pane._movingAverageOrEnvelopeStrategyDidChange): Added.
10800 2015-03-19  Ryosuke Niwa  <rniwa@webkit.org>
10802         Unreviewed build fixes.
10804         * public/include/manifest.php:
10805         (Manifest::generate): These should be {} instead of [] when they're empty.
10806         * public/v2/data.js:
10807         (Measurement.prototype.formattedRevisions): Don't assume previousRevisions[repositoryId] exits.
10808         * public/v2/manifest.js:
10809         (App.Metric.fullName): Fixed the typo.
10810         * tests/admin-regenerate-manifest.js: Fixed the test.
10812 2015-02-20  Ryosuke Niwa  <rniwa@webkit.org>
10814         Commit the erroneously reverted change.
10816         * public/api/runs.php:
10817         (RunsGenerator::results): 
10819 2015-02-20  Ryosuke Niwa  <rniwa@webkit.org>
10821         Loading the perf dashboard takes multiple seconds
10822         https://bugs.webkit.org/show_bug.cgi?id=141860
10824         Reviewed by Andreas Kling.
10826         This patch introduces the caches of JSON files returned by /api/ in /data/ directory. It also records
10827         the last time test_runs rows associated with the requested platforms and metrics are inserted, updated,
10828         or removed in the caches as well as the manifest JSON files ("last modified time"). Because the manifest
10829         is regenerated each time a new test result is reported, the front end can compare last modified time in
10830         the manifest file with that in a /api/runs JSON cache to detect the stale-ness.
10832         More concretely, the front end first optimistically fetches the JSON in /data/. If the cache doesn't exit
10833         or the last modified time in the cache doesn't match with that in the manifest file, it would fetch it
10834         again via /api/runs. In the case the cache did exist, we render the charts based on the cache meanwhile.
10835         This dramatically reduces the perceived latency for the page load since charts are drawn immediately using
10836         the cache and we would only re-render the charts as new up-to-date JSON comes in.
10838         This patch also changes the format of runs JSONs by pushing the exiting properties into 'configurations'
10839         and adding 'lastModified' and 'elapsedTime' at the top level.
10841         * init-database.sql: Added config_runs_last_modified to test_configurations table as well as a trigger to
10842         auto-update this column upon changes to test_runs table.
10844         * public/admin/test-configurations.php:
10845         (add_run): Regenerate the manifest file to invalidate the /api/runs JSON cache.
10846         (delete_run): Ditto.
10848         * public/api/runs.php:
10849         (main): Fetch all columns of test_configurations table including config_runs_last_modified. Also generate
10850         the cache in /data/ directory.
10851         (RunsGenerator::__construct): Compute the last modified time for this (platform, metric) pair.
10852         (RunsGenerator::results): Put the old content in 'configurations' property and include 'lastModified' and
10853         'elapsedTime' properties. 'elapsedTime' is added for debugging purposes.
10854         (RunsGenerator::add_runs):
10855         (RunsGenerator::parse_revisions_array):
10857         * public/include/db.php:
10858         (CONFIG_DIR): Added.
10859         (generate_data_file): Added based on ManifestGenerator::store.
10860         (Database::to_js_time): Extracted from RunsGenerator::add_runs to share code.
10862         * public/include/json-header.php:
10863         (echo_success): Renamed from success_json. Return the serialized JSON instead of echo'ing it so that we can
10864         generate caches in /api/runs/.
10865         (exit_with_success):
10867         * public/include/manifest.php:
10868         (ManifestGenerator::generate): Added 'elapsedTime' property for the time taken to generate the manifest.
10869         It seems like we're generating it in 200-300ms for now so that's good.
10870         (ManifestGenerator::store): Uses generate_data_file.
10871         (ManifestGenerator::platforms): Added 'lastModified' array to each platform entry. This array contains the
10872         last modified time for each (platform, metric) pair.
10874         * public/index.html:
10875         (fetchTest): Updated per the format change in runs JSON.
10877         * public/v2/app.js:
10878         (App.Pane._fetch): Fetch the cached JSON first. Refetch the uncached version if instructed as such.
10879         (App.Pane._updateChartData): Extracted from App.Pane._fetch.
10880         (App.Pane._handleFetchErrors): Ditto.
10882         * public/v2/data.js:
10883         (RunsData.fetchRuns): Takes the fourth argument indicating whether we should fetch the cached version or not.
10884         The cached JSON is located in /data/ with the same filename. When fetching a cached JSON results in 404,
10885         fulfill the promise with null as the result instead of rejecting it. The only client of this function which
10886         sets useCache to true is App.Manifest.fetchRunsWithPlatformAndMetric, and it handles this special case.
10888         * public/v2/manifest.js:
10889         (App.DateArrayTransform): Added. Handles the array of last modified dates in platform objects.
10890         (App.Platform.lastModifiedTimeForMetric): Added. Returns the last modified date in the manifest JSON.
10891         (App.Manifest.fetchRunsWithPlatformAndMetric): Takes "useCache" like RunsData.fetchRuns. Set shouldRefetch
10892         to true if response is null (the cache didn't exit) or the cache is out-of-date.
10893         (App.Manifest._formatFetchedData): Extracted from App.Manifest.fetchRunsWithPlatformAndMetric.
10895         * run-tests.js:
10896         (initializeDatabase): Avoid splitting function definitions in the middle.
10898         * tests/api-report.js: Added tests to verify that reporting new test results updates the last modified time
10899         in test_configurations.
10901 2015-02-20  Ryosuke Niwa  <rniwa@webkit.org>
10903         REGRESSION(r180333): Analysis tasks can't be associated with bugs
10904         https://bugs.webkit.org/show_bug.cgi?id=141858
10906         Reviewed by Andreas Kling.
10908         Added back the erroneously removed table to associate bugs. Also moved "details-table-container" div outside
10909         of the chart-details partial template as it needs to wrap associate bugs in analysis task pages.
10911         * public/v2/chart-pane.css:
10912         * public/v2/index.html:
10914 2015-02-20  Ryosuke Niwa  <rniwa@webkit.org>
10916         Selecting revisions for A/B testing is hard
10917         https://bugs.webkit.org/show_bug.cgi?id=141824
10919         Reviewed by Andreas Kling.
10921         Update the revisions used in A/B testing based on the selection in the overview chart. This allows users to
10922         intuitively select revisions based on points shown in the chart. Removed the old select elements used to
10923         select A/B testing points manually.
10925         Also renamed 'testSets' to 'configurations', 'roots' to 'rootConfigurations', and 'revisions' in each root's
10926         sets to 'options' for clarity.
10928         * public/v2/app.css: Reorganized style rules. 
10930         * public/v2/app.js:
10931         (App.AnalysisTaskController):
10932         (App.AnalysisTaskController._taskUpdated): Merged updateTestGroupPanes.
10933         (App.AnalysisTaskController._chartDataChanged): Renamed from paneDomain. It's now an observer instead of
10934         a property, which sets 'overviewDomain' property as well as other properties.
10935         (App.AnalysisTaskController.updateRootConfigurations): Renamed from updateRoots.
10936         (App.AnalysisTaskController._updateRootsBySelectedPoints): Added. Select roots based on the selected points
10937         in the overview chart.
10939         * public/v2/chart-pane.css: Added arrows next to the configuration names (e.g. 'A') to indicate whether
10940         individual build requests / test results are shown or not.
10942         * public/v2/index.html: Removed the select element per configuration column. Also moved the select element
10943         for the number of runs as it doesn't belong in the same table as the one that lists repositories and roots.
10945 2015-02-20  Ryosuke Niwa  <rniwa@webkit.org>
10947         Unreviewed test fixes after r179037, r179591, and r179763.
10949         * tests/admin-regenerate-manifest.js:
10950         * tests/admin-reprocess-report.js:
10952 2015-02-19  Ryosuke Niwa  <rniwa@webkit.org>
10954         Relationship between A/B testing results are unclear
10955         https://bugs.webkit.org/show_bug.cgi?id=141810
10957         Reviewed by Andreas Kling.
10959         Show a "reference chart" indicating which two points have been tested in each test group pane.
10961         Now the chart shown at the top of an analysis task page is called the "overview pane", and we use the pane
10962         and the domain used in this chart to show charts in each test group.
10964         Also renamed an array of revisions used in the A/B test results tables from 'revisions' to 'revisionList'.
10966         * public/v2/analysis.js:
10967         (App.TestGroup._fetchTestResults): Renamed from _fetchChartData. Set 'testResults' instead of 'chartData'
10968         since this is the results of A/B testing results, not the data for charts shown next to them.
10970         * public/v2/app.css: Added CSS rules for reference charts.
10972         * public/v2/app.js:
10973         (App.AnalysisTaskController.paneDomain): Set 'overviewPane' and 'overviewDomain' on each test group pane.
10974         (App.TestGroupPane._populate): Updated per 'chartData' to 'testResults' rename.
10975         (App.TestGroupPane._updateReferenceChart): Get the chart data via the overview pane and find points that
10976         identically matches root sets. If one of configuration used a set of revisions for which no measurement
10977         was made in the original chart, don't show the reference chart as that would be misleading / confusing.
10978         (App.TestGroupPane._computeRepositoryList): Updated per 'chartData' to 'testResults' rename.
10979         (App.TestGroupPane._createConfigurationSummary): Ditto. Also renamed 'revisions' to 'revisionList'.
10980         In addition, renamed 'buildNumber' to 'buildLabel' and prefixed it with "Build ".
10982         * public/v2/data.js:
10983         (Measurement.prototype.revisionForRepository): Added.
10984         (Measurement.prototype.commitTimeForRepository): Cleanup.
10985         (TimeSeries.prototype.findPointByRevisions): Added. Finds a point based on a set of revisions.
10987         * public/v2/index.html: Added the reference chart. Streamlined the status label for each build request
10988         by including the build number in the title attribute instead of in the markup.
10990         * public/v2/interactive-chart.js:
10991         (App.InteractiveChartComponent._updateDomain): Fixed a typo introduced as a consequence of r179913.
10992         (App.InteractiveChartComponent._computeYAxisDomain): Expand the y-axis to show the highlighted points.
10993         (App.InteractiveChartComponent._highlightedItemsChanged): Adjust the y-axis as needed.
10995 2015-02-18  Ryosuke Niwa  <rniwa@webkit.org>
10997         Analysis task pages are unusable
10998         https://bugs.webkit.org/show_bug.cgi?id=141786
11000         Reviewed by Andreas Kling.
11002         This patch makes following improvements to analysis task pages:
11003         1. Making the main chart interactive. This change required the use of App.Pane as well as moving the code to
11004         compute the data for the details pane from PaneController.
11005         2. Moving the form to add a new test group to the top of test groups instead of the bottom of them.
11006         3. Grouping the build requests in each test group by root sets instead of the order by which they were ran.
11007         This change required the creation of App.TestGroupPane as well as its methods.
11008         4. Show a box plot for each root set configuration as well as each build request. This change required
11009         App.BoxPlotComponent.
11010         5. Show revisions of each repository (e.g. WebKit) for each root set and build request.
11012         * public/api/build-requests.php:
11013         (main): Update per the rename of BuildRequestsFetcher::root_sets to BuildRequestsFetcher::root_sets_by_id.
11015         * public/api/test-groups.php:
11016         (main): Include root sets and roots in the response.
11017         (format_test_group):
11019         * public/include/build-requests-fetcher.php:
11020         (BuildRequestsFetcher::root_sets_by_id): Renamed from root_sets.
11021         (BuildRequestsFetcher::root_sets): Added.
11022         (BuildRequestsFetcher::roots): Added.
11023         (BuildRequestsFetcher::fetch_roots_for_set): Takes a boolean argument $resolve_ids. This flag is only set to
11024         true in /api/build-requests/ (as done prior to this patch) to use repository names as identifiers since
11025         tools/sync-with-buildbot.py can't convert repository names to their ids.
11027         * public/v2/analysis.js:
11028         (App.Root): Added.
11029         (App.RootSet): Added.
11030         (App.RootSet.revisionForRepository): Added.
11031         (App.TestGroup.rootSets): Deleted the code to compute root set ids from build requests now that the JSON
11032         response at /api/test-groups will include them.
11033         (App.BuildRequest): Ditto. Also deleted 'configLetter' property, which has been moved to a proxy created by
11034         _createConfigurationSummary.
11035         (App.BuildRequest.statusLabel): Use 'Completed' as the human readable label for 'completed' status.
11036         (App.BuildRequest.aggregateStatuses): Added. Generates a human readable status for a set of build requests.
11038         * public/v2/app.css: Updated style rules for analysis task pages.
11040         * public/v2/app.js:
11041         (App.Pane): This class is now used in analysis task pages to make the main chart interactive.
11042         (App.Pane._updateDetails): Moved from App.PaneController.
11044         (App.PaneController._updateCanAnalyze): Updated the code per the move of selectedPoints.
11046         (App.AnalysisTaskController): Added 'details'.
11047         (App.AnalysisTaskController._taskUpdated):
11048         (App.AnalysisTaskController.paneDomain):Renamed from _fetchedRuns.
11049         (App.AnalysisTaskController.updateTestGroupPanes): Added. Creates App.TestGroupPane for each test group.
11050         (App.AnalysisTaskController.actions.toggleShowRequestList): Added.
11052         (App.TestGroupPane): Added.
11053         (App.TestGroupPane._populate): Added. Group build requests by root sets and create a summary for each group.
11054         (App.TestGroupPane._computeRepositoryList): Added. Returns a sorted list of repositories which is the union
11055         of all repositories appearing in root sets and builds associated with A/B testing results.
11056         (App.TestGroupPane._groupRequestsByConfigurations): Added. Groups build requests by root sets.
11057         (App.TestGroupPane._createConfigurationSummary): Added. Creates a summary for a group of build requests that
11058         use the same root set. We start by wrapping "raw" build requests in a proxy with formatted values,
11059         build numbers, etc... obtained from the fetched chart data. The list of revisions shown in the group summary
11060         is a union of revisions in the root set and the first build request in the group. We null-out revision info
11061         for a build request if it is identical to the one in the summary. The range of values is expanded as needed
11062         by the values in the group as well as 95% percentile confidence interval.
11064         (App.BoxPlotComponent): Added. Controls a box plot shown for each test group summary and build request.
11065         (App.BoxPlotComponent.didInsertElement): Added. Inserts a SVG element as well as two indicator rects to show
11066         the mean and the confidence interval.
11067         (App.BoxPlotComponent._updateBars): Added. Updates the dimensions of the indicator rects.
11068         (App.BoxPlotComponent.valueChanged): Added. Computes the relative dimensions of the indicator rects and
11069         calls _updateBars to update the rects.
11071         * public/v2/chart-pane.css: Added some style rules to be used in the details pane in analysis task pages.
11073         * public/v2/data.js:
11074         (Measurement.prototype.formattedRevisions):
11075         (Measurement.formatRevisionRange): Renamed from Measurement.prototype._formatRevisionRange so that it can be
11076         called in _createConfigurationSummary.
11078         * public/v2/index.html: Updated the templates for analysis task pages. Moved the form to create a new test
11079         group above all test groups, and replaced the list of data points by "details" pane used in the charts page.
11080         Also made the fetching of chartData no longer block showing of test groups.
11082         * public/v2/interactive-chart.js:
11083         (App.InteractiveChartComponent._updateDomain): Added an early exit to fix a newly revealed race condition.
11084         (App.InteractiveChartComponent._domainChanged): Ditto.
11085         (App.InteractiveChartComponent._updateSelectionToolbar): Made it respect 'zoomable' boolean property.
11087         * public/v2/js/statistics.js:
11088         (Statistics.min): Added.
11089         (Statistics.max): Added.
11091         * public/v2/manifest.js:
11092         (App.Manifest.fetchRunsWithPlatformAndMetric): Added formatWithDeltaAndUnit to be used in _createConfigurationSummary.
11094 2015-02-14  Ryosuke Niwa  <rniwa@webkit.org>
11096         Build URL on new perf dashboard doesn't resolve $builderName
11097         https://bugs.webkit.org/show_bug.cgi?id=141583
11099         Reviewed by Darin Adler.
11101         Support $builderName in the build URL template.
11103         * public/js/helper-classes.js:
11104         (TestBuild.buildUrl): Replaced $builderName with the builder name.
11106         * public/v2/manifest.js:
11107         (App.Metric.fullName): Fixed the typo. We need &ni, not &in.
11108         (App.BuilderurlFromBuildNumber): Replaced $builderName with the builder name.
11110 2015-02-13  Ryosuke Niwa  <rniwa@webkit.org>
11112         Unreviewed build fix after r179591.
11114         * public/api/commits.php:
11116 2015-02-13  Ryosuke Niwa  <rniwa@webkit.org>
11118         The status of a A/B testing request always eventually becomes "Failed"
11119         https://bugs.webkit.org/show_bug.cgi?id=141523
11121         Reviewed by Andreas Kling.
11123         The bug was caused by /api/build-requests always setting the status of a build request to 'failed' when
11124         'failedIfNotCompleted' was sent by the buildbot sync'er.
11126         Fixed the bug by only setting the status to 'failed' if it wasn't set to 'completed'.
11128         * public/api/build-requests.php:
11129         (main):
11131 2015-02-13  Csaba Osztrogonác  <ossy@webkit.org>
11133         Unreviewed, remove empty directories.
11135         * public/data: Removed.
11137 2015-02-12  Ryosuke Niwa  <rniwa@webkit.org>
11139         Perf dashboard should show the results of A/B testing
11140         https://bugs.webkit.org/show_bug.cgi?id=141500
11142         Reviewed by Chris Dumez.
11144         Added the support for fetching test_runs for a specific test group in /api/runs/, and used it in the
11145         analysis task page to fetch results for each test group.
11147         Merged App.createChartData into App.Manifest.fetchRunsWithPlatformAndMetric so that App.BuildRequest
11148         can use the formatter.
11150         * public/api/runs.php:
11151         (fetch_runs_for_config_and_test_group): Added.
11152         (fetch_runs_for_config): Just return the fetched rows since main will format them with RunsGenerator.
11153         (main): Use fetch_runs_for_config_and_test_group to fetch rows when a test group id is specified. Also
11154         use RunsGenerator to format results.
11155         (RunsGenerator): Added.
11156         (RunsGenerator::__construct): Added.
11157         (RunsGenerator::add_runs): Added.
11158         (RunsGenerator::format_run): Moved.
11159         (RunsGenerator::parse_revisions_array): Moved.
11161         * public/v2/analysis.js:
11162         (App.TestGroup): Fixed a typo. The property on a test group that refers to an analysis task is "task".
11163         (App.TestGroup._fetchChartData): Added. Fetches all A/B testing results for this group.
11164         (App.BuildRequest.configLetter): Renamed from config since this returns a letter that identifies the
11165         configuration associated with this build request such as "A" and "B".
11166         (App.BuildRequest.statusLabel): Added the missing label for failed build requests.
11167         (App.BuildRequest.url): Added. Returns the URL associated with this build request.
11168         (App.BuildRequest._meanFetched): Added. Retrieve the mean and the build number for this request via
11169         _fetchChartData.
11171         * public/v2/app.js:
11172         (App.Pane._fetch): Set chartData directly here.
11173         (App.Pane._updateMovingAverageAndEnvelope): Renamed from _computeChartData. No longer sets chartData
11174         now that it's done in App.Pane._fetch.
11175         (App.AnalysisTaskController._fetchedRuns): Updated per createChartData merge.
11177         * public/v2/data.js:
11178         (Measurement.prototype.buildId): Added.
11179         (TimeSeries.prototype.findPointByBuild): Added.
11181         * public/v2/index.html: Fixed a bug that build status URL was broken. We can't use link-to helper since
11182         url is not an Ember routed path.
11184         * public/v2/manifest.js:
11185         (App.Manifest.fetchRunsWithPlatformAndMetric): Takes testGroupId as the third argument. Merged
11186         App.createChartData here so that App.BuildRequest can use the formatter
11188 2015-02-12  Ryosuke Niwa  <rniwa@webkit.org>
11190         v2 UI should adjust the number of ticks on dashboards based on screen size
11191         https://bugs.webkit.org/show_bug.cgi?id=141502
11193         Reviewed by Chris Dumez.
11195         * public/v2/interactive-chart.js:
11196         (App.InteractiveChartComponent._updateDimensionsIfNeeded): Compute the number of ticks based on the
11197         content size.
11199 2015-02-11  Ryosuke Niwa  <rniwa@webkit.org>
11201         New perf dashboard shows too much space around interesting data points
11202         https://bugs.webkit.org/show_bug.cgi?id=141487
11204         Reviewed by Chris Dumez.
11206         Revise the y-axis range adjustment algorithm in r179913. Instead of showing the entire moving average,
11207         show the current time series excluding points in the series outside the moving average envelope.
11209         * public/v2/app.js:
11210         (App.Pane._computeChartData): Don't deal with missing moving average or enveloping strategy here.
11211         (App.Pane._computeMovingAverageAndOutliers): Set isOutliner to true on all data points in the current
11212         time series if the point lies outside the moving average envelope. Don't expose the moving average or
11213         the envelope computed for this purpose if they're not set by the user.
11215         * public/v2/data.js:
11216         (TimeSeries.prototype.minMaxForTimeRange): Takes a boolean argument, ignoreOutlier. When the flag is set
11217         to true, min/max computation will ignore any point in the series with non-falsy "isOutliner" property.
11219         * public/v2/interactive-chart.js:
11220         (App.InteractiveChartComponent._constructGraphIfPossible): Unsupport hideMovingAverage and hideEnvelope.
11221         (App.InteractiveChartComponent._computeYAxisDomain): Removed the commented out code. Also moved the code
11222         to deal with showFullYAxis here.
11223         (App.InteractiveChartComponent._minMaxForAllTimeSeries): Rewrote the code. Takes ignoreOutliners as an
11224         argument instead of directly inspecting showFullYAxis.
11226 2015-02-10  Ryosuke Niwa  <rniwa@webkit.org>
11228         New perf dashboard shouldn't always show outliners
11229         https://bugs.webkit.org/show_bug.cgi?id=141445
11231         Reviewed by Chris Dumez.
11233         Use the simple moving average with an average difference envelope to compute the y-axis range to show
11234         to avoid expanding it spuriously to show one off outlier.
11236         * public/v2/app.js:
11237         (App.Pane): Don't show the full y-axis range by default.
11238         (App.Pane._computeChartData): Use the first strategies for the moving average and the enveloping if
11239         one is not specified by the user but without showing them in the charts.
11240         (App.Pane._computeMovingAverage): Takes moving average and enveloping strategies as arguments instead
11241         of retrieving via chosenMovingAverageStrategy and chosenEnvelopingStrategy.
11243         (App.ChartsController._parsePaneList): Added showFullYAxis as a query string argument to each pane.
11244         (App.ChartsController._serializePaneList): Ditto.
11246         * public/v2/chart-pane.css: Added a CSS rule for when y-axis is clickable.
11248         * public/v2/index.html: Pass in showFullYAxis as an argument to the main interactive chart.
11250         * public/v2/interactive-chart.js:
11251         (App.InteractiveChartComponent._constructGraphIfPossible): Add an event listener on y-axis labels when
11252         the chart is interactive so that toggle showFullYAxis. Also hide the moving average and/or the envelope
11253         if they are not specified by the user (i.e. only used to adjust y-axis range).
11254         (App.InteractiveChartComponent._updateDomain): Don't exit early if y-axis domains are different even if
11255         x-axis domain remained the same. Without this change, the charts would never redraw.
11256         (App.InteractiveChartComponent._minMaxForAllTimeSeries): Use the moving average instead of the current
11257         time series to compute the y-axis range if showFullYAxis is false. When showFullYAxis is true, expand
11258         y-axis all the way down to 0 or the minimum value in the current time series whichever is smaller.
11260         * public/v2/js/statistics.js:
11261         (Statistics.MovingAverageStrategies): Use a wider window in Simple Moving Average by default.
11263 2015-02-10  Ryosuke Niwa  <rniwa@webkit.org>
11265         Unreviewed build fix.
11267         * public/v2/app.js:
11268         (set get App.Pane.Ember.Object.extend):
11270 2015-02-10  Ryosuke Niwa  <rniwa@webkit.org>
11272         New perf dashboard should have the ability to overlay moving average with an envelope
11273         https://bugs.webkit.org/show_bug.cgi?id=141438
11275         Reviewed by Andreas Kling.
11277         This patch adds three kinds of moving average strategies and two kinds of enveloping strategies:
11279         Simple Moving Average - The moving average xÌ„_i of x_i is computed as the arithmetic mean of values
11280         from x_(i - n) though x_(i + m) where n is a non-negative integer and m is a positive integer. It takes
11281         n, backward window size, and m, forward window size, as an argument.
11283         Cumulative Moving Average - xÌ„_i is computed as the arithmetic mean of all values x_0 though x_i.
11284         That is, xÌ„_1 = x_1 and xÌ„_i = ((i - 1) * M_(i - 1) + x_i) / i for all i > 1.
11286         Exponential Moving Average - xÌ„_i is computed as the weighted average of x_i and xÌ„_(i - 1) with Î± as
11287         an argument specifying x_i's weight. To be precise, xÌ„_1 = x_1 and xÌ„_i = Î± * x_i + (α - 1) xÌ„_(i-1).
11290         Average Difference - The enveloping delta d is computed as the arithmetic mean of the difference
11291         between each x_i and xÌ„_i.
11293         Moving Average Standard Deviation - d is computed like the standard deviation except the deviation
11294         for each term is measured from the moving average instead of the sample arithmetic mean. i.e. it uses
11295         the average of (x_i - xÌ„_i)^2 as the "sample variance" instead of the conventional (x_i - xÌ„)^2 where
11296         xÌ„ is the sample mean of all x_i's. This change was necessary since our time series is non-stationary.
11299         Each strategy is cloned for an App.Pane instance so that its parameterList can be configured per pane.
11300         The configuration of the currently chosen strategies is saved in the query string for convenience.
11302         Also added the "stat pane" to choose a moving average strategy and a enveloping strategy in each pane.
11304         * public/v2/app.css: Specify the fill color for all SVG groups in the pane toolbar icons.
11306         * public/v2/app.js:
11307         (App.Pane._fetch): Delegate the creation of 'chartData' to _computeChartData.
11308         (App.Pane.updateStatisticsTools): Added. Clones moving average and enveloping strategies for this pane.
11309         (App.Pane._cloneStrategy): Added. Clones a strategy for a new pane.
11310         (App.Pane._configureStrategy): Added. Finds and configures a strategy from the configuration retrieved
11311         from the query string via ChartsController.
11312         (App.Pane._computeChartData): Added. Creates chartData from fetchedData.
11313         (App.Pane._computeMovingAverage): Added. Computes the moving average and the envelope.
11314         (App.Pane._executeStrategy): Added.
11315         (App.Pane._updateStrategyConfigIfNeeded): Pushes the strategy configurations to the query string via
11316         ChartsController.
11317         (App.ChartsController._parsePaneList): Merged the query string arguments for the range and point
11318         selections, and added two new arguments for the moving average and the enveloping configurations.
11319         (App.ChartsController._serializePaneList): Ditto.
11320         (App.ChartsController._scheduleQueryStringUpdate): Observes strategy configurations.
11321         (App.PaneController.actions.toggleBugsPane): Hides the stat pane.
11322         (App.PaneController.actions.toggleSearchPane): Hides the stat pane.
11323         (App.PaneController.actions.toggleStatPane): Added.
11325         * public/v2/chart-pane.css: Added CSS rules for the new stat pane. Also added .foreground class for the
11326         current (as opposed to baseline and target) time series for when it's the most foreground graph without
11327         moving average and its envelope overlapping on top of it.
11329         * public/v2/index.html: Added the templates for the stat pane and the corresponding icon (Σ).
11331         * public/v2/interactive-chart.js:
11332         (App.InteractiveChartComponent.chartDataDidChange): Unset _totalWidth and _totalHeight to avoid exiting
11333         early inside _updateDimensionsIfNeeded when chartData changes after the initial layout.
11334         (App.InteractiveChartComponent.didInsertElement): Attach event listeners here instead of inside
11335         _constructGraphIfPossible since that could be called multiple times on the same SVG element.
11336         (App.InteractiveChartComponent._constructGraphIfPossible): Clear down the old SVG element we created
11337         but don't bother removing individual paths and circles. Added the code to show the moving average time
11338         series when there is one. Also add "foreground" class on SVG elements for the current time series when
11339         we're not showing the moving average. chart-pane.css has been updated to "dim down" the current time
11340         series when "foreground" is not set.
11341         (App.InteractiveChartComponent._minMaxForAllTimeSeries): Take the moving average time series into
11342         account when computing the y-axis range.
11343         (App.InteractiveChartComponent._brushChanged): Removed 'selectionIsLocked' argument as it's useless.
11345         * public/v2/js/statistics.js:
11346         (Statistics.MovingAverageStrategies): Added.
11347         (Statistics.EnvelopingStrategies): Added.
11349 2015-02-06  Ryosuke Niwa  <rniwa@webkit.org>
11351         The delta value in the chart pane sometimes doens't show '+' for a positive delta
11352         https://bugs.webkit.org/show_bug.cgi?id=141340
11354         Reviewed by Andreas Kling.
11356         The bug was caused by computeStatus prefixing the value delta with '+' if it's greater than 0 after
11357         it had already been formatted. Fixed the bug by using a formatter that always emits a sign symbol.
11359         * public/v2/app.js:
11360         (App.Pane.computeStatus):
11361         (App.createChartData):
11363 2015-02-06  Ryosuke Niwa  <rniwa@webkit.org>
11365         Unreviewed build fix. currentPoint wasn't defined when selectedPoints was used to find points.
11367         * public/v2/app.js:
11368         (App.PaneController._updateDetails):
11370 2015-02-06  Ryosuke Niwa  <rniwa@webkit.org>
11372         Unreviewed. Commit the forgotten change.
11374         * public/include/manifest.php:
11376 2015-02-06  Ryosuke Niwa  <rniwa@webkit.org>
11378         New perf dashboard should have multiple dashboard pages
11379         https://bugs.webkit.org/show_bug.cgi?id=141339
11381         Reviewed by Chris Dumez.
11383         Added the support for multiple dashboard pages. Also added the status of the latest data point.
11384         e.g. "5% better than target"
11386         * public/v2/app.css: Tweaked the styles to work around the fact Ember.js creates empty script elements.
11387         Also hid the border lines around charts on the dashboard page for a cleaner look.
11389         * public/v2/app.js:
11390         (App.IndexRoute): Added. Navigate to /dashboard/<defaultDashboardName> once the manifest.json is loaded.
11391         (App.IndexRoute.beforeModel): Added.
11392         (App.DashboardRoute): Added.
11393         (App.DashboardRoute.model): Added. Return the dashboard specified by the name.
11394         (App.CustomDashboardRoute): Added. This route is used for a customized dashboard specified by "grid".
11395         (App.CustomDashboardRoute.model): Create a dashboard model from "grid" query parameter.
11396         (App.CustomDashboardRoute.renderTemplate): Use the dashboard template.
11397         (App.DashboardController): Renamed from App.IndexController.
11398         (App.DashboardController.modelChanged): Renamed from gridChanged. Removed the code to deal with "grid"
11399         and "defaultDashboard" as these are taken care of by newly added routers.
11400         (App.DashboardController.computeGrid): Renamed from updateGrid. No longer updates "grid" since this is
11401         now done in actions.toggleEditMode.
11402         (App.DashboardController.actions.toggleEditMode): Navigate to CustomDashboardRoute when start editing
11403         an existing dashboard.
11405         (App.Pane.computeStatus): Moved from App.PaneController so that to be called in App.Pane.latestStatus.
11406         Also moved the code to compute the delta with respect to the previous data point from _updateDetails.
11407         (App.Pane._relativeDifferentToLaterPointInTimeSeries): Ditto.
11408         (App.Pane.latestStatus): Added. Used by the dashboard template to show the status of the latest result.
11410         (App.createChartData): Added deltaFormatter to show less significant digits for differences.
11412         (App.PaneController._updateDetails): Updated per changes to computeStatus.
11414         * public/v2/chart-pane.css: Added style rules for the status labels on the dashboard.
11416         * public/v2/data.js:
11417         (TimeSeries.prototype.lastPoint): Added.
11419         * public/v2/index.html: Prefetch manifest.json as soon as possible, show the latest data points' status
11420         on the dashboard, and enumerate all predefined dashboards.
11422         * public/v2/interactive-chart.js:
11423         (App.InteractiveChartComponent._relayoutDataAndAxes): Slightly adjust the offset at which we show unit
11424         for the dashboard page.
11426         * public/v2/manifest.js:
11427         (App.Dashboard): Inherit from App.NameLabelModel now that each predefined dashboard has a name.
11428         (App.MetricSerializer.normalizePayload): Parse all predefined dashboards instead of a single dashboard.
11429         IDs are generated for each dashboard for forward compatibility.
11430         (App.Manifest):
11431         (App.Manifest.dashboardByName): Added.
11432         (App.Manifest.defaultDashboardName): Added.
11433         (App.Manifest._fetchedManifest): Create dashboard model objects for all predefined ones.
11435 2015-02-05  Ryosuke Niwa  <rniwa@webkit.org>
11437         Move commits viewer to the end of details view
11438         https://bugs.webkit.org/show_bug.cgi?id=141315
11440         Rubber-stamped by Andreas Kling.
11442         Show the difference instead of the old value per kling's request.
11444         * public/v2/app.js:
11445         (App.PaneController._updateDetails):
11446         * public/v2/index.html:
11448 2015-02-05  Ryosuke Niwa  <rniwa@webkit.org>
11450         Move commits viewer to the end of details view
11451         https://bugs.webkit.org/show_bug.cgi?id=141315
11453         Reviewed by Andreas Kling.
11455         Improved the way list of commits are shown per kling's request.
11457         * public/v2/app.js:
11458         (App.PaneController._updateDetails): Always show the old value even when a single point is selected.
11460         * public/v2/chart-pane.css: Updated the style for the commits viewer.
11462         * public/v2/commits-viewer.js:
11463         (App.CommitsViewerComponent): Added "visible" property to hide the list of commits.
11464         (App.CommitsViewerComponent.actions.toggleVisibility): Added. Toggles "visible" property.
11466         * public/v2/index.html: Updated the template for commits viewer to support "visible" property. Also
11467         moved the commits viewers out of the details tables so that they don't interleave revision data.
11469 2015-02-05  Ryosuke Niwa  <rniwa@webkit.org>
11471         New perf dashboard should compare results to baseline and target
11472         https://bugs.webkit.org/show_bug.cgi?id=141286
11474         Reviewed by Chris Dumez.
11476         Compare the selected value against baseline and target values as done in v1. e.g. "5% below target"
11477         Also use d3.format to format the selected value to show four significant figures.
11479         * public/v2/app.js:
11480         (App.Pane.searchCommit):
11481         (App.Pane._fetch): Create time series here via createChartData so that _computeStatus can use them
11482         to compute the status text without having to recreate them.
11483         (App.createChartData): Added.
11484         (App.PaneController._updateDetails): Use 3d.format on current and old values.
11485         (App.PaneController._computeStatus): Added. Computes the status text.
11486         (App.PaneController._relativeDifferentToLaterPointInTimeSeries): Added.
11487         (App.AnalysisTaskController._fetchedManifest): Use createChartData as done in App.Pane._fetch. Also
11488         format the values using chartData.formatter.
11490         * public/v2/chart-pane.css: Enlarge the status text. Show the status text in red if it's worse than
11491         the baseline and in blue if it's better than the target.
11493         * public/v2/data.js:
11494         (TimeSeries.prototype.findPointAfterTime): Added.
11496         * public/v2/index.html: Added a new tbody for the status text and the selected value. Also fixed
11497         the bug that we were not showing the old value's unit.
11499         * public/v2/interactive-chart.js:
11500         (App.InteractiveChartComponent._constructGraphIfPossible): Use chartData.formatter. Also cleaned up
11501         the code to show the baseline and the target lines.
11503         * public/v2/manifest.js:
11504         (App.Manifest.fetchRunsWithPlatformAndMetric): Added smallerIsBetter.
11506 2015-02-05  Ryosuke Niwa  <rniwa@webkit.org>
11508         Unreviewed build fix.
11510         * public/v2/app.js:
11511         (App.IndexController.gridChanged): Use store.createRecord to create a custom dashboard as required by Ember.js
11513 2015-02-04  Ryosuke Niwa  <rniwa@webkit.org>
11515         New perf dashboard doesn't preserve the number of days when clicking on a dashboard chart
11516         https://bugs.webkit.org/show_bug.cgi?id=141280
11518         Reviewed by Chris Dumez.
11520         Fixed the bug by passing in "since" as a query parameter to the charts page.
11522         Also fixed the styling issue that manifests when a JSON fetching fails on "Dashboard" page.
11524         * public/v2/app.css: Fixed CSS rules for error messages shown in the place of charts.
11525         * public/v2/app.js:
11526         (App.IndexController): Changed the default number of days from one month to one week.
11527         (App.IndexController._sharedDomainChanged): Set "since" property on the controller.
11528         * public/v2/index.html: Pass in "since" property on the controller as a query parameter.
11530 2015-02-04  Ryosuke Niwa  <rniwa@webkit.org>
11532         New perf dashboard erroneously clears zoom when poping history items
11533         https://bugs.webkit.org/show_bug.cgi?id=141278
11535         Reviewed by Chris Dumez.
11537         The bug was caused by _sharedZoomChanged updating overviewSelection without updating mainPlotDomain.
11539         Updating overviewSelection resulted in _overviewSelectionChanged, which observes changes to overviewSelection,
11540         to schedule a call to propagateZoom, which in turn overrode "sharedZoom" we just parsed from the query string.
11542         * public/v2/app.js:
11543         (App.PaneController._overviewSelectionChanged): Don't schedule propagateZoom if the selected domain is already
11544         shown in the main plot.
11545         (App.PaneController._sharedZoomChanged): Set both overviewSelection and mainPlotDomain to avoid overriding
11546         "sharedZoom" via propagateZoom inside _overviewSelectionChanged.
11548 2015-02-04  Ryosuke Niwa  <rniwa@webkit.org>
11550         New perf dashboard shows null as the aggregator name if no aggregation is done
11551         https://bugs.webkit.org/show_bug.cgi?id=141256
11553         Reviewed by Chris Dumez.
11555         Don't show the aggregator name if there isn't one.
11557         * public/v2/manifest.js:
11558         (App.Metric.label):
11560 2015-02-04  Ryosuke Niwa  <rniwa@webkit.org>
11562         Unreviewed build fix after r179611.
11564         * public/v2/interactive-chart.js:
11566 2015-02-04  Ryosuke Niwa  <rniwa@webkit.org>
11568         Perf dashboard doesn’t show the right unit for Safari UI tests
11569         https://bugs.webkit.org/show_bug.cgi?id=141238
11571         Reviewed by Darin Adler.
11573         Safari UI tests use custom metrics that end with "Time". This patch teaches the perf dashboard how to
11574         get the unit for a given metric based on the suffix of the metric name instead of hard-coding the mapping
11575         between metrics and their units.
11577         * public/js/helper-classes.js:
11578         (PerfTestRuns): Use the suffix of the metric name to compute the unit.
11579         * public/v2/manifest.js:
11580         (App.Manifest.fetchRunsWithPlatformAndMetric): Ditto. Also set "useSI" property iff for "bytes".
11581         * public/v2/interactive-chart.js:
11582         (App.InteractiveChartComponent._constructGraphIfPossible): Respect useSI. Use toPrecision(3) otherwise.
11583         (App.InteractiveChartComponent._relayoutDataAndAxes): Place the unit vertically on the left of ticks.
11585 2015-02-04  Ryosuke Niwa  <rniwa@webkit.org>
11587         Interactive chart component provides two duplicate API for highlighting points
11588         https://bugs.webkit.org/show_bug.cgi?id=141234
11590         Reviewed by Chris Dumez.
11592         Prior to this patch, the interactive chart component supported highlightedItems for finding commits
11593         on the main charts page and markedPoints to show the two end points in the analysis task page.
11595         This patch merges markedPoints into highlightedItems. 
11597         * public/v2/app.js:
11598         (App.AnalysisTaskController._fetchedRuns): Use highlightedItems.
11599         * public/v2/chart-pane.css:
11600         * public/v2/index.html: Ditto.
11601         * public/v2/interactive-chart.js: 
11602         (App.InteractiveChartComponent._constructGraphIfPossible): Make this._highlights an array instead of
11603         array of arrays. Also call _highlightedItemsChanged at the end to fix the bug that we never highlight
11604         items if highlightedItems was set before the initial layout.
11605         (App.InteractiveChartComponent._relayoutDataAndAxes):
11606         (App.InteractiveChartComponent._updateHighlightPositions): Now that highlights are circles instead of
11607         vertical lines, just set cx and cy as done for other "dots".
11608         (App.InteractiveChartComponent._highlightedItemsChanged): Exit early only if _clippedContainer wasn't
11609         already set; i.e. _constructGraphIfPossible hasn't been called. Also updated the logic to accommodate
11610         the fact this._highlights is an array of elements instead of an array of arrays of elements. Finally,
11611         set the radius of highlight circles here.
11613 2015-02-03  Ryosuke Niwa  <rniwa@webkit.org>
11615         Don’t use repository names as id’s.
11616         https://bugs.webkit.org/show_bug.cgi?id=141226
11618         Reviewed by Chris Dumez.
11620         Not using repository names as their id's reduces the need to fetch the entire repositories table.
11621         Since names of repositories are available in manifest.json, we can resolve their names in the front end.
11623         * Websites/perf.webkit.org/public/api/runs.php:
11624         (parse_revisions_array): No longer uses $repository_id_to_name.
11625         (main): No longer populates $repository_id_to_name.
11627         * Websites/perf.webkit.org/public/api/triggerables.php:
11628         (main): Don't resolve repository names.
11630         * Websites/perf.webkit.org/public/include/manifest.php:
11631         (ManifestGenerator::repositories): Use repositories ids as keys in the result and include their names.
11632         (ManifestGenerator::bug_trackers): Don't resolve repository names.
11634         * Websites/perf.webkit.org/public/js/helper-classes.js:
11635         (TestBuild): Renamed repositoryName to repositoryId.
11636         (TestBuild.revision): Ditto.
11637         (TestBuild.formattedRevisions): Ditto. Continue to use the repository name in the formatted result
11638         since this is the text shown to human.
11640         * Websites/perf.webkit.org/public/v2/app.js:
11641         (App.pane.searchCommit): Renamed repositoryName to repositoryId.
11642         (App.PaneController._updateDetails): Ditto.
11643         (App.AnalysisTaskController.updateRoots): Ditto.
11645         * Websites/perf.webkit.org/public/v2/data.js:
11646         (Measurement): Ditto.
11647         (Measurement.prototype.commitTimeForRepository): Ditto.
11648         (Measurement.prototype.formattedRevisions): Ditto.
11650         * Websites/perf.webkit.org/public/v2/index.html: Use the repository name and the repository id as
11651         select element's label and value respectively.
11653 2015-02-03  Ryosuke Niwa  <rniwa@webkit.org>
11655         Unreviewed build fix. Declare $repository_id_to_name in the global scope.
11657         * public/api/runs.php:
11659 2015-02-03  Ryosuke Niwa  <rniwa@webkit.org>
11661         /api/runs.php should have main function
11662         https://bugs.webkit.org/show_bug.cgi?id=141220
11664         Reviewed by Benjamin Poulain.
11666         Wrapped the code inside main function for clarity.
11668         * public/api/runs.php:
11670 2015-01-27  Ryosuke Niwa  <rniwa@webkit.org>
11672         Unreviewed build fix. "eta" isn't set on a in-progress build on a newly added builder.
11674         * tools/sync-with-buildbot.py:
11675         (find_request_updates):
11677 2015-01-23  Ryosuke Niwa  <rniwa@webkit.org>
11679         Perf dashboard always assigns the result of A/B testing with build request 1
11680         https://bugs.webkit.org/show_bug.cgi?id=140382
11682         Reviewed by Darin Adler.
11684         The bug was caused by the expression array_get($report, 'jobId') or array_get($report, 'buildRequest')
11685         which always evaluated to 1 when the report contained jobId. Fixed the bug by cascading array_get instead.
11687         Also fixed a typo as well as a bug that reports were never associated with builds.
11689         * public/include/report-processor.php:
11690         (ReportProcessor::process): Don't use "or" to find the non-null value since that always evaluates to 1
11691         instead of the first non-null value.
11692         (ReportProcessor::resolve_build_id): Fixed the typo by adding the missing "$this->".
11693         (ReportProcessor::commit): Associate the report with the corresponding build as intended.
11695 2015-01-23  Ryosuke Niwa  <rniwa@webkit.org>
11697         Unreviewed typo fix. The prefix in triggerable_configurations is "trigconfig", not "trigrepo".
11699         * public/admin/tests.php:
11701 2015-01-10  Ryosuke Niwa  <rniwa@webkit.org>
11703         Unreviewed build fix. Removed the stale code.
11705         * public/admin/triggerables.php:
11707 2015-01-09  Ryosuke Niwa  <rniwa@webkit.org>
11709         Perf dashboard should have the ability to post A/B testing builds
11710         https://bugs.webkit.org/show_bug.cgi?id=140317
11712         Rubber-stamped by Simon Fraser.
11714         This patch adds the support for triggering A/B testing from the perf dashboard.
11716         We add a few new tables to the database. "build_triggerables", which represents a set of builders
11717         that accept A/B testing. "triggerable_repositories" associates each "triggerable" with a fixed set
11718         of repositories for which an arbitrary revision can be specified for A/B testing.
11719         "triggerable_configurations" specifies a triggerable available on a given test on a given platform.
11720         "roots" table which specifies the revision used in a given root set in each repository.
11722         * init-database.sql: Added "build_triggerables", "triggerable_repositories",
11723         "triggerable_configurations", and "roots" tables. Added references to "build_triggerables",
11724         "platforms", and "tests" tables as well as columns to store status, status url, and creation time
11725         to build_requests table. Also made each test group's name unique in a given analysis task as it
11726         would be confusing to have multiple test groups of the same name.
11728         * public/admin/tests.php: Added the UI and the code to associate a test with a triggerable.
11730         * public/admin/triggerables.php: Added. Manages the list of triggerables as well as repositories
11731         for which a specific revision can be set in an A/B testing on a given triggerable.
11733         * public/api/build-requests.php: Added. Returns the list of open build requests on a specified
11734         triggerable. Also updates the status' and the status urls of specified build requests when
11735         buildRequestUpdates is provided in the raw POST data.
11736         (main):
11738         * public/api/runs.php:
11739         (fetch_runs_for_config): Don't include results associated with a build request, meaning they are
11740         results of an A/B testing.
11742         * public/api/test-groups.php:
11743         (main): Use the newly added BuildRequestsFetcher. Also merged fetch_test_groups_for_task back.
11745         * public/api/triggerables.php: Added.
11746         (main): Returns a list of triggerables or a triggerable associated with a given analysis task.
11748         * public/include/admin-header.php:
11750         * public/include/build-requests-fetcher.php: Added. Extracted from public/api/test-groups.php.
11751         (BuildRequestsFetcher): This class abstracts the process of fetching a list of builds requests
11752         and root sets used in those requests.D
11753         (BuildRequestsFetcher::__construct):
11754         (BuildRequestsFetcher::fetch_for_task):
11755         (BuildRequestsFetcher::fetch_for_group):
11756         (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable):
11757         (BuildRequestsFetcher::has_results):
11758         (BuildRequestsFetcher::results):
11759         (BuildRequestsFetcher::results_with_resolved_ids):
11760         (BuildRequestsFetcher::results_internal):
11761         (BuildRequestsFetcher::root_sets):
11762         (BuildRequestsFetcher::fetch_roots_for_set):
11764         * public/include/db.php:
11765         (Database::prefixed_column_names): Don't return "$prefix_" when there are no columns.
11766         (Database::insert_row): Support taking an empty array for values. This is useful in "root_sets"
11767         table since it only has the primary key, id, column.
11768         (Database::select_or_insert_row):
11769         (Database::update_or_insert_row):
11770         (Database::update_row): Added.
11771         (Database::_select_update_or_insert_row): Takes an extra argument specifying whether a new row
11772         should be inserted when no row matches the specified criteria. This is used while updating
11773         build_requests' status and url in public/api/build-requests.php since we shouldn't be inserting
11774         new build requests in that API.
11775         (Database::select_rows): Also use "1 == 1" in the select query when the query criteria is empty.
11776         This is used in public/api/triggerables.php when no analysis task is specified.
11778         * public/include/json-header.php:
11779         (find_triggerable_for_task): Added. Finds a triggerable available on a given test. We return the
11780         triggerable associated with the closest ancestor of the test. Since issuing a new query for each
11781         ancestor test is expensive, we retrieve triggerable for all ancestor tests at once and manually
11782         find the closest ancestor with a triggerable.
11784         * public/include/report-processor.php:
11785         (ReportProcessor::process):
11786         (ReportProcessor::resolve_build_id): Associate a build request with the newly created build
11787         if jobId or buildRequest is specified.
11789         * public/include/test-name-resolver.php:
11790         (TestNameResolver::map_metrics_to_tests): Store the entire metric row instead of its name so that
11791         test_exists_on_platform can use it. The last diff in public/admin/tests.php adopts this change.
11792         (TestNameResolver::test_exists_on_platform): Added. Returns true iff the test has ever run on
11793         a given platform.
11795         * public/include/test-path-resolver.php: Added.
11796         (TestPathResolver): This class abstracts the ancestor chains of a test. It retrieves the entire
11797         "tests" table to do this since there could be arbitrary number of ancestors for a given test.
11798         This class is a lot more lightweight than TestNameResolver, which retrieves a whole bunch of tables
11799         in order to compute full test metric names.
11800         (TestPathResolver::__construct):
11801         (TestPathResolver::ancestors_for_test): Returns the ordered list of ancestors from the closest to
11802         the highest (a test without a parent).
11803         (TestPathResolver::path_for_test): Returns a test "path", the ordered list of test names from
11804         the highest ancestor to the test itself.
11805         (TestPathResolver::ensure_id_to_test_map): Fetches "tests" table to construct id_to_test_map.
11807         * public/privileged-api/create-test-group.php: Added. An API to create A/B testing groups.
11808         (main):
11809         (commit_sets_from_root_sets): Given a dictionary of repository names to a pair of revisions
11810         for sets A and B respectively, returns a pair of arrays, each of which contains the corresponding
11811         set of "commits" for sets A and B respectively. e.g. {"WebKit": [1, 2], "Safari": [3, 4]} will
11812         result in [[WebKit commit at r1, Safari commit at r3], [WebKit commit at r2, Safari commit at r4]].
11814         * public/v2/analysis.js:
11815         (App.AnalysisTask.testGroups): Takes arguments so that set('testGroups') will invalidate the cache.
11816         (App.AnalysisTask.triggerable): Added. Retrieves the triggerable associated with the task lazily.
11817         (App.TestGroup.rootSets): Added. Returns the list of root set ids used in this A/B testing group.
11818         (App.TestGroup.create): Added. Creates a new A/B testing group.
11819         (App.Triggerable): Added.
11820         (App.TriggerableAdapter): Added.
11821         (App.TriggerableAdapter.buildURL): Added.
11822         (App.BuildRequest.testGroup): Renamed from group.
11823         (App.BuildRequest.orderLabel): Added. One-based index to be used in labels.
11824         (App.BuildRequest.config): Added. Returns either 'A' or 'B' depending on the configuration used
11825         in this build request.
11826         (App.BuildRequest.status): Added.
11827         (App.BuildRequest.statusLabel): Added. Returns a human friendly label for the current status.
11828         (App.BuildRequest): Removed buildNumber, buildBuilder, as well as buildTime as they're unused.
11830         * public/v2/app.js:
11831         (App.AnalysisTaskController.testGroups): Added.
11832         (App.AnalysisTaskController.possibleRepetitionCounts): Added.
11833         (App.AnalysisTaskController.updateRoots): Renamed from roots. This is also no longer a property
11834         but an observer that updates "roots" property. Filter out the repositories that are not accepted
11835         by the associated triggerable as they will be ignored.
11836         (App.AnalysisTaskController.actions.createTestGroup): Added.
11838         * public/v2/index.html: Updated the UI, and added a form element to trigger createTestGroup action.
11840         * tools/sync-with-buildbot.py: Added. This scripts posts new builds on buildbot and reports back
11841         the status of those builds to the perf dashboard. A similar script can be written to support
11842         other continuous builds systems.
11843         (main): Fetches the list of pending builds as well as currently running or completed builds from
11844         a buildbot, and report new statuses of builds requests to the perf dashboard. It will then schedule
11845         a single new build on each builder with no pending builds, and marks the set of open build requests
11846         that have been scheduled to run on the buildbot but not found in the first step as stale.
11847         (load_config): Loads a JSON that contains the configurations for each builder. e.g.
11848         [
11849             {
11850                 "platform": "mac-mavericks",
11851                 "test": ["Parser", "html5-full-render.html"],
11852                 "builder": "Trunk Syrah Production Perf AB Tests",
11853                 "arguments": {
11854                     "forcescheduler": "force-mac-mavericks-release-perf",
11855                     "webkit_revision": "$WebKit",
11856                     "jobid": "$buildRequest"
11857                 }
11858             }
11859         ]
11861         (find_request_updates): Return a list of build request status updates to make based on the pending
11862         builds as well as in-progress and completed builds on each builder on the buildbot. When a build is
11863         completed, we use the special status "failedIfNotCompleted" which results in "failed" status only
11864         if the build request had not been completed. This is necessary because a failed build will not
11865         report its failed-ness back to the perf dashboard in some cases; e.g. lost slave or svn up failure.
11866         (update_and_fetch_build_requests): Submit the build request status updates and retrieve the list
11867         of open requests the perf dashboard has.
11868         (find_stale_request_updates): Compute the list of build requests that have been scheduled on the
11869         buildbot but not found in find_request_updates. These build requests are lost. e.g. a master reboot
11870         or human canceling a build may trigger such a state.
11871         (schedule_request): Schedules a build with the arguments specified in the configuration JSON after
11872         replacing repository names with their revisions and buildRequest with the build request id.
11873         (config_for_request): Finds a builder for the test and the platform of a build request.
11874         (fetch_json): Fetches a JSON from the specified URL, optionally with BasicAuth.
11875         (property_value_from_build): Returns the value of a specific property in a buildbot build.
11876         (request_id_from_build): Returns the build request id of a given buildbot build if there is one.
11878 2015-01-09  Ryosuke Niwa  <rniwa@webkit.org>
11880         Cache-control should be set only on api/runs
11881         https://bugs.webkit.org/show_bug.cgi?id=140312
11883         Reviewed by Andreas Kling.
11885         Some JSON APIs such as api/analysis-tasks can't be cached even for a short period of time (e.g. a few minutes)
11886         since they can be modified by the user on demand. Since only api/runs.php takes a long time to generate JSONs,
11887         just set cache-control there instead of json-header.php which is used by other JSON APIs.
11889         Also set date_default_timezone_set in db.php since we never use non-UTC timezone in our scripts.
11891         * public/api/analysis-tasks.php:
11892         * public/api/runs.php: Set the cache control headers.
11893         * public/api/test-groups.php:
11894         * public/include/db.php: Set the default timezone to UTC.
11895         * public/include/json-header.php: Don't set the cache control headers.
11897 2015-01-09  Ryosuke Niwa  <rniwa@webkit.org>
11899         api/report-commit should authenticate with a slave name and password
11900         https://bugs.webkit.org/show_bug.cgi?id=140308
11902         Reviewed by Benjamin Poulain.
11904         Use a slave name and a password to authenticate new commit reports.
11906         * public/api/report-commits.php:
11907         (main):
11908         * public/include/json-header.php:
11909         (verify_slave): Renamed and repurposed from verify_builder in report-commits.php. Now authenticates with
11910         a slave name and a password instead of a builder name and a password.
11911         * tests/api-report-commits.js: Updated tests.
11912         * tools/pull-svn.py:
11913         (main): Renamed variables.
11914         (submit_commits): Submits slaveName and slavePassword instead of builderName and builderPassword.
11916 2014-12-19  Ryosuke Niwa  <rniwa@webkit.org>
11918         Perf dashboard should support authentication via a slave password
11919         https://bugs.webkit.org/show_bug.cgi?id=139837
11921         Reviewed by Andreas Kling.
11923         For historical reasons, perf dashboard conflated builders and build slaves. As a result we ended up
11924         having to add multiple builders with the same password when a single build slave is shared among them.
11926         This patch introduces the concept of build_slave into the perf dashboard to end this madness.
11928         * init-database.sql: Added build_slave table as well as references to it in builds and reports.
11930         * public/admin/build-slaves.php: Added.
11932         * public/admin/builders.php: Added the support for updating passwords.
11934         * public/include/admin-header.php:
11935         (update_field): Takes an extra argument when a new value needs to be supplied by the caller instead of
11936         being retrieved from $_POST.
11937         (AdministrativePage::render_table): Use array_get to retrieve a value out of the database row since
11938         the raw may not exist (e.g. new_password).
11939         (AdministrativePage::render_form_to_add): Added the support for post_insertion. Don't render the form
11940         control here when this flag evaluates to TRUE.
11942         * public/include/report-processor.php:
11943         (ReportProcessor::process): Added the logic to authenticate with slaveName and slavePassword if those
11944         values are present in the report. In addition, try authenticating builderName with slavePassword if
11945         builderPassword is not specified. When neither password is specified, exit with BuilderNotFound.
11946         Also insert the slave or the builder whichever is missing after we've successfully authenticated.
11947         (ReportProcessor::construct_build_data): Takes a builder ID and an optional slave ID instead of
11948         a builder row.
11949         (ReportProcessor::store_report): Store the slave ID with the report.
11950         (ReportProcessor::resolve_build_id): Exit with MismatchingBuildSlave when the slave associated with
11951         the matching build is different from what's being reported.
11953         * tests/api-report.js: Added a bunch of tests to test the new features of /api/report.
11954         (.addSlave): Added.
11956 2014-12-18  Ryosuke Niwa  <rniwa@webkit.org>
11958         New perf dashboard should not duplicate author information in each commit
11959         https://bugs.webkit.org/show_bug.cgi?id=139756
11961         Reviewed by Darin Adler.
11963         Instead of each commit having author name and email, make it reference a newly added committers table.
11964         Also replace "email" by "account" since some repositories don't use emails as account names.
11966         This improves the keyword search performance in commits.php since LIKE now runs on committers table,
11967         which only contains as many rows as there are accounts in each repository, instead of commits table
11968         which contains every commit ever happened in each repository.
11970         To migrate an existing database into match the new schema, run:
11972         BEGIN;
11974         INSERT INTO committers (committer_repository, committer_name, committer_email)
11975             (SELECT DISTINCT commit_repository, commit_author_name, commit_author_email
11976                 FROM commits WHERE commit_author_email IS NOT NULL);
11978         ALTER TABLE commits ADD COLUMN commit_committer integer REFERENCES committers ON DELETE CASCADE;
11980         UPDATE commits SET commit_committer = committer_id FROM committers
11981             WHERE commit_repository = committer_repository AND commit_author_email = committer_email;
11983         ALTER TABLE commits DROP COLUMN commit_author_name CASCADE;
11984         ALTER TABLE commits DROP COLUMN commit_author_email CASCADE;
11986         COMMIT;
11988         * init-database.sql: Added committers table, and replaced author columns in commits table by a foreign
11989         reference to committers. Also added the missing drop table statements.
11991         * public/api/commits.php:
11992         (main): Fetch the corresponding committers row for a single commit. Also wrap a single commit by
11993         an array here instead of doing it in format_commit.
11994         (fetch_commits_between): Updated queries to JOIN commits with committers.
11995         (format_commit): Takes both commit and committers rows. Also don't wrap the result in an array as that
11996         is now done in main.
11998         * public/api/report-commits.php:
11999         (main): Store the reported committer information or update the existing entry if there is one.
12001         * tests/admin-regenerate-manifest.js: Fixed tests.
12003         * tests/api-report-commits.js: Ditto. Also added a test for updating an existing committer entry.
12005         * tools/pull-svn.py: Renamed email to account.
12006         (main):
12007         (fetch_commit_and_resolve_author):
12008         (fetch_commit):
12009         (resolve_author_name_from_account):
12010         (resolve_author_name_from_email): Deleted.
12012 2014-12-17  Ryosuke Niwa  <rniwa@webkit.org>
12014         Unreviewed build fix.
12016         * public/v2/index.html: Include js files we extracted in r177424.
12018 2014-12-16  Ryosuke Niwa  <rniwa@webkit.org>
12020         Unreviewed. Adding the forgotten svnprop.
12022         * tools/pull-svn.py: Added property svn:executable.
12024 2014-12-16  Ryosuke Niwa  <rniwa@webkit.org>
12026         Split InteractiveChartComponent and CommitsViewerComponent into separate files
12027         https://bugs.webkit.org/show_bug.cgi?id=139716
12029         Rubber-stamped by Benjamin Poulain.
12031         Refactored InteractiveChartComponent and CommitsViewerComponent out of app.js into commits-viewer.js
12032         and interactive-chart.js respectively since app.js has gotten really large.
12034         * public/v2/app.js:
12035         * public/v2/commits-viewer.js: Added.
12036         * public/v2/interactive-chart.js: Added.
12038 2014-12-02  Ryosuke Niwa  <rniwa@webkit.org>
12040         New perf dashboard's chart UI is buggy
12041         https://bugs.webkit.org/show_bug.cgi?id=139214
12043         Reviewed by Chris Dumez.
12045         The bugginess was caused by weird interactions between charts and panes. Rewrote the code to fix it.
12047         Superfluous selectionChanged and domainChanged "event" actions were removed from the interactive chart
12048         component. This is not how Ember.js components should interact to begin with. The component now exposes
12049         selectedPoints and always updates selection instead of sharedSelection.
12051         * public/v2/app.js:
12052         (App.ChartsController.present): Added. We can't call Date.now() in various points in our code as that
12053         would lead to infinite mutual recursions since X-axis domain values wouldn't match up.
12054         (App.ChartsController.updateSharedDomain): This function was completely useless. The overview's start
12055         and end time should be completely determined by "since" and the present time.
12056         (App.ChartsController._startTimeChanged): Ditto.
12057         (App.ChartsController._scheduleQueryStringUpdate):
12058         (App.ChartsController._updateQueryString): Set "zoom" only if it's different from the shared domain.
12060         (App.domainsAreEqual): Moved from InteractiveChartComponent._xDomainsAreSame.
12062         (App.PaneController.actions.createAnalysisTask): Use selectedPoints property set by the chart.
12063         (App.PaneController.actions.overviewDomainChanged): Removed; only needed to call updateSharedDomain.
12064         (App.PaneController.actions.rangeChanged): Removed. _showDetails (renamed to _updateDetails) directly
12065         observes the changes to selectedPoints property as it gets updated by the main chart.
12066         (App.PaneController._overviewSelectionChanged): This was previously a dead code. Now it's used again
12067         with a bug fix. When the overview selection is cleared, we use the same domain in the main chart and
12068         the overview chart.
12069         (App.PaneController._sharedDomainChanged): Fixed a but that it erroneously updates the overview domain
12070         when domain arrays aren't identical. This was causing a subtle race with other logic.
12071         (App.PaneController._sharedZoomChanged): Ditto. Also don't set mainPlotDomain here as any changes to
12072         overviewSelection will automatically propagate to the main plot's domain as they're aliased.
12073         (App.PaneController._currentItemChanged): Merged into _updateDetails (renamed from _showDetails).
12074         (App.PaneController._updateDetails): Previously, this function took points and inspected _hasRange to
12075         see if those two points correspond to a range or a single data point. Rewrote all that logic by
12076         directly observing selectedPoints and currentItem properties instead of taking points and relying on
12077         an instance variable, which was a terrible API.
12078         (App.PaneController._updateCanAnalyze): Use selectedPoints property. Since this property is only set
12079         when the main plot has a selected range, we don't have to check this._hasRange anymore.
12081         (App.InteractiveChartComponent._updateDomain): No longer sends domainChanged "event" action.
12082         (App.InteractiveChartComponent._sharedSelectionChanged): Removed. This is a dead code.
12083         (App.InteractiveChartComponent._updateSelection):
12084         (App.InteractiveChartComponent._xDomainsAreSame): Moved to App.domainsAreEqual.
12085         (App.InteractiveChartComponent._setCurrentSelection): Update the selection only if needed. Also set
12086         selectedPoints property.
12088         (App.AnalysisTaskController._fetchedRuns):
12089         (App.AnalysisTaskController._rootChangedForTestSet):
12091         * public/v2/index.html:
12092         Removed non-functional sharedSelection and superfluous selectionChanged and domainChanged actions.
12094 2014-11-21  Ryosuke Niwa  <rniwa@webkit.org>
12096         Unreviewed. Fixed syntax errors.
12098         * init-database.sql:
12099         * public/api/commits.php:
12101 2014-11-21  Ryosuke Niwa  <rniwa@webkit.org>
12103         The dashboard on new perf monitor should be configurable
12104         https://bugs.webkit.org/show_bug.cgi?id=138994
12106         Reviewed by Benjamin Poulain.
12108         For now, make it configurable via config.json. We should eventually make it configurable via
12109         an administrative page but this will do for now.
12111         * config.json: Added the empty dashboard configuration.
12113         * public/include/manifest.php: Include the dashboard configuration in the manifest file.
12115         * public/v2/app.js:
12116         (App.IndexController): Removed defaultTable since this is now dynamically obtained via App.Manifest.
12117         (App.IndexController.gridChanged): Use App.Dashboard to parse the dashboard configuration.
12118         Also obtain the default configuration from App.Manifest.
12119         (App.IndexController._normalizeTable): Moved to App.Dashboard.
12121         * public/v2/manifest.js:
12122         (App.Repository.urlForRevision): Fixed the position of the open curly bracket.
12123         (App.Repository.urlForRevisionRange): Ditto.
12124         (App.Dashboard): Added.
12125         (App.Dashboard.table): Extracted from App.IndexController.gridChanged.
12126         (App.Dashboard.rows): Ditto.
12127         (App.Dashboard.headerColumns): Ditto.
12128         (App.Dashboard._normalizeTable): Moved from App.IndexController._normalizeTable.
12129         (App.MetricSerializer.normalizePayload): Synthesize a dashboard record from the configuration.
12130         Since there is exactly one dashboard object per app, it's okay to hard code an id here.
12131         (App.Manifest._fetchedManifest): Set defaultDashboard to the one and only one dashboard we have.
12133 2014-11-21  Ryosuke Niwa  <rniwa@webkit.org>
12135         There should be a way to associate bugs with analysis tasks
12136         https://bugs.webkit.org/show_bug.cgi?id=138977
12138         Reviewed by Benjamin Poulain.
12140         Updated associate-bug.php to match the new database schema.
12142         * public/include/json-header.php:
12143         (require_format): Removed the call to camel_case_words_separated_by_underscore since the name is
12144         already camel-cased in require_existence_of. This makes the function usable elsewhere.
12146         * public/privileged-api/associate-bug.php:
12147         (main): Changed the API to take run, bugTracker, and number to match the new database schema.
12148         Also verify that those values are integers using require_format.
12150         * public/v2/analysis.js:
12151         (App.AnalysisTask.label): Added. Concatenates the task's name with the bug numbers.
12152         (App.Bug.label): Added.
12153         (App.BugAdapter): Added.
12154         (App.BugAdapter.createRecord): Use PrivilegedAPI instead of the builtin ajax call.
12155         (App.BuildRequest): Inherit from newly added App.Model, which is set to DS.Model right now.
12157         * public/v2/app.css: Renamed .test-groups to .analysis-group. Also added new rules for the table
12158         containing the bug information.
12160         * public/v2/app.js:
12161         (App.InteractiveChartComponent._rangesChanged): Added label to range bar objects.
12162         (App.AnalysisTaskRoute):
12163         (App.AnalysisTaskController): Replaced the functionality of App.AnalysisTaskViewModel.
12164         (App.AnalysisTaskController._fetchedManifest): Added.
12165         (App.AnalysisTaskController.actions.associateBug): Added.
12167         * public/v2/chart-pane.css: Renamed .bugs-pane to .analysis-pane.
12169         * public/v2/data.js:
12170         (Measurement.prototype.associateBug): Deleted.
12172         * public/v2/index.html: Renamed .bugs-pane to .analysis-pane and .test-groups to .analysis-group.
12173         Added a table show the bug information. Also hide the chart until chartData is available.
12175         * public/v2/manifest.js:
12176         (App.Model): Added.
12178 2014-11-20  Ryosuke Niwa  <rniwa@webkit.org>
12180         Fix misc bugs and typos in app.js
12181         https://bugs.webkit.org/show_bug.cgi?id=138946
12183         Reviewed by Benjamin Poulain.
12185         * public/v2/app.js:
12186         (App.DashboardPaneProxyForPicker._platformOrMetricIdChanged):
12187         (App.ChartsController.init):
12188         (App.buildPopup): Renamed from App.BuildPopup.
12189         (App.InteractiveChartComponent._constructGraphIfPossible): Fixed the bug that we were calling
12190         remove() on the wrong object (an array as opposed to elements in the array).
12191         (App.InteractiveChartComponent._highlightedItemsChanged): Check the length of _highlights as
12192         _highlights is always an array and evalutes to true.
12194 2014-11-20  Ryosuke Niwa  <rniwa@webkit.org>
12196         New perf dashboard should provide UI to create a new analysis task
12197         https://bugs.webkit.org/show_bug.cgi?id=138910
12199         Reviewed by Benjamin Poulain.
12201         This patch reverts some parts of r175006 and re-introduces bugs associated with analysis tasks.
12202         I'll add UI to show and edit bug numbers associated with an analysis task in a follow up patch.
12204         With this patch, we can create a new analysis task by selection a range of points and opening
12205         "analysis pane" (renamed from "bugs pane"). Each analysis task created is represented by a yellow bar
12206         in the chart hyperlinked to the analysis task.
12208         * init-database.sql: Redefined the bugs to be associated with an analysis task instead of a test run.
12210         * public/api/analysis-tasks.php: Added the support for querying analysis tasks for a specific metric
12211         on a specific platform. Also retrieve and return all bugs associated with analysis tasks.
12212         (main):
12213         (fetch_and_push_bugs_to_tasks): Added. Fetches all bugs associated with an array of analysis tasks
12214         and adds the associated bugs to each task in the array.
12215         (format_task):
12217         * public/api/runs.php: Reverted changes made in r175006.
12218         (fetch_runs_for_config):
12219         (format_run): 
12221         * public/api/test-groups.php:
12222         (fetch_test_groups_for_task): Use the newly added Database::select_rows.
12224         * public/include/db.php:
12225         (Database::select_first_or_last_row):
12226         (Database::select_rows): Extracted from select_first_or_last_row.
12228         * public/v2/analysis.js:
12229         (App.AnalysisTask): Added "bugs" property.
12230         (App.Bug): Added now that bugs are regular data store objects.
12232         * public/v2/app.js:
12233         (App.Pane._fetch): Calls this.fetchAnalyticRanges to fetch analysis tasks as well as test runs.
12234         (App.Pane.fetchAnalyticRanges): Added. Fetches analysis tasks for the current metric on the current
12235         platform that are associated with a specific range of runs.
12236         (App.PaneController.actions.toggleBugsPane): Updated per showingBugsPane to showingAnalysisPane rename.
12237         (App.PaneController.actions.associateBug): Deleted.
12238         (App.PaneController.actions.createAnalysisTask): Replaced the pre-condition checks with assertions as
12239         this action should never be triggered when the pre-condition is not met. Also re-fetch analysis tasks
12240         once we've created one.
12241         (App.PaneController.toggleSearchPane): Updated per showingBugsPane to showingAnalysisPane rename.
12242         (App.PaneController._detailsChanged): Ditto. Removed selectedSinglePoint since it's no longer used.
12243         (App.PaneController._showDetails): Call _updateCanAnalyze to update the status of "Analyze" button.
12244         (App.PaneController._updateBugs): Deleted.
12245         (App.PaneController._updateMarkedPoints): Deleted.
12246         (App.PaneController._updateCanAnalyze): Added. Disables the button to create an analysis task when
12247         the name is missing or when at most one point is selected.
12248         
12249         (App.InteractiveChartComponent._constructGraphIfPossible): Update the locations of range rects.
12250         (App.InteractiveChartComponent._relayoutDataAndAxes): Ditto.
12251         (App.InteractiveChartComponent._mousePointInGraph): Don't return a point unless the mouse cursor is
12252         on our svg element to avoid locking the current item when a bar shown for an analysis task is clicked.
12253         (App.InteractiveChartComponent._rangesChanged): Added. Creates an array of objects representing
12254         clickable bars for analysis tasks.
12255         (App.InteractiveChartComponent._updateRangeBarRects): Computes the inline style used by each clickable
12256         bar for analysis tasks to place them at the right location.
12257         (App.InteractiveChartComponent.actions.openRange): Added. Forwards the action to the parent controller.
12259         * public/v2/chart-pane.css:
12260         (.chart .extent): Use the same color as the vertical indicator in the highlight behind the selection.
12261         (.chart .rangeBar): Added.
12263         * public/v2/data.js:
12264         (TimeSeries.prototype.nextPoint): Added. Used by _rangesChanged.
12266         * public/v2/index.html: Renamed "bugs pane" to "analysis pane" and removed the UI to associate bugs.
12267         This ability will be reinstated in a follow up patch. Also added a container div and spans for analysis
12268         task bars in the interactive chart component.
12270 2014-11-19  Ryosuke Niwa  <rniwa@webkit.org>
12272         Fix typos in r176203.
12274         * public/v2/app.js:
12275         (App.ChartsController.actions.addPaneByMetricAndPlatform):
12276         (App.AnalysisTaskRoute):
12278 2014-11-18  Ryosuke Niwa  <rniwa@webkit.org>
12280         Unreviewed. Updated the install instruction.
12282         * Install.md:
12284 2014-11-17  Ryosuke Niwa  <rniwa@webkit.org>
12286         App.Manifest shouldn't use App.__container__.lookup
12287         https://bugs.webkit.org/show_bug.cgi?id=138768
12289         Reviewed by Andreas Kling.
12291         Removed the hack to find the store object via App.__container__.lookup.
12292         Pass around the store object instead.
12294         * public/v2/app.js:
12295         (App.DashboardRow._createPane): Add "store" property to the pane.
12296         (App.DashboardPaneProxyForPicker._platformOrMetricIdChanged): Ditto.
12297         (App.IndexController.gridChanged): Ditto.
12298         (App.IndexController.actions.addRow): Ditto.
12299         (App.IndexController.init): Ditto.
12300         (App.Pane._fetch): Ditto.
12301         (App.ChartsController._parsePaneList): Ditto.
12302         (App.ChartsController._updateQueryString): Ditto.
12303         (App.ChartsController.actions.addPaneByMetricAndPlatform): Ditto.
12304         (App.BuildPopup): Ditto.
12305         (App.AnalysisTaskRoute.model): Ditto.
12306         (App.AnalysisTaskViewModel._taskUpdated): Ditto.
12308         * public/v2/manifest.js:
12309         (App.Manifest.fetch): Removed the code to find the store object.
12311 2014-11-08  Ryosuke Niwa  <rniwa@webkit.org>
12313         Fix Ember.js warnings the new perf dashboard
12314         https://bugs.webkit.org/show_bug.cgi?id=138531
12316         Reviewed by Darin Adler.
12318         Fixed various warnings.
12320         * public/v2/app.js:
12321         (App.InteractiveChartComponent._relayoutDataAndAxes): We can't use "rem". Use this._rem as done for x.
12322         * public/v2/data.js:
12323         (PrivilegedAPI._post): Removed the superfluous console.log.
12324         (CommitLogs.fetchForTimeRange): Ditto.
12325         * public/v2/index.html: Added tbody as required by the HTML specification.
12327 2014-11-07  Ryosuke Niwa  <rniwa@webkit.org>
12329         Fix typos in r175768.
12331         * public/v2/app.js:
12332         (App.AnalysisTaskViewModel.roots):
12334 2014-11-07  Ryosuke Niwa  <rniwa@webkit.org>
12336         Introduce the concept of analysis task to perf dashboard
12337         https://bugs.webkit.org/show_bug.cgi?id=138517
12339         Reviewed by Andreas Kling.
12341         Introduced the concept of an analysis task, which is created for a range of measurements for a given metric on
12342         a single platform and used to bisect regressions in the range.
12343         
12344         Added a new page to see the list of active analysis tasks and a page to view the contents of an analysis task.
12346         * init-database.sql: Added a bunch of tables to store information about analysis tasks.
12347             analysis_tasks - Represents each analysis task. Associated with a platform and a metric and possibly with two
12348             test runs. Analysis tasks not associated with test runs are used for try new patches.
12349             analysis_test_groups - A test group in an analysis task represents a bunch of related A/B testing results.
12350             root_sets - A root set represents a set of roots (or packages) installed in each A/B testing.
12351             build_requests - A build request represents a single pending build for A/B testing.
12353         * public/api/analysis-tasks.php: Added. Returns the specified analysis task or all analysis tasks in an array.
12354         (main):
12355         (format_task):
12357         * public/api/test-groups.php: Added. Returns analysis task groups for the specified analysis task or returns
12358         the specified analysis task group as well as build requests associated with them.
12359         (main):
12360         (fetch_test_groups_for_task):
12361         (fetch_build_requests_for_task):
12362         (fetch_build_requests_for_group):
12363         (format_test_group):
12364         (format_build_request):
12366         * public/include/json-header.php:
12367         (remote_user_name): Extracted from compute_token so that we can use it in create-analysis-task.php.
12368         (compute_token):
12370         * public/privileged-api/associate-bug.php:
12371         (main): Fixed a typo.
12373         * public/privileged-api/create-analysis-task.php: Added. Creates a new analysis task for a given test run range.
12374         (main):
12375         (ensure_row_by_id):
12376         (ensure_config_from_runs):
12378         * public/privileged-api/generate-csrf-token.php: Use remote_user_name.
12380         * public/v2/analysis.js: Added. Various Ember data store models to represent analysis tasks and related objects.
12381         (App.AnalysisTask):
12382         (App.AnalysisTask.create):
12383         (App.TestGroup):
12384         (App.TestGroupAdapter):
12385         (App.AnalysisTaskSerializer):
12386         (App.TestGroupSerializer):
12387         (App.BuildRequest):
12389         * public/v2/app.css: Added style rules for the analysis page.
12391         * public/v2/app.js:
12392         (App.Pane._fetch): Use fetchRunsWithPlatformAndMetric, which has been refactored into App.Manifest.
12394         (App.PaneController.actions.toggleBugsPane): Show bugs pane even when there are no bug trackers or there is not
12395         exactly one selected point as we can still create an analysis task.
12396         (App.PaneController.actions.associateBug): Renamed singlySelectedPoint to selectedSinglePoint to be more
12397         grammatical and also alert'ed the error message when there is one.
12398         (App.PaneController.actions.createAnalysisTask): Added. Creates a new analysis task and opens it in a new tab.
12399         Since window.open only works during the click, we open the new "window" preemptively and navigates or closes it
12400         once XHR request has completed.
12401         (App.PaneController._detailsChanged): Changes due to singlySelectedPoint to selectedSinglePoint rename.
12402         (App.PaneController._updateBugs): Fixed a bug that we were showing bugs in the previous point when a single point
12403         is selected in the details pane.
12405         (App.AnalysisRoute): Added.
12406         (App.AnalysisTaskRoute): Added.
12407         (App.AnalysisTaskViewModel): Added.
12408         (App.AnalysisTaskViewModel._taskUpdated): Fetch runs for the associated platform and metric.
12409         (App.AnalysisTaskViewModel._fetchedRuns): Setup the chart data to show.
12410         (App.AnalysisTaskViewModel.testSets): The computed property used to update roots for all repositories/projects.
12411         (App.AnalysisTaskViewModel._rootChangedForTestSet): Updates root selections for all repositories/projects when
12412         the user selects an option for all roots in A or B configuration.
12413         (App.AnalysisTaskViewModel.roots): The computed property used to show root choices for each repository/project.
12415         * public/v2/chart-pane.css: Added style rules for details view in the analysis task page.
12417         * public/v2/data.js:
12418         (Measurement.prototype._formatRevisionRange): Don't prefix a revision number with "At " when there is no previous
12419         point so that we can use it in App.AnalysisTaskViewModel.roots.
12420         (TimeSeries.prototype.findPointByMeasurementId): Added.
12421         (TimeSeries.prototype.seriesBetweenPoints): Added.
12423         * public/v2/index.html: Use Metric.fullName since the same value is needed in the analysis task page. Also added
12424         a button to create an analysis task, and made bugs pane button always enabled since we can an analysis task even
12425         when multiple points are selected. Finally, added a new template for the analysis task page.
12427         * public/v2/manifest.js:
12428         (App.Metric.fullName): Added to share code between the charts page and the analysis task page.
12429         (App.Manifest.fetchRunsWithPlatformAndMetric): Extracted from App.Pane._fetch to be reused in
12430         App.AnalysisTaskViewModel._taskUpdated.
12432 2014-10-28  Ryosuke Niwa  <rniwa@webkit.org>
12434         Remove App.PaneController.bugsChangeCount in the new perf dashboard
12435         https://bugs.webkit.org/show_bug.cgi?id=138111
12437         Reviewed by Darin Adler.
12439         * public/v2/app.js:
12440         (App.PaneController.bugsChangeCount): Removed.
12441         (App.PaneController.actions.associateBug): Call _updateMarkedPoints instead of incrementing bugsChangeCount.
12442         (App.PaneController._updateMarkedPoints): Extracted from App.InteractiveChartComponent._updateDotsWithBugs.
12443         Finds the list of current run's points that are associated with bugs.
12444         (App.InteractiveChartComponent._updateMarkedDots): Renamed from _updateDotsWithBugs.
12445         * public/v2/chart-pane.css:
12446         (.chart .marked): Renamed from .hasBugs.
12447         * public/v2/index.html: Specify chartPointRadius and markedPoints.
12449 2014-10-27  Ryosuke Niwa  <rniwa@webkit.org>
12451         REGRESSION: commit logs are not shown sometimes on the new dashboard UI
12452         https://bugs.webkit.org/show_bug.cgi?id=138099
12454         Reviewed by Benjamin Poulain.
12456         The bug was caused by _currentItemChanged not passing the previous point in the list of points and also
12457         _showDetails inverting the order of the current and old measurements.
12459         * public/v2/app.js:
12460         (App.PaneController._currentItemChanged): Pass in the previous point to _showDetails when there is one.
12461         (App.PaneController._showDetails): Since points are ordered chronologically, the last point is the
12462         current (latest) measurement and the first point is the oldest measurement.
12463         (App.CommitsViewerComponent.commitsChanged): Don't show a single measurement as a range for clarity.
12465 2014-10-18  Ryosuke Niwa  <rniwa@webkit.org>
12467         Perf dashboard should provide a way to associate bugs with a test run
12468         https://bugs.webkit.org/show_bug.cgi?id=137857
12470         Reviewed by Andreas Kling.
12472         Added a "privileged" API, /privileged-api/associate-bug, to associate a bug with a test run.
12473         /privileged-api/ is to be protected by an authentication mechanism such as DigestAuth over https by
12474         the Apache configuration.
12477         The Cross Site Request (CSRF) Forgery prevention for privileged APIs work as follows. When a user is
12478         about to make a privileged API access, the front end code obtains a CSRF token generated by POST'ing
12479         to privileged-api/generate-csrf-token; the page sets a randomly generated salt and an expiration time
12480         via the cookie and returns a token computed from those two values as well as the remote username.
12482         The font end code then POST's the request along with the returned token. The server side code verifies
12483         that the specified token can be generated from the salt and the expiration time set in the cookie, and
12484         the token hasn't expired.
12487         * init-database.sql: Added bug_url to bug_trackers table, and added bugs table. Each bug tracker will
12488         have zero or exactly one bug associated with a test run.
12490         * public/admin/bug-trackers.php: Added the support for editing bug_url.
12491         * public/api/runs.php:
12492         (fetch_runs_for_config): Modified the query to fetch bugs associated with test_runs.
12493         (parse_bugs_array): Added. Parses the aggregated bugs and creates a dictionary that maps a tracker id to
12494         an associated bug if there is one.
12495         (format_run): Calls parse_bugs_array.
12497         * public/include/json-header.php: Added helper functions to deal for CSRF prevention.
12498         (ensure_privileged_api_data): Added. Dies immediately if the request's method is not POST or doesn't
12499         have a valid JSON payload.
12500         (ensure_privileged_api_data_and_token): Ditto. Also checks that the CSRF prevention token is valid.
12501         (compute_token): Computes a CSRF token using the REMOTE_USER (e.g. set via BasicAuth), the salt, and
12502         the expiration time stored in the cookie.
12503         (verify_token): Returns true iff the specified token matches what compute_token returns from the cookie.
12505         * public/include/manifest.php:
12506         (ManifestGenerator::bug_trackers): Include bug_url as bugUrl in the manifest. Also use tracker_id instead
12507         of tracker_name as the key in the manifest. This requires changes to both v1 and v2 front end.
12509         * public/index.html:
12510         (Chart..showTooltipWithResults): Updated for the manifest format changed mentioned above.
12512         * public/privileged-api/associate-bug.php: Added.
12513         (main): Added. Associates or dissociates a bug with a test run inside a transaction. It prevent a CSRF
12514         attack via ensure_privileged_api_data_and_token, which calls verify_token.
12516         * public/privileged-api/generate-csrf-token.php: Added. Generates a CSRF token valid for one hour.
12518         * public/v2/app.css:
12519         (.disabled .icon-button:hover g): Used by the "bugs" icon when a range of points or no points are
12520         selected in a chart.
12522         * public/v2/app.js:
12523         (App.PaneController.actions.toggleBugsPane): Added. Toggles the visibility of the bugs pane when exactly
12524         one point is selected in the chart. Also hides the search pane when making the bugs pane visible since
12525         they would overlap on each other if both of them are shown.
12526         (App.PaneController.actions.associateBug): Makes a privileged API request to associate the specified bug
12527         with the currently selected point (test run). Updates the bug information in "details" and colors of dots
12528         in the charts to reflect new states. Because chart data objects aren't real Ember objects for performance
12529         reasons, we have to use a dirty hack of modifying a dummy counter bugsChangeCount.
12530         (App.PaneController.actions.toggleSearchPane): Renamed from toggleSearch. Also hides the bugs pane when
12531         showing the search pane.
12532         (App.PaneController.actions.rangeChanged): Takes all selected points as the second argument instead of
12533         taking start and end points as the second and the third arguments so that _showDetails can enumerate all
12534         bugs in the selected range.
12536         (App.PaneController._detailsChanged): Added. Hide the bugs pane whenever a new point is selected.
12537         Also update singlySelectedPoint, which is used by toggleBugsPane and associateBug.
12538         (App.PaneController._currentItemChanged): Updated for the _showDetails change.
12539         (App.PaneController._showDetails): Takes an array of selected points in place of old arguments.
12540         Simplified the code to compute the revision information. Calls _updateBugs to format the associated bugs.
12541         (App.PaneController._updateBugs): Sets details.bugTrackers to a dictionary that maps a bug tracker id to
12542         a bug tracker proxy with an array of (bugNumber, bugUrl) pairs and also editedBugNumber, which is used by
12543         the bugs pane to associate or dissociate a bug number, if exactly one point is selected.
12545         (App.InteractiveChartComponent._updateDotsWithBugs): Added. Sets hasBugs class on dots as needed.
12546         (App.InteractiveChartComponent._setCurrentSelection): Finds and passes all points in the selected range
12547         to selectionChanged action instead of just finding the first and the last points.
12549         * public/v2/chart-pane.css: Updated the style.
12551         * public/v2/data.js:
12552         (PrivilegedAPI): Added. A wrapper for privileged APIs' CSRF tokens.
12553         (PrivilegedAPI.sendRequest): Makes a privileged API call. Fetches a new CSRF token if needed.
12554         (PrivilegedAPI._generateTokenInServerIfNeeded): Makes a request to privileged-api/generate-csrf-token if
12555         we haven't already obtained a CSRF token or if the token has already been expired.
12556         (PrivilegedAPI._post): Makes a single POST request to /privileged-api/* with a JSON payload.
12558         (Measurement.prototype.bugs): Added.
12559         (Measurement.prototype.hasBugs): Returns true iff bugs has more than one bug number.
12560         (Measurement.prototype.associateBug): Associates a bug with a test run via privileged-api/associate-bug.
12562         * public/v2/index.html: Added the bugs pane. Also added a list of bugs associated with the current run in
12563         the details.
12565         * public/v2/manifest.js:
12566         (App.BugTracker.bugUrl):
12567         (App.BugTracker.newBugUrl): Added.
12568         (App.BugTracker.repositories): Added. This was a missing back reference to repositories.
12569         (App.MetricSerializer.normalizePayload): Now parses/loads the list of bug trackers from the manifest.
12570         (App.Manifest.repositoriesWithReportedCommits): Now initialized to an empty array instead of null.
12571         (App.Manifest.bugTrackers): Added.
12572         (App.Manifest._fetchedManifest): Sets App.Manifest.bugTrackers. Also sorts the list of repositories by
12573         their respective ids to make the ordering stable.
12575 2014-10-14  Ryosuke Niwa  <rniwa@webkit.org>
12577         Remove unused jobs table
12578         https://bugs.webkit.org/show_bug.cgi?id=137724
12580         Reviewed by Daniel Bates.
12582         Removed jobs table in the database as well as related code.
12584         * init-database.sql:
12585         * public/admin/jobs.php: Removed.
12586         * public/admin/tests.php:
12587         * public/include/admin-header.php:
12589 2014-10-13  Ryosuke Niwa  <rniwa@webkit.org>
12591         New perf dashboard should have an ability to search commits by a keyword
12592         https://bugs.webkit.org/show_bug.cgi?id=137675
12594         Reviewed by Geoffrey Garen.
12596         /api/commits/ now accepts query parameters to search a commit by a keyword. Its output format changed to
12597         include "authorEmail" and "authorName" directly as columns instead of including an "author" object.
12598         This API change allows fetch_commits_between to generate results without processing Postgres query results.
12600         In the front end side, we've added a search pane in pane controller, and the interactive chart component
12601         now has a concept of highlighted items which is used to indicate commits found by the search pane.
12603         * public/api/commits.php:
12604         (main): Extract query parameters: keyword, from, and to and use that to fetch appropriate commits.
12605         (fetch_commits_between): Moved some code from main. Now takes a search term as the third argument.
12606         We look for a commit if its author name or email contains the keyword or if its revision matches the keyword.
12607         (format_commit): Renamed from format_commits. Now only formats one commit.
12609         * public/include/db.php:
12610         (Database::query_and_fetch_all): Now returns array() when the query results is empty (instead of false).
12612         * public/v2/app.css: Renamed .close-button to .icon-button since it's used by a search button as well.
12614         * public/v2/app.js:
12615         (App.Pane.searchCommit): Added. Finds the commits by a search term and assigns 'highlightedItems',
12616         which is a hash table that contains highlighted items' measurements' ids as keys.
12617         (App.PaneController.actions.toggleSearch): Toggles the visibility of the search pane. Also sets
12618         the default commit repository.
12619         (App.PaneController.actions.searchCommit): Delegates the work to App.Pane.searchCommit.
12620         (App.InteractiveChartComponent._constructGraphIfPossible): Fixed a bug that we weren't removing old this._dots.
12621         Added the code to initialize this._highlights.
12622         (App.InteractiveChartComponent._updateDimensionsIfNeeded): Updates dimensions of highlight lines.
12623         (App.InteractiveChartComponent._updateHighlightPositions): Added. Ditto.
12624         (App.InteractiveChartComponent._highlightedItemsChanged): Adds vertical lines for highlighted items and deletes
12625         the existing lines for the old highlighted items.
12626         (App.CommitsViewerComponent.commitsChanged): Updated the code per JSON API change mentioned above.
12627         Also fixed a bug that the code tries to update the commits viewer even if the viewer had already been destroyed. 
12629         * public/v2/chart-pane.css: Added style for the search pane and the search button.
12631         * public/v2/data.js: Turned FetchCommitsForTimeRange into a class: CommitLogs.
12632         (CommitLogs): Added.
12633         (CommitLogs.fetchForTimeRange): Renamed from FetchCommitsForTimeRange. Takes a search term as an argument.
12634         (CommitLogs._cachedCommitsBetween): Extracted from FetchCommitsForTimeRange.
12635         (CommitLogs._cacheConsecutiveCommits): Ditto.
12636         (FetchCommitsForTimeRange._cachedCommitsByRepository): Deleted.
12637         (Measurement.prototype.commitTimeForRepository): Extracted from formattedRevisions.
12638         (Measurement.prototype.formattedRevisions): Uses formattedRevisions. Deleted the unused code for commitTime.
12640         * public/v2/index.html: Added the search pane and the search button. Also removed the unused attribute binding
12641         for showingDetails since this property is no longer used.
12643         * public/v2/manifest.js:
12644         (App.Manifest.repositories): Added.
12645         (App.Manifest.repositoriesWithReportedCommits): Ditto. Used by App.PaneController.actions.toggleSearch to find
12646         the default repository to search.
12647         (App.Manifest._fetchedManifest): Populates repositories and repositoriesWithReportedCommits.
12649 2014-10-13  Ryosuke Niwa  <rniwa@webkit.org>
12651         Unreviewed build fix after r174555.
12653         * public/include/manifest.php:
12654         (ManifestGenerator::generate): Assign an empty array to $repositories_with_commit when there are no commits.
12655         * tests/admin-regenerate-manifest.js: Fixed the test case.
12657 2014-10-09  Ryosuke Niwa  <rniwa@webkit.org>
12659         New perf dashboard UI tries to fetch commits all the time
12660         https://bugs.webkit.org/show_bug.cgi?id=137592
12662         Reviewed by Andreas Kling.
12664         Added hasReportedCommits boolean to repository meta data in manifest.json, and used that in
12665         the front end to avoid issuing HTTP requests to fetch commit logs for repositories with
12666         no reported commits as they are all going to fail.
12668         Also added an internal cache to FetchCommitsForTimeRange in the front end to avoid fetching
12669         the same commit logs repeatedly. There are two data structures we cache: commitsByRevision
12670         which maps a given commit revision/hash to a commit object; and commitsByTime which is an array
12671         of commits sorted chronologically by time.
12673         * public/include/manifest.php:
12675         * public/v2/app.js:
12676         (App.CommitsViewerComponent.commitsChanged):
12678         * public/v2/data.js:
12679         (FetchCommitsForTimeRange):
12680         (FetchCommitsForTimeRange._cachedCommitsByRepository):
12682         * public/v2/manifest.js:
12683         (App.Repository):
12685 2014-10-08  Ryosuke Niwa  <rniwa@webkit.org>
12687         Another unreviewed build fix after r174477.
12689         Don't try to insert a duplicated row into build_commits as it results in a database constraint error.
12691         This has been caught by a test in /api/report. I don't know why I thought all tests were passing.
12693         * public/include/report-processor.php:
12695 2014-10-08  Ryosuke Niwa  <rniwa@webkit.org>
12697         Unreviewed build fix after r174477.
12699         * init-database.sql: Removed build_commits_index since it's redundant with build_commit's primary key.
12700         Also fixed a syntax error that we were missing "," after line that declared build_commit column.
12702         * public/api/runs.php: Fixed the query so that test_runs without commits data will be retrieved.
12703         This is necessary for baseline and target values manually added via admin pages.
12705 2014-10-08  Ryosuke Niwa  <rniwa@webkit.org>
12707         Add v2 UI for the perf dashboard
12708         https://bugs.webkit.org/show_bug.cgi?id=137537
12710         Rubber-stamped by Andreas Kling.
12712         * public/v2: Added.
12713         * public/v2/app.css: Added.
12714         * public/v2/app.js: Added.
12715         * public/v2/chart-pane.css: Added.
12716         * public/v2/data.js: Added.
12717         * public/v2/index.html: Added.
12718         * public/v2/js: Added.
12719         * public/v2/js/d3: Added.
12720         * public/v2/js/d3/LICENSE: Added.
12721         * public/v2/js/d3/d3.js: Added.
12722         * public/v2/js/d3/d3.min.js: Added.
12723         * public/v2/js/ember-data.js: Added.
12724         * public/v2/js/ember.js: Added.
12725         * public/v2/js/handlebars.js: Added.
12726         * public/v2/js/jquery.min.js: Added.
12727         * public/v2/js/statistics.js: Added.
12728         * public/v2/manifest.js: Added.
12729         * public/v2/popup.js: Added.
12731 2014-10-08  Ryosuke Niwa  <rniwa@webkit.org>
12733         Remove superfluously duplicated code in public/api/report-commits.php.
12735 2014-10-08  Ryosuke Niwa  <rniwa@webkit.org>
12737         Perf dashboard should store commit logs
12738         https://bugs.webkit.org/show_bug.cgi?id=137510
12740         Reviewed by Darin Adler.
12742         For the v2 version of the perf dashboard, we would like to be able to see commit logs in the dashboard itself.
12744         This patch replaces "build_revisions" table with "commits" and "build_commits" relations to store commit logs,
12745         and add JSON APIs to report and retrieve them. It also adds a tools/pull-svn.py to pull commit logs from
12746         a subversion directory. The git version of this script will be added in a follow up patch.
12749         In the new database schema, each revision in each repository is represented by exactly one row in "commits"
12750         instead of one row for each build in "build_revisions". "commits" and "builds" now have a proper many-to-many
12751         relationship via "build_commits" relations.
12753         In order to migrate an existing instance of this application, run the following SQL commands:
12755         BEGIN;
12757         INSERT INTO commits (commit_repository, commit_revision, commit_time)
12758             (SELECT DISTINCT ON (revision_repository, revision_value)
12759                 revision_repository, revision_value, revision_time FROM build_revisions);
12761         INSERT INTO build_commits (commit_build, build_commit) SELECT revision_build, commit_id
12762             FROM commits, build_revisions
12763             WHERE commit_repository = revision_repository AND commit_revision = revision_value;
12765         DROP TABLE build_revisions;
12767         COMMIT;
12770         The helper script to submit commit logs can be used as follows:
12772         python ./tools/pull-svn.py "WebKit" https://svn.webkit.org/repository/webkit/ https://perf.webkit.org
12773             feeder-slave feeder-slave-password 60 "webkit-patch find-users"
12775         The above command will pull the subversion server at https://svn.webkit.org/repository/webkit/ every 60 seconds
12776         to retrieve at most 10 commits, and submits the results to https://perf.webkit.org using "feeder-slave" and
12777         "feeder-slave-password" as the builder name and the builder password respectively.
12779         The last, optional, argument is the shell command to convert a subversion account to the corresponding username.
12780         e.g. "webkit-patch find-users rniwa@webkit.org" yields "Ryosuke Niwa" <rniwa@webkit.org> in the stdout.
12783         * init-database.sql: Replaced "build_revisions" relation with "commits" and "build_commits" relations.
12785         * public/api/commits.php: Added. Retrieves a list of commits based on arguments in its path of the form
12786             /api/commits/<repository-name>/<filter>. The behavior of this API depends on <filter> as follows:
12788             - Not specified - It returns every single commit for a given repository.
12789             - Matches "oldest" - It returns the commit with the oldest timestamp.
12790             - Matches "latest" - It returns the commit with the latest timestamp.
12791             - Matches "last-reported" - It returns the commit with the latest timestamp added via report-commits.php.
12792             - Is entirely alphanumeric - It returns the commit whose revision matches the filter.
12793             - Is of the form <alphanumeric>:<alphanumeric> or <alphanumeric>-<alphanumeric> - It retrieves the list
12794             of commits added via report-commits.php between two timestamps retrieved from commits whose revisions
12795             match the two alphanumeric values specified. Because it retrieves commits based on their timestamps,
12796             the list may contain commits that do not appear as neither hash's ancestor in git/mercurial.
12797         (main):
12798         (commit_from_revision):
12799         (fetch_commits_between):
12800         (format_commits):
12802         * public/api/report-commits.php: Added. A JSON API to report new subversion, git, or mercurial commits.
12803         See tests/api-report-commits.js for examples on how to use this API.
12805         * public/api/runs.php: Updated the query to use "commit_builds" and "commits" relations instead of
12806         "build_revisions". Regrettably, the new query is 20% slower but I'm going to wait until the new UI is ready
12807         to optimize this and other JSON APIs.
12809         * public/include/db.php:
12810         (Database::select_or_insert_row):
12811         (Database::update_or_insert_row): Added.
12812         (Database::_select_update_or_insert_row): Extracted from select_or_insert_row. Try to update first and then
12813         insert if the update fails for update_or_insert_row. Preserves the old behavior when $should_update is false.
12815         (Database::select_first_row):
12816         (Database::select_last_row): Added.
12817         (Database::select_first_or_last_row): Extracted from select_first_row. Fixed a bug that we were asserting
12818         $order_by to be not alphanumeric/underscore. Retrieve the last row instead of the first if $descending_order.
12820         * public/include/report-processor.php:
12821         (ReportProcessor::resolve_build_id): Store commits instead of build_revisions. We don't worry about the race
12822         condition for adding "build_commits" rows since we shouldn't have a single tester submitting the same result
12823         concurrently. Even if it happened, it will only result in a PHP error and the database will stay consistent.
12825         * run-tests.js:
12826         (pathToTests): Don't call path.resolve with "undefined" testName; It throws an exception in the latest node.js.
12828         * tests/api-report-commits.js: Added.
12829         * tests/api-report.js: Fixed a test per build_revisions to build_commits/commits replacement.
12831         * tools: Added.
12832         * tools/pull-svn.py: Added. See above for how to use this script.
12833         (main):
12834         (determine_first_revision_to_fetch):
12835         (fetch_revision_from_dasbhoard):
12836         (fetch_commit_and_resolve_author):
12837         (fetch_commit):
12838         (textContent):
12839         (resolve_author_name_from_email):
12840         (submit_commits):
12842 2014-09-30  Ryosuke Niwa  <rniwa@webkit.org>
12844         Update Install.md for Mavericks and fix typos
12845         https://bugs.webkit.org/show_bug.cgi?id=137276
12847         Reviewed by Benjamin Poulain.
12849         Add the instruction to copy php.ini to enable the Postgres extension in PHP.
12851         Also use perf.webkit.org as the directory name instead of WebKitPerfMonitor.
12853         Finally, init-database.sql is no longer located inside database directory.
12855         * Install.md:
12857 2014-08-11  Ryosuke Niwa  <rniwa@webkit.org>
12859         Report run id's in api/runs.php for the new dashboard UI
12860         https://bugs.webkit.org/show_bug.cgi?id=135813
12862         Reviewed by Andreas Kling.
12864         Include run_id in the generated JSON.
12866         * public/api/runs.php:
12867         (fetch_runs_for_config): Don't sort results by time since that has been done in the front end for ages now.
12868         (format_run):
12870 2014-08-11  Ryosuke Niwa  <rniwa@webkit.org>
12872         Merging platforms mixes baselines and targets into reported data
12873         https://bugs.webkit.org/show_bug.cgi?id=135260
12875         Reviewed by Andreas Kling.
12877         When merging two platforms, move test configurations of a different type (baseline, target)
12878         as well as of different metric (Time, Runs).
12880         Also avoid fetching the entire table of runs just to see if there are no remaining runs.
12881         It's sufficient to detect one such test_runs object.
12883         * public/admin/platforms.php:
12884         (merge_platforms):
12886 2014-07-30  Ryosuke Niwa  <rniwa@webkit.org>
12888         Merging platforms mixes baselines and targets into reported data
12889         https://bugs.webkit.org/show_bug.cgi?id=135260
12891         Reviewed by Geoffrey Garen.
12893         Make sure two test configurations we're merging are of the same type (e.g. baseline, target, current).
12894         Otherwise, we'll erroneously mix up runs for baseline, target, and current (reported values).
12896         * public/admin/platforms.php:
12898 2014-07-23  Ryosuke Niwa  <rniwa@webkit.org>
12900         Build fix after r171361.
12902         * public/js/helper-classes.js:
12903         (.this.formattedBuildTime):
12905 2014-07-22  Ryosuke Niwa  <rniwa@webkit.org>
12907         Perf dashboard spends 2s processing JSON data during the page loads
12908         https://bugs.webkit.org/show_bug.cgi?id=135152
12910         Reviewed by Andreas Kling.
12912         In the Apple internal dashboard, we were spending as much as 2 seconds
12913         converting raw JSON data into proper JS objects while loading the dashboard.
12915         This caused the apparent unresponsiveness of the dashboard despite of the fact
12916         charts themselves updated almost instantaneously.
12918         * public/index.html:
12919         * public/js/helper-classes.js:
12920         (TestBuild): Compute the return values of formattedTime and formattedBuildTime
12921         lazily as creating new Date objects and running string replace is expensive.
12922         (TestBuild.formattedTime):
12923         (TestBuild.formattedBuildTime):
12924         (PerfTestRuns.setResults): Added. Pushing each result was the biggest bottle neck.
12925         (PerfTestRuns.addResult): Deleted.
12927 2014-07-18  Ryosuke Niwa  <rniwa@webkit.org>
12929         Perf dashboard shouldn't show the full git hash
12930         https://bugs.webkit.org/show_bug.cgi?id=135083
12932         Reviewed by Benjamin Poulain.
12934         Detect Git/Mercurial hash by checking the length.
12936         If it's a hash, use the first 8 characters in the label
12937         while retaining the full length to be used in hyperlinks.
12939         * public/js/helper-classes.js:
12940         (.this.formattedRevisions):
12941         (TestBuild):
12943 2014-05-29  Ryosuke Niwa  <rniwa@webkit.org>
12945         Add an instruction on how to backup the database.
12946         https://bugs.webkit.org/show_bug.cgi?id=133391
12948         Rubber-stamped by Andreas Kling.
12950         * Install.md:
12952 2014-04-08  Ryosuke Niwa  <rniwa@webkit.org>
12954         Build fix after r166479. 'bytes' is now abbreviated as 'B'.
12956         * public/js/helper-classes.js:
12957         (PerfTestRuns.smallerIsBetter):
12959 2014-04-08  Ryosuke Niwa  <rniwa@webkit.org>
12961         Some CSS teaks.
12963         * public/common.css:
12964         (#title):
12965         * public/index.html:
12966         (#charts .pane):
12967         (#charts .arrow):
12969 2014-04-03  Ryosuke Niwa  <rniwa@webkit.org>
12971         WebKitPerfMonitor: There should be a way to add all metrics of a suite without also adding subtests
12972         https://bugs.webkit.org/show_bug.cgi?id=131157
12974         Reviewed by Andreas Kling.
12976         Split "all metrics" into all metrics of a test suite and all subtests of the suite.
12977         This allows, for example, adding all metrics such as Arithmetic and Geometric for
12978         a given test suite without also adding its subtests.
12980         * public/index.html:
12981         (init.showCharts):
12982         (init):
12984 2014-04-03  Ryosuke Niwa  <rniwa@webkit.org>
12986         WebKitPerfMonitor: Tooltips cannot be pinned after using browser's back button
12987         https://bugs.webkit.org/show_bug.cgi?id=131155
12989         Reviewed by Andreas Kling.
12991         The bug was caused by Chart.attach binding event listeners on plot container on each call.
12992         This resulted in the click event handler toggling the visiblity of the tooltip twice upon
12993         click when attach() has been called even number of times, keeping the tooltip invisible.
12995         Fixed the bug by extracting the code to bind event listeners outside of Chart.attach as
12996         a separate function, bindPlotEventHandlers, and calling it exactly once when Chart.attach
12997         is called for the first time.
12999         * public/index.html:
13000         (Chart.attach):
13001         (Chart..bindPlotEventHandlers):
13003 2014-04-03  Ryosuke Niwa  <rniwa@webkit.org>
13005         WebKitPerfMonitor: Tooltips can be cut off at the top
13006         https://bugs.webkit.org/show_bug.cgi?id=130960
13008         Reviewed by Andreas Kling.
13010         * public/common.css:
13011         (#title): Removed the gradients, box shadows, and border from the header.
13012         (#title h1): Reduce the font size.
13013         (#title ul): Use line-height to vertically align the navigation bar instead of specifying a padding atop.
13014         * public/index.html:
13015         (.tooltop:before): Added. Identical to .tooltop:after except it's upside down (arrow facing up).
13016         (.tooltip.inverted:before): Show the arrow facing up when .inverted is set.
13017         (.tooltip.inverted:before): Hide the arrow facing down when .inverted is set.
13018         * public/js/helper-classes.js:
13019         (Tooltip.show): Show the tooltip below the point if placing it above the point results in the top of the
13020         tooltip extending above y=0.
13022 2014-04-03  Ryosuke Niwa  <rniwa@webkit.org>
13024         WebKitPerfMonitor: Y-axis adjustment is too aggressive
13025         https://bugs.webkit.org/show_bug.cgi?id=130937
13027         Reviewed by Andreas Kling.
13029         Previously, adjusted min. and max. were defined as the two standards deviations away from EWMA of measured
13030         results. This had two major problems:
13031         1. Two standard deviations can be too small to show the confidence interval for results.
13032         2. Sometimes baseline and target can be more than two standards deviations away.
13034         Fixed the bug by completely rewriting the algorithm to compute the interval. Instead of blindly using two
13035         standard deviations as margins, we keep adding quarter the standard deviation on each side until more than 90%
13036         of points lie in the interval or we've expanded 4 standard deviations. Once this condition is met, we reduce
13037         the margin on each side separately to reduce the empty space on either side.
13039         A more rigorous approach would involve computing least squared value of results with respect to intervals
13040         but that seems like an overkill for a simple UI problem; it's also computationally expensive.
13042         * public/index.html:
13043         (Chart..adjustedIntervalForRun): Extracted from computeYAxisBoundsToFitLines.
13044         (Chart..computeYAxisBoundsToFitLines): Compute the min. and max. adjusted intervals out of adjusted intervals
13045         for each runs (current, baseline, and target) so that at least one point from each set of results is shown.
13046         We wouldn't see the difference between measured values versus baseline and target values otherwise.
13047         * public/js/helper-classes.js:
13048         (PerfTestResult.unscaledConfidenceIntervalDelta): Returns the default value if the confidence
13049         interval delta cannot be computed.
13050         (PerfTestResult.isInUnscaledInterval): Added. Returns true iff the confidence intervals lies
13051         within the given interval.
13052         (PerfTestRuns..filteredResults): Extracted from unscaledMeansForAllResults now that PerfTestRuns.min and
13053         PerfTestRuns.max need to use both mean and confidence interval delta for each result.
13054         (PerfTestRuns..unscaledMeansForAllResults):
13055         (PerfTestRuns.min): Take the confidence interval delta into account.
13056         (PerfTestRuns.max): Ditto.
13057         (PerfTestRuns.countResults): Returns the number of results in the given time frame (> minTime).
13058         (PerfTestRuns.countResultsInInterval): Returns the number of results whose confidence interval lie within the
13059         given interval.
13060         (PerfTestRuns.exponentialMovingArithmeticMean): Fixed the typo so that it actually computes the EWMA.
13062 2014-03-31  Ryosuke Niwa  <rniwa@webkit.org>
13064         Some CSS tweaks after r166477 and r166479,
13066         * public/index.html:
13068 2014-03-30  Ryosuke Niwa  <rniwa@webkit.org>
13070         WebKitPerfMonitor: Sometimes text inside panes overlap
13071         https://bugs.webkit.org/show_bug.cgi?id=130956
13073         Reviewed by Gyuyoung Kim.
13075         Revamped the pane UI. Now build info uses table element instead of plane text with BRs. The computed status of
13076         the latest result against baseline/target such as "3% until target" is now shown above the current value. This
13077         reduces the total height of the pane and fits more information per screen capita on the dashboard.
13079         * public/index.html: Updated and added a bunch of CSS rules for the new look.
13080         (.computeStatus): Don't append the build info here. The build info is constructed as a separate table now.
13081         (.createSummaryRowMarkup): Use th instead of td for "Current", "Baseline", and "Target" in the summary table.
13082         (.buildLabelWithLinks): Construct table rows instead of br separated lines of text. This streamlines the look
13083         of the build info shown in a chart pane and a tooltip.
13084         (Chart): Made .status a table.
13085         (Chart.populate): Prepend status.text, which contains text such as "3% until target", into the summary rows
13086         right above "Current" value, and populate .status with buildLabelWithLinks manually instead of status.text
13087         now that status.text no longer contains it.
13088         (Chart..showTooltipWithResults):  Wrap buildLabelWithLinks with a table element.
13090         * public/js/helper-classes.js:
13091         (TestBuild.formattedRevisions): Don't include repository names in labels since repository names are now added
13092         by buildLabelWithLinks inside th elements. Also place spaces around '-' between two different OS X versions.
13093         e.g. "OS X 10.8 - OS X 10.9" instead of "OS X 10.8-OS X 10.9".
13094         (PerfTestRuns): Use "/s" for "runs/s" and "B" for "bytes" to make text shorter in .status and .summaryTable.
13095         (PerfTestRuns..computeScalingFactorIfNeeded): Avoid placing a space between 'M' and a unit starting with a
13096         capital letter; e.g. "MB" instead of "M B".
13098 2014-03-30  Ryosuke Niwa  <rniwa@webkit.org>
13100         WebKitPerfMonitor: Header and number-of-days slider takes up too much space
13101         https://bugs.webkit.org/show_bug.cgi?id=130957
13103         Reviewed by Gyuyoung Kim.
13105         Moved the slider into the header. Also reduced the spacing between the header and platform names.
13106         This reclaims 50px Ã— width of the screen real estate.
13108         * public/common.css:
13109         (#title): Reduced the space below the header from 20px to 10px.
13110         * public/index.html:
13111         (#numberOfDaysPicker): Removed the rounded border around the number-of-days slider.
13112         (#dashboard > tbody > tr > td): Added a 1.5em padding at the bottom.
13113         (#dashboard > thead th): That allows us to remove the padding at the top here. This reduces the wasted screen
13114         real estate between the header and the platform names.
13116 2014-03-10  Zoltan Horvath  <zoltan@webkit.org>
13118         Update the install guidelines for perf.webkit.org
13119         https://bugs.webkit.org/show_bug.cgi?id=129895
13121         Reviewed by Ryosuke Niwa.
13123         The current install guideline for perf.webkit.org discourages the use of the installed
13124         Server application. I've actualized the documentation for Mavericks, and modified the
13125         guideline to include the instructions for Server.app also.
13127         * Install.md:
13129 2014-03-08  Zoltan Horvath  <zoltan@webkit.org>
13131         Update perf.webkit.org json example
13132         https://bugs.webkit.org/show_bug.cgi?id=129907
13134         Reviewed by Andreas Kling.
13136         The current example is not valid json syntax. I fixed the syntax errors and indented the code properly.
13138         * ReadMe.md:
13140 2014-01-31  Ryosuke Niwa  <rniwa@webkit.org>
13142         Merge database-common.js and utility.js into run-tests.js.
13144         Reviewed by Matthew Hanson.
13146         Now that run-tests is the only node.js script, merged database-common.js and utility.js into it.
13147         Also moved init-database.sql out of the database directory and removed the directory entirely.
13149         * database: Removed.
13150         * database/database-common.js: Removed.
13151         * database/utility.js: Removed.
13152         * init-database.sql: Moved from database/init-database.sql.
13153         * run-tests.js:
13154         (connect): Moved from database-common.js.
13155         (pathToDatabseSQL): Extracted from pathToLocalScript.
13156         (pathToTests): Moved from database-common.js.
13157         (config): Ditto.
13158         (TaskQueue): Ditto.
13159         (SerializedTaskQueue): Ditto.
13160         (main):
13161         (initializeDatabase):
13162         (TestEnvironment.it):
13163         (TestEnvironment.queryAndFetchAll):
13164         (sendHttpRequest):
13166 2014-01-30  Ryosuke Niwa  <rniwa@webkit.org>
13168         Remove the dependency on node.js from the production code.
13170         Reviewed by Ricky Mondello.
13172         Work towards <rdar://problem/15955053> Upstream SafariPerfMonitor.
13174         Removed node.js dependency from TestRunsGenerator. It was really a design mistake to invoke node.js from php.
13175         It added so much complexity with only theoretical extensibility of adding aggregators.  It turns out that
13176         many aggregators we'd like to add are a lot more complicated than ones that could be written under the current
13177         infrastructure, and we need to make the other aspects (e.g. the level of aggregations) a lot more extensible.
13178         Removing and simplifying TestRunsGenerator allows us to implement such extensions in the future.
13180         Also removed the js files that are no longer used.
13182         * config.json: Moved from database/config.json.
13183         * database/aggregate.js: Removed. No longer used.
13184         * database/database-common.js: Removed unused functions, and updated the path to config.json.
13185         * database/process-jobs.js: Removed. No longer used.
13186         * database/sample-data.sql: Removed. We have a much better corpus of data now.
13187         * database/schema.graffle: Removed. It's completely obsolete.
13188         * public/include/db.php: Updated the path to config.json.
13189         * public/include/evaluator.js: Removed.
13191         * public/include/report-processor.php:
13192         (TestRunsGenerator::aggregate): Directly aggregate values via newly added aggregate_values method instead of
13193         storing values into $expressions and calling evaluate_expressions_by_node.
13194         (TestRunsGenerator::aggregate_values): Added.
13195         (TestRunsGenerator::compute_caches): Directly compute the caches.
13197 2014-01-30  Ryosuke Niwa  <rniwa@webkit.org>
13199         Build fix. Don't fail the platform merges even if there are no test configurations to be moved to the new platform.
13201         * public/admin/platforms.php:
13202         * public/include/db.php:
13204 2014-01-30  Ryosuke Niwa  <rniwa@webkit.org>
13206         Zoomed y-axis view is ununsable when the last result is an outlier.
13208         Reviewed by Stephanie Lewis.
13210         Show two standard deviations from the exponential moving average with alpha = 0.3 instead of the mean of
13211         the last result so that the graph looks sane if the last result was an outlier. However, always show
13212         the last result's mean even if it was an outlier.
13214         * public/index.html:
13215         * public/js/helper-classes.js:
13216         (unscaledMeansForAllResults): Extracted from min/max/sampleStandardDeviation.
13217         Also added the ability to cache the unscaled means to avoid recomputation.
13218         (PerfTestRuns.min): Refactored to use unscaledMeansForAllResults.
13219         (PerfTestRuns.max): Ditto.
13220         (PerfTestRuns.sampleStandardDeviation): Ditto.
13221         (PerfTestRuns.exponentialMovingArithmeticMean): Added.
13223 2014-01-30  Ryosuke Niwa  <rniwa@webkit.org>
13225         Minor fixes.
13227         * public/admin/tests.php:
13228         * public/js/helper-classes.js:
13230 2014-01-29  Ryosuke Niwa  <rniwa@webkit.org>
13232         Use two standard deviations instead as I mentioned in the mailing list.
13234         * public/index.html:
13236 2014-01-28  Ryosuke Niwa  <rniwa@webkit.org>
13238         The performance dashboard erroneously shows upward arrow for combined metrics.
13240         A single outlier can ruin the zoomed y-axis view.
13242         Rubber-stamped by Antti Koivisto.
13244         * public/index.html:
13245         (computeYAxisBoundsToFitLines): Added adjustedMax and adjustedMin, which are pegged at 4 standard deviations
13246         from the latest results' mean.
13247         (Chart): Renamed shouldStartYAxisAtZero to shouldShowEntireYAxis.
13248         (Chart.attachMainPlot): Use the adjusted max and min when we're not showing the entire y-axis.
13249         (Chart.toggleYAxis):
13250         * public/js/helper-classes.js:
13251         (PerfTestRuns.sampleStandardDeviation): Added.
13252         (PerfTestRuns.smallerIsBetter): 'Combined' is a smaller is better metric.
13254 2014-01-28  Ryosuke Niwa  <rniwa@webkit.org>
13256         Don't include the confidence interval when computing the y-axis.
13258         Rubber-stamped by Simon Fraser.
13260         * public/js/helper-classes.js:
13261         (PerfTestRuns.min):
13262         (PerfTestRuns.max):
13264 2014-01-25  Ryosuke Niwa  <rniwa@webkit.org>
13266         Tiny CSS tweak for tooltips.
13268         * public/index.html:
13270 2014-01-25  Ryosuke Niwa  <rniwa@webkit.org>
13272         Remove the erroneously repeated code.
13274         * public/admin/test-configurations.php:
13276 2014-01-24  Ryosuke Niwa  <rniwa@webkit.org>
13278         <rdar://problem/15704893> perf dashboard should show baseline numbers
13280         Reviewed by Stephanie Lewis.
13282         * public/admin/bug-trackers.php:
13283         (associated_repositories): Return an array of HTMLs instead of echo'ing as expected by AdministrativePage.
13284         Also fixed a typo.
13286         * public/admin/platforms.php:
13287         (merge_list): Ditto.
13289         * public/admin/test-configurations.php: Added.
13290         (add_run): Adds a "synthetic" test run and a corresponding build. It doesn't create run_iterations and
13291         build_revisions as they're not meaningful for baseline / target numbers.
13292         (delete_run): Deletes a synthetic test run and its build. It verifies that the specified build has exactly
13293         one test run so that we don't accidentally delete a reported test run.
13294         (generate_rows_for_configurations): Generates rows of configuration IDs and types.
13295         (generate_rows_for_test_runs): Ditto for test runs. It also emits the form to add new "synthetic" test runs
13296         and delete existing ones.
13298         * public/admin/tests.php: We wrongfully assumed there is exactly one test configuration for each metric
13299         on each platform; there could be configurations of distinct types such as "current" and "baseline".
13300         Thus, update all test configurations for a given metric when updating config_is_in_dashboard.
13302         * public/api/runs.php: Remove the NotImplemented when we have multiple test configurations.
13303         (fetch_runs_for_config): "Synthetic" test runs created on test-configurations page are missing revision
13304         data so we need to left-outer-join (instead of inner-join) build_revisions. To avoid making the query
13305         unreadable, don't join revision_repository here. Instead, fetch the list of repositories upfront and
13306         resolve names in parse_revisions_array. This actually reduces the query time by ~10%.
13308         (parse_revisions_array): Skip an empty array created for "synthetic" test runs.
13310         * public/include/admin-header.php:
13311         (AdministrativePage::render_table): Now custom columns support sub columns. e.g. a configuration column may
13312         have id and type sub columns, and each custom column could generate multiple rows.
13314         Any table with sub columns now generates two rows for thead. We generate td's in in the first row without
13315         sub columns with rowspan of 2, and generate ones with sub columns with colspan set to the sub column count.
13316         We then proceed to generate the second header row with sub column names.
13318         When generating the actual content, we first generate all custom columns as they may have multiple rows in
13319         which case regular columns need rowspan set to the maximum number of rows.
13321         Once we've generated the first row, we proceed to generate subsequent rows for those custom columns that
13322         have multiple rows.
13324         (AdministrativePage::render_custom_cells): Added. This function is responsible for generating table cells
13325         for a given row in a given custom column. It generates an empty td when the custom column doesn't have
13326         enough rows. It also generates empty an td when it doesn't have enough columns in some rows except when
13327         the entire row consists of exactly one cell for a custom column with sub columns, in which case the cell is
13328         expanded to occupy all sub columns.
13330         * public/include/manifest.php:
13331         (ManifestGenerator::platforms): Don't add the metric more than once.
13333         * public/include/test-name-resolver.php:
13334         (TestNameResolver::__construct): We had wrongfully assumed that we have exactly one test configuration on
13335         each platform for each metric like tests.php. Fixed that. Also fetch the list of aggregators to compute the
13336         full metric name later.
13337         (TestNameResolver::map_metrics_to_tests): Populate $this->id_to_metric.
13338         (TestNameResolver::test_id_for_full_name): Simplified the code using array_get.
13339         (TestNameResolver::full_name_for_test): Added.
13340         (TestNameResolver::full_name_for_metric): Added.
13341         (TestNameResolver::configurations_for_metric_and_platform): Renamed as it returns multiple configurations.
13343         * public/js/helper-classes.js:
13344         (TestBuild): Use the build time as the maximum time when revision information is missing for "synthetic"
13345         test runs created to set baseline and target points.
13347 2014-01-24  Ryosuke Niwa  <rniwa@webkit.org>
13349         Build fix after r57928. Removed a superfluous close parenthesis.
13351         * public/api/runs.php:
13353 2014-01-24  Ryosuke Niwa  <rniwa@webkit.org>
13355         Unreviewed build & typo fixes.
13357         * public/admin/platforms.php:
13358         * tests/admin-platforms.js:
13360 2014-01-24  Ryosuke Niwa  <rniwa@webkit.org>
13362         <rdar://problem/15704893> perf dashboard should show baseline numbers
13364         Rubber-stamped by Antti Koivisto.
13366         Organize some code into functions in runs.php.
13368         Also added back $paths that was erroneously removed in r57925 from json-header.php.
13370         * public/api/runs.php:
13371         (fetch_runs_for_config): Extracted.
13372         (format_run): Ditto.
13374 2014-01-23  Ryosuke Niwa  <rniwa@webkit.org>
13376         Merge the upstream json-shared.php as of https://trac.webkit.org/r162693.
13378         * database/config.json:
13379         * public/admin/reprocess-report.php:
13380         * public/api/report.php:
13381         * public/api/runs.php:
13382         * public/include/json-header.php:
13384 2014-01-23  Ryosuke Niwa  <rniwa@webkit.org>
13386         Commit yet another forgotten change.
13388         Something went horribly wrong with my merge :(
13390         * database/init-database.sql:
13392 2014-01-23  Ryosuke Niwa  <rniwa@webkit.org>
13394         Commit one more forgotten change. Sorry for making a mess here.
13396 2014-01-23  Ryosuke Niwa  <rniwa@webkit.org>
13398         Commit the forgotten files.
13400         * public/admin/platforms.php: Added.
13401         * tests/admin-platforms.js: Added.
13403 2014-01-23  Ryosuke Niwa  <rniwa@webkit.org>
13405         <rdar://problem/15889905> SafariPerfMonitor: there should be a way to merge and hide platforms
13407         Reviewed by Stephanie Lewis.
13409         Added /admin/platforms/ page to hide and merge platforms.
13411         Merging two platforms is tricky because we need to migrate test runs as well as some test configurations.
13412         Recall that each test (e.g. Dromaeo) can have many "test metrics" (e.g. MaxAllocations, EndAllocations),
13413         and they have a distinct "test configuration" for each platform (e.g. MaxAllocation on Mountain Lion), and
13414         each test configuration a distinct "test run" for each build.
13416         In order to merge platform A into platform B, we must migrate all test runs that belong to platform A via
13417         their test configurations into platform B.
13419         Suppose we're migrating a test run R for test configuration T_A in platform A for metric M. Since M exists
13420         independent of platforms, R should continue to relate to M through some test configuration. Unfortunately,
13421         we can't simply move T_A into platform B since we may already have a test configuration T_B for metric M
13422         in platform B, in which case R should relate to T_B instead.
13424         Thus, we first migrate all test runs for which we already have corresponding test configurations in the
13425         new platform. We then migrate the test configurations of the remaining test runs.
13427         * database/init-database.sql: Added platform_hidden.
13429         * public/admin/platforms.php: Added.
13430         (merge_platforms): Added. Implements the algorithm described above.
13431         (merge_list): Added.
13433         * public/admin/tests.php: Disable the checkbox to show a test configuration on the dashboard if its platform
13434         is hidden since it doesn't do anything.
13436         * public/include/admin-header.php: Added the hyperlink to /admin/platforms.
13437         (update_field): Don't bail out if the newly added "update-column" is set to the field name even if $_POST is
13438         missing it since unchecked checkbox doesn't set the value in $_POST.
13439         (AdministrativePage::render_form_control_for_column): Added the support for boolean edit mode. Also used
13440         switch statement instead of repeated if's.
13441         (AdministrativePage::render_table): Emit "update-column" for update_field.
13443         * public/include/db.php: Disable warnings when we're not in the debug mode.
13445         * public/include/manifest.php:
13446         (ManifestGenerator::platforms): Skip platforms that have been hidden.
13448         * run-tests.js:
13449         (TestEnvironment.postJSON):
13450         (TestEnvironment.httpGet):
13451         (TestEnvironment.httpPost): Added.
13452         (sendHttpRequest): Set the content type if specified.
13454         * tests/admin-platforms.js: Added tests.
13456 2014-01-22  Ryosuke Niwa  <rniwa@webkit.org>
13458         Extract the code to compute full test names from tests.php.
13460         Reviewed by Stephanie Lewis.
13462         Extracted TestNameResolver out of tests.php. This reduces the number of global variables in tests.php
13463         and paves our way to re-use the code in other pages.
13465         * public/admin/tests.php:
13467         * public/include/db.php:
13468         (array_set_default): Renamed from array_item_set_default and moved from tests.php as it's used in both
13469         tests.php and test-name-resolver.php.
13471         * public/include/test-name-resolver.php: Added.
13472         (TestNameResolver::__construct):
13473         (TestNameResolver::compute_full_name): Moved from tests.php.
13474         (TestNameResolver::map_metrics_to_tests): Ditto.
13475         (TestNameResolver::sort_tests_by_full_name): Ditto.
13476         (TestNameResolver::tests): Added.
13477         (TestNameResolver::test_id_for_full_name): Ditto.
13478         (TestNameResolver::metrics_for_test_id): Ditto.
13479         (TestNameResolver::child_metrics_for_test_id): Ditto.
13480         (TestNameResolver::configuration_for_metric_and_platform): Ditto.
13482 2014-01-21  Ryosuke Niwa  <rniwa@webkit.org>
13484         <rdar://problem/15867325> Perf dashboard is erroneously associating reported results with old revisions
13486         Reviewed by Stephanie Lewis.
13488         Add the ability to reprocess reports so that I can re-associate wrongfully associated reports.
13490         Added public/admin/reprocess-report.php. It doesn't have any nice UI to find reports and it returns JSON
13491         but that's sufficient to correct the wrongfully processed reports for now.
13493         * public/admin/reprocess-report.php: Added. Takes a report id in $_GET or $_POST and process the report.
13494         We should eventually add a nice UI to find and reprocess reports.
13496         * public/api/report.php: ReportProcessor and TestRunsGenerator have been removed.
13498         * public/include/db.php: Added the forgotten call to prefixed_column_names.
13500         * public/include/report-processor.php: Copied from public/api/report.php.
13501         (ReportProcessor::__construct): Fetch the list of aggregators here for simplicity.
13502         (ReportProcessor::process): Optionally takes $existing_report_id. When this value is specified, we don't
13503         create a new report or authenticate the builder password (the password is never stored in the report).
13504         Also use select_first_row instead of query_and_fetch_all to find the builder for simplicity.
13505         (ReportProcessor::construct_build_data): Extracted from store_report_and_get_build_data.
13506         (ReportProcessor::store_report): Ditto.
13508         * tests/admin-reprocess-report.js: Added.
13510 2014-01-21  Ryosuke Niwa  <rniwa@webkit.org>
13512         <rdar://problem/15867325> Perf dashboard is erroneously associating reported results with old revisions
13514         Reviewed by Ricky Mondello.
13516         The bug was caused by a build fix r57645. It attempted to treat multiple reports from the same builder
13517         for the same build number as a single build by ignoring build time. This was necessary to associate
13518         multiple reports by a single build - e.g. for different performance test suites - because the scripts
13519         we use to submit results computed its own "build time" when they're called.
13521         An unintended consequence of this change was revealed when we moved a buildbot master to the new machine
13522         last week; new reports were wrongfully associated with old build numbers.
13524         Fixed the bug by not allowing reports made more than 1 day after the initial build time to be assigned
13525         to the same build. Instead, we create a new build object for those reports. Since the longest set of
13526         tests we have only take a couple of hours to run, 24 hours should be more than enough.
13528         * database/init-database.sql: We can no longer constrain that each build number is unique to a builder
13529         or that build number and build time pair is unique. Instead, constrain the uniqueness of the tuple
13530         (builder, build number, build time).
13532         * public/api/report.php:
13533         (ReportProcessor::resolve_build_id): Look for any builds made within the past one day. Create a new build
13534         when no such build exists. This prevents a report from being associated with a very old build of the same
13535         build number.
13537         Also check that revision numbers or hashes match when we're adding revision info. This will let us catch
13538         a similar bug in the future sooner.
13540         * tests/api-report.js: Added three test cases.
13542 2014-01-20  Ryosuke Niwa  <rniwa@webkit.org>
13544         Merged the upstream changes to db.php
13545         See http://trac.webkit.org/browser/trunk/Websites/test-results/public/include/db.php
13547         * public/include/db.php:
13549 2014-01-20  Ryosuke Niwa  <rniwa@webkit.org>
13551         Update other scripts and tests per previous patch.
13553         * public/include/manifest.php:
13554         * tests/admin-regenerate-manifest.js:
13556 2014-01-20  Ryosuke Niwa  <rniwa@webkit.org>
13558         Remove metrics_unit.
13560         Reviewed by Ricky Mondello.
13562         This column is no longer used by the front-end code since r48360.
13564         * database/init-database.sql:
13565         * public/admin/tests.php:
13567 2014-01-16  Ryosuke Niwa  <rniwa@webkit.org>
13569         Unreviewed build fix.
13571         * public/api/report.php:
13573 2014-01-15  Ryosuke Niwa  <rniwa@webkit.org>
13575         <rdar://problem/15832456> Automate DoYouEvenBench (124497)
13577         Reviewed by Ricky Mondello.
13579         Support a new alternative format for aggregated results where we have raw values as well as
13580         the list aggregators so that instead of
13581         "metrics": {"Time": ["Arithmetic"]}
13582         we can have
13583         "metrics": {"Time": { "aggregators" : ["Arithmetic"], "current": [300, 310, 320, 330] }}
13585         This allows single JSON generated by run-perf-tests in WebKit to be shared between the perf
13586         dashboard and the generated results page, which doesn't know how to aggregate values.
13588         We need to keep the support for the old format because all other existing performance tests
13589         all rely on the old format. Even if we updated the tests, we need the dashboard to support
13590         the old format during the transition.
13592         * public/api/report.php:
13593         (ReportProcessor::recursively_ensure_tests): Support the new format in addition to the old one.
13594         (ReportProcessor::aggregator_list_if_exists): Replaced is_list_of_aggregators.
13596         * tests/api-report.js: Updated one of aggregator test cases to test the new format.
13598 2013-05-31  Ryosuke Niwa  <rniwa@webkit.org>
13600         Unreviewed; Tweak the CSS so that chart panes align vertically.
13602         * public/index.html:
13604 2013-05-31  Ryosuke Niwa  <rniwa@webkit.org>
13606         SafariPerfMonitor should support Combined metric.
13608         * public/js/helper-classes.js:
13609         (PerfTestRuns): Added 'Combined' metric. In general, it could be used for smaller-is-better
13610         value as well but assume it to be greater-is-better for now.
13612 2013-05-30  Ryosuke Niwa  <rniwa@webkit.org>
13614         Commit the forgotten init-database change to add iteration_relative_time.
13616         * database/init-database.sql:
13618 2013-05-30  Ryosuke Niwa  <rniwa@webkit.org>
13620         <rdar://problem/13993069> SafariPerfMonitor: Support accepting (relative time, value) pairs
13622         Reviewed by Ricky Mondello.
13624         Add the support for each value to have a relative time. This is necessary for frame rate history
13625         since a frame rate needs to be associated with a time it was sampled.
13627         * database/init-database.sql: Added iteration_relative_time to run_iterations.
13629         * public/api/report.php:
13630         (TestRunsGenerator::test_value_list_to_values_by_iterations): Reject any non-numeral values here.
13631         This code is used to aggregate values but it doesn't make sense to aggregate iteration values
13632         with relative time since taking the average of two frame rates for two subtests taken at two
13633         different times doesn't make any sense.
13634         (TestRunsGenerator::compute_caches): When we encounter an array value while computing sum, mean,
13635         etc..., use the second element since we assume values are of the form (relative time, frame rate).
13636         Also exit early with an error if the number of elements in the array is not a pair.
13637         (TestRunsGenerator::commit): Store the relative time and the frame rate as needed.
13639         * tests/api-report.js: Added a test case. Also modified existing test cases to account for
13640         iteration_relative_time.
13642 2013-05-27  Ryosuke Niwa  <rniwa@webkit.org>
13644         <rdar://problem/13654488> SafariPerfMonitor: Support accepting single-value results
13646         Reviewed by Ricky Mondello.
13648         Support that. It's one line change.
13650         * public/api/report.php:
13651         (ReportProcessor.recursively_ensure_tests): When there is exactly one value, wrap it inside an array
13652         to match the convention assumed elsewhere.
13653         * tests/api-report.js: Added a test case.
13655 2013-05-26  Ryosuke Niwa  <rniwa@webkit.org>
13657         SafariPerfMonitor shows popups for points outside of the visible region.
13659         Rubber-stamped by Simon Fraser.
13661         * public/index.html:
13662         (Chart.closestItemForPageXRespectingPlotOffset): renamed from closestItemForPageX.
13663         (Chart.attach): Always use closestItemForPageXRespectingPlotOffset to work around the fact flot
13664         may return an item underneath y-axis labels.
13666 2013-05-26  Ryosuke Niwa  <rniwa@webkit.org>
13668         Tweak the CSS a little to avoid the test name overlapping with the summary table.
13670         * public/index.html:
13672 2013-05-26  Ryosuke Niwa  <rniwa@webkit.org>
13674         Unreviewed. Fix the typo. The anchor element should wrap the svg element, not the other way around.
13676         * public/index.html:
13678 2013-05-26  Ryosuke Niwa  <rniwa@webkit.org>
13680         <rdar://problem/13992266> Should be a toggle to show entire Y-axis range
13681         <rdar://problem/13992271> Should scale Y axis to include error ranges
13683         Reviewed by Ricky Mondello.
13685         Add the feature. Also made adjust y-axis respect confidence interval delta so that the gray shade behind
13686         the main graph doesn't go outside the graph even when the y-axis is adjusted.
13688         * database/config.json:
13689         * public/index.html:
13690         (Chart): Add a SVG arrow to toggle y-axis mode, and bind click on the arrow to toggleYAxis().
13691         (Chart.attachMainPlot): Respect shouldStartYAxisAtZero.
13692         (Chart.toggleYAxis): Toggle the y-axis mode of this chart by toggling shouldStartYAxisAtZero and calling
13693         attachMainPlot.
13694         * public/js/helper-classes.js:
13695         (PerfTestResult.confidenceIntervalDelta):
13696         (PerfTestResult.unscaledConfidenceIntervalDelta): Extracted.
13697         (PerfTestRuns.min): Take confidence interval delta into account.
13698         (PerfTestRuns.max): Ditto.
13699         (PerfTestRuns.hasConfidenceInterval): Not sure why this function was checking the typeof. Just use isNaN.
13701 2013-04-26  Ryosuke Niwa  <rniwa@webkit.org>
13703         A build fix of the previous. Don't look for a test with NULL parent because NULL != NULL in our beloved SQL.
13705         * public/api/report.php:
13706         (ReportProcessor::recursively_ensure_tests):
13707         * tests/api-report.js: Added a test.
13709 2013-04-26  Ryosuke Niwa  <rniwa@webkit.org>
13711         Unreviewed build fixes.
13713         * public/api/report.php:
13714         (ReportProcessor::process): Explicitly exit with error when builder name or build time is missing.
13715         Also, tolerate reports without any revision information.
13717         (ReportProcessor::recursively_ensure_tests): When looking for a test, don't forget to compare its
13718         parent test.
13720         * tests/api-report.js: Added few test cases.
13722 2013-04-26  Ryosuke Niwa  <rniwa@webkit.org>
13724         Commit another change that was supposed to be committed in r50331.
13726         * run-tests.js:
13727         (TestEnvironment.this.postJSON):
13728         (TestEnvironment.this.httpGet):
13729         (sendHttpRequest):
13731 2013-04-09  Ryosuke Niwa  <rniwa@webkit.org>
13733         Commit the remaining files.
13735         * public/admin/regenerate-manifest.php:
13736         * public/include/admin-header.php:
13737         * public/include/json-header.php:
13738         * public/include/manifest.php:
13739         * run-tests.js:
13740         (TestEnvironment.this.postJSON):
13741         (TestEnvironment.this.httpGet):
13742         (sendHttpRequest):
13744 2013-03-15  Ryosuke Niwa  <rniwa@webkit.org>
13746         SafariPerfMonitor: Add some tests for admin/regenerate-manifest.
13748         Reviewed by Ricky Mondello.
13750         Added some tests for admin/regenerate-manifest.
13752         * public/admin/regenerate-manifest.php: Use require_once instead of require.
13753         * public/include/admin-header.php: Ditto.
13754         * public/include/json-header.php: Ditto.
13756         * public/include/manifest.php:
13757         (ManifestGenerator::builders): Removed a reference to a non-existent variable.
13758         When there are no builders, simply return an empty array.
13760         * run-tests.js:
13761         (TestEnvironment.postJSON):
13762         (TestEnvironment.httpGet): Added.
13763         (sendHttpRequest): Renamed from postHttpRequest as it now takes method as an argument.
13765         * tests/admin-regenerate-manifest.js: Added with a bunch of test cases.
13767 2013-03-14  Ryosuke Niwa  <rniwa@webkit.org>
13769         Unreviewed. Added more tests for api/report to ensure it creates tests, metrics, test_runs,
13770         and run_iterations. Also fixed a typo in report.php found by new tests.
13772         * public/api/report.php:
13773         (main): Fix a bug in the regular expression to wrap numbers with double quotations.
13774         * tests/api-report.js: Added more test cases.
13776 2013-03-12  Ryosuke Niwa  <rniwa@webkit.org>
13778         <rdar://problem/13399038> SafariPerfMonitor: Need integration tests
13780         Reviewed by Ricky Mondello.
13782         Add a test runner script and some simple test cases.
13784         * database/config.json: Added the configuration for "testServer".
13785         * database/database-common.js:
13786         (pathToTests): Added.
13787         * run-tests.js: Added.
13788         (main):
13790         (confirmUserWantsDatabaseToBeInitializedIfNeeded): Checks whether there are any non-empty tables,
13791         and if there are, asks the user if it’s okay to delete all of the data contained therein.
13792         (confirmUserWantsDatabaseToBeInitializedIfNeeded.findNonEmptyTable): Find a table with non-zero
13793         number of rows.
13794         (confirmUserWantsDatabaseToBeInitializedIfNeeded.fetchTableNames): Fetch the list of all tables
13795         in the current database using PostgreSQL's information_schema.
13796         (askYesOrNoQuestion):
13798         (initializeDatabase): Executes init-database.sql. It drops all tables and creates them again.
13800         (TestEnvironment): The global object exposed in tests. Provides various utility functions.
13801         (TestEnvironment.assert): Exposes assert to tests.
13802         (TestEnvironment.console): Exposes console to tests.
13803         (TestEnvironment.describe): Adds a description.
13804         (TestEnvironment.it): Adds a test case.
13805         (TestEnvironment.postJSON):
13806         (TestEnvironment.queryAndFetchAll):
13807         (TestEnvironment.sha256):
13808         (TestEnvironment.notifyDone): Ends the current test case.
13810         (postHttpRequest):
13812         (TestContext): An object created for each test case. Conceptually, this object is always on
13813         "stack" when a test case is running. TestEnvironment and an uncaughtException handler accesses
13814         this object via currentTestContext.
13815         (TestContext.description):
13816         (TestContext.done):
13817         (TestContext.logError):
13819         * tests: Added.
13820         * tests/api-report.js: Added some basic tests for /api/report.php.
13822 2013-03-08  Ryosuke Niwa  <rniwa@webkit.org>
13824         Unreviewed administrative page fix. Make it possible to remove all configuration from dashboard.
13826         The problem was that we were detecting whether we're updating dashboard or not by checking
13827         the existence of metric_configurations in $_POST but this key doesn't exist when we're removing
13828         all configurations. Use separate 'dashboard' action to execute the code even when
13829         metric_configurations is empty.
13831         * public/admin/tests.php:
13833 2013-03-08  Ryosuke Niwa  <rniwa@webkit.org>
13835         SafariPerfMonitor: Extract a class to aggregate and store values from ReportProcessor.
13837         Reviewed by Ricky Mondello.
13839         This patch extracts TestRunsGenerator, which aggregates and compute caches of values,
13840         from ReportProcessor as a preparation to replace deprecated aggregate.js.
13842         * public/api/report.php:
13843         (ReportProcessor::exit_with_error): Moved.
13844         (ReportProcessor::process): Use the extracted TestRunsGenerator.
13845         (TestRunsGenerator): Added.
13846         (TestRunsGenerator::exit_with_error): Copied from ReportProcessor.
13847         (TestRunsGenerator::add_aggregated_metric): Moved.
13848         (TestRunsGenerator::add_values_for_aggregation): Moved. Made public.
13849         (TestRunsGenerator::aggregate): Moved. Made public.
13850         (TestRunsGenerator::aggregate_current_test_level): Moved.
13851         (TestRunsGenerator::test_value_list_to_values_by_iterations): Moved.
13852         (TestRunsGenerator::evaluate_expressions_by_node): Moved.
13853         (TestRunsGenerator::compute_caches): Moved. Made public.
13854         (TestRunsGenerator::add_values_to_commit): Moved. Made public.
13855         (TestRunsGenerator::commit): Moved. Made public. Also takes build_id and platform_id.
13856         (TestRunsGenerator::rollback_with_error): Moved.
13858 2013-03-08  Ryosuke Niwa  <rniwa@webkit.org>
13860         SafariPerfMonitor: Administrative pages should update manifest JSON as needed.
13862         Reviewed by Remy Demarest.
13864         Regenerate the manifest file when updating fields or adding new items that are included in
13865         the manifest JSON.
13867         * public/admin/bug-trackers.php:
13868         * public/admin/builders.php:
13869         * public/admin/regenerate-manifest.php:
13870         * public/admin/repositories.php:
13871         * public/admin/tests.php:
13872         * public/include/admin-header.php:
13873         (regenerate_manifest): Extracted from regenerate-manifest.php.
13875 2013-03-08  Ryosuke Niwa  <rniwa@webkit.org>
13877         Unreviewed build fix for memory test results.
13879         Make aggregation work in the nested cases. We start from the "leaf" tests and move our ways up,
13880         aggregating at each level.
13882         * public/api/report.php:
13883         (ReportProcessor::recursively_ensure_tests):
13884         (ReportProcessor::add_aggregated_metric): Renamed from ensure_aggregated_metric.
13885         (ReportProcessor::add_values_for_aggregation):
13886         (ReportProcessor::aggregate):
13887         (ReportProcessor::aggregate_current_test_level): Extracted from aggregate.
13889 2013-03-02  Ryosuke Niwa  <rniwa@webkit.org>
13891         Build fixes. iteration_count_cache should be the total number of values in all iteration group,
13892         not the number of iteration groups. Also, don't set group number when the entire run belongs
13893         a single iteration group.
13895         * public/api/report.php:
13896         (ReportProcessor::commit):
13898 2013-03-01  Ryosuke Niwa  <rniwa@webkit.org>
13900         SafariPerfMonitor: Introduce iteration groups
13902         Reviewed by Remy Demarest.
13904         In WebKit land, we're going to use multiple instances of DumpRenderTree or WebKitTestRunner to amortize
13905         the runtime environment variances to get more stable results. And it's desirable to keep track of
13906         the instance of DumpRenderTree or WebKitTestRunner used to generate each iteration value.
13908         This patch introduces "iteration groups" to keep track of this extra information.
13910         Instead of receiving a flat array of iteration values, we can now receive a two dimensional array where
13911         the outer array denotes iteration groups and each inner array contains iteration values for each group.
13914         * database/init-database.sql: Add iteration_group column.
13915         * public/api/report.php:
13916         (ReportProcessor::recursively_ensure_tests): Always use the two dimensional array internally.
13918         (ReportProcessor::aggregate): test_value_list_to_values_by_iterations now returns an associative array
13919         contains the list of values indexed by the iteration order and group sizes. Store the group size so
13920         that we can restore the iteration groups before passing it to node.js and restore them later.
13922         (ReportProcessor::test_value_list_to_values_by_iterations): Flatten iteration groups into an array
13923         of values and construct group_size array to restore the groups later in ReportProcessor::aggregate.
13925         Also check that each iteration group in each subtest are consistent with one another. To see why we need
13926         to do this, suppose we're aggregating two tests T1 and T2 with the following values. Then it's important
13927         that each iteration group in T1 and T2 have the same size:
13928         T1 = [[1, 2], [3, 4, 5]]
13929         T2 = [[6, 7], [8, 9, 10]]
13931         so that the aggregated result (the sum in this case) can have the same groups as in:
13932         T  = [[7, 9], [11, 13, 15]]
13934         If some iteration groups in T1 and T2 had a different size as in:
13935         T1 = [[1, 2, 3], [4, 5]]
13936         T2 = [[6, 7], [8, 9, 10]]
13938         Then iteration groups of the aggregated T is ambiguous.
13940         (ReportProcessor::compute_caches): Flatten iteration groups to compute caches (e.g. mean, stdev, etc...)
13941         (ReportProcessor::commit): Store iteration_group values.
13943 2013-03-01  Ryosuke Niwa  <rniwa@webkit.org>
13945         Unreviewed. Delete the migration tool for webkit-perf.appspot.com now that we have successfully
13946         migrated to perf.webkit.org.
13948         * database/perf-webkit-migrator.js: Removed.
13950 2013-03-01  Ryosuke Niwa  <rniwa@webkit.org>
13952         Build fix. Don't forget to add metrics of the top level tests e.g. Dromaeo:Time:Arithmetic.
13954         * public/index.html:
13955         (.showCharts):
13957 2013-03-01  Ryosuke Niwa  <rniwa@webkit.org>
13959         SafariPerfMonitor: Make it possible to add charts for all subtests or all platforms.
13961         Reviewed by Ricky Mondello.
13963         It is often desirable to see charts of a given test for all platforms, or to be able to see
13964         charts of all subtests on a given platform when trying to triage perf. regressions.
13966         Support this use case by adding the ability to do so on the charts page.
13968         Also, we used to disable items on the test list based on the platform chosen. This turned out
13969         to be a bad UI because in many situations you want to be able to compare results of the same test
13970         on multiple platforms.
13972         In this new UI, we have three select elements, each of which selects the following:
13973         1. Top-level test - Test suite such as Dromaeo
13974         2. Metric - Pages and subtests under the suite such as www.webkit.org for dom-modify:Runs
13975            (where dom-modify is the name of the subtest and Runs is a metric in that subtest) for Dromaeo.
13976         3. Platform - Mountain Lion, Qt, etc...
13978         A user can select "all" for metric and platform but we disallow doing both at once since adding
13979         all metrics on all platforms tends to add way too many charts and hang the browser. I also can't
13980         think of a use case where you want to look at that many charts at once. We can support this later
13981         if valid use cases come up.
13983         * public/index.html:
13984         (.showCharts.addOption): Extracted.
13985         (.showCharts): Added "metricList" that shows the list of test and metrics (in the form of
13986         relative metrics paths such as "DOMWalk:Time") for each top-level test selected in testList.
13987         metricList has onchange handler that enables/disables items on platformList.
13988         
13989         (init): Sort tests and test metrics here instead of doing that in showCharts.
13991 2013-02-28  Ryosuke Niwa  <rniwa@webkit.org>
13993         <rdar://problem/13316756> SafariPerfMonitor: tooltip should include a link to build URLs
13995         Reviewed by Remy Demarest and Ricky Mondello.
13997         Added a hyperlink to build page in tooltips. Repeating the entire build URL in each build
13998         was a bad idea because it bloats the resultant JSON file too much. So move the build URL
13999         templates to the manifest file instead. Each build now only contains the builder id.
14001         * public/api/runs.php: Removed the part of the query that joined builders table. This
14002         speeds up the query quite a bit.
14004         * public/include/manifest.php:
14005         (ManifestGenerator::generate): Generate builders field.
14006         (ManifestGenerator::builders): Added. Returns an associative array of builder ids to an
14007         associative array that contains name and its build URL template.
14009         * public/index.html:
14010         (.buildLabelWithLinks.linkifyIfNotNull): Renamed from linkifiedLabel. Take a label and url
14011         instead of a revision since this function is used for revisions and build page URLs now.
14012         (.buildLabelWithLinks): Include the linkified build number.
14014         * public/js/helper-classes.js:
14015         (TestBuild.builder): Added.
14016         (TestBuild.buildNumber): Added.
14017         (TestBuild.buildUrl): Returns the build URL. The variable name in the URL template has been
14018         changed from %s to $buildNumber to be more descriptive and consistent with other URL templates.
14020 2013-02-27  Ryosuke Niwa  <rniwa@webkit.org>
14022         Tooltips interfere with user interactions
14024         Rubber-stamped by Simon Fraser.
14026         Disable tooltip on the dashboard page since graphs are too small to be useful there.
14027         Also, show graphs for only 10 days by default as opposed to 20.
14028         Finally, dismiss the hovering tooltip when mouse enters a "pinned" tooltip.
14030         * public/index.html:
14031         * public/js/helper-classes.js:
14033 2013-02-24  Ryosuke Niwa  <rniwa@webkit.org>
14035         Fix some serious typo. We're supposed to be using SHA-256, not SHA-1 to hash our passwords,
14036         to be compatible with webkit-perf.appspot.com.
14038         * public/admin/builders.php:
14039         * public/api/report.php:
14041 2013-02-23  Ryosuke Niwa  <rniwa@webkit.org>
14043         Unreviewed.
14045         Add a missing constraint on builds table. For a given builder, there should be exactly
14046         one build for a given build number.
14048         Also add report_committed_at to reports table to record the time at which a given report
14049         was processed and test_runs and run_iterations rows were committed into the database.
14051         * database/config.json:
14052         * public/api/report.php:
14054 2013-02-22  Ryosuke Niwa  <rniwa@webkit.org>
14056         Unreviewed. Add more checks for empty SQL query results.
14058         * public/include/manifest.php:
14060 2013-02-21  Ryosuke Niwa  <rniwa@webkit.org>
14062         More build fixes on perf.webkit.org.
14064         * public/api/runs.php: Make PostgreSQL happier.
14065         * public/include/manifest.php: Don't assume we always have bug trackers.
14067 2013-02-21  Ryosuke Niwa  <rniwa@webkit.org>
14069         SafariPerfMonitor: index.html duplicates the code in PerfTestRuns to determine smallerIsBetter
14070         and fix other miscellaneous UI bugs.
14072         Rubber-stamped by Simon Fraser.
14074         Removed the code to determine whether smaller value is better or not for a given test in index.html
14075         in the favor of using that of PerfTestRuns.
14077         * public/include/manifest.php: Fixed a typo.
14078         * public/index.html:
14079         (Chart):
14080         (Chart.attachMainPlot): Fixed a bug to access previousPoint.left even when previousPoint is null.
14082         * public/js/helper-classes.js:
14083         (PerfTestRuns): Added EndAllocations, MaxAllocations, and MeanAllocations.
14085         (PerfTestRuns.computeScalingFactorIfNeeded): When the mean is almost 10,000 units, we may end up
14086         using 5 digits instead of 4, resulting in the use of scientific notations. Go up to the next unit
14087         at roughly 2,000 units to avoid this.
14089         (Tooltip.show): Show the tooltip even when the new content is identical to the previous content.
14090         The only thing we can avoid is innerHTML.
14092 2013-02-21  Ryosuke Niwa  <rniwa@webkit.org>
14094         Another build fix. The path to node is /usr/local/bin/node, not /usr/bin/local/node
14096         * public/include/evaluator.js:
14098 2013-02-21  Ryosuke Niwa  <rniwa@webkit.org>
14100         <rdar://problem/13267898> SafariPerfMonitor: Bug trackers should be configurable
14102         Reviewed by Remy Demarest.
14104         Made the list of bug trackers configurable. Namely, each bug tracker can be added in
14105         admin/bug-trackers.php and can be associated with multiple repositories.
14107         The association between bug trackers and repositories (such as WebKit, Safari, etc...) are used
14108         to determine the set of bug trackers to show for a given set of blame lists.
14109         e.g. if a test regressed due to a change in Safari, then we don't want to show WebKit Bugzilla as
14110         a place to file bugs against the regression.
14112         * database/init-database.sql: Added bug_trackers and tracker_repositories.
14113         Also drop those tables before creating them (note "DROP TABLE reports" was missing).
14115         * public/admin/bug-trackers.php: Added. The administrative interface for adding and managing
14116         bug trackers, namely associated repositories.
14118         * public/include/admin-header.php: Added a link to bug-trackers.php
14119         * public/include/manifest.php:
14120         (ManifestGenerator::generate): Include the list of bug trackers in the manifest.
14121         Also moved the code to fetch repositories table here from ManifestGenerator::repositories.
14123         (ManifestGenerator::repositories):
14125         (ManifestGenerator::bug_trackers): Added. Generates an associative array of bug trackers where
14126         keys are names of bug trackers and values are associative arrays with keys 'new_bug_url' and
14127         'repositories' where the latter contains the list of associated repository names.
14129         * public/index.html:
14130         (Chart): Takes bugTrackers as as argument.
14131         (Chart.showTooltipWithResults): Removed the hard-coded list.
14132         (init):
14133         (init.addPlatformsToDashboard):
14134         (init.showCharts.createChartFromListPair):
14135         (init): Stores the list of bug trackers in the manifest to a local variable.
14137 2013-02-21  Ryosuke Niwa  <rniwa@webkit.org>
14139         A follow up on the previous build fix. When using proc_open, we need to make evalulator.js executable.
14141         * public/include/evaluator.js:
14143 2013-02-21  Ryosuke Niwa  <rniwa@webkit.org>
14145         SafariPerfMonitor: Extract the code to generate tabular view in administrative pages
14147         Reviewed by Remy Demarest.
14149         Extracted AdministrativePage to share the code to generate a tabular view of data and a form to insert
14150         new row into the database.
14152         * public/admin/aggregators.php: Use AdministrativePage.
14153         * public/admin/builders.php: Ditto.
14154         * public/admin/repositories.php: Ditto.
14155         * public/include/admin-header.php:
14156         (AdministrativePage): Added.
14157         (AdministrativePage::__construct): column_info is an associative array that maps a SQL column name
14158         to an associative array that describes the column.
14159             - editing_mode: Specifies the type of form ('text', 'url', or 'string') to show for this column.
14160             - label: Human readable name of the column.
14161             - pre_insertion: Signifies that this column exists only before the row is inserted. e.g. password
14162               column exists only before we create password_hash column at the insertion time.
14164         (AdministrativePage::name_to_titlecase): Converts an underscored lowercase name to a human readable
14165         titlecase (e.g. new_bug is converted to New Bug).
14166         (AdministrativePage::column_label): Obtains the label specified in column_info or titlecased column name.
14167         (AdministrativePage::render_form_control_for_column): "Renders" a text form control such as input and
14168         textarea for a given editing mode ('text', 'url', or 'string').
14169         (AdministrativePage::render_table): Renders a whole SQL table after sorting rows by the specified column.
14170         (AdministrativePage::render_form_to_add): Renders a form to insert new row.
14172 2013-02-20  Ryosuke Niwa  <rniwa@webkit.org>
14174         Build fix. Some systems don't support r+. Use proc_open instead.
14176         * public/api/report.php:
14178 2013-02-15  Ryosuke Niwa  <rniwa@webkit.org>
14180         Build fix. Use the mean data series as supposed to upper or lower confidence bounds
14181         when computing the y-axis of data points to show tooltips at.
14183         * public/index.html:
14185 2013-02-15  Ryosuke Niwa  <rniwa@webkit.org>
14187         Unreviewed. Removed .htaccess in favor of directly putting directives in httpd.conf.
14189         * Install.md:
14190         * public/.htaccess: Removed.
14192 2013-02-14  Ryosuke Niwa  <rniwa@webkit.org>
14194         Unreviewed.
14196         * public/include/manifest.php: Build fix. db is on this.
14197         * public/js/statistics.js:
14198         (Statistics.confidenceInterval): Added. An utility function for debugging purposes.
14200 2013-02-13  Ryosuke Niwa  <rniwa@webkit.org>
14202         <rdar://problem/13165667> SafariPerfMonitor doesn't work on perf.webkit.org (Part 2)
14204         Reviewed by Anders Carlsson.
14206         Rewrote and merged populate-from-report.js into report.php.
14208         * database/config.json: Added a path to node.js.
14210         * database/init-database.sql: Don't require unit to be always present since it's no longer used by the front end.
14211         Once we land this patch and update the administrative pages, we can remove this column.
14213         Also add a new reports table to store JSON reported by builders. We used to store everything in jobs table but
14214         that table is going away once we remove the node.js backend.
14216         * database/populate-from-report.js: Removed.
14217         * public/api/report.php: Added.
14218         (ReportProcessor):
14219         (ReportProcessor.__construct):
14220         (ReportProcessor.process):
14222         (ReportProcessor.store_report_and_get_build_data): We store the report into the database as soon as it has been
14223         verified to be submitted by a known builder.
14225         (ReportProcessor.exit_with_error): Store the error message and details in the database if the report had been
14226         stored. If not, then notify that to the client via 'failureStored' in the JSON response.
14227         (ReportProcessor.resolve_build_id): Insert build and build_revisions rows if needed. We don't do this atomically
14228         inside a transaction because there could be multiple reports for a single build, each containing results for
14229         different tests.
14231         (ReportProcessor.recursively_ensure_tests): Parse a tree of tests and insert tests and test_metrics rows as
14232         needed. It also computes the metrics to aggregate and prepares values to commit via ensure_aggregated_metric,
14233         add_values_to_commit, and add_values_for_aggregation.
14235         (ReportProcessor.is_list_of_aggregators): When a metric is an aggregation, it contains an array of aggregator
14236         names, e.g. ["Arithmetic", "Geometric"], instead of a dictionary of configuration types to their values,
14237         e.g. {Time: {current: [1, 2, 3,]}}. This function detects the former. (Note that dictionary and list are both
14238         array's in PHP).
14240         (ReportProcessor.ensure_aggregated_metric): Create a metric with aggregator to add it to the list of metrics
14241         to be aggregated in ReportProcessor.aggregate.
14243         (ReportProcessor.add_values_for_aggregation): Called by test metrics with aggregated parent test metrics.
14245         (ReportProcessor.aggregate): Compute results for aggregated metrics. Consider a matrix with rows representing
14246         child tests and columns representing "iterations" for a given aggregated metrics M. Initially, we have values
14247         given for each row (child metrics of M). This function extracts each column (iteration) via
14248         test_value_list_to_values_by_iterations, and feeds it into evaluate_expressions_by_node to get aggregated values
14249         for each column (iteration of M). Finally, it registers those aggregated values to be committed.
14251         Note that we don't want to start a new node.js process for each aggregation, so we accumulate all values to be
14252         aggregated in node.js in $expressions. Each entry in $expressions is a JSON string that contains code and
14253         values to be aggregated. node.js gives us back a list of JSON strings that contain aggregated values.
14255         (ReportProcessor.test_value_list_to_values_by_iterations): See above.
14256         (ReportProcessor.evaluate_expressions_by_node): See above.
14258         (ReportProcessor.compute_caches): Compute cached mean, sum, and square sums for each run we're about to add
14259         using evaluate_expressions_by_node. We can't do this before computing aggregated results since those aggregated
14260         results also need the said caches.
14262         (ReportProcessor.add_values_to_commit):
14264         (ReportProcessor.commit): Add test_runs and run_iterations atomically inside a transaction, rolling back
14265         the transaction as needed if anything goes wrong.
14267         (ReportProcessor.rollback_with_error)
14268         (main):
14269         * public/include/db.php:
14270         (Database.prepare_params): Use $values (instead of $placeholders) to compute the current index since
14271         placeholders ($1, $2, etc...) may be split up into multiple arrays given they may not necessarily show up
14272         contiguously in a SQL statement.
14274         (Database.select_or_insert_row): Added. Selects a row if the attempt to insert the same row fails. It
14275         automatically creates a query string from a dictionary of unprefixed column names and table. It returns
14276         a column value of the choice.
14278         (Database.begin_transaction): Added.
14279         (Database.commit_transaction): Added.
14280         (Database.rollback_transaction): Added.
14282         * public/include/evaluator.js: Added.
14283         * public/include/json-header.php:
14284         (exit_with_error): Take error details and merge it with "additional details". This allows report.php to provide
14285         context under which the request failed.
14286         (successful_exit): Merge "additional details".
14287         (set_exit_detail): Added. Sets "additional details" to the JSON returned by exit_with_error or successful_exit.
14288         (merge_additional_details):
14290 2013-02-12  Ryosuke Niwa  <rniwa@webkit.org>
14292         SafariPerfMonitor: Add more helper functions to db.php
14294         Reviewed by Remy Demarest.
14296         Added Database::insert_row and array_get to make common database operations easier.
14298         * public/admin/aggregators.php: Use Database::insert_row instead of
14299         execute_query_and_expect_one_row_to_be_affected.
14301         * public/admin/builders.php: Ditto.
14303         * public/admin/tests.php: Ditto; We used to run a separate SELECT query just to get the id after
14304         inserting a row. With insert_row, we don't need that.
14306         * public/include/admin-header.php: Ditto.
14308         * public/include/db.php:
14309         (array_get): Added. It returns the value of an array given a key if the key exists; otherwise
14310         return the default value (defaults to NULL) if the key doesn't exist.
14312         (Database::column_names): Added. Prefixes an array of column names and creates a comma separated
14313         list of the names.
14315         (Database::prepare_params): Added. Takes an associative array of column names and their values,
14316         and builds up arrays for placeholder (e.g. $1, $2, etc...) and values, then returns an array of
14317         column names all in the same order.
14319         (Database::insert_row): Added. Inserts a new row into the specified table where column names have
14320         the given prefix. Values are given in a form of an associative array where keys are unprefixed
14321         column names and values are corresponding values. When the row is successfully inserted, it returns
14322         the specified column's value (defaults to prefix_id). If NULL is specified, it returns a boolean
14323         indicating the success of the insertion.
14325 2013-02-11  Ryosuke Niwa  <rniwa@webkit.org>
14327         <rdar://problem/13165667> SafariPerfMonitor doesn't work on perf.webkit.org (Part 1)
14329         Reviewed by Conrad Shultz.
14331         Rewrote the manifest generator in PHP.
14333         * database/generate-manifest.js: Removed.
14334         * public/admin/regenerate-manifest.php: Added. Use ManifestGenerator to generate and store the manifest.
14335         * public/include/db.php:
14336         (array_ensure_item_has_array): Added.
14337         * public/include/evaluator.js: Added.
14338         * public/include/json-header.php:
14339         * public/include/manifest.php: Added.
14341 2013-02-11  Ryosuke Niwa  <rniwa@webkit.org>
14343         Dates on overflow plot are overlapping
14345         Rubber-stamped by Simon Fraser.
14347         Don't show more than 5 days.
14349         * public/index.html:
14350         * public/js/helper-classes.js:
14351         (TestBuild.UTCtoPST):
14352         (TestBuild.now):
14354 2013-02-07  Ryosuke Niwa  <rniwa@webkit.org>
14356         Show build time as well as commit time on the dashboard and tooltips.
14358         Rubber-stamped by Simon Fraser.
14360         Include both the maximum commit time and build time in buildLabelWithLinks.
14361         Also use ISO format to save the screen real estate.
14363         * public/index.html:
14364         (buildLabelWithLinks):
14365         * public/js/helper-classes.js:
14366         (TestBuild):
14367         (TestBuild.buildTime):
14368         (TestBuild.formattedBuildTime):
14370 2013-02-08  Ryosuke Niwa  <rniwa@webkit.org>
14372         Unreviewed; Convert metric.name to metric.unit in the front end.
14374         * public/js/helper-classes.js:
14376 2013-02-07  Ryosuke Niwa  <rniwa@webkit.org>
14378         <rdar://problem/13166276> SafariPerfMonitor: Need hyperlinks to file bugs
14380         Rubber-stamped by Simon Fraser.
14382         This patch adds hyperlinks to file new bugs on Radar and WebKit Bugzilla. Because we want to include information
14383         such as the degree of progression or regression and the regression ranges when filing new bugs, broke various
14384         label() functions into smaller pieces to be used in both generating tooltips and the hyperlinks.
14386         * public/index.html:
14387         (.buildLabelWithLinks): Extracted from TestBuild.label.
14388         (.showTooltipWithResults): Extracted from Tooltip.show. Also added the code to generate hyperlinks to file new bugs
14389         on Radar and WebKit Bugzilla.
14390         * public/js/helper-classes.js:
14391         (PerfTestResult.metric): Replaced test() as runs.test() no longer exists.
14392         (PerfTestResult.isBetterThan): Added.
14393         (PerfTestResult.formattedRelativeDifference): Extracted from PerfTestResult.label.
14394         (PerfTestResult.formattedProgressionOrRegression): Ditto. Also use "better" and "worse" instead of arrow symbols
14395         to indicate progressions or regressions.
14396         (PerfTestResult.label):
14397         (TestBuild.formattedTime): Added.
14398         (TestBuild.platform): Added.
14399         (TestBuild.formattedRevisions): Extracted from TestBuild.label. Merged a part of linkifyLabel.
14400         (TestBuild.smallerIsBetter): Added.
14401         (Tooltip.show): Take a raw markup instead of two results.
14403 2013-02-06  Ryosuke Niwa  <rniwa@webkit.org>
14405         <rdar://problem/13151520> SafariPerfMonitor: Dashboard can cause excessive horizontal scrolling when there are many platforms
14407         Rubber-stamped by Tim Horton.
14409         Stack platforms when there are more than 3 of them since making the layout adaptive is tricky
14410         since each platform may have a different number of tests to be shown on the dashboard.
14412         * public/index.html:
14414 2013-02-05  Ryosuke Niwa  <rniwa@webkit.org>
14416         Build fix. Don't prefix a SVn revision with 'r' when constructing a changeset / blame URL.
14418         * public/js/helper-classes.js:
14419         (TestBuild.label):
14421 2013-02-05  Ryosuke Niwa  <rniwa@webkit.org>
14423         SafariPerfMonitor: repository names or revisions are double-quoted when they contain a space
14425         Rubber-stamped by Tim Horton.
14427         The bug was in the PHP code that parsed Postgres array. Trim double quotations as needed.
14429         Also fixed a bug in TestBuild where we used to show the revision range as r1234-1250 when
14430         the revision r1234 was the revision used in the previous build.
14432         * public/api/runs.php:
14433         (parse_revisions_array): Trim double quotations around repository names and revisions.
14434         * public/js/helper-classes.js:
14435         (TestBuild.label):
14437 2013-02-05  Ryosuke Niwa  <rniwa@webkit.org>
14439         <rdar://problem/13151558> SafariPerfMonitor: Tooltip is unusable
14441         Rubber-stamped by Tim Horton.
14443         * public/index.html:
14444         (Chart.attachMainPlot): Disable auto highlighting (circle around a data point that shows up on hover)
14445         on the dashboard page as it's way too noisy.
14447         (Chart.hideTooltip): Added. Hides the tooltip that shows up on hover.
14449         (.toggleClickTooltip): Extracted from the code for "mouseout" bind (now replaced by "mouseleave").
14450         Pins or unpins a tooltip. When pinning a tooltip, we create a tooltip behind the scene and show that
14451         so that the tooltip for hover can be reused further.
14453         (.closestItemForPageX): Find the closest item given pageX. We iterate data points from left to right,
14454         and find the first point that lies on the right of the cursor position. We then compute the midpoint
14455         between this and the previous point and pick the closer of the two. It returns an item-like object
14456         that has all properties we need since flot doesn't provide an API to retrieve the real item object.
14458         (Chart): Call toggleClickTooltip when a (hover) tooltip is clicked.
14460         (Chart.attach): In "plothover" bind, call closestItemForPageX when item is not provided by flot on
14461         the first or "current" data points (as opposed to target or baseline data points).
14463         Also bind the code to clear crosshair and hide tooltips to "mouseleave" instead of "mouseout", and
14464         avoid triggering this code when the cursor is still within the plot's rectangle (e.g. when a cursor
14465         moves onto a tooltip) to avoid the premature dismissal of a tooltip.
14467         * public/js/helper-classes.js:
14468         (Tooltip.ensureContainer): Don't automatically close then the user clicks on tooltip. Delegate this
14469         work to the client via bindClick.
14471         (Tooltip.show): Move tooltip up by 5px. Also added a FIXME to move this offset computation to the client.
14473         (Tooltip.bindClick): Added.
14475 2013-02-03  Ryosuke Niwa  <rniwa@webkit.org>
14477         Yet another build fix. metricId*s*.
14479         * public/admin/tests.php:
14481 2013-02-03  Ryosuke Niwa  <rniwa@webkit.org>
14483         Another build fix. Use the new payload format for the aggregate job.
14485         * public/admin/tests.php:
14487 2013-02-03  Ryosuke Niwa  <rniwa@webkit.org>
14489         Build fixes.
14491         * database/aggregate.js: Use variables that actually exist.
14492         * database/database-common.js:
14493         (ensureConfigurationIdFromList): Add the newly added configuration to the list so that subsequent
14494         function calls will find this configuration.
14496 2013-01-31  Ryosuke Niwa  <rniwa@webkit.org>
14498         <rdar://problem/13130139> SafariPerfMonitor: Add ReadMe
14500         Reviewed by Ricky Mondello.
14502         Turned InstallManual into a proper markdown document and added ReadMe.md.
14504         * InstallManual: Removed.
14505         * InstallManual.md: Moved from InstallManual.
14506         * ReadMe.md: Added.
14508 2013-01-31  Ryosuke Niwa  <rniwa@webkit.org>
14510         <rdar://problem/13109335> SafariPerfMonitor: Add baseline and target lines
14512         Reviewed by Ricky Mondello.
14514         This patch prepares the front end code to process baseline and target results properly.
14516         * public/index.html:
14517         (fetchTest.createRunAndResults): Extracted.
14518         (fetchTest): Call createRunAndResults on current, baseline, and target values of the JSON.
14519         Deleted the comment about how sorting will be unnecessary once we start results in the server side
14520         since sorting by the maximum revision commit time turned out to be non-trivial in php.
14522 2013-01-29  Ryosuke Niwa  <rniwa@webkit.org>
14524         <rdar://problem/13057071> SafariPerfMonitor: Use newer version of flot that supports timezone properly
14526         Reviewed by Tim Horton.
14528         Use flot at https://github.com/flot/flot/commit/ec168da2cb8619ebf59c7e721d12c44a7960ff41.
14529         These files are "dynamically linked" to our app.
14531         * public/index.html:
14532         * public/js/jquery-1.8.2.min.js: Removed.
14533         * public/js/jquery.colorhelpers.js: Added.
14534         * public/js/jquery.flot.categories.js: Added.
14535         * public/js/jquery.flot.crosshair.js: Added.
14536         * public/js/jquery.flot.errorbars.js: Added.
14537         * public/js/jquery.flot.fillbetween.js: Added.
14538         * public/js/jquery.flot.js: Added.
14539         * public/js/jquery.flot.min.js: Removed.
14540         * public/js/jquery.flot.navigate.js: Added.
14541         * public/js/jquery.flot.resize.js: Added.
14542         * public/js/jquery.flot.selection.js: Added.
14543         * public/js/jquery.flot.stack.js: Added.
14544         * public/js/jquery.flot.symbol.js: Added.
14545         * public/js/jquery.flot.threshold.js: Added.
14546         * public/js/jquery.flot.time.js: Added.
14547         * public/js/jquery.js: Added.
14549 2013-01-29  Ryosuke Niwa  <rniwa@webkit.org>
14551         Return NaN instead of throwing when there aren't enough samples.
14553         Reviewed by Sam Weinig.
14555         It's better to return NaN when we don't have enough samples so that we can treat it
14556         as if we don't have any confidence interval.
14558         * public/js/statistics.js:
14559         (Statistics.new):
14561 2013-01-28  Ryosuke Niwa  <rniwa@webkit.org>
14563         Build fix. Apparently Safari sometimes appends / at the end of hash location. Remove that.
14565         * public/js/helper-classes.js:
14566         (URLState.parseIfNeeded):
14568 2013-01-28  Ryosuke Niwa  <rniwa@webkit.org>
14570         <rdar://problem/13081582> SafariPerfMonitor: Always use parameterized SQL functions in php code
14572         Reviewed by Ricky Mondello.
14574         Parameterized execute_query_and_expect_one_row_to_be_affected and updated the code accordingly.
14576         * public/admin/aggregators.php: Use heredoc.
14577         * public/admin/builders.php:
14578         * public/admin/jobs.php:
14579         * public/admin/repositories.php:
14580         * public/admin/tests.php: Updated the forms to use unprefixed field names to match other pages.
14581         This allows us to use update_field when updating test's url and metric's unit. Changed the action
14582         to regenerate aggregated matrix from "update" to "add" to simplify the dependencies in if-else.
14583         Also removed a stray code to update unit and url simultaneously since it's never used.
14584         * public/include/admin-header.php:
14585         (execute_query_and_expect_one_row_to_be_affected): Added $params. Also automatically convert
14586         empty strings to NULL as it was previously done via $db->quote_string_or_null_if_empty in callers.
14587         (update_field): Moved from repositories.php.
14588         (add_job):
14589         * public/include/db.php:
14590         (quote_string_or_null_if_empty): Removed now that nobody uses this function.
14592 2013-01-25  Ryosuke Niwa  <rniwa@webkit.org>
14594         Build fixes. Treat mean, sum, and square sum as float, not int.
14596         Also use 95% confidence interval instead of 90% confidence interval.
14598         * public/api/runs.php:
14599         * public/js/helper-classes.js:
14600         (.this.confidenceIntervalDelta):
14602 2013-01-24  Ryosuke Niwa  <rniwa@webkit.org>
14604         Add an administrative page to edit repository information.
14606         Reviewed by Ricky Mondello.
14608         * public/admin/repositories.php: Added.
14609         * public/include/admin-header.php:
14611 2013-01-23  Ryosuke Niwa  <rniwa@webkit.org>
14613         <rdar://problem/13067539> SafariPerfMonitor: Automatically create aggregated metrics from builder reports
14615         Reviewed by Ricky Mondello.
14617         Auto-create aggregated matrix such as arithmetic means and geometric means as requested and add a job
14618         to aggregate results for those matrix in populate-from-report.js.
14620         * database/generate-manifest.js:
14621         (.): Include aggregator names such as Arithmetic and Geometric in the list of metrics.
14622         * database/init-database.sql: Remove an erroneous unique constraint. There could be multiple matrix that share
14623         the same test and name (e.g. Dromaeo, Time) with different aggregators (e.g. Arithmetic and Geometric).
14624         * database/populate-from-report.js:
14625         (main):
14626         (getReport): No change even though the diff looks as if it moved.
14627         (processReport): Extracted from main. Fetch the list of aggregators, pass that to recursivelyEnsureTestsIdsAndMetricsIds
14628         to obtain the list of aggregated metrics (such as arithmetic means) that need to be passed to aggregate.js
14629         (scheduleJobs): Extracted from processReport. Add a job to aggregate results.
14630         (recursivelyEnsureTestsIdsAndMetricsIds): When a metric is a list of names, assume them as aggregator names,
14631         and add corresponding metrics for them. Note we convert those names to ids using the dictionary we obtained
14632         in processReport.
14633         (ensureMetricId): Take an aggregator id as an argument.
14634         * database/process-jobs.js: Support multiple metric ids and build id. Note that aggregate.js aggregates results
14635         for all builds when the build id is not specified.
14636         * public/admin/tests.php:
14637         * public/index.html: Include the aggregator name in the full name since there could be multiple metrics
14638         of the same name with different aggregators.
14640 2013-01-22  Ryosuke Niwa  <rniwa@webkit.org>
14642         Build fix. Don't pass in arguments to in the wrong order.
14644         * database/aggregate.js:
14646 2013-01-21  Ryosuke Niwa  <rniwa@webkit.org>
14648         <rdar://problem/13057110> SafariPerfMonitor: x-axis is messed up
14650         Reviewed by Ricky Mondello.
14652         Since the version of flot we use doesn't support showing graphs in the current locate or
14653         in a specific timezone, convert all timestamps to PST manually (Date's constructor will still
14654         treat them as in UTC). We don't want to use the current locate because other websites on
14655         webkit.org assume PST.
14657         Also append this information to build's label.
14659         * public/js/helper-classes.js:
14660         (TestBuild):
14661         (TestBuild.label):
14663 2013-01-21  Ryosuke Niwa  <rniwa@webkit.org>
14665         Store test URLs reported by builders.
14667         Reviewed by Ricky Mondello.
14669         * database/populate-from-report.js:
14670         (recursivelyEnsureTestsIdsAndMetricsIds): Pass in the test url.
14671         (ensureTestId): Store the URL.
14673 2013-01-20  Ryosuke Niwa  <rniwa@webkit.org>
14675         Yet another build fix; don't blow up even if we didn't have any test configurations.
14677         * public/admin/tests.php:
14679 2013-01-21  Ryosuke Niwa  <rniwa@webkit.org>
14681         Build fix; don't instantiate Date when a timestamp wasn't provided.
14683         * database/populate-from-report.js:
14685 2013-01-18  Ryosuke Niwa  <rniwa@webkit.org>
14687         Rename SafariPerfDashboard to SafariPerfMonitor and add a install manual.
14689         Reviewed by Tim Horton.
14691         Added an install manual.
14693         * InstallManual: Added.
14695 2012-12-21  Ryosuke Niwa  <rniwa@webkit.org>
14697         Minor build fix. Don't unset builderPassword when it's not set.
14699         * public/api/report.php:
14701 2012-12-18  Ryosuke Niwa  <rniwa@webkit.org>
14703         Prettify JSON payloads and make very large payloads not explode the table in jobs.php.
14705         Reviewed by Ricky Mondello.
14707         * public/admin/admin.css: Make a very large payload scrollable.
14708         * public/admin/jobs.php: Format JSONs.
14710 2012-12-19  Ryosuke Niwa  <rniwa@webkit.org>
14712         <rdar://problem/12897424> SafariPerfMonitor: Add ability to report results from bots
14714         Reviewed by Ricky Mondello.
14716         Add report.php and populate-from-report.js that process JSON files submitted by builders.
14718         * database/populate-from-report.js: Added.
14719         (main):
14720         (getReport): Obtains the payload (the actual report) from "jobs" table.
14721         (recursivelyEnsureTestsIdsAndMetricsIds): "reports.tests" contain a tree of tests, test metrics,
14722         and their results. This function recursively traverses tests and metrics and ensure their ids.
14723         (ensureTestId):
14724         (metricToUnit): Maps a metric name to a unit. This should really be done in the client side since
14725         there is no point in storing unit given that every metric maps to exactly one unit (i.e. the mapping
14726         is a "function" in mathematical sense).
14727         (ensureMetricId):
14728         (ensureRepositoryIdsForAllRevisions):
14729         (getIdOrCreateBuildWithRevisions):
14730         (ensureBuildIdAndRevisions): Obtains a build id given a builder name, a build number, and a build time
14731         if one already exists. If not, then inserts a new build and corresponding revisions information (e.g.
14732         build 123 may contain WebKit revision r456789). We don't retrieve rows for revisions since we don't use
14733         it elsewhere.
14734         (insertRun): Insert new rows into "test_runs" and "run_iterations" tables, thereby recording the new
14735         test results all in a single transaction. This allows us to keep the database consistent in that either
14736         a build has been reported or not at least in "test_runs" and "run_iterations" tables. It'll be ideal if
14737         we could do the same for "builds" and "build_revisions" but that's not a hard requirement as far as
14738         other parts of the application are concerned.
14739         (scheduleQueriesToInsertRun):
14740         * database/process-jobs.js: Add a call to populate-from-report.js.
14741         * public/api/report.php: Added. Adds a new job named "report" to be processed by populate-from-report.js.
14742         * public/include/db.php: Support parameterized query.
14743         * public/include/json-header.php: Always include 'status' in the response so that builder submitting
14744         a test result could confirm that the submission indeed succeeded.
14746 2012-12-18  Ryosuke Niwa  <rniwa@webkit.org>
14748         Rename get(Id)OrCreate*(Id) to ensure*Id as suggested by Ricky on one of his code reviews.
14750         * database/aggregate.js:
14751         * database/database-common.js:
14752         (selectColumnCreatingRowIfNeeded):
14753         (ensureRepositoryId):
14754         (ensureConfigurationIdFromList):
14755         * database/perf-webkit-migrator.js:
14756         (.migrateStat.):
14757         (.migrateStat):
14758         (getOrCreateBuildId):
14760 2012-12-17  Ryosuke Niwa  <rniwa@webkit.org>
14762         Extract commonly-used functions from aggregate.js and perf-webkit-migrator.js.
14764         Reviewed by Ricky Mondello.
14766         As a preparation to add report.js that processes a JSON file submitted by bots, extract various functions
14767         and classes from aggregate.js and perf-webkit-migrator.js to be shared.
14769         * database/aggregate.js: Extracted TaskQueue and SerializedTaskQueue into utility.js.
14770         (main):
14771         (processBuild):
14772         (saveAggregatedResults):
14773         * database/database-common.js:
14774         (getIdOrCreatePlatform): Extracted from webkit-perf-migrator.js.
14775         (getIdOrCreateRepository): Ditto.
14776         (getConfigurationsForPlatformAndMetrics): Renamed from fetchConfigurations. Extracted from aggregator.js.
14777         (getIdFromListOrInsertConfiguration): Renamed from getOrInsertConfiguration. Extracted from aggregator.js.
14778         * database/perf-webkit-migrator.js:
14779         * database/utility.js: Added.
14780         (TaskQueue): Extracted from aggregator.js. Fixed a bug that prevented tasks added after start() is called
14781         from being executed.
14782         (TaskQueue.startTasksInQueue): Execute remaining tasks without serializing them. If the queue is empty,
14783         call the callback passed into start().
14784         (TaskQueue.taskCallback): The function each task calls back. Decrement the counter and call statTasksInQueue.
14785         (TaskQueue.addTask):
14786         (TaskQueue.start):
14787         (SerializedTaskQueue): Unlike TaskQueue, this class executes each task sequentially.
14788         (SerializedTaskQueue.executeNextTask):
14789         (SerializedTaskQueue.addTask):
14790         (SerializedTaskQueue.start):
14792 2012-12-18  Ryosuke Niwa  <rniwa@webkit.org>
14794         Revert erroneously committed changes.
14796         * database/config.json:
14798 2012-12-18  Ryosuke Niwa  <rniwa@webkit.org>
14800         aggregator.js should be able to accept multiple metric ids and a single build id.
14802         Reviewed by Ricky Mondello.
14804         Make aggregator.js accept multiple ids and generate results for single build when bots are
14805         reporting new results.
14807         * database/aggregate.js:
14808         (parseArgv): Added. Returns an object containing the parsed representation of argv,
14809         which currently contains metricIDs and buildIds.
14810         (main): Use parseArgv and processConfigurations
14811         (processPlatform): Use build ids passed in or obtain all builds for the given platform.
14812         (processPlatform.processConfigurations): Extracted.
14814 2012-12-17  Ryosuke Niwa  <rniwa@webkit.org>
14816         Add an administrative page for builders.
14818         Reviewed by Ricky Mondello.
14820         We need an administrative page to add and edit builder information.
14821         Also renamed "slaves" to "builders" in order to reduce the amount of technical jargon we use.
14823         * database/init-database.sql: Renamed slaves table to builders. Drop slave_os and slave_spec
14824         since we don't have plans to use those columns in near future. Also make builder_name unique
14825         as required by the rest of the app.
14826         * public/admin/builders.php: Added.
14827         * public/api/runs.php: Updated per the table rename.
14828         * public/include/admin-header.php: Added a link to builders.php.
14830 2012-12-14  Ryosuke Niwa  <rniwa@webkit.org>
14832         Build fixes for r46982.
14834         * database/aggregate.js:
14835         (fetchConfigurations):  Bind i so that it's not always metricIds.length.
14836         (fetchBuildsForPlatform): Return run_build as build_id since that's what caller expects.
14837         (processBuild): Don't print "." until we've committed transactions. It's misleading.
14839 2012-12-13  Ryosuke Niwa  <rniwa@webkit.org>
14841         Unreviewed. Move some php files to public/include as suggested by Mark on a code review.
14843         * public/admin/aggregators.php:
14844         * public/admin/footer.php: Removed.
14845         * public/admin/header.php: Removed.
14846         * public/admin/index.php:
14847         * public/admin/jobs.php:
14848         * public/admin/tests.php:
14849         * public/api/json-header.php: Removed.
14850         * public/api/runs.php:
14851         * public/db.php: Removed.
14852         * public/include: Added.
14853         * public/include/admin-footer.php: Copied from public/admin/footer.php.
14854         * public/include/admin-header.php: Copied from public/admin/header.php.
14855         * public/include/db.php: Copied from public/db.php.
14856         * public/include/json-header.php: Copied from public/api/json-header.php.
14858 2012-12-13  Ryosuke Niwa  <rniwa@webkit.org>
14860         <rdar://problem/12822613> SafariPerfMonitor: implement naive value aggregation mechanism
14862         Reviewed by Ricky Mondello.
14864         Added the initial implementation of value aggregation.
14865         Also added abilities to configure the dashboard page in tests.php.
14867         * database/aggregate.js: Added.
14868         (TaskQueue): Added. Execute all tasks at once and waits for those tasks to complete.
14869         (TaskQueue.addTask):
14870         (TaskQueue.start):
14871         (SerializedTaskQueue): Added. Execute tasks sequentially after one another until all of them are completed.
14872         (SerializedTaskQueue.addTask):
14873         (SerializedTaskQueue.start):
14874         (main):
14875         (processPlatform):
14876         (fetchConfigurations):
14877         (fetchBuildsForPlatform):
14878         (processBuild):
14879         (testsWithDifferentIterationCounts):
14880         (aggregateIterationsForMetric): Retrieve run_iterations and aggregate results in memory.
14881         (saveAggregatedResults): Insert into test_runs and test_config in transactions.
14882         (getOrInsertConfiguration):
14883         (fetchAggregators):
14884         * database/database-common.js:
14885         (fetchTable): Log an error as an error.
14886         (getOrCreateId): Extracted from perf-webkit-migrator.
14887         (statistics): Added.
14888         * database/perf-webkit-migrator.js:
14889         (migrateTestConfig): Converted units to respective metric names. Also removed the code to add jobs to update
14890         runs JSON since runs JSONs are generated on demand now.
14891         (migrateStat):
14892         (getOrCreatePlatformId):
14893         (getOrCreateTestId):
14894         (getOrCreateConfigurationId):
14895         (getOrCreateRevisionId):
14896         (getOrCreateRepositoryId):
14897         (getOrCreateBuildId):
14898         * database/process-jobs.js:
14899         (processJob): Handle 'aggregate' type.
14901 2012-12-11  Ryosuke Niwa  <rniwa@webkit.org>
14903         Fix the dashboard after adding test_metrics.
14905         Reviewed by Ricky Mondello.
14907         Rename test to metrics in various functions and sort tests on the charts page.
14908         Also representing whether a test appears or not by setting a flag on dashboard
14909         was bogus because test objects are shared by multiple platforms. Instead, store
14910         dashboard platform list as intended by the manifest JSON.
14912         * public/index.html:
14913         (PerfTestRuns): Renamed test to metric.
14914         (fetchTest): Ditto.
14915         (showCharts): Ditto; also sort metrics' full names before adding them to the select element.
14916         (fullName): Moved so that it appears above where it's called.
14917         * public/js/helper-classes.js:
14919 2012-12-10  Ryosuke Niwa  <rniwa@webkit.org>
14921         Update tests.php to reflect recent changes in the database schema.
14923         Reviewed by Conrad Shultz.
14925         Made the following changes to tests.php:
14926         1. Disallow adding metrics to tests without subtests.
14927         2. Made dashboard configurable by adding checkboxes for each platform on each metric.
14928         3. Linkified tests with subtests instead of showing all them at once.
14930         * public/admin/admin.css:
14931         (.action-field, .notice):
14932         (label):
14933         * public/admin/header.php: Specify paths by absolute paths so that tests.php can use PATH_INFO.
14934         (execute_query_and_expect_one_row_to_be_affected): Return a boolean. Used in tests.php while adding test_metrics.
14935         (add_job): Extracted.
14936         * public/admin/tests.php: See above.
14937         (array_item_set_default): Added.
14938         (array_item_or_default): Renamed from get_value_with_default.
14939         (compute_full_name): Extracted.
14940         (sort_tests): Ditto.
14941         (map_metrics_to_tests): Ditto.
14943 2012-12-06  Ryosuke Niwa  <rniwa@webkit.org>
14945         <rdar://problem/12832324> SafariPerfMonitor: Linkify test names
14947         Reviewed by Simon Fraser.
14949         Linkify the headers using metric.test.url when it's provided.
14951         * public/index.html:
14953 2012-12-03  Ryosuke Niwa  <rniwa@webkit.org>
14955         Use parameterized pg_query_params in query_and_fetch_all
14957         Reviewed by Conrad Shultz.
14959         Address a review comment by Mark by using pg_query_params instead of pg_query in query_and_fetch_all.
14961         * public/api/runs.php:
14962         * public/db.php:
14963         (ctype_alnum_underscore): Added.
14965 2012-12-04  Ryosuke Niwa  <rniwa@webkit.org>
14967         Update the migration tool to support test_metrics.
14969         Reviewed by Mark Rowe.
14971         Updated the migration tool from webkit-perf.appspot.com to support test_metrics.
14972         Also import run_iteration rows as runs JSON files now include individual values.
14974         * database/database-common.js:
14975         (addJob): Extracted.
14976         * database/perf-webkit-migrator.js:
14977         (migrateTestConfig): Interchange the order in which we fetch runs and add configurations
14978         so that we can pass in the metric name and unit to getOrCreateConfigurationId.
14979         (getOrCreateConfigurationId): Updated to add both test configuration and test metric.
14980         (ensureCheckout):
14982 2012-12-03  Ryosuke Niwa  <rniwa@webkit.org>
14984         Build fix. Suppress "Undefined index" warning.
14986         * public/admin/tests.php:
14988 2012-12-03  Ryosuke Niwa  <rniwa@webkit.org>
14990         Fix a commit error in r46756. api/ should obviously be added under public/
14992         * api: Removed.
14993         * api/json-header.php: Removed.
14994         * api/runs.php: Removed.
14995         * public/api: Copied from api.
14997 2012-12-03  Ryosuke Niwa  <rniwa@webkit.org>
14999         SafariPerfMonitor: Linkify revisions and revisions range
15000         <rdar://problem/12801010>
15002         Reviewed by Mark Rowe.
15004         Linkify revisions in TestBuild.label. Pass in manifest.repositories to TestBuild's constructor
15005         since it needs to know "url" and "blameUrl".
15007         Also tweaked the appearance of graphs on charts page to better align graphs when unit names are long.
15009         * public/index.html:
15010         * public/js/helper-classes.js:
15011         (TestBuild):
15012         (TestBuild.revision): Renamed from webkitRevision. Now returns an arbitrary revision number.
15013         (TestBuild.label): Add labels for all revisions.
15014         (TestBuild):
15015         (.ensureContainer):
15017 2012-12-03  Ryosuke Niwa  <rniwa@webkit.org>
15019         Make the generation of "runs" JSON dynamic and support test_metrics.
15021         Reviewed by Mark Rowe.
15023         It turned out that we can fetch all runs for a given configuration in roughly 100-200ms.
15025         Since there could be hundreds, if not thousands, of tests for each configuration and users
15026         aren't necessarily interested in looking at all test results, it's much more efficient to
15027         generate runs JSON dynamically (i.e. polling) upon a request instead of generating all of them
15028         when bots report new results (i.e. pushing).
15030         Rewrote the script to generate runs JSON in php and also supported test_metrics table.
15032         * api: Added.
15033         * api/json-header.php: Added. Sets Content-Type and cache policies (10 minutes by default).
15034         (exit_with_error): Added.
15035         (successful_exit): Added.
15036         * api/runs.php: Added. Ported database/database-common.js. It's much shorter in php!
15037         * database/generate-runs.js: Removed.
15038         * database/process-jobs.js: No longer supports "runs".
15039         * public/.htaccess: Added. Always add MultiView so that api/runs can receive a path info.
15040         * public/db.php: Print "Nothing to see here." when it's accessed directly.
15041         (ends_with): Added.
15042         * public/index.html: Fetch runs JSONs from /api/runs/ instead of data/.
15044 2012-12-03  Ryosuke Niwa  <rniwa@webkit.org>
15046         Update tests.php and sample-data.sql per addition of test_metrics.
15048         Rubber-stamped by Timothy Hatcher.
15050         Remove a useless code from tests.php that used to update the unit and the url of a test
15051         since it's no longer used, and add the UI and the ability to add a new aggregator to a test.
15053         Also update the sample data to reflect the addition of test_metrics.
15055         * database/sample-data.sql:
15056         * public/admin/tests.php:
15058 2012-11-30  Ryosuke Niwa  <rniwa@webkit.org>
15060         Share more code between admin pages.
15062         Reviewed by Timothy Hatcher.
15064         Added notice and execute_query_and_expect_one_row_to_be_affected helper functions to share more code
15065         between admin pages.
15067         Also moved the code to connect to the database into header.php to be shared. Admin pages just need
15068         to check the nullity of global $db now.
15070         * public/admin/aggregators.php:
15071         * public/admin/header.php:
15072         (notice): Added
15073         (execute_query_and_expect_one_row_to_be_affected): Added.
15074         * public/admin/index.php:
15075         * public/admin/jobs.php:
15076         * public/admin/tests.php:
15078 2012-11-29  Ryosuke Niwa  <rniwa@webkit.org>
15080         SafariPerfMonitor: Add admin page to edit aggregators
15081         <rdar://problem/12782687>
15083         Reviewed by Mark Rowe.
15085         Add aggregators.php. It's very simple. We should probably share more code between various admin pages.
15087         * public/admin/aggregators.php: Added.
15088         * public/admin/header.php:
15089         * public/admin/jobs.php: Removed an erroneous hidden input element.
15091 2012-11-28  Ryosuke Niwa  <rniwa@webkit.org>
15093         Fix a syntax error in init-database.sql and add the missing drop table at the beginning.
15095         * database/init-database.sql:
15097 2012-11-28  Ryosuke Niwa  <rniwa@webkit.org>
15099         SafariPerfMonitor: Allow multiple metrics per test
15100         <rdar://problem/12773506>
15102         Rubber-stamped by Mark Rowe.
15104         Introduce a new table test_metrics. This table represents metrics each test can have
15105         such as time, memory allocation, frame rate as well as aggregation such as arithmetic mean
15106         and geometric mean.
15108         Updated admin/tests.php and index.html accordingly.
15110         Also create few indexes based on postgres' "explain analysis" as suggested by Mark.
15112         * database/generate-manifest.js:
15113         (buildPlatformMapIfPossible):
15114         * database/generate-runs.js:
15115         (fetchRuns):
15116         * database/init-database.sql:
15117         * database/schema.graffle:
15118         * public/admin/admin.css:
15119         (table):
15120         (tbody.odd):
15121         * public/admin/tests.php:
15122         * public/index.html:
15124 2012-11-27  Ryosuke Niwa  <rniwa@webkit.org>
15126         SafariPerfMonitor: Improve the webkit-perf migration tool
15127         <rdar://problem/12760882>
15129         Reviewed by Mark Rowe.
15131         Make the migrator tool skip runs when fetching runs failed since webkit-perf.appspot.com is unreliable
15132         and we don't want to pause the whole importation process until the user comes back to decide whether
15133         to retry or not.
15135         Also place form controls next to each test in tests.php so that users don't have to scroll all the way
15136         down to make modifications.
15138         Finally, add unique constraint to (run_config, run_build) in test_runs table in order to optimize a query
15139         of the form: "SELECT run_id FROM test_runs WHERE run_config = $1 AND run_build = $2",
15141         * database/init-database.sql:
15142         * database/perf-webkit-migrator.js:
15143         (migrateTestConfig):
15144         * database/schema.graffle:
15145         * public/admin/admin.css:
15146         (table):
15147         * public/admin/tests.php:
15149 2012-11-16  Ryosuke Niwa  <rniwa@webkit.org>
15151         Create a new performance dashboard
15152         <rdar://problem/12625582>
15154         Rubber-stamped by Mark Rowe.
15156         Add the initial implementation of the perf dashboard.
15158         * database: Added.
15159         * database/config.json: Added.
15160         * database/database-common.js: Added.
15161         (connect):
15162         (fetchTable):
15163         (manifestPath):
15164         (pathToRunsJSON):
15165         (pathToLocalScript):
15166         (config):
15167         * database/generate-manifest.js: Added.
15168         (ensureProperty):
15169         (buildTestMap):
15170         (buildPlatformMapIfPossible):
15171         (generateFileIfPossible):
15172         * database/perf-webkit-migrator.js: Added.
15173         * database/process-jobs.js: Added.
15174         * database/sample-data.sql: Added.
15175         * database/schema.graffle: Added.
15176         * public: Added.
15177         * public/admin: Added.
15178         * public/admin/README: Added.
15179         * public/admin/admin.css: Added.
15180         * public/admin/footer.php: Added.
15181         * public/admin/header.php: Added.
15182         * public/admin/index.php: Added.
15183         * public/admin/jobs.php: Added.
15184         * public/admin/tests.php: Added.
15185         * public/common.css: Added.
15186         * public/data: Added.
15187         * public/db.php: Added.
15188         * public/index.html: Added.
15189         * public/js: Added.
15190         * public/js/helper-classes.js: Added.
15191         * public/js/jquery-1.8.2.min.js: Added.
15192         * public/js/jquery.flot.min.js: Added.
15193         * public/js/jquery.flot.plugins.js: Added.
15194         * public/js/shared.js: Added.
15195         (fileNameFromPlatformAndTest):
15196         * public/js/statistics.js: Added.