1 2017-03-29 Ryosuke Niwa <rniwa@webkit.org>
3 Another build fix after r214502.
5 * public/v3/components/analysis-results-viewer.js:
6 (AnalysisResultsViewer.prototype.render): this._groupToCellMap.get may not contain the cell when startPoint
7 or metric had not been fetched yet even if currentTestGroup is set.
9 2017-03-29 Ryosuke Niwa <rniwa@webkit.org>
11 Build fix after r214502. Analysis tasks without any test groups are throwing exceptions.
13 * public/v3/components/results-table.js:
14 (ResultsTable.prototype.renderTable): Don't show the header row when there are no content to show.
15 (ResultsTable.prototype._computeRepositoryList): Return a pair of arrays. The caller expects the repository
16 list to be an array, not undefined.
18 2017-03-28 Ryosuke Niwa <rniwa@webkit.org>
20 Modernize AnalysisTaskPage
21 https://bugs.webkit.org/show_bug.cgi?id=170165
23 Reviewed by Antti Koivisto.
25 Modernized AnalysisTaskPage and related components. The main refactoring happened in AnalysisTaskPage
26 from which AnalysisTaskResultsPane and AnalysisTaskTestGroupPane have been extracted.
28 Decoupled BuildRequest from its results. AnalysisResultsViewer and TestGroupResultsTable now stores
29 a reference to AnalysisResultsView and Metric to find the results for each build request.
30 This refactoring is necessary in order to view results of an arbitrary metric in the future.
32 Also refactored ResultsTable and its subclasses extensively. Instead of making its render() to invoke
33 subclass' methods such as buildRowGroups, heading, and additionalHeading, rely on each subclass call
34 to invoke renderTable(), renamed from render(), with callbacks to add extra headers and columns.
36 This patch also fixes a number of usability issues found by the user such as changing the test name
37 resets the customized revisions by the virtue of the modern code being naturally more correct.
39 * public/v3/components/analysis-results-viewer.js:
40 (AnalysisResultsViewer):
41 (AnalysisResultsViewer.prototype.setTestGroupCallback): Deleted. Replaced by "testGroupClick" action.
42 (AnalysisResultsViewer.prototype.setRangeSelectorLabels): Moved here from ResultsTable since it's
43 never used in ResultsTable or TestGroupResultsTable.
44 (AnalysisResultsViewer.prototype.selectedRange): Ditto.
45 (AnalysisResultsViewer.prototype.setPoints): Now takes metric as the third argument.
46 (AnalysisResultsViewer.prototype.setTestGroups): Now takes the current test group.
47 (AnalysisResultsViewer.prototype.didUpdateResults): Deleted.
48 (AnalysisResultsViewer.prototype.setAnalysisResultsView): Added.
49 (AnalysisResultsViewer.prototype.render): Invoke _renderTestGroups lazily. Also simplified the logic
50 to find the selected list item. Since we always use a shadow DOM now, we can simply look for an element
51 with ".seleted" instead of crafting a unique class name.
52 (AnalysisResultsViewer.prototype.renderTestGroups): Renamed from buildRowGroups. Specify callbacks to
53 insert headers for A/B radio buttons, which has been moved from ResultsTable.prototype.render, and the
54 stacked blocks of testing results.
55 (AnalysisResultsViewer.prototype._classForTestGroup): Deleted.
56 (AnalysisResultsViewer.prototype._openStackingBlock): Deleted.
57 (AnalysisResultsViewer.prototype._expandBetween): Create a new set for expandedPoints to make
58 _renderTestGroupsLazily.evaluate do the work.
59 (AnalysisResultsViewer._layoutBlocks): Moved from TestGroupStackingGrid.layout.
60 (AnalysisResultsViewer._sortBlocksByRow): Moved from AnalysisResultsViewer.TestGroupStackingGrid.
61 (AnalysisResultsViewer._insertAfterBlockWithSameRange): Ditto.
62 (AnalysisResultsViewer._insertBlockInFirstAvailableColumn): Ditto.
63 (AnalysisResultsViewer._createCellsForRow): Ditto.
65 (AnalysisResultsViewer.TestGroupStackingBlock):
66 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.addRowIndex):
67 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): No longer creates a unique
68 class name here. See the inline comment for AnalysisResultsViewer.prototype.render.
69 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.isThin): Deleted. We used to collapse "failed"
70 test groups as a thin vertical line, and we wanted to show them next to each other in _layoutBlock but
71 we don't do that anymore.
72 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForCommitSet): Added. Uses
73 this._analysisResultsView to extract the results for the current metrics.
74 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
76 * public/v3/components/analysis-task-bug-list.js: Added.
77 (AnalysisTaskBugList): Added. Extracted from AnalysisTaskChartPane.
78 (AnalysisTaskBugList.prototype.setTask): Added.
79 (AnalysisTaskBugList.prototype.didConstructShadowTree): Added.
80 (AnalysisTaskBugList.prototype.render): Added.
81 (AnalysisTaskBugList.prototype._associateBug): Added.
82 (AnalysisTaskBugList.prototype._dissociateBug): Added.
83 (AnalysisTaskBugList.htmlTemplate): Added.
85 * public/v3/components/chart-pane-base.js:
86 (ChartPaneBase.htmlTemplate): Added a hook to insert more content at the end in AnalysisTaskChartPane.
87 (ChartPaneBase.paneFooterTemplate): Added.
89 * public/v3/components/customizable-test-group-form.js:
90 (CustomizableTestGroupForm):
91 (CustomizableTestGroupForm.prototype.setCommitSetMap):
92 (CustomizableTestGroupForm.prototype.startTesting): Renamed from _submitted. Now dispatches an action
93 by the name of "startTesting" instead of calling this._startCallback.
94 (CustomizableTestGroupForm.prototype.didConstructShadowTree): Added. Moved the logic to attach event
95 handlers here to avoid eagerly creating the shadow tree in the constructor.
96 (CustomizableTestGroupForm.prototype._computeCommitSetMap): Use the newly added this._revisionEditorMap
97 to find the relevant input element instead of running a querySelector.
98 (CustomizableTestGroupForm.prototype.render): Lazily invoke _renderCustomRevisionTable. This avoids
99 overriding the customized revisions when the user finally types in the test group name.
100 (CustomizableTestGroupForm.prototype._renderCustomRevisionTable): Extracted from render.
101 (CustomizableTestGroupForm.prototype._constructRevisionRadioButtons): Made this a non-static method
102 since it needs to update this._revisionEditorMap now. Merged _constructRevisionRadioButtons.
103 (CustomizableTestGroupForm.prototype._createRadioButton): Deleted. See above.
104 (CustomizableTestGroupForm.cssTemplate):
105 (CustomizableTestGroupForm.formContent): Use IDs instead of classes to make this.content(ID) work.
107 * public/v3/components/mutable-list-view.js:
108 (MutableListView.prototype.setList):
109 (MutableListView.prototype.setKindList):
110 (MutableListView.prototype.setAddCallback): Deleted. Replaced by "addItem" action.
111 (MutableListView.prototype.render):
112 (MutableListItem.prototype.content):
114 * public/v3/components/results-table.js:
115 (ResultsTable): Removed this._rangeSelectorLabels, this._rangeSelectorCallback, and this._selectedRange
116 as they are only used by AnalysisResultsViewer. Also replaced this._valueFormatter by
117 this._analysisResultsView which knows a metric.
118 (ResultsTable.prototype.setValueFormatter): Deleted.
119 (ResultsTable.prototype.setRangeSelectorLabels): Deleted.
120 (ResultsTable.prototype.setRangeSelectorCallback): Deleted.
121 (ResultsTable.prototype.selectedRange): Deleted.
122 (ResultsTable.prototype._rangeSelectorClicked): Deleted.
123 (ResultsTable.prototype.setAnalysisResultsView): Added.
124 (ResultsTable.prototype.renderTable): Added. Removed the logic to add _rangeSelectorLabels since it has
125 been moved to AnalysisResultsViewer.prototype.render inside buildColumns, which also inserts additional
126 columns which used to be stored on each ResultsTableRow. Use the same technique to insert additional
127 headers. Also take the name (thead tr th) of row header (tbody tr td) as an argument and automatically
128 create a table cell of an appropriate colspan.
129 (ResultsTable.prototype._createRevisionListCells):
130 (ResultsTable.prototype.heading): Deleted. Superseded by buildHeaders callback.
131 (ResultsTable.prototype.additionalHeading): Ditto.
132 (ResultsTable.prototype.buildRowGroups): Deleted. It is now the responsibility of each subclass to call
133 ResultsTable's renderTable() in the subclass' render() function.
134 (ResultsTable.prototype._computeRepositoryList): No longer takes extraRepositories as an argument.
135 Instead, this function now returns a pair of the repository list and the list of constant commits.
136 (ResultsTable.htmlTemplate):
137 (ResultsTable.cssTemplate):
139 * public/v3/components/test-group-form.js:
140 (TestGroupForm): Avoid eagerly creating the shadow tree. Also removed the removed the dead code.
141 (TestGroupForm.prototype.setRepetitionCount): Simply override the value of the select element.
142 (TestGroupForm.prototype.didConstructShadowTree): Added. Attach event handlers here to avoid eagerly
143 creating the shadow tree in the constructor.
144 (TestGroupForm.prototype.startTesting): Renamed from _submitted. Dispatch "startTesting" action instead
145 of invoking _startCallback which has been removed.
146 (TestGroupForm.htmlTemplate):
147 (TestGroupForm.formContent):
149 * public/v3/components/test-group-results-table.js:
150 (TestGroupResultsTable):
151 (TestGroupResultsTable.prototype.didUpdateResults): Deleted. No longer neeed per setAnalysisResultsView
153 (TestGroupResultsTable.prototype.setTestGroup):
154 (TestGroupResultsTable.prototype.heading): Deleted.
155 (TestGroupResultsTable.prototype.render):
156 (TestGroupResultsTable.prototype._renderTestGroup): Extracted from render.
157 (TestGroupResultsTable.prototype._buildRowGroups): Renamed from buildRowGroups.
158 (TestGroupResultsTable.prototype._buildRowGroupForCommitSet): Extracted from buildRowGroups.
159 (TestGroupResultsTable.prototype._buildComparisonRow): Extracted from buildRowGroups.buildRowGroups
161 * public/v3/index.html: Include analysis-task-bug-list.js.
163 * public/v3/models/analysis-results.js:
164 (AnalysisResults): Inverted the map so that we can easily create a view based on metric.
165 (AnalysisResults.prototype.find): Ditto.
166 (AnalysisResults.prototype.add): Ditto.
167 (AnalysisResults.prototype.viewForMetric): Added.
168 (AnalysisResults.fetch):
169 (AnalysisResultsView): Added.
170 (AnalysisResultsView.prototype.metric): Added.
171 (AnalysisResultsView.prototype.resultForBuildId): Added.
173 * public/v3/models/build-request.js:
174 (BuildRequest.result): Deleted.
175 (BuildRequest.setResult): Deleted.
177 * public/v3/models/test-group.js:
178 (TestGroup): Removed this._allCommitSets since it was never used.
179 (TestGroup.prototype.didSetResult): Deleted since it was never used.
180 (TestGroup.prototype.compareTestResults): Now takes an array of measurement set values.
181 (TestGroup.prototype._valuesForCommitSet): Deleted.
183 * public/v3/pages/analysis-task-page.js:
184 (AnalysisTaskChartPane): This class now includes the form to cutomize the revisions.
185 (AnalysisTaskChartPane.prototype.setShowForm): Added.
186 (AnalysisTaskChartPane.prototype._mainSelectionDidChange):
187 (AnalysisTaskChartPane.prototype.didConstructShadowTree): Added. Dispatches "newTestGroup" action when
188 the user presses the button to start a new A/B testing from the chart.
189 (AnalysisTaskChartPane.prototype.render): Added.
190 (AnalysisTaskChartPane.prototype.paneFooterTemplate): Added.
191 (AnalysisTaskChartPane.cssTemplate):
193 (AnalysisTaskResultsPane): Added. Encapsulates AnalysisResultsViewer and CustomizableTestGroupForm.
194 (AnalysisTaskResultsPane.prototype.setPoints): Added.
195 (AnalysisTaskResultsPane.prototype.setTestGroups): Added.
196 (AnalysisTaskResultsPane.prototype.setAnalysisResultsView): Added.
197 (AnalysisTaskResultsPane.prototype.setShowForm): Added.
198 (AnalysisTaskResultsPane.prototype.didConstructShadowTree): Added. Dispatches "newTestGroup" action
199 when the user presses the button to start a new A/B testing from the chart.
200 (AnalysisTaskResultsPane.prototype.render): Added.
201 (AnalysisTaskResultsPane.htmlTemplate): Added.
202 (AnalysisTaskResultsPane.cssTemplate): Added.
204 (AnalysisTaskTestGroupPane): Added. Encapsulates TestGroupResultsTable and CustomizableTestGroupForm.
205 (AnalysisTaskTestGroupPane.prototype.didConstructShadowTree): Added.
206 (AnalysisTaskTestGroupPane.prototype.setTestGroups): Added.
207 (AnalysisTaskTestGroupPane.prototype.setAnalysisResultsView): Added.
208 (AnalysisTaskTestGroupPane.prototype.render): Added.
209 (AnalysisTaskTestGroupPane.prototype._renderTestGroups): Added. Updates the list of test groups. Hide
210 the hidden groups unless showHiddenGroups is set. Updates this._testGroupMap so that the visibility of
211 groups and their names can be updated without having to re-render the entire list.
212 (AnalysisTaskTestGroupPane.prototype._renderTestGroupVisibility): Added.
213 (AnalysisTaskTestGroupPane.prototype._renderTestGroupNames): Added.
214 (AnalysisTaskTestGroupPane.prototype._renderCurrentTestGroup): Added. Update TestGroupResultsTable with
215 the selected test group. Also highlight the list view, and update the hide-unhide toggle button's label
217 (AnalysisTaskTestGroupPane.htmlTemplate): Added.
218 (AnalysisTaskTestGroupPane.cssTemplate): Added.
220 (AnalysisTaskPage): Deleted a massive number of instance variables. They are now manged by newly added
221 AnalysisTaskChartPane, AnalysisTaskResultsPane, and AnalysisTaskTestGroupPane
222 (AnalysisTaskPage.prototype.didConstructShadowTree): Added. Attach various event handlers here to avoid
223 eagerly creating the shadow tree in the constructor.
224 (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId):
225 (AnalysisTaskPage.prototype._didFetchTask): No longer sets the value formatter to the results viewer
226 and the results table as they now recieve AnalysisResultsView later in _assignTestResultsIfPossible.
227 (AnalysisTaskPage.prototype._didFetchMeasurement): Set the metric to the results viewer.
228 (AnalysisTaskPage.prototype._didUpdateTestGroupHiddenState):
229 (AnalysisTaskPage.prototype._assignTestResultsIfPossible): Create AnalysisResultsView from the newly
230 retrieved AnalysisResults and pass it to AnalysisTaskResultsPane and AnalysisTaskTestGroupPane.
231 (AnalysisTaskPage.prototype.render): Dramatically simplified.
232 (AnalysisTaskPage.prototype._renderTaskNameAndStatus): Extracted from render.
233 (AnalysisTaskPage.prototype._renderRelatedTasks): Ditto.
234 (AnalysisTaskPage.prototype._renderCauseAndFixes): Ditto.
235 (AnalysisTaskPage.prototype._showTestGroup):
236 (AnalysisTaskPage.prototype._updateTaskName): Now takes the new name as an argument.
237 (AnalysisTaskPage.prototype._updateTestGroupName): Now takes the new name as the second argument.
238 (AnalysisTaskPage.prototype._hideCurrentTestGroup): Now takes the test group to hide.
239 (AnalysisTaskPage.prototype._associateCommit): Moved to AnalysisTaskBugList.
240 (AnalysisTaskPage.prototype._dissociateCommit): Ditto.
241 (AnalysisTaskPage.prototype._retryCurrentTestGroup): Now takes the test group as the first argument.
242 (AnalysisTaskPage.prototype._chartSelectionDidChange): Deleted.
243 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Deleted.
244 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): Deleted.
245 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Deleted.
246 (AnalysisTaskPage.htmlTemplate):
247 (AnalysisTaskPage.cssTemplate):
249 * unit-tests/test-groups-tests.js: Updated a test case which was expecting BuildReqeust's result, which
250 has been removed, to exist.
252 2017-03-23 Ryosuke Niwa <rniwa@webkit.org>
254 Share more code between ManifestGenerator and /api/triggerables
255 https://bugs.webkit.org/show_bug.cgi?id=169993
257 Reviewed by Chris Dumez.
259 Shared the code to fetch the list of triggerables from the database between ManifestGenerator
260 and /api/triggerables.
262 * public/api/triggerables.php:
264 * public/include/manifest-generator.php:
265 (ManifestGenerator::fetch_triggerables): Extracted as a static function. Also include the ID
266 in the triggerable data.
268 2017-03-23 Ryosuke Niwa <rniwa@webkit.org>
270 create-test-group should allow a different set of repositories to be used in each configuration
271 https://bugs.webkit.org/show_bug.cgi?id=169992
273 Rubber-stamped by Antti Koivisto.
275 Added the support for new POST parameter, revisionSets, to /privileged-api/create-test-group.
276 This new parameter now specifies an array of repository id to revision dictionaries, and allows
277 different set of repositories' revisions to be specified in each dictionary.
279 We keep the old API for v2 UI and detect-changes.js compatibility for now.
281 * public/privileged-api/create-test-group.php:
283 (commit_sets_from_revision_sets): Added.
284 (ensure_commit_sets): Only fetch the top-level repository per r213788 and r213976.
286 * public/v3/models/test-group.js:
287 (TestGroup.createAndRefetchTestGroups): Use the newly added revisionSets parameter instead of
288 the now depreacted commitSets parameter.
290 * public/v3/pages/analysis-task-page.js:
291 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingCommitSetList): Simplified this code
292 by simply verifying the consistency of commit sets now that createAndRefetchTestGroups takes
293 an array of commit sets instead of a dictionary of repository name to a list of revisions.
295 * server-tests/privileged-api-create-test-group-tests.js: Added test cases for new parameter.
297 2017-03-22 Ryosuke Niwa <rniwa@webkit.org>
299 /api/uploaded-file should return createdAt as a POSIX timestamp
300 https://bugs.webkit.org/show_bug.cgi?id=169980
302 Rubber-stamped by Antti Koivisto.
304 Call Database::to_js_time on createdAt to return it as a POSIX timestamp.
306 * public/include/uploaded-file-helpers.php:
307 (format_uploaded_file): Fixed the bug.
308 * server-tests/api-manifest-tests.js: Renamed from api-manifest.js.
309 * server-tests/api-uploaded-file-tests.js: Renamed from api-uploaded-file.js. Added a test case.
311 2017-03-22 Ryosuke Niwa <rniwa@webkit.org>
313 UploadedFile should support a callback for upload progress
314 https://bugs.webkit.org/show_bug.cgi?id=169977
316 Reviewed by Andreas Kling.
318 Added a new option dictionary to CommonRemoteAPI.sendHttpRequest with uploadProgressCallback
320 Moved request headers and responseHandler callback in NodeRemoteAPI to this dictionary,
321 and updated the tests which relied on this code.
323 * public/shared/common-remote.js:
324 (CommonRemoteAPI.prototype.postJSON):
325 (CommonRemoteAPI.prototype.postJSONWithStatus):
326 (CommonRemoteAPI.prototype.postFormData):
327 (CommonRemoteAPI.prototype.postFormDataWithStatus):
328 * public/v3/privileged-api.js:
329 (PrivilegedAPI.prototype.sendRequest):
330 * public/v3/remote.js:
331 (BrowserRemoteAPI.prototype.sendHttpRequest):
332 (BrowserRemoteAPI.prototype.sendHttpRequestWithFormData):
334 * server-tests/api-uploaded-file.js:
335 * tools/js/remote.js:
336 (NodeRemoteAPI.prototype.sendHttpRequest):
337 (NodeRemoteAPI.prototype.sendHttpRequestWithFormData):
340 2017-03-22 Ryosuke Niwa <rniwa@webkit.org>
342 ComponentBase should enqueue itself to render when it becomes connected
343 https://bugs.webkit.org/show_bug.cgi?id=169905
345 Reviewed by Antti Koivisto.
347 When a component becomes connected to a document, enqueue itself to render automatically.
348 Also added the support for boolean attribute to ComponentBase.createElement.
350 * ReadMe.md: Added an instruction to raise the upload limit per r214065.
351 * browser-tests/component-base-tests.js: Added tests for the new behavior and createElement. Also moved
352 the tests related to enqueueToRenderOnResize out of defineElement tests.
354 * browser-tests/index.html:
355 (BrowsingContext.prototype.constructor): Override requestAnimationFrame so that the callback would be
356 involved immediately durign testing.
358 * public/v3/components/base.js:
359 (ComponentBase): Enqueue itself to render during construction if custom elements is not available.
360 (ComponentBase.defineElement):
361 (ComponentBase.defineElement.elementClass.prototype.connectedCallback): Enqueue itself to render when
362 the component's element became connected.
363 (ComponentBase.createElement): Use Array.isArray instead of instanceof to make it work with arrays made
364 in other realms (global objects) during testing. Added the support for boolean attributes. Setting an
365 attribute value to true would set the attribute, and setting it to false would not set the attribute.
366 (ComponentBase.useNativeCustomElements): Added. True iff window.customElements is defined.
368 * public/v3/components/chart-pane-base.js:
369 (ChartPaneBase.prototype.render): No longer need to call enqueueToRender on the commit log viewer.
371 * public/v3/components/commit-log-viewer.js:
372 (CommitLogViewer.prototype.render): No longer need to call enqueueToRender on the spinner icon.
374 * public/v3/models/time-series.js:
375 (TimeSeries): Made this a proper class declaration now that we don't include data.js after r213300.
377 * public/v3/pages/chart-pane.js:
378 (ChartPane.prototype._renderActionToolbar): No longer need to call enqueueToRender on the close icon.
380 * public/v3/pages/summary-page.js:
381 (SummaryPage.prototype._renderCell): No longer need to call enqueueToRender on the spinner icon.
383 2017-03-20 Ryosuke Niwa <rniwa@webkit.org>
385 Delete another function that was supposed to be removed in the previous commit.
387 * public/v3/models/build-request.js:
388 (BuildRequest.cachedRequestsForTriggerableID): Deleted.
390 2017-03-20 Ryosuke Niwa <rniwa@webkit.org>
392 Modernize BuildRequestQueuePage
393 https://bugs.webkit.org/show_bug.cgi?id=169903
395 Reviewed by Antti Koivisto.
397 Modernized the code for /v3/#/analysis/queue.
399 * public/v3/models/build-request.js:
400 (BuildRequest.fetchTriggerables): Deleted since the manifest JSON now contains all the triggerables.
402 * public/v3/pages/build-request-queue-page.js:
403 (BuildRequestQueuePage): Deleted this._triggerables. Added this._buildRequestsByTriggerable.
404 (BuildRequestQueuePage.prototype.open): Modernized the code.
405 (BuildRequestQueuePage.prototype.render): Ditto.
406 (BuildRequestQueuePage.prototype._constructBuildRequestTable): Ditto.
408 2017-03-19 Ryosuke Niwa <rniwa@webkit.org>
410 Charts page show an inconsistent list of revisions for Git and Subversion
411 https://bugs.webkit.org/show_bug.cgi?id=169888
413 Reviewed by Andreas Kling.
415 With Git, CommitLogViewer was showing the list of revisions including the starting hash,
416 which was the last data point's revision instead of all revisions after the last data point.
418 Fixed the bug by always specifying the revision at the last data point in both Subversion
419 and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision.
420 For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and
421 "lastRevision" respectively.
423 We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g.
424 when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250"
425 instead of "r1235-r1250".
427 * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer
428 specifies from/to revisions.
429 * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer.
430 * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css.
432 * public/api/commits.php:
433 (main): Renamed "from" and "to" query parameters.
435 * public/include/commit-log-fetcher.php:
436 (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified
437 in both rows or not specified in either. Also reject when before_first_revision is identical
438 or after last_revision instead of re-ordering them since it no longer makes sense to do so with
439 new query parameter names.
441 * public/v3/components/base.js:
442 (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient
443 againt realm (global object) differences.
445 * public/v3/components/chart-pane-base.js:
446 (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since
447 CommitLogViewer does that on its own now.
448 (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer
449 to remember which repository is current. This was the only use of currentRepository.
451 * public/v3/components/commit-log-viewer.js:
453 (CommitLogViewer.prototype.currentRepository): Deleted.
454 (CommitLogViewer.prototype.view):
455 (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy.
456 Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision
457 since the generic JSON API no longer supports being called with the identical revisions.
458 (CommitLogViewer.prototype.render): Modernized & simplified the code.
459 (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy.
460 (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable.
461 (CommitLogViewer.cssTemplate):
463 * public/v3/models/commit-log.js:
464 (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding
465 1 to a Subversion-like starting revision for creating the label. See above. But we still do this
466 for forming URLs due to the way tools like Trac work with Subversion revisions.
467 (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for
468 what this function is supposed to be doing.
469 (CommitLog._cachedCommitLogs): Deleted.
470 (CommitLog.fetchForSingleRevision): Added.
471 (CommitLog._constructFromRawData): Added.
473 * public/v3/models/data-model.js:
474 (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them.
476 * public/v3/remote.js:
477 (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo.
479 * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to
480 use new query parameters and added more test cases.
482 * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer
483 includes from/to values. They're computed in ChartRevisionRange instead.
485 2017-03-20 Ryosuke Niwa <rniwa@webkit.org>
487 Fix os-build-fetcher.js and subprocess.js to make them work
488 https://bugs.webkit.org/show_bug.cgi?id=169844
490 Reviewed by Antti Koivisto.
492 The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel.
493 Some commands to poll the lsit of system components is not desirable to be ran in parallel.
495 * server-tests/resources/mock-subprocess.js:
496 (MockSubprocess): Use const declaration.
497 (MockSubprocess.resetAndWaitForInvocation): Added.
498 (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb.
499 See https://webkit.org/code-style-guidelines/#names-verb
500 (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array
501 regardless of whether reset is called or when it's called.
503 * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now
504 expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting
505 them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve,
506 its subcommand to run, and then move onto the second top-level command. Also use a local reference
507 to MockSubprocess.invocations instead of using the fully qualified name.
509 * tools/js/os-build-fetcher.js:
510 (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array
511 in serial (not asynchronous) is a very common pattern in this class.
512 (OSBuildFetcher.fetchAndReportAllInOrder): Added.
513 (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted.
514 (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result
515 in each top-level command to be execued in parallel. Since each subcommand is executed as soon as
516 its parent command is executed, this results in commands to be executed in parallel.
517 Added a whole bunch of logging so that we can at least detect a bug like this in the future.
518 (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style.
519 (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion
520 about the content returned by a subcommand.
522 * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess.
523 execFile is defined on require('child_process') itself.
524 (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist.
527 * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js.
528 (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep.
530 2017-03-16 Ryosuke Niwa <rniwa@webkit.org>
532 Add the file uploading capability to the perf dashboard.
533 https://bugs.webkit.org/show_bug.cgi?id=169737
535 Reviewed by Chris Dumez.
537 Added /privileged-api/upload-file to upload a file, and /api/uploaded-file/ to download the file
538 and retrieve its meta data based on its SHA256. We treat two files with the identical SHA256 as
539 identical since anyone who can upload a file using this mechanism can execute arbitrary code in
540 our bots anyway. This is important for avoiding uploading a large darwinup roots multiple times
541 to the server, saving both user's time/bandwidth and server's disk space.
543 * config.json: Added uploadDirectory, uploadFileLimitInMB, and uploadUserQuotaInMB as options.
544 * init-database.sql: Added uploaded_files table.
546 * public/api/uploaded-file.php: Added.
547 (main): /api/uploaded-file/N would download uploaded_file with id=N. /api/uploaded-file/?sha256=X
548 would return the meta data for uploaded_file with sha256=X.
549 (stream_file_content): Streams the file content in 64KB chunks. We support Range & If-Range HTTP
550 request headers so that browsers can pause and resume downloading of a large root file.
551 (parse_range_header): Parses Range HTTP request header.
553 * public/include/json-header.php:
554 (remote_user_name): Use the default argument of NULL.
556 * public/include/manifest-generator.php:
557 (ManifestGenerator::generate): Include the maximum upload size in the manifest file to let the
558 frontend code preemptively check the file size before attempting to submit a file.
560 * public/include/uploaded-file-helpers.php: Added.
561 (format_uploaded_file):
562 (uploaded_file_path_for_row):
564 * public/privileged-api/upload-file-form.html: Added. For debugging purposes.
568 * public/privileged-api/upload-file.php: Added.
570 (query_total_file_size):
571 (create_uploaded_file_from_form_data):
573 * public/shared/common-remote.js:
574 (CommonRemoteAPI.prototype.postFormData): Added.
575 (CommonRemoteAPI.prototype.postFormDataWithStatus): Added.
576 (CommonRemoteAPI.prototype.sendHttpRequestWithFormData): Added.
577 (CommonRemoteAPI.prototype._asJSON): Throw an exception instead of calling a non-existent reject.
579 * public/v3/models/uploaded-file.js: Added.
580 (UploadedFile): Added.
581 (UploadedFile.uploadFile): Added.
582 (UploadedFile.fetchUnloadedFileWithIdenticalHash): Added. Finds the file with the same SHA256 in
583 the server to avoid uploading a large custom root multiple times.
584 (UploadedFile._computeSHA256Hash): Added.
586 * public/v3/privileged-api.js:
587 (PrivilegedAPI.prototype.sendRequest): Added the options dictionary as a third argument. For now,
588 only support useFormData boolean.
590 * public/v3/remote.js:
591 (BrowserRemoteAPI.prototype.sendHttpRequestWithFormData): Added.
593 * server-tests/api-manifest.js: Updated per the inclusion of fileUploadSizeLimit in the manifest.
594 * server-tests/api-uploaded-file.js: Added.
595 * server-tests/privileged-api-upload-file-tests.js: Added.
597 * server-tests/resources/temporary-file.js: Added.
598 (TemporaryFile): Added. A helper class for creating a temporary file to upload.
599 (TemporaryFile.makeTemporaryFileOfSizeInMB):
600 (TemporaryFile.makeTemporaryFile):
601 (TemporaryFile.inject):
603 * server-tests/resources/test-server.conf: Set upload_max_filesize and post_max_size for testing.
604 * server-tests/resources/test-server.js:
605 (TestServer.prototype.testConfig): Use uploadFileLimitInMB and uploadUserQuotaInMB of 2MB and 5MB.
606 (TestServer.prototype._ensureDataDirectory): Create a directory to store uploaded files inside
607 the data directory. In a production server, we can place it outside ServerRoot / DocumentRoot.
608 (TestServer.prototype.cleanDataDirectory): Delete the aforementioned directory as needed.
610 * tools/js/database.js:
611 (tableToPrefixMap): Added uploaded_files.
613 * tools/js/remote.js:
614 (NodeRemoteAPI.prototype.sendHttpRequest): Added a dictionary to specify request headers and
615 a callback to process the response as arguments. Fixed the bug that any 2xx code other than 200
616 was resulting in a rejected promise. Also include the response headers in the result for tests.
617 Finally, when content is a function, call that instead of writing the content since FormData
618 requires a custom logic.
619 (NodeRemoteAPI.prototype.sendHttpRequestWithFormData): Added.
621 * tools/js/v3-models.js: Include uploaded-file.js.
623 * tools/run-tests.py:
624 (main): Add form-data as a new dependency.
626 2017-03-15 Dewei Zhu <dewei_zhu@apple.com>
628 Fix unit test and bug fix for 'pull-os-versions.js' script.
629 https://bugs.webkit.org/show_bug.cgi?id=169701
631 Reviewed by Ryosuke Niwa.
633 Fix unit tests warnings on node-6.10.0.
634 Fix 'pull-os-versions.js' does not fetch new builds and report.
636 * server-tests/tools-os-build-fetcher-tests.js:
640 * tools/pull-os-versions.js:
643 2017-03-15 Ryosuke Niwa <rniwa@webkit.org>
645 In-browser and node.js implementations of RemoteAPI should share some code
646 https://bugs.webkit.org/show_bug.cgi?id=169695
648 Rubber-stamped by Antti Koivisto.
650 Extracted CommonRemoteAPI out of RemoteAPI implementations for node.js and browser.
652 * public/shared/common-remote.js: Added.
653 (CommonRemoteAPI): Added.
654 (CommonRemoteAPI.prototype.postJSON): Extracted from RemoteAPI.
655 (CommonRemoteAPI.prototype.postJSONWithStatus): Ditto.
656 (CommonRemoteAPI.prototype.getJSON): Ditto.
657 (CommonRemoteAPI.prototype.getJSONWithStatus): Ditto.
658 (CommonRemoteAPI.prototype.sendHttpRequest): Added. Needs to implemented by a subclass.
659 (CommonRemoteAPI.prototype._asJSON): Added.
660 (CommonRemoteAPI.prototype._checkStatus): Added.
662 * public/v3/index.html: Include common-remote.js.
664 * public/v3/privileged-api.js:
665 (PrivilegedAPI): Use class now that we don't include data.js.
666 (PrivilegedAPI.sendRequest): Modernized the code.
667 (PrivilegedAPI.requestCSRFToken): Ditto.
669 * public/v3/remote.js:
670 (BrowserRemoteAPI): Renamed from RemoteAPI. window.RemoteAPI is now an instance of this class.
671 (BrowserRemoteAPI.prototype.sendHttpRequest): Moved from RemoteAPI.sendHttpRequest.
672 (BrowserRemoteAPI.prototype.sendHttpRequest):
674 * server-tests/privileged-api-create-analysis-task-tests.js: Updated tests since NodeJSRemoteAPI
675 now throws the JSON status as an error to be consistent with BrowserRemoteAPI.
676 * server-tests/privileged-api-create-test-group-tests.js: Ditto.
677 * server-tests/privileged-api-upate-run-status.js: Ditto.
679 * tools/js/buildbot-triggerable.js:
680 (BuildbotTriggerable.prototype.syncOnce): Just use postJSONWithStatus instead of manually
683 * tools/js/remote.js:
684 (NodeRemoteAPI): Renamed from RemoteAPI. Still exported as RemoteAPI.
685 (NodeRemoteAPI.prototype.constructor):
686 (NodeRemoteAPI.prototype.sendHttpRequest): Modernized the code.
688 2017-03-15 Ryosuke Niwa <rniwa@webkit.org>
690 Fix server tests after r213998 and r213969
691 https://bugs.webkit.org/show_bug.cgi?id=169690
693 Reviewed by Antti Koivisto.
695 Fixed the existing server tests.
697 * public/v3/models/analysis-task.js:
698 (AnalysisTask.prototype._updateRemoteState): Use the relative path from the root so that it works inside tests.
699 (AnalysisTask.prototype.associateBug): Ditto.
700 (AnalysisTask.prototype.dissociateBug): Ditto.
701 (AnalysisTask.prototype.associateCommit): Ditto.
702 (AnalysisTask.prototype.dissociateCommit): Ditto.
703 (AnalysisTask._fetchSubset): Ditto.
704 (AnalysisTask.fetchAll): Ditto.
705 * public/v3/models/test-group.js:
706 (TestGroup.prototype.updateName): Ditto.
707 (TestGroup.prototype.updateHiddenFlag): Ditto.
708 (TestGroup.createAndRefetchTestGroups): Ditto.
709 (TestGroup.cachedFetch): Ditto.
710 * server-tests/api-manifest.js: Reverted an inadvertant change in r213969.
711 * tools/js/database.js:
712 (tableToPrefixMap): Added analysis_strategies.
713 * unit-tests/analysis-task-tests.js: Updated expectations per changes to AnalysisTask.
715 2017-03-15 Ryosuke Niwa <rniwa@webkit.org>
717 Add tests for privileged-api/create-analysis-task and privileged-api/create-test-group
718 https://bugs.webkit.org/show_bug.cgi?id=169688
720 Rubber-stamped by Antti Koivisto.
722 Added tests for privileged-api/create-analysis-task and privileged-api/create-test-group, and fixed newly found bugs.
724 * public/privileged-api/create-analysis-task.php:
725 (main): Fixed the bug that we were not explicitly checking whether start_run and end_run were integers or not.
726 Also return InvalidTimeRange when start and end times are identical as that makes no sense for an analysis task.
728 * public/privileged-api/create-test-group.php:
729 (main): Fixed a bug that we were not explicitly checking task and repetitionCount to be an integer.
730 (ensure_commit_sets): Fixed the bug that the number of commit sets weren't checked.
732 * server-tests/privileged-api-create-analysis-task-tests.js: Added.
733 * server-tests/privileged-api-create-test-group-tests.js: Added.
735 * server-tests/resources/common-operations.js:
736 (prepareServerTest): Increase the timeout from 1s to 5s.
738 * server-tests/resources/mock-data.js:
739 (MockData.addMockData): Use a higher database ID of 20 for a mock build_slave to avoid a conflict with auto-generated IDs.
741 2017-03-15 Ryosuke Niwa <rniwa@webkit.org>
743 Make unit tests return a promise instead of manually calling done
744 https://bugs.webkit.org/show_bug.cgi?id=169663
746 Reviewed by Antti Koivisto.
748 Make the existing unit tests always reutrn a promise instead of manually calling "done" callback as done
749 in r213969. The promise tests are a lot more stable and less error prone.
751 Also use MockRemoteAPI.waitForRequest() instead of chaining two resolved promises where appropriate.
753 * unit-tests/analysis-task-tests.js:
754 * unit-tests/buildbot-syncer-tests.js:
755 * unit-tests/checkconfig.js:
756 * unit-tests/privileged-api-tests.js:
758 2017-03-15 Dewei Zhu <dewei_zhu@apple.com>
760 Rewrite 'pull-os-versions' script in Javascript to add support for reporting os revisions with sub commits.
761 https://bugs.webkit.org/show_bug.cgi?id=169542
763 Reviewed by Ryosuke Niwa.
765 Extend '/api/commits/<repository>/last-reported' to accept a range and return last reported commits in given range.
766 Rewrite 'pull-os-versions' in JavaScript and add unit tests for it.
767 Instead of writing query manually while searching criteria contains null columns, use the methods provided in 'db.php'.
768 Add '.gitignore' file to ommit files generated by while running tests/instances locally.
771 * public/api/commits.php:
772 * public/api/report-commits.php:
773 * public/include/commit-log-fetcher.php:
774 * public/include/db.php: 'null_columns' of prepare_params should be a reference.
775 * public/include/report-processor.php:
776 * server-tests/api-commits.js:
778 * server-tests/api-report-commits-tests.js:
779 * server-tests/resources/mock-logger.js: Added.
781 (MockLogger.prototype.log):
782 (MockLogger.prototype.error):
783 * server-tests/resources/mock-subprocess.js: Added.
784 (MockSubprocess.call):
785 (MockSubprocess.waitingForInvocation):
786 (MockSubprocess.inject):
787 (MockSubprocess.reset):
788 * server-tests/tools-buildbot-triggerable-tests.js:
789 (MockLogger): Deleted.
790 (MockLogger.prototype.log): Deleted.
791 (MockLogger.prototype.error): Deleted.
792 * server-tests/tools-os-build-fetcher-tests.js: Added.
794 (return.waitingForInvocationPromise.then):
796 (string_appeared_here.return.waitingForInvocationPromise.then):
797 (return.addSlaveForReport.emptyReport.then):
798 * tools/js/os-build-fetcher.js: Added.
800 (OSBuildFetcher.prototype._fetchAvailableBuilds):
801 (OSBuildFetcher.prototype._computeOrder):
802 (OSBuildFetcher.prototype._commitsForAvailableBuilds.return.this._subprocess.call.then.):
803 (OSBuildFetcher.prototype._commitsForAvailableBuilds):
804 (OSBuildFetcher.prototype._addSubCommitsForBuild):
805 (OSBuildFetcher.prototype._submitCommits):
806 (OSBuildFetcher.prototype.fetchAndReportNewBuilds):
807 * tools/js/subprocess.js: Added.
808 (const.childProcess.require.string_appeared_here.Subprocess.prototype.call):
809 (const.childProcess.require.string_appeared_here.Subprocess):
810 * tools/pull-os-versions.js: Added.
813 * tools/sync-commits.py:
814 (Repository.fetch_commits_and_submit):
816 2017-03-14 Ryosuke Niwa <rniwa@webkit.org>
818 Make server tests return a promise instead of manually calling done
819 https://bugs.webkit.org/show_bug.cgi?id=169648
821 Rubber-stamped by Chris Dumez.
823 Make the existing server tests always reutrn a promise instead of manually calling "done" callback.
824 The promise tests are a lot more stable and less error prone.
826 Also use arrow functions everywhere and use prepareServerTest, renamed from connectToDatabaseInEveryTest,
827 in more tests instead of manually connecting to database in every test, and reset v3 models.
829 * server-tests/admin-platforms-tests.js:
830 * server-tests/admin-reprocess-report-tests.js:
831 * server-tests/api-build-requests-tests.js:
832 * server-tests/api-manifest.js:
833 * server-tests/api-measurement-set-tests.js:
834 (.postReports): Deleted. Not used in any test.
835 * server-tests/api-report-commits-tests.js:
836 * server-tests/api-report-tests.js:
837 * server-tests/api-update-triggerable.js:
838 * server-tests/privileged-api-upate-run-status.js:
839 * server-tests/resources/common-operations.js:
840 (prepareServerTest): Renamed from connectToDatabaseInEveryTest. Increase the timeout and reset v3 models.
841 * server-tests/tools-buildbot-triggerable-tests.js:
843 2017-03-12 Ryosuke Niwa <rniwa@webkit.org>
845 Rename RootSet to CommitSet
846 https://bugs.webkit.org/show_bug.cgi?id=169580
848 Rubber-stamped by Chris Dumez.
850 Renamed root_sets to commit_sets and roots to commit_set_relationships in the database schema, and renamed
851 related classes in public/v3/ and tools accordingly.
853 RootSet, MeasurementRootSet, and CustomRootSet are respectively renamed to CommitSet, MeasurementCommitSet,
856 In order to migrate the database, run:
859 ALTER TABLE root_sets RENAME TO commit_sets;
860 ALTER TABLE commit_sets RENAME COLUMN rootset_id TO commitset_id;
861 ALTER TABLE roots RENAME TO commit_set_relationships;
862 ALTER TABLE commit_set_relationships RENAME COLUMN root_set TO commitset_set;
863 ALTER TABLE commit_set_relationships RENAME COLUMN root_commit TO commitset_commit;
864 ALTER TABLE build_requests RENAME COLUMN request_root_set TO request_commit_set;
868 * browser-tests/index.html:
870 * public/api/build-requests.php:
872 * public/api/test-groups.php:
875 * public/include/build-requests-fetcher.php:
876 (BuildRequestsFetcher::__construct):
877 (BuildRequestsFetcher::results_internal):
878 (BuildRequestsFetcher::commit_sets): Renamed from root_sets.
879 (BuildRequestsFetcher::commits): Renamed from roots.
880 (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Renamed from fetch_roots_for_set_if_needed.
881 * public/privileged-api/create-test-group.php:
883 (ensure_commit_sets): Renamed from commit_sets_from_root_sets.
884 * public/v3/components/analysis-results-viewer.js:
885 (AnalysisResultsViewer.prototype.buildRowGroups):
886 (AnalysisResultsViewer.prototype._collectCommitSetsInTestGroups): Renamed from _collectRootSetsInTestGroups.
887 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
888 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
889 (AnalysisResultsViewer.CommitSetInTestGroup): Renamed from RootSetInTestGroup.
890 (AnalysisResultsViewer.CommitSetInTestGroup.prototype.constructor):
891 (AnalysisResultsViewer.CommitSetInTestGroup.prototype.commitSet): Renamed from rootSet.
892 (AnalysisResultsViewer.CommitSetInTestGroup.prototype.succeedingCommitSet): Renamed from succeedingRootSet.
893 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.constructor):
894 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.addRowIndex):
895 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.isComplete):
896 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.startRowIndex):
897 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.endRowIndex):
898 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
899 * public/v3/components/chart-revision-range.js:
900 (ChartRevisionRange.prototype._revisionForPoint):
901 (ChartRevisionRange.prototype._computeRevisionList):
902 * public/v3/components/customizable-test-group-form.js:
903 (CustomizableTestGroupForm.prototype.constructor):
904 (CustomizableTestGroupForm.prototype.setCommitSetMap): Renamed from setRootSetMap.
905 (CustomizableTestGroupForm.prototype._submitted):
906 (CustomizableTestGroupForm.prototype._computeCommitSetMap): Renamed from _computeRootSetMap.
907 (CustomizableTestGroupForm.prototype.render): Renamed from render.
908 (CustomizableTestGroupForm.prototype._constructRevisionRadioButtons):
909 * public/v3/components/results-table.js:
910 (ResultsTable.prototype.render):
911 (ResultsTable.prototype._createRevisionListCells):
912 (ResultsTable.prototype._computeRepositoryList):
913 (ResultsTableRow.prototype.constructor):
914 (ResultsTableRow.prototype.commitSet): Renamed from rootSet.
915 * public/v3/components/test-group-results-table.js:
916 (TestGroupResultsTable.prototype.buildRowGroups):
917 * public/v3/index.html:
918 * public/v3/models/build-request.js:
919 (BuildRequest.prototype.constructor):
920 (BuildRequest.prototype.updateSingleton):
921 (BuildRequest.prototype.commitSet): Renamed from rootSet.
922 (BuildRequest.constructBuildRequestsFromData):
923 * public/v3/models/commit-set.js: Renamed from public/v3/models/root-set.js.
924 (CommitSet): Renamed from RootSet.
925 (CommitSet.containsMultipleCommitsForRepository):
926 (MeasurementCommitSet): Renamed from MeasurementRootSet.
927 (MeasurementCommitSet.prototype.namedStaticMap):
928 (MeasurementCommitSet.prototype.ensureNamedStaticMap):
929 (MeasurementCommitSet.namedStaticMap):
930 (MeasurementCommitSet.ensureNamedStaticMap):
931 (MeasurementCommitSet.ensureSingleton):
932 (CustomCommitSet): Renamed from CustomRootSet.
933 * public/v3/models/measurement-adaptor.js:
934 (MeasurementAdaptor.prototype.applyTo):
935 * public/v3/models/test-group.js:
936 (TestGroup.prototype.constructor):
937 (TestGroup.prototype.addBuildRequest):
938 (TestGroup.prototype.repetitionCount):
939 (TestGroup.prototype.requestedCommitSets): Renamed from requestedRootSets.
940 (TestGroup.prototype.requestsForCommitSet): Renamed from requestsForRootSet.
941 (TestGroup.prototype.labelForCommitSet): Renamed from labelForRootSet.
942 (TestGroup.prototype.didSetResult):
943 (TestGroup.prototype.compareTestResults):
944 (TestGroup.prototype._valuesForCommitSet): Renamed from _valuesForRootSet.
945 (TestGroup.prototype.createAndRefetchTestGroups):
946 * public/v3/pages/analysis-task-page.js:
947 (AnalysisTaskPage.prototype.render):
948 (AnalysisTaskPage.prototype._retryCurrentTestGroup):
949 (AnalysisTaskPage.prototype._createNewTestGroupFromChart):
950 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer):
951 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingCommitSetList):
952 * server-tests/api-build-requests-tests.js:
953 * server-tests/resources/mock-data.js:
954 (MockData.resetV3Models):
955 (MockData.addMockData):
956 (MockData.addAnotherMockTestGroup):
957 * tools/detect-changes.js:
958 (createAnalysisTaskAndNotify):
959 * tools/js/buildbot-syncer.js:
960 (BuildbotSyncer.prototype._propertiesForBuildRequest):
961 (BuildbotSyncer.prototype._revisionSetFromCommitSetWithExclusionList):
962 * tools/js/database.js:
964 * tools/js/v3-models.js:
965 * tools/sync-buildbot.js:
967 * tools/sync-with-buildbot.py: Deleted. No longer used.
968 * unit-tests/analysis-task-tests.js:
969 * unit-tests/build-request-tests.js:
970 (sampleBuildRequestData):
971 * unit-tests/buildbot-syncer-tests.js:
972 (sampleCommitSetData):
973 * unit-tests/measurement-adaptor-tests.js:
974 * unit-tests/measurement-set-tests.js:
975 * unit-tests/resources/mock-v3-models.js:
977 * unit-tests/test-groups-tests.js:
980 2017-03-13 Ryosuke Niwa <rniwa@webkit.org>
982 Database's query functions should support querying for a row with NULL value
983 https://bugs.webkit.org/show_bug.cgi?id=169504
985 Reviewed by Antti Koivisto.
987 Add the support for calling select_* with one of column values set to NULL.
988 This feature is useful in webkit.org/b/146374 and webkit.org/b/168962.
990 * public/include/db.php:
991 (Database::prepare_params): Added $null_columns as an optional argument.
992 (Database::select_conditions_with_null_columns): Added. Builds up a query string by appending AND x is NULL
993 to match columns whose value must be NULL.
994 (Database::_select_update_or_insert_row):
995 (Database::select_rows):
997 2017-03-13 Dewei Zhu <dewei_zhu@apple.com>
999 Add the ability to report a commit with sub-commits.
1000 https://bugs.webkit.org/show_bug.cgi?id=168962
1002 Reviewed by Ryosuke Niwa.
1004 Introduce 'commit_ownerships' which records ownership between commits.
1005 On existing production server, run ```
1006 CREATE TABLE commit_ownerships (
1007 commit_owner integer NOT NULL REFERENCES commits ON DELETE CASCADE,
1008 commit_ownee integer NOT NULL REFERENCES commits ON DELETE CASCADE,
1009 PRIMARY KEY (commit_owner, commit_ownee)
1011 ALTER TABLE repositories RENAME repository_parent TO repository_owner;
1012 ALTER TABLE repositories DROP repository_name_must_be_unique;
1013 CREATE UNIQUE INDEX repository_name_owner_unique_index ON repositories (repository_owner, repository_name) WHERE repository_owner IS NOT NULL;
1014 CREATE UNIQUE INDEX repository_name_unique_index ON repositories (repository_name) WHERE repository_owner IS NULL;
1015 ``` to update database.
1016 Add unit-tests to cover this change.
1018 * init-database.sql:
1019 * public/api/report-commits.php:
1020 * public/include/commit-log-fetcher.php:
1021 * public/include/db.php:
1022 * public/include/manifest-generator.php:
1023 * public/include/report-processor.php:
1024 * public/v3/models/repository.js:
1026 (Repository.prototype.owner):
1027 * server-tests/admin-reprocess-report-tests.js:
1028 (addBuilderForReport.simpleReportWithRevisions.0.then):
1030 * server-tests/api-manifest.js:
1032 * server-tests/api-report-commits-tests.js:
1033 (addSlaveForReport.sameRepositoryNameInSubCommitAndMajorCommit.then):
1035 (addSlaveForReport.systemVersionCommitWithSubcommits.then):
1036 (addSlaveForReport.multipleSystemVersionCommitsWithSubcommits.then):
1037 (addSlaveForReport.systemVersionCommitWithEmptySubcommits.then):
1038 (addSlaveForReport.systemVersionCommitAndSubcommitWithTimestamp.then):
1039 * tools/js/database.js:
1041 2017-03-07 Ryosuke Niwa <rniwa@webkit.org>
1043 Update ReadMe.md to use directory format for backing up & restoring the database
1044 https://bugs.webkit.org/show_bug.cgi?id=169263
1046 Reviewed by Joseph Pecoraro.
1048 Update ReadMe.md's instruction to backup and restore the database to use directory format instead of
1049 piping it to gzip. The new command will backup and restore the database with multiple concurrent processes
1050 with a custom compression level.
1054 2017-03-02 Ryosuke Niwa <rniwa@webkit.org>
1056 Make baseline data points selectable
1057 https://bugs.webkit.org/show_bug.cgi?id=169069
1058 <rdar://problem/29209427>
1060 Reviewed by Antti Koivisto.
1062 Add the capability to select data points other than "current" configuration type.
1064 This patch refactors the way the "chart status" is computed. Before this patch, ChartStatusView was
1065 responsible for determining two data points for which to compute the status, and computing the status
1066 between two data points. ChartPaneStatusView which inherits from ChartStatusView and used in the charts
1067 page relied upon ChartStatusView to compute these values, and computed the list of revision ranges for
1068 each relevant repository between the data points. ChartPane then had callbacks on ChartPaneStatusView
1069 to know whenever these values changed. Because of this entangled mess, ChartStatusView had to be aware
1070 of InteractiveTimeSeriesChart even though only ChartPaneStatusView could be used with it.
1072 This patch dramatically simplifies the situation by adding referencePoints() on TimeSeriesChart and
1073 InteractiveTimeSeriesChart which returns the current point, the previous point if there is any, and
1074 their time series view. It also extracts ChartStatusEvaluator which computes the current status values
1075 and ChartRevisionRange which computes a list of revision differences both based on the referencePoints.
1076 As a result, ChartPaneStatusView no longer inherits from ChartStatusView, and ChartStatusView has been
1077 renamed to DashboardChartStatusView to reflect its purpose. Furthermore, ChartPane which used to rely on
1078 ChartPaneStatusView's revisionCallback to update the commit log viewer simply uses another instance of
1079 ChartRevisionRange, eliminating the need for the callback.
1081 To implement these classes easily, this patch also introduces a new class, LazilyEvaluatedFunction to
1082 memoize the return value of a function when called with the same arguments. Delaying the computation of
1083 a value and avoiding the work when the values are the same is a very common pattern in the perf dashboard
1084 so I expect this class would be used in a lot more places in the future.
1086 * browser-tests/chart-revision-range-tests.js: Added. Tests for ChartRevisionRange.
1087 * browser-tests/chart-status-evaluator-tests.js: Added. Tests for ChartStatusEvaluator.
1089 * browser-tests/index.html:
1091 (BrowsingContext.importScripts): Fixed the bug that calling importScripts twice results in MockRemoteAPI
1093 (ChartTest.importChartScripts): Import more model objects.
1094 (ChartTest.sampleCluster): Made this a getter.
1095 (ChartTest.makeModelObjectsForSampleCluster):
1096 (ChartTest.makeSampleCluster): Added. Cutomizes the valus of baseline / target based on options.
1097 (ChartTest.respondWithSampleCluster): Now takes an options argument for makeSampleCluster.
1099 * public/v3/components/chart-pane-base.js:
1100 (ChartPaneBase): Added _openRepository to keep track of the currently open repository instead of relying
1101 on _mainChartStatus or _commitLogViewer to keep track of it.
1102 (ChartPaneBase.prototype.configure): The callback for when the user clicked on a repository name in
1103 ChartPaneStatusView has been replaced by "openRepository" action.
1104 (ChartPaneBase.prototype.setOpenRepository): Moved from ChartPane.
1105 (ChartPaneBase.prototype._mainSelectionDidChange):
1106 (ChartPaneBase.prototype._indicatorDidChange):
1107 (ChartPaneBase.prototype._didFetchData):
1108 (ChartPaneBase.prototype._updateCommitLogViewer): Renamed from _updateStatus.
1109 (ChartPaneBase.prototype.openNewRepository): Renamed from _requestOpeningCommitViewer. Fixed a bug that
1110 clicking on the repository name inside ChartPaneStatusView would not focus the pane, which resulted in
1111 arrow keys to be ignored instead of moving the main chart's indicator or the currently open repository.
1112 (ChartPaneBase.prototype._keyup):
1113 (ChartPaneBase.prototype._moveOpenRepository): Moved from ChartPaneStatusView's
1114 moveRepositoryWithNotification. Used when changing the open repository by up/down arrow keys.
1116 * public/v3/components/chart-revision-range.js: Added. Extracted from ChartPaneStatusView.
1117 (ChartRevisionRange): Added.
1118 (ChartRevisionRange.prototype.revisionList): Added.
1119 (ChartRevisionRange.prototype.rangeForRepository): Added.
1120 (ChartRevisionRange._revisionForPoint): Added. Extracted from ChartPaneStatusView's
1121 _updateRevisionListForNewCurrentRepository.
1122 (ChartRevisionRange._computeRevisionList): Ditto from computeChartStatusLabels.
1124 * public/v3/components/chart-status-evaluator.js: Added.
1125 (ChartStatusEvaluator): Added.
1126 (ChartStatusEvaluator.prototype.status): Added.
1127 (ChartStatusEvaluator.computeChartStatus): Added. Extracted from ChartStatusView's updateStatusIfNeeded.
1129 * public/v3/components/chart-status-view.js: Removed.
1130 (ChartStatusView): Deleted. Split into ChartStatusEvaluator and DashboardChartStatusView.
1132 * public/v3/components/chart-styles.js:
1133 (ChartStyles.baselineStyle): Make baseline data points interactive. This single line change is what
1134 enables the user to interact with the data points. The rest of changes in this patch mostly deals with
1135 the status text such as "5% worse than baseline" and the list of revisions shown in the commit log viewer
1136 which would have shown the wrong range without these changes.
1138 * public/v3/components/dashboard-chart-status-view.js: Added. Extracted from ChartStatusView.
1139 (DashboardChartStatusView): Added.
1140 (DashboardChartStatusView.prototype.render): Added.
1141 (DashboardChartStatusView.htmlTemplate): Added.
1142 (DashboardChartStatusView.cssTemplate): Added.
1144 * public/v3/components/interactive-time-series-chart.js:
1145 (InteractiveTimeSeriesChart.prototype.referencePoints): Added. Return the first point and the last point
1146 as the reference points when there is a selection. Only report the previous point if they are distinct as
1147 showing a range of revisions from a data point to itself makes no sense. When there is a indicator simply
1148 return it and its previous point as reference points. Otherwise return null unlike TimeSeriesChart's
1149 referencePoints which always returns the latest point as the reference point.
1151 * public/v3/components/time-series-chart.js:
1152 (TimeSeriesChart.prototype.referencePoints): Added. Return the latest point as the reference point. It
1153 never returns the previous point even if there were more data points as there is no way for the user to
1154 specify which data points to compare.
1156 * public/v3/index.html: Include newly added files.
1158 * public/v3/lazily-evaluated-function.js: Added.
1159 (LazilyEvaluatedFunction): Added.
1160 (LazilyEvaluatedFunction.prototype.evaluate): Added.
1162 * public/v3/models/commit-log.js:
1163 (CommitLog.prototype.diff): Fixed a bug that computing the diff of two Subversion-like revisions results
1164 in "from" field to be unexpectedly an integer instead of a string.
1166 * public/v3/models/metric.js:
1167 (Metric): Moved the code to compute the unit from the metric name from v2's RunsData class. This makes
1168 writing tests easier since it eliminates the need to load v2's data.js.
1169 (Metric.prototype.unit):
1170 (Metric.prototype.isSmallerBetter): Ditto for determining whether the unit is smaller-is-better.
1172 * public/v3/pages/analysis-task-page.js:
1173 (AnalysisTaskChartPane.prototype._updateStatus): Deleted the unused code.
1175 * public/v3/pages/chart-pane-status-view.js:
1176 (ChartPaneStatusView): No longer inherits from ChartStatusView. Uses ChartStatusEvaluator and
1177 ChartRevisionRange to to compute the chart status and the list of revision changes.
1178 (ChartPaneStatusView.prototype.pointsRangeForAnalysis): Deleted.
1179 (ChartPaneStatusView.prototype.render): Split it into _renderStatus and _renderBuildRevisionTable using
1180 LazilyEvaluatedFunction.
1181 (ChartPaneStatusView.prototype._renderStatus): Added.
1182 (ChartPaneStatusView.prototype._renderBuildRevisionTable): Added.
1183 (ChartPaneStatusView.prototype.setCurrentRepository): _updateRevisionListForNewCurrentRepository has been
1184 moved into ChartRevisionRange. Just enqueue itself to re-render.
1185 (ChartPaneStatusView.prototype._setRevisionRange): Deleted.
1186 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Deleted.
1187 (ChartPaneStatusView.prototype.updateRevisionList): Deleted.
1188 (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Deleted.
1189 (ChartPaneStatusView.prototype.computeChartStatusLabels): Deleted.
1190 (ChartPaneStatusView.htmlTemplate):
1191 (ChartPaneStatusView.cssTemplate):
1193 * public/v3/pages/chart-pane.js:
1194 (ChartPane.prototype.openNewRepository): Overrides the one in ChartPaneBase, which has been renamed from
1195 _requestOpeningCommitViewer.
1196 (ChartPane.prototype._analyzeRange):
1197 (ChartPane.prototype._renderActionToolbar): Use the main chart's selection directly to determine whether
1198 an analysis task can be created for the currenty selected range.
1200 * public/v3/pages/dashboard-page.js:
1201 (DashboardPage.prototype._createChartForCell):
1203 * unit-tests/lazily-evaluated-function-tests.js: Added. Tests for LazilyEvaluatedFunction.
1205 2017-03-01 Ryosuke Niwa <rniwa@webkit.org>
1207 Build fix after r212853. Make creating an analysis task work again.
1209 * public/v3/pages/analysis-task-page.js:
1210 (AnalysisTaskPage.prototype.render):
1212 2017-02-27 Ryosuke Niwa <rniwa@webkit.org>
1214 Fix tests after r213119 and r213120.
1216 * browser-tests/time-series-chart-tests.js:
1217 (return.ChartTest.importChartScripts.context.then):
1218 (string_appeared_here.then): Deleted.
1220 2017-02-27 Ryosuke Niwa <rniwa@webkit.org>
1222 Removed the unused code that was supposed to be removed in the previous commit.
1224 * browser-tests/time-series-chart-tests.js:
1226 2017-02-27 Ryosuke Niwa <rniwa@webkit.org>
1228 Split tests for InteractiveTimeSeriesChart into a separate test file.
1229 https://bugs.webkit.org/show_bug.cgi?id=168960
1231 Reviewed by Joseph Pecoraro.
1233 Extracted the test cases for InteractiveTimeSeriesChart charts from time-series-chart-tests.js
1234 into interactive-time-series-chart-tests.js now that the former file has gotten really big over time.
1236 Also extracted a bunch of helper functions time-series-chart-tests.js as ChartTest in index.html.
1237 Any test which instantiates a time series chart can use this helper class.
1239 * browser-tests/index.html:
1240 (ChartTest.importChartScripts): Ditto.
1241 (ChartTest.posixTime): Moved from time-series-chart-tests.js.
1242 (ChartTest.sampleCluster): Ditto.
1243 (ChartTest.createChartWithSampleCluster): Ditto.
1244 (ChartTest.createInteractiveChartWithSampleCluster): Ditto.
1245 (ChartTest.respondWithSampleCluster):
1246 * browser-tests/interactive-time-series-chart-tests.js: Extracted from time-series-chart-tests.js.
1247 * browser-tests/time-series-chart-tests.js:
1249 (dayInMilliseconds): Moved.
1250 (sampleCluster): Moved.
1251 (createChartWithSampleCluster): Moved.
1252 (createInteractiveChartWithSampleCluster): Moved.
1253 (respondWithSampleCluster): Moved.
1254 * unit-tests/analysis-task-tests.js: Fixed a typo. s/adopter/adapter/.
1256 2017-02-27 Ryosuke Niwa <rniwa@webkit.org>
1258 Calling build() on a baseline point results in an exception
1259 https://bugs.webkit.org/show_bug.cgi?id=168959
1261 Reviewed by Joseph Pecoraro.
1263 Some baseline points may lack the build information. e.g. A custom data point made by an user.
1264 Only instantiate Build object in a point object returned by MeasurementAdaptor when the builder id
1265 is available so that we don't hit an assertion inside Build's constructor.
1267 * public/v3/models/measurement-adaptor.js:
1268 (MeasurementAdaptor.prototype.applyTo..build): Only instantiate Build when builderId is set.
1269 * unit-tests/measurement-adaptor-tests.js: Added a test case.
1271 2017-02-27 Ryosuke Niwa <rniwa@webkit.org>
1273 Arrow key shouldn't move the indicator beyond the visible points
1274 https://bugs.webkit.org/show_bug.cgi?id=168956
1276 Reviewed by Joseph Pecoraro.
1278 The bug was caused by moveLockedIndicatorWithNotification using the full sampled time series view
1279 instead of the one constrained by the domain. Since the time series chart expands the visible domain
1280 to include at least one point before the start time and one point after the end tiem to draw lines
1281 extending beyond the visible region (otherwise it looks as though the graph ends there), we need to
1282 use a view constrained by the start time and the end time before looking for a next/previous point.
1284 * browser-tests/time-series-chart-tests.js: Added test cases for moveLockedIndicatorWithNotification.
1285 * public/v3/components/interactive-time-series-chart.js:
1286 (InteractiveTimeSeriesChart.prototype.moveLockedIndicatorWithNotification): Fixed the bug. Also
1287 enqueue itself to render instead of relying on a parent component to do it.
1289 2017-02-27 Ryosuke Niwa <rniwa@webkit.org>
1291 A Locked indicator should be visually distinct from an unlocked indicator
1292 https://bugs.webkit.org/show_bug.cgi?id=168868
1293 <rdar://problem/29666054>
1295 Reviewed by Antti Koivisto.
1297 Added the support for specifying options.lockedIndicator in addition to options.indicator to style
1298 an locked indicator differently from an unlocked one.
1300 * browser-tests/time-series-chart-tests.js: Added new test cases for indicators.
1301 (createChartWithSampleCluster): Renamed and swapped the order of arguments to better match
1302 TimeSeriesChart's constructor. Now the second argument is an array of source as is in the constructor.
1303 (createInteractiveChartWithSampleCluster): Added.
1305 * public/v3/components/chart-styles.js:
1306 (ChartStyles.overviewChartOptions): Changed the color of a selection to blue.
1307 (ChartStyles.mainChartOptions): Ditto. Also use a different style for a locked indicator.
1309 * public/v3/components/interactive-time-series-chart.js:
1310 (InteractiveTimeSeriesChart.prototype._layout): Removed the unused variable.
1311 (InteractiveTimeSeriesChart.prototype._renderChartContent): Use options.lockedIndicator when rendering
1312 a locked indicator. Also stroke the circle in addition to filling it so that we can use a blue circle
1313 with a white hole for a locked indicator to make it even more visually distinctive from an unlocked one.
1315 2017-02-25 Dewei Zhu <dewei_zhu@apple.com>
1317 Commit should order by 'commit_order' as secondary key.
1318 https://bugs.webkit.org/show_bug.cgi?id=168866
1320 Reviewed by Ryosuke Niwa.
1322 Currently, commits are sorted by 'commit_time' only.
1323 We should use 'commit_order' as secondary key when 'commit_time' is equal or null.
1325 * public/include/commit-log-fetcher.php:
1326 * public/include/db.php:
1327 * server-tests/api-commits.js:
1328 (return.addSlaveForReport.subversionCommits.then):
1331 2017-02-24 Ryosuke Niwa <rniwa@webkit.org>
1333 REGRESSION(r212853): Comparisons to baseline no longer shows up
1334 https://bugs.webkit.org/show_bug.cgi?id=168863
1336 Reviewed by Joseph Pecoraro.
1338 The bug was caused by ChartStatusView's code not being updated to use TimeSeriesView's.
1339 Updated the code to use TimeSeriesView's methods to fix the bug.
1341 Also made InteractiveTimeSeriesChart's currentPoint to return a (TimeSeriesView, point, isLocked) tuple
1342 to consolidate it with lockedIndicator() to work towards making the baseline data points selectable.
1344 * browser-tests/time-series-chart-tests.js: Updated the test cases to use currentIndicator, and added
1345 test cases for newly added lastPointInTimeRange.
1347 * public/v3/components/chart-pane.js:
1348 (ChartPane.prototype.serializeState): Updated to use currentIndicator.
1349 (ChartPane.prototype._renderFilteringPopover): Ditto.
1351 * public/v3/components/chart-status-view.js:
1352 (ChartStatusView.prototype.updateStatusIfNeeded): Use currentIndicator for an interative time series.
1353 Fixed the non-interactive chart's code path for TimeSeriesView.
1354 (ChartStatusView.prototype._computeChartStatus): Modernized the code.
1355 (ChartStatusView.prototype._findLastPointPriorToTime): Deleted. Replaced by TimeSeriesView's
1356 lastPointInTimeRange.
1358 * public/v3/components/interactive-time-series-chart.js:
1359 (InteractiveTimeSeriesChart.prototype.currentIndicator):
1360 (InteractiveTimeSeriesChart.prototype.moveLockedIndicatorWithNotification):
1361 (InteractiveTimeSeriesChart.prototype._renderChartContent):
1362 (InteractiveTimeSeriesChart):
1364 * public/v3/models/time-series.js:
1365 (TimeSeriesView.prototype.lastPointInTimeRange): Added.
1366 (TimeSeriesView.prototype._reverse): Added. Traverses the view in the reverse order.
1367 * unit-tests/time-series-tests.js:
1369 2017-02-23 Dewei Zhu <dewei_zhu@apple.com>
1371 Rename 'commit_parent' in 'commits' table to 'commit_previous_commit'.
1372 https://bugs.webkit.org/show_bug.cgi?id=168816
1374 Reviewed by Ryosuke Niwa.
1376 Rename 'commit_parent' to avoid ambiguity in the coming feature.
1377 For exisiting database, run
1378 "ALTER TABLE commits RENAME commit_parent TO commit_previous_commit;"
1379 to update the database.
1381 * init-database.sql:
1382 * public/api/report-commits.php:
1383 * public/include/commit-log-fetcher.php:
1384 * server-tests/api-commits.js:
1386 * server-tests/api-report-commits-tests.js:
1388 * tools/sync-commits.py:
1390 (Repository.fetch_commits_and_submit):
1391 (GitRepository._revision_from_tokens):
1392 * unit-tests/analysis-task-tests.js:
1393 (sampleAnalysisTask):
1395 2017-02-23 Ryosuke Niwa <rniwa@webkit.org>
1397 New sampling algorithm shows very few points when zoomed out
1398 https://bugs.webkit.org/show_bug.cgi?id=168813
1400 Reviewed by Saam Barati.
1402 When a chart is zoomed out to a large time interval, the new sampling algorithm introduced in r212853 can
1403 hide most of the data points because the difference between the preceding point's time and the succeeding
1404 point's time of most points will be below the threshold we computed.
1406 Instead, rank each data point based on the aforementioned time interval difference, and pick the first M data
1407 points when M data points are to be shown.
1409 This makes the new algorithm behave like our old algorithm while keeping it stable still. Note that this
1410 algorithm still biases data points without a close neighboring point but this seems to work out in practice
1411 because such a point tends to be an important sample anyway, and we don't have a lot of space between
1412 data points since we aim to show about one point per pixel.
1414 * browser-tests/index.html:
1415 (CanvasTest.canvasContainsColor): Extracted from one of the test cases and generalized. Returns true when
1416 the specified region of the canvas contains a specified color (alpha is optional).
1417 * browser-tests/time-series-chart-tests.js: Added a test case for sampling. It checks that sampling happens
1418 and that we always show some data point even when zoomed out to a large time interval.
1419 (createChartWithSampleCluster):
1421 * public/v3/components/interactive-time-series-chart.js:
1422 (InteractiveTimeSeriesChart.prototype._sampleTimeSeries):
1423 * public/v3/components/time-series-chart.js:
1424 (TimeSeriesChart.prototype._ensureSampledTimeSeries): M, the number of data points we pick must be computed
1425 based on the width of data points we're about to draw constrained by the canvas size. e.g. when the canvas
1426 is only half filled, we shouldn't be showing two points per pixel in the filled region.
1427 (TimeSeriesChart.prototype._sampleTimeSeries): Refined the algorithm. First, compute the time difference or
1428 the rank for each N data points. Sort those ranks in descending order (in the order we prefer), and include
1429 all data points above the M-th rank in the sample.
1430 (TimeSeriesChart.prototype.computeTimeGrid): Revert the inadvertent change in r212935.
1432 * public/v3/models/time-series.js:
1433 (TimeSeriesView.prototype.filter): Fixed a bug that the indices passed onto the callback were shifted by the
1435 * unit-tests/time-series-tests.js: Added a test case to ensure callbacks are called with correct data points
1438 2017-02-23 Ryosuke Niwa <rniwa@webkit.org>
1440 REGRESSION(r212542): Make TimeSeriesChart.computeTimeGrid stops x-axis grid prematurely
1441 https://bugs.webkit.org/show_bug.cgi?id=168812
1443 Reviewed by Joseph Pecoraro.
1445 Add time iterator of two months, three months, and four months with some tests.
1447 Also for one-month time iterator, round the day of month to 1 or 15 whichever is closer.
1449 * browser-tests/time-series-chart-tests.js: Added more tests.
1450 * public/v3/components/time-series-chart.js:
1451 (TimeSeriesChart._timeIterators.next):
1452 (TimeSeriesChart._timeIterators):
1454 2017-02-22 Ryosuke Niwa <rniwa@webkit.org>
1456 Add tests for InteractiveTimeSeriesChart and adopt actions
1457 https://bugs.webkit.org/show_bug.cgi?id=168750
1459 Reviewed by Chris Dumez.
1461 Added tests for InteractiveTimeSeriesChart.
1463 Also replaced selection.onchange, selection.onzoom, indicator.onchange, annotations.onclick callbacks
1464 by "selectionChange", "zoom", "indicatorChange", and "annotationClick" actions respectively.
1466 Also fixed various bugs and bad code I encountered while writing these tests.
1468 * browser-tests/index.html:
1469 (waitForComponentsToRender): Delay the call to enqueueToRender until the next run loop because there
1470 might be outstanding promises that just got resolved. e.g. for fetching measurement sets JSONs. Let
1471 all those promises get resolved first. Otherwise, some tests become racy.
1472 (canvasImageData): Extracted from time-series-chart-tests.js.
1473 (canvasRefTest): Ditto.
1474 (CanvasTest): Ditto.
1475 (CanvasTest.fillCanvasBeforeRedrawCheck): Ditto.
1476 (CanvasTest.hasCanvasBeenRedrawn): Ditto.
1477 (CanvasTest.canvasImageData): Ditto.
1478 (CanvasTest.expectCanvasesMatch): Ditto.
1479 (CanvasTest.expectCanvasesMismatch): Ditto.
1481 * browser-tests/time-series-chart-tests.js: Fixed some test cases where dpr multipler was not doing
1482 the right thing anymore in Safari under a high DPI screen. Also added a lot of test cases for interactive
1483 time series chart and one for rendering annotations.
1485 (posixTime): Added. A helper function for sampleCluster.
1486 (dayInMilliseconds): Ditto.
1487 (sampleCluster): Moved here. Made the same cluster more artifical for an easier testing.
1488 (createChartWithSampleCluster): Moved out of one of the tests.
1489 (respondWithSampleCluster): Ditto.
1491 * public/v3/components/chart-pane-base.js:
1492 (ChartPaneBase.prototype.configure): Adopted new actions in InteractiveTimeSeriesChart.
1494 * public/v3/components/chart-status-view.js:
1495 (ChartStatusView.prototype.updateStatusIfNeeded): Removed a superflous console.log.
1497 * public/v3/components/chart-styles.js:
1498 (ChartStyles.mainChartOptions): Set zoomButton to true. InteractiveTimeSeriesChart used to determine
1499 whether to show the zoom button or not based on the precense of the zoom callback. We made it explicit.
1501 * public/v3/components/interactive-time-series-chart.js:
1502 (InteractiveTimeSeriesChart.prototype.setIndicator): Explicitly call _notifySelectionChanged with false
1503 instead of relying on undefined to be treated as falsey.
1504 (InteractiveTimeSeriesChart.prototype._createCanvas): Use id instead of selector to find elements.
1505 (InteractiveTimeSeriesChart.htmlTemplate):
1506 (InteractiveTimeSeriesChart.cssTemplate):
1507 (InteractiveTimeSeriesChart.prototype._mouseMove): Explicitly call _startOrContinueDragging with false
1508 instead of relying on undefined treated as falsey. Also added the missing call to enqueueToRender found
1509 by new tests. This was working fine on the dashboard due to other components invoking enqueueToRender
1510 but won't work in a standalone instance of InteractiveTimeSeriesChart.
1511 (InteractiveTimeSeriesChart.prototype._mouseLeave): Ditto, adding the missing call to enqueueToRender.
1512 (InteractiveTimeSeriesChart.prototype._click): Removed the assignment to _forceRender when calling
1513 _mouseMove in an early exist, which does set this flag and invokes enqueueToRender, and added the missing
1514 call to enqueueToRender in the other code path.
1515 (InteractiveTimeSeriesChart.prototype._startOrContinueDragging): Replaced annotations.onclick callback
1516 by the newly added "annotationClick" action, and added the missing call to enqueueToRender.
1517 (InteractiveTimeSeriesChart.prototype._endDragging): Use arrow function.
1518 (InteractiveTimeSeriesChart.prototype._notifyIndicatorChanged): Replaced indicator.onchange callback by
1519 the newly added "indicatorChange" action.
1520 (InteractiveTimeSeriesChart.prototype._notifySelectionChanged): Replaced selection.onchange callback by
1521 the newly added "selectionChange" action.
1522 (InteractiveTimeSeriesChart.prototype._renderChartContent): Show the zoom button when options.zoomButton
1523 is set instead of relying on the presence of selection.onzoom especially now that the callback has been
1524 replaced by the "zoom" action.
1526 * public/v3/components/time-series-chart.js:
1527 (TimeSeriesChart.prototype.setAnnotations): Added the missing call to enqueueToRender.
1529 * public/v3/main.js:
1531 2017-02-21 Ryosuke Niwa <rniwa@webkit.org>
1533 Make sampling algorithm more stable and introduce an abstraction for sampled data
1534 https://bugs.webkit.org/show_bug.cgi?id=168693
1536 Reviewed by Chris Dumez.
1538 Before this patch, TimeSeriesChart's resampling resulted in some points poping up and disappearing as
1539 the width of a chart is changed. e.g. when resizing the browser window. The bug was by caused by
1540 the sample for a given width not always including all points for a smaller width so as the width is
1541 expanded, some point may be dropped.
1543 Fixed this by using a much simpler algorithm of always picking a point when the time interval between
1544 the preceding point and the succeeding point is larger than the minimum space we allow for a given width.
1546 Also introduced a new abstraction around the sample data: TimeSeriesView. A TimeSeriesView provides
1547 a similar API to TimeSeries for a subset of the time series filtered by a time range a custom function.
1548 This paves a way to adding the ability to select baseline, etc... on the chart status view.
1550 TimeSeriesView can be in two modes:
1551 Mode 1. The view represents a contiguous subrange of TimeSeries - In this mode, this._data references
1552 the underlying TimeSeries's _data directly, and we use _startingIndex to adjust index given to
1553 find the relative index. Finding the next point or the previous point of a given point is done
1554 via looking up the point's seriesIndex and doing a simple arithmetic. In general, an index is
1555 converted to the absolute index in the underlying TimeSeries's _data array.
1557 Mode 2. The view represents a filtered non-contiguous subset of TimeSeries - In this mode, this._data is
1558 its own array. Finding the next point or the previous point of a given point requires finding
1559 a sibling point in the underlying TimeSeries which is in this view. Since this may result in O(n)
1560 traversal and a hash lookup, we lazily build a map of each point to its position in _data instead.
1562 * public/v3/components/chart-status-view.js:
1563 (ChartStatusView.prototype.updateStatusIfNeeded): Call selectedPoints instead of sampledDataBetween for
1564 clarity. This function now returns a TimeSeriesView instead of a raw array.
1566 * public/v3/components/interactive-time-series-chart.js:
1567 (InteractiveTimeSeriesChart.prototype.currentPoint): Updated now that _sampledTimeSeriesData contains
1568 an array of TimeSeriesView's. Note that diff is either 0, -1, or 1.
1569 (InteractiveTimeSeriesChart.prototype.selectedPoints): Ditto. sampledDataBetween no longer exists since
1570 we can simply call viewTimeRange on TimeSeriesView returned by sampledDataBetween.
1571 (InteractiveTimeSeriesChart.prototype.firstSelectedPoint): Ditto.
1572 (InteractiveTimeSeriesChart.prototype._sampleTimeSeries): Use add since excludedPoints is now a Set.
1574 * public/v3/components/time-series-chart.js:
1575 (TimeSeriesChart.prototype.sampledDataBetween): Deleted.
1576 (TimeSeriesChart.prototype.firstSampledPointBetweenTime): Deleted.
1577 (TimeSeriesChart.prototype._ensureSampledTimeSeries): Modernized the code. Use the the time interval of
1578 the chart divided by the number of allowed points as the time interval used in the new sampling algorithm.
1579 (TimeSeriesChart.prototype._sampleTimeSeries): Rewritten. We also create TimeSeriesView here.
1580 (TimeSeriesChart.prototype._sampleTimeSeries.findMedian): Deleted.
1581 (TimeSeriesChart.prototype._updateCanvasSizeIfClientSizeChanged): Fixed a bug that the canvas size wasn't
1582 set to the correct value on Chrome when a high DPI screen is used.
1584 * public/v3/models/time-series.js:
1585 (TimeSeries.prototype.viewBetweenPoints): Renamed from dataBetweenPoints. Now returns a TimeSeriesView.
1586 (TimeSeriesView): Added. This constructor is to be called by viewBetweenPoints, viewTimeRange, and filter.
1587 (TimeSeriesView.prototype._buildPointIndexMap): Added. Used in mode (2).
1588 (TimeSeriesView.prototype.length): Added.
1589 (TimeSeriesView.prototype.firstPoint): Added.
1590 (TimeSeriesView.prototype.lastPoint): Added.
1591 (TimeSeriesView.prototype.nextPoint): Added. Note index is always a position in this._data. In mode (1),
1592 this is the position of the point in the underlying TimeSeries' _data. In mode (2), this is the position
1593 of the point in this._data which is dictinct from the underlying TimeSeries' _data.
1594 (TimeSeriesView.prototype.previousPoint): Ditto.
1595 (TimeSeriesView.prototype.findPointByIndex): Added. Finds the point using the positional index from the
1596 beginning of this view. findPointByIndex(0) on one view may not be same as findPointByIndex(0) of another.
1597 (TimeSeriesView.prototype.findById): Added. This is O(n).
1598 (TimeSeriesView.prototype.values): Added. Returns the value of each point in this view.
1599 (TimeSeriesView.prototype.filter): Added. Creates a new view with a subset of data points the predicate
1600 function returned true.
1601 (TimeSeriesView.prototype.viewTimeRange): Added. Creates a new view with a subset of data points for the
1602 given time ragne. When the resultant view would include all points of this view, it simply returns itself
1604 (TimeSeriesView.prototype.firstPointInTimeRange): Added. Returns the first point in the view which lies
1605 within the specified time range.
1606 (TimeSeriesView.prototype.Symbol.iterator): Added. Iterates over each point in the view.
1608 * public/v3/pages/analysis-task-page.js:
1609 (AnalysisTaskChartPane.prototype.selectedPoints): Use selectedPoints in lieu of getting selection and then
1610 calling sampledDataBetween with that range.
1612 * public/v3/pages/summary-page.js:
1613 (SummaryPageConfigurationGroup.set _medianForTimeRange): Modernized.
1615 * unit-tests/time-series-tests.js: Added tests for TimeSeries and TimeSeriesView. Already caught bugs!
1616 (addPointsToSeries):
1618 2017-02-17 Ryosuke Niwa <rniwa@webkit.org>
1620 Add tests for the time series chart and fix bugs I found along the way
1621 https://bugs.webkit.org/show_bug.cgi?id=168499
1623 Reviewed by Antti Koivisto.
1625 Add basic tests for the time series chart.
1627 Replaced the "ondata" callback set in the options by "dataChange" action now that ComponentBase provides
1628 a facility for defining event-like actions.
1630 Also fixed bugs I encountered while writing these tests see below for descriptions.
1632 * browser-tests/editable-text-tests.js:
1633 (waitToRender): Moved to index.html
1634 * browser-tests/index.html:
1635 (waitToRender): Moved from editable-text-tests.js.
1637 * browser-tests/time-series-chart-tests.js: Added.
1638 * public/v3/components/chart-pane-base.js:
1639 (ChartPaneBase.prototype.configure):
1640 * public/v3/components/time-series-chart.js:
1641 (TimeSeriesChart): Removed the code to set display and position inline properties. This is now done inside
1642 cssTemplate with :host pseudo class.
1643 (TimeSeriesChart.prototype._ensureCanvas): Don't strech the canvas to 100% of width and height. This was
1644 causing a flush of contents where the canvas is momentarily streched by the browser and the script later
1645 updates with the content with the correct aspect ratio.
1646 (TimeSeriesChart.cssTemplate): Added :host rule to set display: block and position: relative.
1647 (TimeSeriesChart._updateAllCharts): Deleted.
1648 (TimeSeriesChart.prototype.render): Only run the code for axis when options.axis is defined. Also, avoid
1649 setting the fill style because we never fill for axis drawing.
1650 (TimeSeriesChart.prototype._computeHorizontalRenderingMetrics): Ditto. Fallback to sensible values when
1651 options.axis is not defined.
1652 (TimeSeriesChart.prototype._renderYAxis): Now computeValueGrid generates a sequence of {time, label}.
1653 (TimeSeriesChart.prototype._renderTimeSeries): Don't draw the shades for confidence intervals unless its
1654 fill style is defined. Otherwise, we'd end up drawing black shade and mask the actual data points.
1655 (TimeSeriesChart.prototype._ensureSampledTimeSeries): Dispatch newly added "dataChange" action instead of
1656 calling "ondata" callback in options dictionary.
1657 (TimeSeriesChart.computeTimeGrid): Modernized to use const/let. Also fixed the bug that we were emitting
1658 the date even when the entire time range fit within a 24-hour interval.
1659 (TimeSeriesChart.computeValueGrid): Rewritten to make MB/GB use a nice round number instead of 0.98GB.
1660 We were using a power of 10 to round up the stepping value but the value formatter used a power of 1024
1661 to divide byte measurements (e.g. for memory). Use formatter.divisor to find the right scaling factor for
1663 * public/v3/models/metric.js:
1664 (Metric.prototype.makeFormatter):
1665 (Metric.makeFormatter): Extracted from the one on the prototype so that tests don't need a metric object
1666 just to test TimeSeriesChart. Added the second argument which specifies the maximum absolute value of the
1667 range we're formatting. This is needed to use the same number of decimal points when the most significant
1668 digit of some value is smaller than that of the biggest one. For example, we were emitting 0.50GB instead
1669 of 0.5G along with 2.0GB. The "adjustment" reduces the number of significant figures in these cases.
1670 * public/v3/pages/dashboard-page.js:
1671 (DashboardPage.prototype._createChartForCell):
1673 2017-02-16 Ryosuke Niwa <rniwa@webkit.org>
1675 Use expect.js instead of expect in browser tests
1676 https://bugs.webkit.org/show_bug.cgi?id=168492
1678 Reviewed by Joseph Pecoraro.
1680 Use expect.js (https://github.com/Automattic/expect.js) instead of expect (https://github.com/mjackson/expect).
1682 * browser-tests/close-button-tests.js:
1683 * browser-tests/component-base-tests.js:
1684 * browser-tests/editable-text-tests.js:
1685 * browser-tests/index.html:
1687 2017-02-16 Ryosuke Niwa <rniwa@webkit.org>
1689 Modernize and fix measurement-set tests
1690 https://bugs.webkit.org/show_bug.cgi?id=168484
1692 Reviewed by Joseph Pecoraro.
1694 Modernized and fixed the tests in measurement-set-tests.js.
1696 1. Return a promise instead of manually calling done in then/catch hanlders.
1697 2. Use arrow function everywhere.
1698 3. Explicitly assert the number of calls to callbacks instead of asserting never reached.
1700 The test case labled "should return false when the range ends after the fetched cluster"
1701 was incorrectly asserting that hasFetchedRange returns false when the end time is after
1702 the primary cluster's end time. Test an interval before the primary cluster instead.
1704 Added a test case for hasFetchedRange returning true when the end time appears after
1705 the end of the primary cluster and fixed hasFetchedRange to that end. Since there are
1706 no data points after the primary cluster which is chronologically the last cluster,
1707 there is nothing to fetch beyond its end time.
1709 * public/v3/models/measurement-set.js:
1710 (MeasurementSet.prototype.hasFetchedRange): Fixed the bug that this function returned
1711 false when the end time was after the primary cluster's end by truncating the range by
1712 the end of the primary cluster.
1713 * unit-tests/measurement-set-tests.js:
1714 * unit-tests/resources/mock-remote-api.js:
1715 (assert.notReached.assert.notReached): Deleted. It's no longer used by any tests.
1717 2017-02-15 Ryosuke Niwa <rniwa@webkit.org>
1719 Update ReadMe.md and merge it with Install.md
1720 https://bugs.webkit.org/show_bug.cgi?id=168405
1722 Reviewed by Michael Catanzaro.
1724 Merged Install.md and ReadMe.md into one file.
1726 * Install.md: Removed.
1727 * ReadMe.md: Merged Install.md at the top and updated the rest of the content.
1729 2017-01-24 Ryosuke Niwa <rniwa@webkit.org>
1731 Modernize editable-text component and add tests
1732 https://bugs.webkit.org/show_bug.cgi?id=167398
1734 Reviewed by Yusuke Suzuki.
1736 Modernized EditableText component to use the action feature added in r210938.
1738 * browser-tests/editable-text-tests.js: Added. Added tests for EditableText component.
1740 * browser-tests/index.html:
1741 * public/v3/components/base.js:
1742 (ComponentBase.prototype.dispatchAction): Return the result from the callback.
1743 * public/v3/components/editable-text.js:
1744 (EditableText): Removed a bunch of instance variables that are no longer needed.
1745 (EditableText.prototype.didConstructShadowTree): Added. Add event listeners on the Edit/Save button and the host.
1746 (EditableText.prototype.editedText): Return the text field's value directly.
1747 (EditableText.prototype.text): Added.
1748 (EditableText.prototype.setText): Call enqueueToRender automatically instead of relying on the parent component
1749 to do so in _startedEditingCallback, which has been removed.
1750 (EditableText.prototype.render): Modernized the code.
1751 (EditableText.prototype._didClick): No longer prevents the default action manually since that's automatically done
1752 in createEventHandler. Handle the case where the update action is not handled.
1753 (EditableText.prototype._endEditingMode): Renamed from _didUpdate.
1754 (EditableText.htmlTemplate): Added ids on various elements in the shadow tree.
1755 (EditableText.cssTemplate): Updated the CSS selectors per above change.
1756 * public/v3/main.js:
1757 (main): Fixed a typo.
1758 * public/v3/pages/analysis-task-page.js:
1759 (AnalysisTaskPage): Use the action listener instead of manually setting callbacks.
1760 (AnalysisTaskPage.prototype._createTestGroupListItem): Ditto.
1761 (AnalysisTaskPage.prototype._didStartEditingTaskName): Deleted.
1763 2017-01-20 Ryosuke Niwa <rniwa@webkit.org>
1765 Build fix after r210783. Didn't mean to require custom elements API.
1767 * public/v3/main.js:
1770 2017-01-20 Ryosuke Niwa <rniwa@webkit.org>
1772 Make sync-commits.py robust against missing Subversion authors and missing parent Git commits
1773 https://bugs.webkit.org/show_bug.cgi?id=167231
1775 Reviewed by Antti Koivisto.
1777 Fixed a bug that a subversion commit that's missing author name (anonymous commit) results in an out of bound
1778 exception, and a bug that syncing a git repository starts failing once there was a merge commit which pulled
1779 in a commit data earlier than that of the last reported commit.
1781 For the latter fix, added --max-ancestor-fetch-count to specify the number of maximum commits to look back.
1783 * tools/sync-commits.py:
1784 (main): Added --max-ancestor-fetch-count.
1785 (Repository.fetch_commits_and_submit): If submit_commits fails with FailedToFindParentCommit, fetch the parent
1786 commit's information until we've resolved them all.
1787 (Repository.fetch_next_commit): Renamed from fetch_commit.
1788 (SVNRepository.fetch_next_commit): Renamed from fetch_commit. Don't try to get the author name if it's missing
1789 due to an anonymous commit. It's important to never include the "author" field in the JSON submitted to
1790 a dashboard since it rejects when "author" field is not an array (e.g. null).
1791 (GitRepository.fetch_next_commit): Renamed from fetch_commit.
1792 (GitRepository.fetch_commit): Added. Fetches the commit information for a given git hash. Used to retrieve
1793 missing parent commits.
1794 (GitRepository._revision_from_tokens): Extracted from fetch_commit.
1797 (submit_commits): Optionally takes status_to_accept to avoid throwing in the case of FailedToFindParentCommit
1798 and returns the response JSON.
1800 2017-01-20 Ryosuke Niwa <rniwa@webkit.org>
1802 REGRESSION(r198234): /api/commits/%revision% always fails
1803 https://bugs.webkit.org/show_bug.cgi?id=167235
1805 Reviewed by Antti Koivisto.
1807 The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on
1808 $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there.
1810 Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest,
1811 and /last-reported would return a commit with all values set to null instead of an empty list.
1813 Finally, added server API tests for /api/commits.
1815 * public/api/commits.php:
1816 (main): Add a comment for APIs that only exist for v2 UI.
1818 * public/include/commit-log-fetcher.php:
1819 (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the
1820 the latest commit as desired.
1821 (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception
1822 because commit_for_revision is defined on $this, not $this->db.
1823 (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with
1824 all values set to null.
1826 * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits.
1827 (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits
1828 to one sent to /api/report-commits.
1830 2017-01-19 Ryosuke Niwa <rniwa@webkit.org>
1832 measurement-sets API can incorrectly order points with OS version without commit time
1833 https://bugs.webkit.org/show_bug.cgi?id=167227
1835 Reviewed by Chris Dumez.
1837 Ignore revision_order for the purpose of ordering data points in /api/measurement-sets.
1839 These orderings are used in some UI (e.g A/B testing) to order OS build numbers which do not have a timestamp
1840 associated with each "revision".
1842 The baseline measurements made in our internal dashboard were using these ordering numbers before ordering
1843 results with build time. Because those data points don't have an associated Webkit revisions, all data points
1844 were ordered first by macOS's revision_order, then build time. Because v3 UI completely ignores revision_order
1845 for the purpose of plotting data points, this resulted in some data points being plotted in a wrong order
1846 with some lines going backwards in time.
1848 This patch addresses this discrepancy by stop ordering data points with revision_order in the JSON API.
1850 * public/api/measurement-set.php:
1851 (MeasurementSetFetcher::execute_query): Fixed the bug.
1852 * server-tests/api-measurement-set-tests.js: Added a test.
1854 2017-01-19 Ryosuke Niwa <rniwa@webkit.org>
1856 Build fix after r210626. We need to clear Triggerable's static map in each iteration.
1858 * tools/sync-buildbot.js:
1861 2017-01-18 Ryosuke Niwa <rniwa@webkit.org>
1863 Add a mechanism to dispatch and listen to an action
1864 https://bugs.webkit.org/show_bug.cgi?id=167191
1866 Reviewed by Antti Koivisto.
1868 Added the notion of an action to components. Like DOM events, it can be dispatched or listen to.
1870 Also added ComponentBase.prototype.part which finds a sub-component inside a component's shadow tree,
1871 and made ComponentBase.prototype.content take an id to find an element that matches it.
1873 * browser-tests/close-button-tests.js: Added. Tests for CloseButton.
1874 * browser-tests/component-base-tests.js: Added tests for ComponentBase's part(~), content(id), dispatchEvent.
1875 * browser-tests/index.html:
1876 * public/v3/components/base.js:
1877 (ComponentBase): Added this._actionCallbacks, which is a map of an action name to a callback to be invoked.
1878 (ComponentBase.prototype.content): Return an element of the given id if one is specified.
1879 (ComponentBase.prototype.part): Find a component whose element has the matching id.
1880 (ComponentBase.prototype.dispatchAction): Added.
1881 (ComponentBase.prototype.listenToAction): Added.
1882 (ComponentBase.prototype._ensureShadowTree): Call didConstructShadowTree.
1883 (ComponentBase.prototype.didConstructShadowTree): Added.
1884 (ComponentBase.prototype._recursivelyReplaceUnknownElementsByComponents): Copy attributes when instantiating
1885 an element for a component when the browser doesn't support custom elements API.
1886 (ComponentBase.createLink):
1887 (ComponentBase.prototype.createEventHandler): Added.
1888 (ComponentBase.createEventHandler): Renamed from createActionHandler.
1889 * public/v3/components/button-base.js:
1890 (ButtonBase.prototype.didConstructShadowTree): Added. Dispatch "activate" action when the button is clicked.
1891 (ButtonBase.prototype.setCallback): Deleted.
1892 (ButtonBase.htmlTemplate): Use id instead of class so that this.content() can find it.
1893 (ButtonBase.cssTemplate): Updated style rules.
1894 * public/v3/pages/chart-pane.js:
1896 (ChartPane.prototype.didConstructShadowTree): Added. Listen to "activate" action on the close button.
1897 (ChartPane.prototype.render): Fixed a bug that we were never calling enqueueToRender on the close button.
1898 (ChartPane.htmlTemplate): Add the id on the close button.
1900 2017-01-18 Dewei Zhu <dewei_zhu@apple.com>
1902 'buildbot-syncer.js' should be able to determine force build argument from a list of possible repositories.
1903 https://bugs.webkit.org/show_bug.cgi?id=167152
1905 Reviewed by Ryosuke Niwa.
1907 Add 'rootOptions' key which maps to a list of possible repositories.
1908 For a build request, only one of the repositories in the list is valid.
1910 * tools/js/buildbot-syncer.js:
1911 (BuildbotSyncer.prototype._propertiesForBuildRequest):
1912 (BuildbotSyncer._validateAndMergeProperties):
1914 * unit-tests/buildbot-syncer-tests.js:
1916 (sampleiOSConfigWithExpansions):
1917 (createSampleBuildRequest):
1918 (Promise.resolve.then):
1919 * unit-tests/resources/mock-v3-models.js:
1920 (MockModels.inject):
1922 2017-01-17 Ryosuke Niwa <rniwa@webkit.org>
1924 Make calls to render() functions async
1925 https://bugs.webkit.org/show_bug.cgi?id=167151
1927 Reviewed by Andreas Kling.
1929 Make calls to render() async by coalescing calls inside enqueueToRender(), which has been renamed from
1930 updateRendering(). We now queue up all the components and wait until the next animation frame to invoke
1931 render() on all those components.
1933 This reduces render() calls in the summary page of our internal dashboard by 15x from ~9400 to ~600 by
1934 eliminating pathological O(n^2) behavior between render() calls.
1936 Consolidated TimeSeriesChart's enqueueRender into this newly added feature of ComponentBase along with
1937 the support to call render() on a resize event. New implementation makes use of connectedCallback and
1938 disconnectedCallback to avoid the work when the component is not in a document tree.
1940 The rest of the patch concerns with renaming updateRendering to enqueueToRender and fixing a few minor bugs
1941 that I encountered while working on this patch.
1943 * browser-tests/component-base-tests.js: Added tests for ComponentBase.enqueueToRender().
1944 * browser-tests/index.html:
1945 (BrowserContext.prototype.importScripts): Renamed from importScript; Now supports loading multiple scripts.
1946 (BrowserContext.prototype.importScript): Added.
1947 (BrowserContext): Removed the unused createWithScripts.
1949 * public/v3/components/analysis-results-viewer.js:
1950 (AnalysisResultsViewer.prototype._expandBetween):
1951 * public/v3/components/bar-graph-group.js:
1952 (BarGraphGroup.prototype.updateGroupRendering):
1954 * public/v3/components/base.js:
1955 (ComponentBase): When the browser doesn't support custom elements and
1956 (ComponentBase.prototype.enqueueToRender): Renamed from updateRendering. Queues up the component to call
1957 render() instead of immediately invoking it.
1958 (ComponentBase.renderingTimerDidFire): Call render(). Since render() function often calls enqueueToRender
1959 on child components, go ahead and invoke render() on any components enqueued during render() calls.
1960 (ComponentBase._connectedComponentToRenderOnResize): Added.
1961 (ComponentBase._disconnectedComponentToRenderOnResize): Added.
1962 (ComponentBase.defineElement.elementClass.prototype.connectedCallback): Added. This is an optimization to
1963 avoid the work when the component is not in the document; e.g. because the entire page component has been
1964 detached from the document. The old implementation in TimeSeriesChart was not doing this.
1965 (ComponentBase.defineElement.elementClass.prototype.disconnectedCallback): Added.
1966 (ComponentBase): Replaced unused static variables with _componentsToRender and _componentsToRenderOnResize.
1968 * public/v3/components/chart-pane-base.js:
1969 (ChartPaneBase.prototype.fetchAnalysisTasks):
1970 (ChartPaneBase.prototype.didUpdateAnnotations): Added. Addresses the bug that the annotation bars in the
1971 charts shown an an analysis task doesn't update its color when the state is updated in the UI.
1972 (ChartPaneBase.prototype._mainSelectionDidZoom):
1973 (ChartPaneBase.prototype._updateStatus):
1974 (ChartPaneBase.prototype._requestOpeningCommitViewer):
1975 (ChartPaneBase.prototype._keyup):
1976 (ChartPaneBase.prototype.render):
1977 * public/v3/components/commit-log-viewer.js:
1978 * public/v3/components/customizable-test-group-form.js:
1979 (CustomizableTestGroupForm):
1980 (CustomizableTestGroupForm.prototype._customize):
1981 * public/v3/components/editable-text.js:
1982 (EditableText.prototype._didUpdate):
1983 * public/v3/components/interactive-time-series-chart.js:
1984 * public/v3/components/pane-selector.js:
1985 (PaneSelector.prototype._selectedItem):
1986 * public/v3/components/time-series-chart.js:
1987 (TimeSeriesChart): Removed the logic to update upon resize. See _connectedComponentToRenderOnResize above.
1988 (TimeSeriesChart.prototype.get enqueueToRenderOnResize): Added. Returns true.
1989 (TimeSeriesChart.prototype.enqueueToRender): Deleted.
1990 (TimeSeriesChart._renderEnqueuedCharts): Deleted.
1991 (TimeSeriesChart): Call ComponentBase.defineElement to make this a proper component so that the logic in
1992 connectedCallback to update upon resize event would work.
1993 * public/v3/instrumentation.js:
1994 (Instrumentation.dumpStatistics): Sort results by the key names.
1995 * public/v3/models/time-series.js:
1996 (TimeSeries.prototype.values): Added. This method was never ported to v3 in r198462, and broke the feature
1997 to show moving averages, etc... on the charts page.
1998 * public/v3/pages/analysis-category-page.js:
1999 (AnalysisCategoryPage.prototype.open):
2000 (AnalysisCategoryPage.prototype.updateFromSerializedState):
2001 (AnalysisCategoryPage.prototype.filterDidChange):
2002 (AnalysisCategoryPage.prototype.render):
2003 * public/v3/pages/analysis-task-page.js:
2004 (AnalysisTaskChartPane.prototype._updateStatus):
2005 (AnalysisTaskPage.prototype.updateFromSerializedState):
2006 (AnalysisTaskPage.prototype._didFetchTask):
2007 (AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks):
2008 (AnalysisTaskPage.prototype._didFetchMeasurement):
2009 (AnalysisTaskPage.prototype._didFetchTestGroups):
2010 (AnalysisTaskPage.prototype._showAllTestGroups):
2011 (AnalysisTaskPage.prototype._didFetchAnalysisResults):
2012 (AnalysisTaskPage.prototype.render):
2013 (AnalysisTaskPage.prototype._renderTestGroupList.):
2014 (AnalysisTaskPage.prototype._renderTestGroupList):
2015 (AnalysisTaskPage.prototype._createTestGroupListItem):
2016 (AnalysisTaskPage.prototype._showTestGroup):
2017 (AnalysisTaskPage.prototype._didStartEditingTaskName):
2018 (AnalysisTaskPage.prototype._updateTaskName):
2019 (AnalysisTaskPage.prototype._updateTestGroupName):
2020 (AnalysisTaskPage.prototype._hideCurrentTestGroup):
2021 (AnalysisTaskPage.prototype._updateChangeType): Fixed the bug that we were never updating annotation bars
2022 in the main chart by calling didUpdateAnnotations.
2023 (AnalysisTaskPage.prototype._associateBug):
2024 (AnalysisTaskPage.prototype._dissociateBug):
2025 (AnalysisTaskPage.prototype._associateCommit):
2026 (AnalysisTaskPage.prototype._dissociateCommit):
2027 (AnalysisTaskPage.prototype._chartSelectionDidChange):
2028 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer):
2029 * public/v3/pages/build-request-queue-page.js:
2030 (BuildRequestQueuePage.prototype.open.):
2031 (BuildRequestQueuePage.prototype.open):
2032 * public/v3/pages/chart-pane.js:
2033 (ChartPane.prototype.setOpenRepository):
2034 (ChartPane.prototype._renderTrendLinePopover): Fixed a race condition. Insert a select element as needed
2035 before trying to assign the current value on it.
2036 (ChartPane.prototype._trendLineTypeDidChange):
2037 (ChartPane.prototype._updateTrendLine):
2038 * public/v3/pages/charts-page.js:
2039 (ChartsPage.prototype.updateFromSerializedState):
2040 (ChartsPage.prototype._updateDomainsFromSerializedState):
2041 (ChartsPage.prototype.setNumberOfDaysFromToolbar):
2042 (ChartsPage.prototype._didMutatePaneList):
2043 (ChartsPage.prototype.render):
2044 * public/v3/pages/charts-toolbar.js:
2045 (ChartsToolbar.prototype.render):
2046 * public/v3/pages/create-analysis-task-page.js:
2047 (CreateAnalysisTaskPage.prototype.updateFromSerializedState):
2048 * public/v3/pages/dashboard-page.js:
2049 (DashboardPage.prototype.updateFromSerializedState):
2050 (DashboardPage.prototype._fetchedData):
2051 * public/v3/pages/heading.js:
2052 (Heading.prototype.render):
2053 * public/v3/pages/page-with-heading.js:
2054 (PageWithHeading.prototype.render):
2055 * public/v3/pages/page.js:
2056 (Page.prototype.open):
2057 * public/v3/pages/summary-page.js:
2058 (SummaryPage.prototype.open):
2059 (SummaryPage.prototype.this._renderQueue.push):
2061 (SummaryPage.prototype._renderCell):
2063 2017-01-15 Ryosuke Niwa <rniwa@webkit.org>
2065 Add the build fix for browsers that don't yet support custom elements SPI.
2066 It was supposedly to be a part of the previous commit.
2068 * public/v3/components/base.js:
2069 (ComponentBase.defineElement):
2071 2017-01-12 Ryosuke Niwa <rniwa@webkit.org>
2073 Adopt custom elements API in perf dashboard
2074 https://bugs.webkit.org/show_bug.cgi?id=167045
2076 Reviewed by Darin Adler.
2078 Adopt custom elements API in ComponentBase, and create the shadow tree lazily in content() and render()
2079 instead of eagerly creating it inside the constructor.
2081 For now, create a separate element class for each component in ComponentBase.defineElement instead of
2082 making ComponentBase inherit from HTMLElement to preserve the semantics we have as well as to test
2083 the boundaries of what custom elements API allows for framework authors.
2085 In order to ensure one-to-one correspondence between elements and their components, we use a static map,
2086 ComponentBase._currentlyConstructedByInterface, to remember which element or component is being created
2087 and use that in custom element's constructor to update element.component() and this._element.
2089 Also dropped the support for not having attachShadow as we've shipped this feature in Safari 10.
2091 Finally, added tests to be ran inside a browser to test the front end code in browser-tests.
2093 * browser-tests/component-base-tests.js: Added. Basic tests for ComponentBase.
2094 * browser-tests/index.html: Added.
2096 * public/v3/components/base.js:
2097 (ComponentBase): Don't create the shadow tree. Use the currently constructed element as this._element if
2098 there is one (the custom element's constructor is getting called). Otherwise create a new element but
2099 store this component in the map to avoid creating a new component in the custom element's constructor.
2100 (ComponentBase.prototype.content): Lazily create the shadow tree now.
2101 (ComponentBase.prototype.render): Ditto.
2102 (ComponentBase.prototype._ensureShadowTree): Renamed from _constructShadowTree. Dropped the support for
2103 not having shadow DOM API. This is now required. Also use importNode instead of cloneNode in cloning
2104 the template content since the latter would not get upgraded.
2105 (ComponentBase.prototype._recursivelyReplaceUnknownElementsByComponents): Modernized the code. Don't
2106 re-create a component if its element had already been upgraded by its custom element constructor.
2107 (ComponentBase.defineElement): Add this component to the static maps. _componentByName is used by
2108 _recursivelyReplaceUnknownElementsByComponents to instantiate new components in the browsers that don't
2109 support custom elements API and _componentByClass is used by ComponentBase's constructor to lookup the
2110 element name. The latter should go away once all components fully adopt ComponentBase.defineElement.
2111 (ComponentBase.defineElement.elementClass): A class to define a custom element for the component.
2112 We need to reconfigure the property since class's name is not writable but configurable.
2114 * public/v3/components/button-base.js:
2115 (ButtonBase.htmlTemplate): Added. Extracted the common code from CloseButton and WarningIcon.
2116 (ButtonBase.buttonContent): Added. An abstract method overridden by CloseButton and WarningIcon.
2117 (ButtonBase.sizeFactor): Added. Overridden by WarningIcon.
2118 (ButtonBase.cssTemplate): Updated to use :host.
2119 * public/v3/components/close-button.js:
2120 (CloseButton.buttonContent): Renamed from htmlTemplate.
2121 * public/v3/components/spinner-icon.js:
2122 (SpinnerIcon.cssTemplate): Removed webkit prefixed properties, and updated it to animate stroke instead
2123 of opacity to reduce the power usage.
2124 (SpinnerIcon.htmlTemplate): Factored stroke, stroke-width, and stroke-linecap into cssTemplate.
2125 * public/v3/components/warning-icon.js:
2126 (WarningIcon.cssTemplate): Deleted.
2127 (WarningIcon.sizeFactor): Added.
2128 (WarningIcon.buttonContent): Renamed from htmlTemplate.
2129 * public/v3/pages/summary-page.js:
2130 (SummaryPage._constructRatioGraph): Fixed a bug that we were not never calling spinner.updateRendering().
2131 (SummaryPage.prototype._renderCell):
2133 2017-01-13 Ryosuke Niwa <rniwa@webkit.org>
2135 Instrument calls to render()
2136 https://bugs.webkit.org/show_bug.cgi?id=167037
2138 Reviewed by Sam Weinig.
2140 Wrap every call to render() by newly added ComponentBase.updateRendering() to instrument it.
2141 Also, use arrow functions instead of this.render.bind or regular closures for simplicity.
2143 Currently, we're making 5100 calls to render() while opening the summary page, and that's way too high.
2145 * public/v3/components/analysis-results-viewer.js:
2146 (AnalysisResultsViewer.prototype._expandBetween):
2147 * public/v3/components/bar-graph-group.js:
2148 (BarGraphGroup.prototype.updateGroupRendering): Renamed form render() as BarGraphGroup is not a component.
2149 * public/v3/components/base.js:
2150 (ComponentBase.prototype.updateRendering): Added. Instruments render() call.
2151 * public/v3/components/chart-pane-base.js:
2152 (ChartPaneBase.prototype.fetchAnalysisTasks):
2153 (ChartPaneBase.prototype._mainSelectionDidZoom):
2154 (ChartPaneBase.prototype._updateStatus):
2155 (ChartPaneBase.prototype._requestOpeningCommitViewer):
2156 (ChartPaneBase.prototype._keyup):
2157 (ChartPaneBase.prototype.render):
2158 * public/v3/components/commit-log-viewer.js:
2159 * public/v3/components/customizable-test-group-form.js:
2160 (CustomizableTestGroupForm):
2161 (CustomizableTestGroupForm.prototype._customize):
2162 * public/v3/components/editable-text.js:
2163 (EditableText.prototype._didUpdate):
2164 * public/v3/components/pane-selector.js:
2165 (PaneSelector.prototype._selectedItem):
2166 * public/v3/components/results-table.js:
2167 (ResultsTable.prototype.render):
2168 * public/v3/components/time-series-chart.js:
2169 (TimeSeriesChart._renderEnqueuedCharts):
2170 * public/v3/pages/analysis-category-page.js:
2171 (AnalysisCategoryPage.prototype.open):
2172 (AnalysisCategoryPage.prototype.updateFromSerializedState):
2173 (AnalysisCategoryPage.prototype.filterDidChange):
2174 (AnalysisCategoryPage.prototype.render):
2175 * public/v3/pages/analysis-task-page.js:
2176 (AnalysisTaskChartPane.prototype._updateStatus):
2177 (AnalysisTaskPage.prototype.updateFromSerializedState):
2178 (AnalysisTaskPage.prototype._didFetchTask):
2179 (AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks):
2180 (AnalysisTaskPage.prototype._didFetchMeasurement):
2181 (AnalysisTaskPage.prototype._didFetchTestGroups):
2182 (AnalysisTaskPage.prototype._showAllTestGroups):
2183 (AnalysisTaskPage.prototype._didFetchAnalysisResults):
2184 (AnalysisTaskPage.prototype.render):
2185 (AnalysisTaskPage.prototype._renderTestGroupList.):
2186 (AnalysisTaskPage.prototype._renderTestGroupList):
2187 (AnalysisTaskPage.prototype._createTestGroupListItem):
2188 (AnalysisTaskPage.prototype._showTestGroup):
2189 (AnalysisTaskPage.prototype._didStartEditingTaskName):
2190 (AnalysisTaskPage.prototype._updateTaskName):
2191 (AnalysisTaskPage.prototype._updateTestGroupName):
2192 (AnalysisTaskPage.prototype._hideCurrentTestGroup):
2193 (AnalysisTaskPage.prototype._updateChangeType):
2194 (AnalysisTaskPage.prototype._associateBug):
2195 (AnalysisTaskPage.prototype._dissociateBug):
2196 (AnalysisTaskPage.prototype._associateCommit):
2197 (AnalysisTaskPage.prototype._dissociateCommit):
2198 (AnalysisTaskPage.prototype._chartSelectionDidChange):
2199 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer):
2200 * public/v3/pages/build-request-queue-page.js:
2201 (BuildRequestQueuePage.prototype.open.):
2202 (BuildRequestQueuePage.prototype.open):
2203 * public/v3/pages/chart-pane.js:
2204 (ChartPane.prototype.setOpenRepository):
2205 (ChartPane.prototype._trendLineTypeDidChange):
2206 (ChartPane.prototype._updateTrendLine):
2207 * public/v3/pages/charts-page.js:
2208 (ChartsPage.prototype.updateFromSerializedState):
2209 (ChartsPage.prototype._updateDomainsFromSerializedState):
2210 (ChartsPage.prototype.setNumberOfDaysFromToolbar):
2211 (ChartsPage.prototype._didMutatePaneList):
2212 (ChartsPage.prototype.render):
2213 * public/v3/pages/charts-toolbar.js:
2214 (ChartsToolbar.prototype.render):
2215 * public/v3/pages/create-analysis-task-page.js:
2216 (CreateAnalysisTaskPage.prototype.updateFromSerializedState):
2217 * public/v3/pages/dashboard-page.js:
2218 (DashboardPage.prototype.updateFromSerializedState):
2219 (DashboardPage.prototype._fetchedData):
2220 * public/v3/pages/heading.js:
2221 (Heading.prototype.render):
2222 * public/v3/pages/page-with-heading.js:
2223 (PageWithHeading.prototype.render):
2224 * public/v3/pages/page.js:
2225 (Page.prototype.open):
2226 * public/v3/pages/summary-page.js:
2227 (SummaryPage.prototype.open):
2228 (SummaryPage.prototype.this._renderQueue.push):
2230 (SummaryPage.prototype._renderCell):
2232 2017-01-12 Ryosuke Niwa <rniwa@webkit.org>
2234 Outliers are not hidden in v3 UI
2235 https://bugs.webkit.org/show_bug.cgi?id=166966
2237 Reviewed by Andreas Kling.
2239 Fixed the typo in addToSeries. An outlier has markedOutlier set to true, not isOutlier.
2241 Also fixed a bug unveiled by new tests in MeasurementRootSet.ensureSingleton. It was was creating
2242 a new MeasurementRootSet each time it was called instead of finding an existing instance. Fixed the bug
2243 by merging the static maps of MeasurementRootSet and RootSet.
2245 * public/v3/models/measurement-cluster.js:
2246 (MeasurementCluster.prototype.addToSeries): Fixed the bug.
2247 * public/v3/models/root-set.js:
2248 (MeasurementRootSet.prototype.namedStaticMap): Added.
2249 (MeasurementRootSet.prototype.ensureNamedStaticMap): Added.
2250 (MeasurementRootSet.namedStaticMap): Added.
2251 (MeasurementRootSet.ensureNamedStaticMap): Added.
2252 * unit-tests/measurement-set-tests.js: Added tests for adopting time series data from a cluster.
2254 2017-01-12 Ryosuke Niwa <rniwa@webkit.org>
2256 Hide the UI to trigger an A/B testing when there are no triggerables
2257 https://bugs.webkit.org/show_bug.cgi?id=166964
2259 Reviewed by Yusuke Suzuki.
2261 Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later
2262 when the user tries to create one it with a TriggerableNotFound error.
2264 Added the list of triggerables to the manifest JSON so that we can determine this condition without
2265 having to fetch /api/triggerable for each analysis task as done in v2 UI.
2267 * public/admin/reprocess-report.php:
2268 * public/api/manifest.php:
2269 * public/api/report.php:
2270 * public/include/admin-header.php:
2271 * public/include/manifest-generator.php: Moved from public/include/manifest.php.
2272 (ManifestGenerator::generate):
2273 (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts
2274 as well as the list of (test, platform) pairs on which this triggerable is available.
2275 Use [testId, platformId] instead of a dictionary to reduce the file size.
2276 * public/v3/components/customizable-test-group-form.js:
2277 (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to
2278 disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute
2279 the visibility of the button in render() function instead.
2280 (CustomizableTestGroupForm.prototype.setRootSetMap):
2281 (CustomizableTestGroupForm.prototype._submitted):
2282 (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed.
2283 The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed.
2284 "Customize" button must be hidden when no range is selected.
2285 * public/v3/components/test-group-form.js:
2286 (TestGroupForm): Removed _disabled since it's no longer used.
2287 (TestGroupForm.prototype.setDisabled): Ditto.
2288 (TestGroupForm.prototype.render): Ditto.
2289 * public/v3/index.html: Include triggerable.js.
2290 * public/v3/models/manifest.js:
2291 (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON.
2292 * public/v3/models/triggerable.js: Added.
2293 (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair.
2294 (Triggerable.prototype.acceptedRepositories): Added.
2295 (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map.
2296 * public/v3/pages/analysis-task-page.js:
2297 (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data
2298 points that were previously not available may have become available. The lack of this update was
2299 causing a race condition in which the "Start A/B Testing" button for the charts is disabled even
2300 after a group name had been specified because setRootSetMap was never called with a valid set.
2301 (AnalysisTaskPage): Added this._triggerable.
2302 (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task.
2303 (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely
2304 when there are no groups to show. Also hide the forms to start A/B testing when there are no matching
2305 triggerable, which is the main feature of this patch.
2306 * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON.
2307 * server-tests/resources/mock-data.js:
2308 (MockData.resetV3Models): Reset Triggerable's static map.
2309 * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed
2310 with appropriate list of repositories and (test, platform) associations.
2311 * tools/js/database.js:
2312 (tableToPrefixMap): Added triggerable_repositories's prefix.
2313 * tools/js/remote.js:
2314 (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging.
2315 * tools/js/v3-models.js: Import triggerable.js.
2317 2017-01-11 Ryosuke Niwa <rniwa@webkit.org>
2319 fetch-from-remote doesn’t work with some websites
2320 https://bugs.webkit.org/show_bug.cgi?id=166963
2322 Reviewed by Yusuke Suzuki.
2324 Apparently file_get_contents is not compatible with some SSL/TLS connections.
2325 Use curl_* functions to access remote servers instead.
2327 * public/admin/fetch-from-remote.php:
2330 2017-01-10 Ryosuke Niwa <rniwa@webkit.org>
2332 Another build fix. Always use UTC when expressing commit times in UNIX-epoch timestamps.
2334 * public/api/measurement-set.php:
2336 2017-01-10 Ryosuke Niwa <rniwa@webkit.org>
2338 Fix a typo in the previous commit.
2340 * public/api/measurement-set.php:
2342 2017-01-10 Ryosuke Niwa <rniwa@webkit.org>
2344 Build fixes for older versions of Postgres.
2346 Also redirect / and /# to /v3/ as intended in r200820.
2348 * public/api/measurement-set.php:
2349 * public/api/runs.php:
2350 * public/index.html:
2352 2016-10-18 Dewei Zhu <dewei_zhu@apple.com>
2354 Update test cases for change r206465.
2355 https://bugs.webkit.org/show_bug.cgi?id=163618
2357 Reviewed by Ryosuke Niwa.
2359 Update test case for change r206465 which added support for multiple summary pages.
2360 Use deepStrictEqual instead of deepEqual as deepEqual will not complain in the case like 'deepEqual([],{})'.
2361 Fix a test failure in tools-buildbot-triggerable-tests.js.
2362 Fix a bug in generating manifest.
2365 * public/include/manifest.php:
2366 * server-tests/api-manifest.js:
2367 (TestServer.remoteAPI.getJSON.string_appeared_here.then):
2368 * server-tests/tools-buildbot-triggerable-tests.js:
2371 2016-09-27 Dewei Zhu <dewei_zhu@apple.com>
2373 Extend perf dashboard to support multiple summary pages.
2374 https://bugs.webkit.org/show_bug.cgi?id=162594
2376 Reviewed by Ryosuke Niwa.
2378 Start support multiple summary pages instead of one.
2379 Specify 'summaryPages' as key that map to a list of summaries which follows
2380 current 'summary' format in 'config.json' but with 2 more properties:
2381 'name': specifying the name shows on perf dashboard,
2382 'route': specifying the path to this page.
2384 * public/include/manifest.php:
2385 * public/v3/main.js:
2388 * public/v3/models/manifest.js:
2389 (Manifest._didFetchManifest):
2391 * public/v3/pages/summary-page.js:
2393 (SummaryPage.prototype.routeName):
2395 2016-08-09 Ryosuke Niwa <rniwa@webkit.org>
2397 Don't filter out the latest data point in chart data sampling
2398 https://bugs.webkit.org/show_bug.cgi?id=160714
2400 Reviewed by Chris Dumez.
2402 Exclude the last data point from sampling so that it's always included in the "sampled" charts data.
2403 Without this, the last data point can change as we zoom out the time domain.
2405 Luckily, we already had a mechanism to exclude the user selected point from sampling. Extend this
2406 feature by supporting an array of point IDs instead of a single ID to exclude from filering.
2408 * public/v3/components/interactive-time-series-chart.js:
2409 (InteractiveTimeSeriesChart.prototype._sampleTimeSeries): Replaced exclusionPointID by excludedPoints.
2411 * public/v3/components/time-series-chart.js:
2412 (TimeSeriesChart.prototype._ensureSampledTimeSeries): Put the last data point in excludedPoints.
2413 (TimeSeriesChart.prototype._sampleTimeSeries): Check point's id against the list of IDs.
2415 2016-08-09 Ryosuke Niwa <rniwa@webkit.org>
2417 Build fix after r204187. interval has to be a getter, not a method.
2419 * public/v3/components/time-series-chart.js:
2420 (TimeSeriesChart.prototype._renderTimeSeries):
2421 * public/v3/models/measurement-adaptor.js:
2422 (MeasurementAdaptor.prototype.applyTo):
2424 2016-08-09 Ryosuke Niwa <rniwa@webkit.org>
2426 Fix a typo that was supposed to be fixed in r204296 before landing.
2428 * public/v3/pages/chart-pane.js:
2430 (ChartPane.prototype.updateFromSerializedState):
2431 (ChartPane.prototype._analyzeRange):
2432 (ChartPane.prototype._renderTrendLinePopover):
2433 (ChartPane.prototype._trendLineTypeDidChange):
2435 2016-08-08 Ryosuke Niwa <rniwa@webkit.org>
2437 Always show segmentation on v3 charts page
2438 https://bugs.webkit.org/show_bug.cgi?id=160576
2440 Rubber-stamped by Chris Dumez.
2442 Added "Trend Lines" popover to select and customize a moving average or a segmentation to show on charts page
2443 and made Schwarz criterion segmentation the default trend line for all charts.
2445 Because computing the segmentation is expensive, we use WebWorker to parallelize the computation via AsyncTask.
2446 We also compute and cache the segmentation for each cluster separately to avoid processing the entire measurement
2447 set as that could take 10-20s total, which was a huge problem in v2 UI. v3 UI's approach is more incremental and
2448 even opens up an opportunity to cache the results in the server side.
2450 Also brought back "shading" for the confidence interval drawing as done in v1 and v2 UI.
2452 * public/shared/statistics.js:
2453 (Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Added segmentCountWeight and gridSize as arguments
2454 to customize the algorithm.
2455 (Statistics.splitIntoSegmentsUntilGoodEnough): Takes segmentCountWeight as BirgeAndMassartC.
2457 * public/v3/async-task.js: Added.
2458 (AsyncTask): Added. This class represents a task such as computing segmentation to be executed in a worker.
2459 (AsyncTask.prototype.execute): Added. Returns a promise that gets resolved when the specified task completes.
2460 (AsyncTaskWorker.waitForAvailableWorker): Added. Calls the given callback with the first available worker. When
2461 all workers are processing some tasks, it waits until one becomes available by putting the callback into a queue.
2462 _didRecieveMessage pops an item out of this queue when a worker completes a task. We don't use a promise here
2463 because calling this function multiple times synchronously could result in all the returned promises getting
2464 resolved with the same worker as none of the callers get to lock away the first available worker until the end
2465 of the current micro-task.
2466 (AsyncTaskWorker._makeWorkerEventuallyAvailable): Added. A helper function for waitForAvailableWorker. Start
2467 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
2468 8 cores on the machine). Avoid starting a new worker if we've started a new worker within the last 50 ms since
2469 starting a new worker takes some time.
2470 (AsyncTaskWorker._findAvailableWorker): Added. Finds a worker that's available right now if there is any.
2471 (AsyncTaskWorker): Added. An instance of AsyncTaskWorker represents a Web worker.
2472 (AsyncTaskWorker.prototype.id): Added.
2473 (AsyncTaskWorker.prototype.sendTask): Added. Sends a task represented by AsyncTask to the worker.
2474 (AsyncTaskWorker.prototype._didRecieveMessage): Added. This function gets called when the current task completes
2475 in the worker. Pop the next callback if some caller of waitForAvailableWorker is still waiting. Otherwise stop
2476 the worker after one second of waiting to avoid worker churning.
2477 (AsyncTaskWorker.workerDidRecieveMessage): Added. Called by onmessage on the worker. Executes the specified task
2478 and sends back a message upon completion with the appropriate timing data.
2480 * public/v3/components/chart-pane-base.js:
2481 (ChartPaneBase.prototype.configure): Uses _createSourceList.
2482 (ChartPaneBase.prototype._createSourceList): Added. Extracted from configure to customize the source list for
2483 the main chart and the overview chart.
2484 (ChartPaneBase.prototype._updateSourceList): Uses _createSourceList.
2486 * public/v3/components/chart-styles.js:
2487 (ChartStyles.createSourceList): Added a boolean showPoint as an extra argument. This specifies whether circles
2488 are drawn for each data point.
2489 (ChartStyles.baselineStyle): Added styles for foreground lines and background lines. They're used for trend lines
2490 and underlying raw data respectively when trend lines are shown.
2491 (ChartStyles.targetStyle): Ditto.
2492 (ChartStyles.currentStyle): Ditto.
2494 * public/v3/components/time-series-chart.js:
2495 (TimeSeriesChart): Added _trendLines, _renderedTrendLines, and _fetchedTimeSeries as instance variables.
2496 (TimeSeriesChart.prototype.setSourceList): Clear _fetchedTimeSeries before calling setSourceList for consistency.
2497 (TimeSeriesChart.prototype.sourceList): Added.
2498 (TimeSeriesChart.prototype.clearTrendLines): Added.
2499 (TimeSeriesChart.prototype.setTrendLine): Added. Preserves the existing trend lines for other sources. This is
2500 necessary because segmentation for "current" and "baseline" lines may become available at different times, and we
2501 don't want to clear one or the other when setting one.
2502 (TimeSeriesChart.prototype._layout): Added a call to _ensureTrendLines.
2503 (TimeSeriesChart.prototype._renderChartContent): Call _renderTimeSeries for trend lines. Trend lines are always
2504 foreground lines and "regular" raw data points are drawn as background if there are trend lines.
2505 (TimeSeriesChart.prototype._renderTimeSeries): Added layerName as an argument. It could be an empty string,
2506 "foreground", or "background". Draw a "shade" just like v1 and v2 UI instead of vertical lines for the confidence
2507 intervals. Pick "foreground", "background", or "regular" chart style based on layerName. Also avoid drawing data
2508 points when *PointRadius is set to zero to reduce the runtime of this function.
2509 (TimeSeriesChart.prototype._sourceOptionWithFallback): Added.
2510 (TimeSeriesChart.prototype._ensureSampledTimeSeries): When *PointRadius is 0, show as many points as there are x
2511 coordinates as a fallback instead of showing every point.
2512 (TimeSeriesChart.prototype._ensureTrendLines): Added. Returns true if the chart contents haven't been re-rendered
2513 since the last update to trend lines. This flag is unset by setTrendLine.
2515 * public/v3/index.html:
2517 * public/v3/models/measurement-cluster.js:
2518 (MeasurementCluster.prototype.addToSeries): Store the data points' index to idMap to help aid MeasurementSet's
2519 _cachedClusterSegmentation efficiently re-create the segmentation from the cache.
2521 * public/v3/models/measurement-set.js:
2522 (MeasurementSet): Added _segmentationCache as an instance variable.
2523 (MeasurementSet.prototype.fetchSegmentation): Added. Calls _cachedClusterSegmentation on each cluster, and
2524 constructs the time series representation of the segmentation from the results.
2525 (MeasurementSet.prototype._cachedClusterSegmentation): Computes and caches the segmentation for each cluster.
2526 The cache of segmentation stores ID of each measurement set at which segment changes instead of its index since
2527 the latter could change in any moment when a new test result is reported, or an existing test result is removed
2528 from the time series; e.g. when it's marked as an outlier.
2529 (MeasurementSet.prototype._validateSegmentationCache): Added. Checks whether the cached segmentation's name and
2530 its parameters match that of the requested one.
2531 (MeasurementSet.prototype._invokeSegmentationAlgorithm): Added. Invokes the segmentation algorithm either in the
2532 main thread or in a Web worker via AsyncTask API based on the size of the time series. While parallelizing the
2533 work is beneficial when the data set is large, the overhead can add up if we keep processing a very small data
2536 * public/v3/models/time-series.js: Made the file compatible with Node.
2537 (TimeSeries.prototype.length): Added.
2538 (TimeSeries.prototype.valuesBetweenRange): Added.
2540 * public/v3/pages/chart-pane.js:
2541 (createTrendLineExecutableFromAveragingFunction): Added.
2542 (ChartTrendLineTypes): Added. Similar to StatisticsStrategies (statistics-strategies.js) in v2 UI.
2543 (ChartPane): Added _trendLineType, _trendLineParameters, _trendLineVersion, and _renderedTrendLineOptions as
2545 (ChartPane.prototype.serializeState): Serialize the trend line option. This format is compatible with v2 UI.
2546 (ChartPane.prototype.updateFromSerializedState): Ditto. Parsing is compatible with v2 UI except that we now have
2547 the default trend line set when the specified ID doesn't match an existing type ID.
2548 (ChartPane.prototype._renderActionToolbar): Added a call to _renderTrendLinePopover. This is the popover that
2549 specifies the type of a trend line to show as well as its parameters.
2550 (ChartPane.prototype._renderTrendLinePopover): Added. A popover for specifying and customizing a trend line.
2551 (ChartPane.prototype._trendLineTypeDidChange): Added. Called when a new trend line is selected.
2552 (ChartPane.prototype._defaultParametersForTrendLine): Added.
2553 (ChartPane.prototype._trendLineParameterDidChange): Added. Called when the trend lines' parameters are changed.
2554 (ChartPane.prototype._didFetchData): Added. Overrides the one in ChartPaneBase to trigger a trend line update.
2555 (ChartPane.prototype._updateTrendLine): Added. Update the trend line. Since segmentation can take an arbitrary
2556 long time, avoid updating trend lines if this function had been called again (possibly for a different trend line
2557 type or with different parameters) before the results become available; hence the versioning.
2558 (ChartPane.paneHeaderTemplate): Added the trend line popover.
2559 (ChartPane.cssTemplate): Added styles for the trend line popover. Also use a more opaque background color behind
2560 popovers when the -webkit-backdrop-filter property is not supported.
2562 * public/v3/pages/dashboard-page.js:
2563 (DashboardPage.prototype._createChartForCell): Call createSourceList with showPoints set to true to preserve the
2566 * tools/js/v3-models.js: Include TimeSeries object.
2568 * unit-tests/measurement-set-tests.js: Added two test cases for MeasurementSet's fetchSegmentation.
2570 * unit-tests/resources/almost-equal.js: Added.
2571 (almostEqual): Extracted out of statistics-tests.js.
2573 * unit-tests/statistics-tests.js:
2575 2016-08-05 Ryosuke Niwa <rniwa@webkit.org>
2577 segmentTimeSeriesByMaximizingSchwarzCriterion returns a bogus result on empty charts
2578 https://bugs.webkit.org/show_bug.cgi?id=160575
2580 Rubber-stamped by Chris Dumez.
2582 The bug was caused by an early return in segmentTimeSeriesByMaximizingSchwarzCriterion.
2583 Removed this early return as the one in splitIntoSegmentsUntilGoodEnough was sufficient.
2585 Also factored out a few functions in findOptimalSegmentation so that they can be better
2586 optimized in JSC's DFG and FTL tiers, and removed unused debuggingTestingRangeNomination.
2588 * public/shared/statistics.js:
2589 (Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Removed an early return.
2590 (Statistics.splitIntoSegmentsUntilGoodEnough):
2591 (.allocateCostUpperTriangularForSegmentation): Extracted from findOptimalSegmentation.
2592 (.allocatePreviousNodeForSegmentation): Ditto.
2593 (.findOptimalSegmentationInternal): Ditto.
2594 (.findOptimalSegmentation):
2596 * unit-tests/statistics-tests.js: Added a test case.
2598 2016-08-05 Ryosuke Niwa <rniwa@webkit.org>
2600 Perf dashboard sometimes tries to fetch a non-existent measurement-set JSON
2601 https://bugs.webkit.org/show_bug.cgi?id=160577
2603 Rubber-stamped by Chris Dumez.
2605 The bug was caused by findClusters computing the first cluster's endTime incorrectly. Namely, we were
2606 multiplying the number of clusters by clusterStart instead of clusterSize with an off-by-one error.
2608 * public/v3/models/measurement-set.js:
2609 (MeasurementSet.prototype.findClusters): Folded computeClusterStart into where clusterEnd is computed
2610 for clarity. Also fixed a bug that we were not computing the first cluster to fetch correctly when
2611 the fetched time range started before clusterStart (i.e. when startTime - clusterStart is negative).
2612 Finally, fixed the main bug by multiplying the number of clusters by clusterSize instead of
2613 clusterStart to compute the end time of the very first cluster in this measurement set. Because what
2614 we're computing here is the end time of the first cluster, not the start time, we also need to subtract
2615 one from the number of clusters. e.g. if there was exactly one cluster, then firstClusterEndTime is
2616 identically equal to lastClusterEndTime.
2617 (MeasurementSet.prototype.fetchedTimeSeries): Removed the unused argument to TimeSeries's constructor.
2619 * unit-tests/analysis-task-tests.js: Fixed the tests for the latest version of Mocha which complains if
2620 we returned a promise in unit tests when "done" function is used.
2621 * unit-tests/checkconfig.js: Ditto.
2622 * unit-tests/measurement-set-tests.js: Added a test case for findClusters and a test to make sure
2623 fetchBetween doesn't try to fetch a cluster before the first cluster in the set. Also fixed other test
2624 cases which were relying on the bug this patch fixed.
2626 2016-08-04 Ryosuke Niwa <rniwa@webkit.org>
2628 MeasurementCluster's addToSeries is slow
2629 https://bugs.webkit.org/show_bug.cgi?id=160581
2631 Rubber-stamped by Chris Dumez.
2633 The bulk of time was spent in MeasurementAdaptor.prototype.applyTo where we computed the interval.
2635 Since some of data points are filtered out by TimeSeriesChart component before intervals are used,
2636 we can significantly reduce the CPU time by lazily compute them. This patch reduces the runtime of
2637 applyTo from ~60ms to ~30ms on my machine.
2639 * public/v3/models/measurement-adaptor.js:
2640 (MeasurementAdaptor.prototype.applyTo): Lazily compute and cache the interval. Also cache the build
2641 object instead of always creating a new object.
2642 * public/v3/models/measurement-cluster.js:
2643 (MeasurementCluster.prototype.addToSeries): Call applyTo first before checking whether the point is
2644 an outlier or its id to avoid extracting those values twice since they show up in the profiler. Also
2645 use "of" instead "forEach" since "of" seems to be faster here.
2647 2016-08-04 Ryosuke Niwa <rniwa@webkit.org>
2649 Syncing script's configuration duplicates a lot of boilerplate
2650 https://bugs.webkit.org/show_bug.cgi?id=160574
2652 Rubber-stamped by Chris Dumez.
2654 This patch makes each configuration accept an array of platforms and types so that we can write:
2656 {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"},
2657 {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"},
2658 {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"},
2659 {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"},
2660 {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"},
2661 {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"},
2662 {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"},
2663 {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"},
2667 {"builder": "mba", "types": ["speedometer", "jetstream"],
2668 "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]},
2669 {"builder": "mbp", "types": ["speedometer", "jetstream"],
2670 "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]},
2672 * tools/js/buildbot-syncer.js:
2673 (BuildbotSyncer._loadConfig):
2674 (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type
2676 (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig.
2677 (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that
2678 shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms',
2679 and merged the code for verify an array of strings. Finally, allow the appearance of 'properties'
2680 since this function can now be called on a cloned configuration in which 'arguments' had already
2681 been renamed to 'properties'.
2683 * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration.
2684 (sampleiOSConfigWithExpansions): Added.
2686 * unit-tests/resources/mock-v3-models.js:
2687 (MockModels.inject): Added a few more mock models for the newly added test.
2689 2016-07-26 Ryosuke Niwa <rniwa@webkit.org>
2691 REGRESSION: Tooltip for analysis tasks doesn't show up on charts
2692 https://bugs.webkit.org/show_bug.cgi?id=160221
2694 Rubber-stamped by Chris Dumez.
2696 The bug was caused by ChartPaneBase resetting annotation bars every time the current point has moved.
2697 Avoid doing this in ChartPaneBase's _renderAnnotations().
2699 * public/v3/components/chart-pane-base.js:
2701 (ChartPaneBase.prototype.fetchAnalysisTasks):
2702 (ChartPaneBase.prototype._renderAnnotations):
2704 2016-07-26 Ryosuke Niwa <rniwa@webkit.org>
2706 REGRESSION: The arrow indicating the current page doesn't get updated
2707 https://bugs.webkit.org/show_bug.cgi?id=160185
2709 Reviewed by Chris Dumez.
2711 The bug was caused by Heading's render() function not updating the DOM more than once. I don't understand
2712 how this has ever worked. Fixed the bug by rendering DOM whenever the current page has changed.
2714 * public/v3/pages/heading.js:
2716 (Heading.prototype.render):
2718 2016-07-25 Ryosuke Niwa <rniwa@webkit.org>
2720 Build fix for Safari 9.
2722 * public/v3/models/build-request.js:
2723 (BuildRequest.prototype.waitingTime): Don't use "const" in strict mode.
2725 2016-07-23 Ryosuke Niwa <rniwa@webkit.org>
2727 Perf dashboard should show the list of a pending A/B testing jobs
2728 https://bugs.webkit.org/show_bug.cgi?id=160138
2730 Rubber-stamped by Chris Dumez.
2732 Add a page to show the list of A/B testing build requests per triggerable. Ideally, we would like to
2733 see a queue per builder but that would require changes to database tables and syncing scripts.
2735 Because this page is most useful when the analysis task with which each build request is associated,
2736 JSON API at /api/build-requests/ has been modified to return the analysis task ID for each request.
2738 Also streamlined the page that shows the list of analysis tasks per Chris' feedback by consolidating
2739 "Bisecting" and "Identified" into "Investigated" and moving the toolbar from the upper left corner
2740 inside the heading to right beneath the heading above the table. Also made the category page serialize
2741 the filter an user had typed in so that reloading the page doesn't clear it.
2743 * public/api/analysis-tasks.php:
2744 (fetch_associated_data_for_tasks): Removed 'category' from the list of columns returned as the notion
2745 of 'category' is only relevant in UI, and it's better computed in the front-end.
2746 (format_task): Ditto.
2747 (determine_category): Deleted.
2749 * public/api/test-groups.php:
2752 * public/include/build-requests-fetcher.php:
2753 (BuildRequestsFetcher::fetch_for_task): Include the analysis task ID in the rows.
2754 (BuildRequestsFetcher::fetch_for_group): Ditto. Ditto.
2755 (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Ditto.
2756 (BuildRequestsFetcher::results_internal): Ditto.
2758 * public/v3/index.html:
2760 * public/v3/main.js:
2761 (main): Create a newly introduced BuildRequestQueuePage as a subpage of AnalysisCategoryPage.
2763 * public/v3/components/ratio-bar-graph.js:
2764 (RatioBarGraph.prototype.update): Fixed a bogus assertion here. ratio can be any number. The coercion
2765 into [-1, 1] is done inside RatioBarGraph's render() function.
2767 * public/v3/models/analysis-task.js:
2768 (AnalysisTask.prototype.category): Moved the code to compute the analysis task's category from
2769 determine_category in analysis-tasks.php. Also merged "bisecting" and "identified" into "investigated".
2770 (AnalysisTask.categories): Merged "bisecting" and "identified" into "investigated".
2772 * public/v3/models/build-request.js:
2773 (BuildRequest): Remember the triggerable and the analysis task associated with this request as well as
2774 the time at when this request was created.
2775 (BuildRequest.prototype.analysisTaskId): Added.
2776 (BuildRequest.prototype.statusLabel): Use a shorter label: "Waiting" for "pending" status.
2777 (BuildRequest.prototype.createdAt): Added.
2778 (BuildRequest.prototype.waitingTime): Added. Returns a human readable time duration since the creation
2779 of this build request such as "2 hours 21 minutes" against a reference time.
2780 (BuildRequest.fetchTriggerables): Added.
2781 (BuildRequest.cachedRequestsForTriggerableID): Added. Used when navigating back to
2783 * public/v3/pages/analysis-category-page.js:
2784 (AnalysisCategoryPage): Construct AnalysisCategoryToolbar and store it in this._categoryToolbar since it
2785 no longer inherits from Toolbar class, which PageWithHeading recognizes and stores.
2786 (AnalysisCategoryPage.prototype.title):
2787 (AnalysisCategoryPage.prototype.serializeState): Added.
2788 (AnalysisCategoryPage.prototype.stateForCategory): Added. Include the filter in the serialization.
2789 (AnalysisCategoryPage.prototype.updateFromSerializedState): Restore the filter from the URL state.
2790 (AnalysisCategoryPage.prototype.filterDidChange): Added. Called by AnalysisCategoryToolbar to update
2791 the URL state in addition to calling render() as done previously via setFilterCallback.
2792 (AnalysisCategoryPage.prototype.render): Always call _categoryToolbar.render() since the hyperlinks for
2793 the category pages now include the filter, which can be updated in each call.
2794 (AnalysisCategoryPage.cssTemplate):
2796 * public/v3/pages/analysis-category-toolbar.js:
2797 (AnalysisCategoryToolbar): Inherits from ComponentBase instead of Toolbar since AnalysisCategoryToolbar
2798 no longer works with Heading class unlike other subclasses of Toolbar class.
2799 (AnalysisCategoryToolbar.prototype.setCategoryPage): Added.
2800 (AnalysisCategoryToolbar.prototype.setFilterCallback): Deleted.
2801 (AnalysisCategoryToolbar.prototype.setFilter): Added. Used to restore from a serialized URL state.
2802 (AnalysisCategoryToolbar.prototype.render): Don't recreate the input element as it clears the value as
2803 well as the selection of the element. Also use AnalysisCategoryPage's stateForCategory to serialize the
2804 category name and the current filter for each hyperlink.
2805 (AnalysisCategoryToolbar.prototype._filterMayHaveChanged): Now takes an boolean argument specifying
2806 whether the URL state should be updated or not. We update the URL only when a change event is fired to
2807 avoid constantly updating it while an user is still typing.
2808 (AnalysisCategoryToolbar.cssTemplate): Added.
2809 (AnalysisCategoryToolbar.htmlTemplate): Added a button to open the newly added queue page.
2811 * public/v3/pages/build-request-queue-page.js:
2812 (BuildRequestQueuePage): Added.
2813 (BuildRequestQueuePage.prototype.routeName): Added.
2814 (BuildRequestQueuePage.prototype.pageTitle): Added.
2815 (BuildRequestQueuePage.prototype.open): Added. Fetch open build requests for every triggerables using
2816 the same API as the syncing scripts.
2817 (BuildRequestQueuePage.prototype.render): Added.
2818 (BuildRequestQueuePage.prototype._constructBuildRequestTable): Added. Construct a table for the list of
2819 pending, scheduled or running build requests in the order syncing scripts would see. Note that the list
2820 of build requests returned by /api/build-requests/* can contain completed, canceled, or failed requests
2821 since the JSON returns all build requests associated with each test group if one of the requests of the
2822 group have not finished. This helps syncing scripts picking the right builder for A/B testing when it
2823 had previously been unloaded or crashed in the middle of processing a test group. This characteristics
2824 of the API actually helps us here because we can reliably compute the total number of build requests in
2825 the group. The first half of this function does this counting as well as collapses all but the first
2826 unfinished build requests into a "contraction" row, which just shows the number of build requests that
2827 are remaining in the group.
2828 (BuildRequestQueuePage.cssTemplate): Added.
2829 (BuildRequestQueuePage.htmlTemplate): Added.
2831 * public/v3/pages/summary-page.js:
2832 (SummaryPage.prototype.open): Use one-day median instead of seven-day median to compute the status.
2833 (SummaryPageConfigurationGroup): Initialize _ratio to NaN. This was causing assertion failures in
2834 RatioBarGraph's update() while measurement sets are being fetched.
2836 * server-tests/api-build-requests-tests.js: Updated the tests per change in BuildRequest's statusLabel.
2837 * unit-tests/analysis-task-tests.js: Ditto.
2838 * unit-tests/test-groups-tests.js: Ditto.
2839 * unit-tests/build-request-tests.js: Added tests for BuildRequest's waitingTime.
2841 2016-07-22 Ryosuke Niwa <rniwa@webkit.org>
2843 REGRESSION(r203035): Marking points as an outlier no longer updates charts
2844 https://bugs.webkit.org/show_bug.cgi?id=160106
2846 Reviewed by Darin Adler.
2848 The bug was caused by MeasurementSet's fetchBetween clearing previously registered callbacks when noCache
2849 option is specified.
2851 * public/v3/components/time-series-chart.js:
2852 (TimeSeriesChart.prototype.setSourceList): Clear this._fetchedTimeSeries when changing chart options.
2853 e.g. need to start including or excluding outliers.
2854 (TimeSeriesChart.prototype.fetchMeasurementSets): Don't skip the fetching when noCache is true.
2856 * public/v3/models/measurement-set.js:
2857 (MeasurementSet): Added this._callbackMap as an instance variable to keep track of all callbacks on every
2858 cluster since we may need to call each callback multiple times per cluster when noCache option is used.
2859 (MeasurementSet.prototype.fetchBetween): Moved the code to add _primaryClusterPromise to _allFetches here
2860 so that now this function and _ensureClusterPromise are only functions that touch _allFetches.
2861 (MeasurementSet.prototype._ensureClusterPromise): Extracted out of fetchBetween. Queue up all callbacks
2862 for each cluster when creating a new promise.
2863 (MeasurementSet.prototype._fetchPrimaryCluster): Removed the code to add _primaryClusterPromise now that
2864 it's done in fetchBetween.
2866 * public/v3/remote.js:
2867 (RemoteAPI.postJSONWithStatus): Removed superfluous call to console.log.
2869 * unit-tests/measurement-set-tests.js: Updated the test case for noCache. The callback registered before
2870 fetchBetween is called with noCache=true is now invoked so callCount must be 3 instead of 2.
2872 2016-07-19 Ryosuke Niwa <rniwa@webkit.org>
2874 Perf dashboard always re-generate measurement set JSON
2875 https://bugs.webkit.org/show_bug.cgi?id=159951
2877 Reviewed by Chris Dumez.
2879 The bug was caused by manifest.json reporting the last modified date of a measurement set in floating point,
2880 and a measurement set JSON reporting it as an integer. Fixed the bug by always using an integer.
2882 * public/api/measurement-set.php:
2883 (main): Return 404 when the results is empty.
2884 (MeasurementSetFetcher::execute_query): Use "extract(epoch from commit_time)" like ManifestGenerator to improve
2885 the generation speed. This is ~10% runtime improvement.
2886 (MeasurementSetFetcher::format_map): Updated to reflect the above change.
2887 (MeasurementSetFetcher::parse_revisions_array): Ditto.
2889 * public/include/manifest.php:
2890 (ManifestGenerator::platforms): Fixed the bug by coercing lastModified to integer (instead of float).
2892 * server-tests/api-measurement-set-tests.js: Added a test case for returning empty results, and a test case for
2893 making sure lastModified dates in manifest.json and measurement sets match.
2895 * tools/js/remote.js:
2896 (RemoteAPI.prototype.sendHttpRequest): Reject the promise when HTTP status code is not 200.
2898 2016-07-09 Ryosuke Niwa <rniwa@webkit.org>
2900 Perf dashboard can consume 50-70% of CPU on MacBook even if user is not interacting at all
2901 https://bugs.webkit.org/show_bug.cgi?id=159597
2903 Reviewed by Chris Dumez.
2905 TimeSeriesChart and InteractiveTimeSeriesChart had been relying on continually polling on requestAnimationFrame
2906 to update itself in response to its canvas resizing. Even though there as an early exit in the case there was
2907 nothing to update, this is still causing a significant power drain when the user is not interacting at all.
2909 Let TimeSeriesChart use the regular top-down render path like other components with exceptions of listening to
2910 window's resize eventas well as when new JSONs are fetched from the server. The render() call to the latter case
2911 will be coerced into a single callback on requestAnimationFrame to avoid DOM-mutation-layout churn.
2913 * public/v3/components/base.js:
2914 (ComponentBase.isElementInViewport): Deleted.
2915 * public/v3/components/chart-pane-base.js:
2916 (ChartPaneBase.prototype.render): Enqueue charts to render.
2917 * public/v3/components/chart-styles.js:
2918 (ChartStyles.dashboardOptions): Removed updateOnRequestAnimationFrame which is no longer an available option.
2919 * public/v3/components/time-series-chart.js:
2920 (TimeSeriesChart): Replaced the code to register itself for rAF by the code to listen to resize events on window.
2921 (TimeSeriesChart._updateOnRAF): Deleted.
2922 (TimeSeriesChart._updateAllCharts): Added.
2923 (TimeSeriesChart.prototype._enqueueToRender): Added.
2924 (TimeSeriesChart._renderEnqueuedCharts): Added.
2925 (TimeSeriesChart.prototype.fetchMeasurementSets): Avoid calling fetchBetween when the range had been fetched.
2926 Without this change, we can incur a significant number of redundant calls to render() when adjusting the domain
2927 in charts page by the slider. When no new JSON is fetched, simply enqueue this chart to render on rAF.
2928 (TimeSeriesChart.prototype._didFetchMeasurementSet): Enqueue this chart to render on rAF.
2929 (TimeSeriesChart.prototype.render): Removed the check for isElementInViewport since we no longer get render() call
2930 when this chart moves into the viewport (as we no longer listen to every rAF or scroll event).
2931 * public/v3/models/measurement-set.js:
2932 (MeasurementSet.prototype.hasFetchedRange): Fixed various bugs revealed by the new use in fetchMeasurementSets.
2933 * public/v3/pages/chart-pane-status-view.js:
2934 (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Removed the dead code. It was probably
2935 copied from when this code was in InteractiveTimeSeries chart. There is no this._forceRender in this component.
2936 * public/v3/pages/dashboard-page.js:
2937 (DashboardPage.prototype.render): Enqueue charts to render.
2938 * public/v3/pages/heading.js:
2939 (SummaryPage.prototype.open): Removed the call to isElementInViewport. This wasn't really doing anything useful in
2941 * unit-tests/measurement-set-tests.js: Added tests for hasFetchedRange.
2942 (.waitForMeasurementSet): Moved to be used in a newly added test case.
2944 2016-07-09 Ryosuke Niwa <rniwa@webkit.org>
2946 REGRESSION: manifest.json generation takes multiple seconds on perf dashboard
2947 https://bugs.webkit.org/show_bug.cgi?id=159596
2949 Reviewed by Chris Dumez.
2951 The most of CPU time was spent looking for a duplicate entry in an array of metrics by array_search.
2952 This patch moves to postgres by using aggregate functions in the query. Also moved the code to convert
2953 datetime to UNIX epoch timestamp from PHP to within postgres query.
2955 These improvements reduce total runtime of Manifest::generate from ~4s to ~350ms on my machine.
2957 * public/include/manifest.php:
2958 (Manifest::generate): No longer fetches test_configurations table as this is done in Manifest::platforms now.
2959 Also moved calls to each method in the class to separate lines for easier instrumentation.
2960 (Manifest::platforms): Group test configurations (current, baseline, target) by platform and metric.
2961 Use the max of the last modified dates in UNIX epoch timestamps (ms to be compatible with JS's representation).
2962 A given platform, metric pair is considered to be in the v1 dashboard if any test configuration is in.
2964 2016-07-08 Ryosuke Niwa <rniwa@webkit.org>
2966 bundle-v3-scripts.py should compress HTML/CSS templates
2967 https://bugs.webkit.org/show_bug.cgi?id=159582
2969 Reviewed by Joseph Pecoraro.
2971 Strip leading and trailing whitespaces from HTML and CSS templates. This is a 8% progression on the file size.
2973 * Install.md: Updated the list of MIME types to apply deflate for newer versions of Apache.
2974 * tools/bundle-v3-scripts.py:
2976 (compress_template): Added.
2978 2016-06-13 Ryosuke Niwa <rniwa@webkit.org>
2980 Build fix. Strip out "use strict" everywhere so that the perf dashboard works on the shipping Safari.
2982 * tools/bundle-v3-scripts.py:
2985 2016-06-13 Ryosuke Niwa <rniwa@webkit.org>
2987 Invalid token error when trying to create an A/B analysis for a range
2988 https://bugs.webkit.org/show_bug.cgi?id=158679
2990 Reviewed by Chris Dumez.
2992 The problem in this particular case was due to another website overriding cookies for our subdomain.
2993 Make PrivilegedAPI robust against its token becoming invalid in general to fix the bug since the cookie
2994 is only available under /privileged-api/ and the v3 UI can't access it for security reasons.
2996 This patch factors out PrivilegedAPI out of remote.js so that it can be tested separately in server tests
2997 as well as unit tests even though RemoteAPI itself is implemented differently in each case.
2999 * init-database.sql: Added a forgotten default value "false" to run_marked_outlier.
3000 * public/v3/index.html:
3001 * public/v3/privileged-api.js: Added. Extracted out of public/v3/remote.js.
3002 (PrivilegedAPI.sendRequest): Fixed the bug. When the initial request fails with "InvalidToken" error,
3003 re-generate the token and re-issue the request.
3004 (PrivilegedAPI.requestCSRFToken):
3005 * public/v3/remote.js:
3006 (RemoteAPI.postJSON): Added to match tools/js/remote.js.
3007 (RemoteAPI.postJSONWithStatus): Ditto.
3008 (PrivilegedAPI): Moved to privileged-api.js.
3009 * server-tests/api-measurement-set-tests.js: Removed the unused require for crypto.
3010 * server-tests/privileged-api-upate-run-status.js: Added tests for /privileged-api/update-run-status.
3011 * server-tests/resources/test-server.js:
3012 (TestServer.prototype.inject): Clear the cookies as well as tokens in PrivilegedAPI.
3013 * tools/js/remote.js:
3014 (RemoteAPI): Added the support for PrivilegedAPI by making cookie set by the server persist.
3015 (RemoteAPI.prototype.clearCookies): Added for tests.
3016 (RemoteAPI.prototype.postJSON): Make sure sendHttpRequest always sends a valid JSON.
3017 (RemoteAPI.prototype.postJSONWithStatus): Added since this API is used PrivilegedAPI.
3018 (RemoteAPI.prototype.sendHttpRequest): Retain the cookie set by the server and send it back in each request.
3019 * tools/js/v3-models.js:
3020 * unit-tests/privileged-api-tests.js: Added unit tests for PrivilegedAPI.
3021 * unit-tests/resources/mock-remote-api.js:
3022 (MockRemoteAPI.postJSON): Added for unit testing.
3023 (MockRemoteAPI.postJSONWithStatus): Ditto.
3025 2016-06-13 Ryosuke Niwa <rniwa@webkit.org>
3027 /admin/tests is very slow
3028 https://bugs.webkit.org/show_bug.cgi?id=158682
3030 Reviewed by Chris Dumez.
3032 The slowness came from TestNameResolver::__construct, which was fetching the entire table of test_configurations,
3033 which at this point contains more than 32,000 rows. Don't fetch the entire table in the constructor. Instead,
3034 fetch a subset of rows as needed in configurations_for_metric_and_platform. Even though this results in many SQL
3035 queries being issued, that's a lot more efficient in practice because we only fetch a few dozen rows in practice.
3037 Also removed a whole bunch of features from /admin/tests to simplify the page. In particular, the ability to update
3038 the list of triggerables has been removed now that sync-buildbot.js automatically updates that for us. This removed
3039 the last use of test_exists_on_platform, which was also dependent on fetching test_configurations upfront.
3041 * public/admin/tests.php:
3042 * public/include/test-name-resolver.php:
3043 (TestNameResolver::__construct): Don't fetch the entire table of test_configurations.
3044 (TestNameResolver::configurations_for_metric_and_platform): Just issue a SQL query for the specified platform and metric.
3045 (TestNameResolver::test_exists_on_platform): Removed.
3047 2016-06-08 Ryosuke Niwa <rniwa@webkit.org>
3049 sync-buildbot.js should update the list of tests and platforms associated with a triggerable
3050 https://bugs.webkit.org/show_bug.cgi?id=158406
3052 Reviewed by Chris Dumez.
3054 Add /api/update-triggerable and a test for it, which were supposed to be added in r201718
3055 but for which I forgot to run svn add.
3057 * public/api/update-triggerable.php: Added.
3059 * server-tests/api-update-triggerable.js: Added.
3061 2016-06-07 Ryosuke Niwa <rniwa@webkit.org>
3063 Build fix after r201739. attachShadow was throwing an exception on this component.
3065 * public/v3/pages/analysis-category-toolbar.js:
3066 (AnalysisCategoryToolbar):
3068 2016-06-06 Ryosuke Niwa <rniwa@webkit.org>
3070 sync-buildbot.js should update the list of tests and platforms associated with a triggerable
3071 https://bugs.webkit.org/show_bug.cgi?id=158406
3072 <rdar://problem/26185737>
3074 Reviewed by Darin Adler.
3076 Added /api/update-triggerable to update the list of configurations (platform and test pairs)
3077 associated with a given triggerable, and make sync-buildbot.js use this JSON API before each
3078 syncing cycle so that the association gets updated automatically by simply updating the JSON.
3080 * server-tests/api-manifest.js: Use const for imported modules.
3081 * server-tests/api-report-commits-tests.js: Removed unnecessary importing of crypto.
3082 * server-tests/resources/mock-data.js:
3083 (MockData.someTestId): Added.
3084 (MockData.somePlatformId): Added.
3085 (MockData.addMockData):
3086 * server-tests/tools-buildbot-triggerable-tests.js: Use const for imported modules. Also added
3087 a test for BuildbotTriggerable's updateTriggerable.
3088 * tools/js/buildbot-triggerable.js:
3089 (BuildbotTriggerable.prototype.updateTriggerable): Added. Find the list of all configurations
3090 associated with this triggeerable and post it to /api/update-triggerable.
3091 * tools/js/database.js: Added triggerable_configurations to the list of tables.
3092 * tools/js/remote.js:
3093 (RemoteAPI.prototype.postJSON): Print the whole response when JSON parsing fails for debugging.
3094 * tools/sync-buildbot.js:
3095 (syncLoop): Call BuildbotTriggerable's updateTriggerable before syncing.
3097 2016-06-02 Ryosuke Niwa <rniwa@webkit.org>
3099 Build fix after r201564.
3101 * public/v3/pages/analysis-category-page.js:
3102 (AnalysisCategoryPage.prototype.updateFromSerializedState):
3103 * public/v3/pages/create-analysis-task-page.js:
3104 (CreateAnalysisTaskPage.prototype.updateFromSerializedState):
3105 (CreateAnalysisTaskPage.prototype.render):
3107 2016-05-31 Ryosuke Niwa <rniwa@webkit.org>
3109 v3 UI should support marking and unmarking outliers as well as hiding them
3110 https://bugs.webkit.org/show_bug.cgi?id=158248
3112 Rubber-stamped by Chris Dumez.
3114 Added the support for marking and unmarking a sequence of points as outliers. Unlike v2, we now support marking
3115 multiple points as outliers in a single click. Also fixed a bug that outliers are never explicitly hidden in v3 UI.
3117 This patch splits ChartStyles.createChartSourceList into two functions: resolveConfiguration and createSourceList
3118 to separate the work of resolving platform and metric IDs to their respective model objects, and creating a source
3119 list used by TimeSeriesChart to fetch measurement sets. createSourceList is called again when filtering options are
3122 It also adds noCache option to TimeSeriesChart's fetchMeasurementSets, MeasurementSet's fetchBetween and
3123 _fetchPrimaryCluster to update the measurement sets after marking or unmarking points as outliers. In addition, it
3124 fixes a bug that the annotation bars for analysis tasks are not updated in charts page after creating an analysis
3125 task by adding noCache option to ChartPaneBase's fetchAnalysisTasks, AnalysisTask's fetchByPlatformAndMetric and
3128 Finally, this patch splits ChartPane._makeAnchorToOpenPane into _makePopoverActionItem, _makePopoverOpenOnHover and
3129 _setPopoverVisibility for clarity.
3131 * public/v3/components/chart-pane-base.js:
3132 (ChartPaneBase): Added _disableSampling and _showOutliers as instance variables.
3133 (ChartPaneBase.prototype.configure):
3134 (ChartPaneBase.prototype.isSamplingEnabled): Added.
3135 (ChartPaneBase.prototype.setSamplingEnabled): Added. When a filtering option is updated, recreate the source list
3136 so that TimeSeriesChart.setSourceList can re-fetch the measurement set JSONs.
3137 (ChartPaneBase.prototype.isShowingOutliers): Added.
3138 (ChartPaneBase.prototype.setShowOutliers): Added. Ditto for calling _updateSourceList.
3139 (ChartPaneBase.prototype._updateSourceList): Added.
3140 (ChartPaneBase.prototype.fetchAnalysisTasks): Renamed from _fetchAnalysisTasks. Now takes noCache as an argument
3141 instead of platform and metric IDs since they're on instance variables.
3143 * public/v3/components/chart-styles.js:
3144 (ChartStyles.resolveConfiguration): Renamed from createChartSourceList. Just resolves platform and metric IDs.
3145 (ChartStyles.createSourceList): Extracted from createChartSourceList since it needs to be called when a filtering
3146 option is changed as well as when ChartPaneBase.prototype.configure is called.
3147 (ChartStyles.baselineStyle): Now takes filtering options.
3148 (ChartStyles.targetStyle): Ditto.
3149 (ChartStyles.currentStyle): Ditto.
3151 * public/v3/components/interactive-time-series-chart.js:
3152 (InteractiveTimeSeriesChart.prototype.currentPoint): Find the point in _fetchedTimeSeries when
3153 _sampledTimeSeriesData hasn't been computed yet as a fallback (e.g. when the chart hasn't been rendered yet).
3154 (InteractiveTimeSeriesChart.prototype.selectedPoints): Added.
3155 (InteractiveTimeSeriesChart.prototype.firstSelectedPoint): Added.
3156 (InteractiveTimeSeriesChart.prototype.lockedIndicator): Added. Returns the current point if it's locked.
3158 * public/v3/components/time-series-chart.js:
3159 (TimeSeriesChart.prototype.setDomain):
3160 (TimeSeriesChart.prototype.setSourceList): Added. Re-create _fetchedTimeSeries when filtering options have changed.
3161 Don't re-fetch measurement set JSONs here since showing outliers can be done entirely in the front end.
3162 (TimeSeriesChart.prototype.fetchMeasurementSets): Extracted out of setDomain. Now takes noCache as an argument.
3163 ChartPane._markAsOutlier
3164 (TimeSeriesChart.prototype.firstSampledPointBetweenTime): Added.
3166 * public/v3/models/analysis-task.js:
3167 (AnalysisTask.fetchByPlatformAndMetric): Added noCache as an argument.
3168 (AnalysisTask._fetchSubset): Ditto.
3170 * public/v3/models/measurement-adaptor.js:
3171 (MeasurementAdaptor.prototype.isOutlier): Added.
3172 (MeasurementAdaptor.prototype.applyToAnalysisResults): Add markedOutlier as a property on each point.
3174 * public/v3/models/measurement-cluster.js:
3175 (MeasurementCluster.prototype.addToSeries): Fixed the bug that filtering outliers was broken as _markedOutlierIndex
3176 is undefined here. Use MeasurementAdaptor's isOutlier instead.
3178 * public/v3/models/measurement-set.js:
3179 (MeasurementSet.prototype.fetchBetween): Added noCache as an argument. Reset _primaryClusterPromise and _allFetches
3180 when noCache is true since we need to re-fetch the primary cluster as well as all secondary clusters now.
3181 (MeasurementSet.prototype._fetchPrimaryCluster): Added noCache as an argument. Directly invoke the JSON API at
3182 /api/measurement-set to re-generate all clusters' JSON files instead of first fetching the cached version.
3183 (MeasurementSet.prototype._fetchSecondaryCluster):
3184 (MeasurementSet.prototype._didFetchJSON): Removed a bogus assertion since this function is called on secondary
3185 clusters as well as primary clusters.
3186 (MeasurementSet.prototype._addFetchedCluster): Reimplemented this function using an insertion sort. Also remove the
3187 existing entry if the fetch cluster should replace it.
3189 * public/v3/models/time-series.js:
3190 (TimeSeries.prototype.dataBetweenPoints): Removed the dead code to filter out outliers. This is done in addToSeries
3191 of MeasurementCluster instead.
3193 * public/v3/pages/chart-pane.js:
3194 (ChartPane): Renamed pane to popover since it was confusing to have a pane inside a pane class. As such, renamed
3195 _paneOpenedByClick to _lockedPopover.
3196 (ChartPane.prototype.serializeState): Added the code to serialize filtering options in the serialized state URL.
3197 (ChartPane.prototype.updateFromSerializedState): Ditto for parsing.
3198 (ChartPane.prototype._analyzeRange): Extracted out of render(). Also fixed a bug that the charts page don't show
3199 the newly created analysis task by invoking fetchAnalysisTasks with noCache set to true.
3200 (ChartPane.prototype._markAsOutlier): Added.
3201 (ChartPane.prototype._renderActionToolbar): A bunch of changes due to pane -> popover rename. Also added a popover
3202 for filtering options.
3203 (ChartPane.prototype._makePopoverActionItem): Extracted from _makeAnchorToOpenPane.
3204 (ChartPane.prototype._makePopoverOpenOnHover): Ditto.
3205 (ChartPane.prototype._setPopoverVisibility): Ditto.
3206 (ChartPane.prototype._renderFilteringPopover): Added.
3207 (ChartPane.htmlTemplate): Added a popover for specifying filtering options. Also added .popover on each popover.
3208 (ChartPane.cssTemplate): Updated the style to make use of .popover.
3210 * public/v3/pages/charts-page.js:
3211 (ChartsPage.prototype.graphOptionsDidChange): Added. Updates the URL state when a filtering option is modified.
3213 * public/v3/pages/dashboard-page.js:
3214 (DashboardPage.prototype._createChartForCell):
3216 * public/v3/pages/page-router.js:
3217 (PageRouter.prototype._serializeHashQueryValue): Serialize a set of strings as | separated tokens.
3218 (PageRouter.prototype._deserializeHashQueryValue): Rewrote the function as the serialized URL can no longer be
3219 parsed as a JSON as | separated tokens can't be converted into a valid JSON construct with a simple regex.
3221 * unit-tests/measurement-set-tests.js: Added a test case for fetchBetween with noCache=true.
3223 2016-05-24 Ryosuke Niwa <rniwa@webkit.org>
3225 Another build fix after r201307.
3227 * public/v3/pages/page-router.js:
3228 (PageRouter.prototype._deserializeHashQueryValue):
3229 (PageRouter.prototype._countOccurrences): Moved from _deserializeHashQueryValue.
3231 2016-05-23 Ryosuke Niwa <rniwa@webkit.org>
3233 Build fix after r201307.
3235 * public/v3/pages/chart-pane.js:
3236 (ChartPane.prototype.serializeState):
3238 2016-05-23 Ryosuke Niwa <rniwa@webkit.org>
3240 Some applications truncates the last closing parenthesis in perf dashboard URL
3241 https://bugs.webkit.org/show_bug.cgi?id=157976
3243 Reviewed by Tim Horton.
3245 Unfortunately, different applications use different heuristics to determine the end of each URL. Two trailing
3246 parentheses, for example, is just fine in Radar as well as Apple Mail if the URL is short enough. Using other
3247 characters such as ] and } wouldn't work either because they would be %-escaped. At that point, we might as well
3248 as %-escape everything.
3250 Work around the bug by parsing the URL as if it had one extra ')' if the parsing had failed. Also shorten the charts
3251 page's URL by avoid emitting "-null" for each pane when the pane doesn't have a currently selected point or selection.
3252 This improves the odds of the entire URL being recognized by various applications.
3254 We could, in theory, implement some sort of a URL shorter but that can wait until when we support real user accounts.
3256 * public/v3/pages/chart-pane.js:
3257 (ChartPane.prototype.serializeState): Don't serialize the selection or the current point if nothing is selected.
3258 * public/v3/pages/page-router.js:
3259 (PageRouter.prototype._deserializeHashQueryValue): Try parsing the value again with one extra ] at the end if
3260 the JSON parsing had failed.
3262 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
3264 Perf dashboard "Add pane" should list first by test, then by machine
3265 https://bugs.webkit.org/show_bug.cgi?id=157880
3267 Reviewed by Stephanie Lewis.
3269 Reversed the order which tests and platforms are selected. Also split .pane-selector-container into #tests and
3270 #platform for the ease of DOM node manipulations.
3272 * public/v3/components/pane-selector.js:
3274 (PaneSelector.prototype._renderPlatformList): Renamed from _renderPlatformLists since there is a single list
3275 for platforms. This list now disappears while a non-metric item is selected in the collection of test lists.
3276 e.g. "Speedometer" instead of its "Score" metric. Remember the last metric we rendered to avoid churning.
3277 (PaneSelector.prototype._renderTestLists): Render the top level tests once. The index of lists have been
3278 decreased by one since test lists are now inside #tests instead of appearing after the platform list.
3279 (PaneSelector.prototype._buildTestList): Don't filter tests since platform is chosen after tests now.
3280 (PaneSelector.prototype._replaceList):
3281 (PaneSelector.prototype._selectedItem): Don't reset the test path (specifies which subtest or metric is picked)
3282 when a platform is selected since it happens after a test metric is chosen now.
3283 (PaneSelector.prototype._clickedItem): Add a pane when a platform is clicked, not when a metric is clicked.
3284 (PaneSelector.cssTemplate):
3286 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
3288 Analysis task should look for a git commit based on abridged hashes
3289 https://bugs.webkit.org/show_bug.cgi?id=157877
3290 <rdar://problem/26254374>
3292 Reviewed by Chris Dumez.
3294 Made /privileged-api/associate-commit look for commits using LIKE instead of an exact match.
3295 Associate the commit when there is exactly one match.
3297 * public/include/commit-log-fetcher.php:
3298 (CommitLogFetcher::fetch_between):
3299 * public/include/db.php:
3300 (Database::escape_for_like): Extracted from CommitLogFetcher::fetch_between.
3301 * public/privileged-api/associate-commit.php:
3302 (main): Look for the commits using LIKE. Reject whenever there are multiple commits. We limit the number of
3303 matches to two for performance when the user specifies something that almost thousands of commits: e.g. "1".
3304 * public/v3/pages/analysis-task-page.js:
3305 (AnalysisTaskPage.prototype._associateCommit): Added human friendly error messages for mismatching commits.
3307 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
3309 Unreviewed build fix. Use --date-order so that every child commit appears after its parent.
3310 Otherwise we'll hit a FailedToFindParentCommit error while submitting a commit that appears before its parent.
3312 * tools/sync-commits.py:
3313 (GitRepository._fetch_all_hashes):
3315 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
3317 Removed the erroneously committed debug code.
3319 * tools/sync-commits.py:
3320 (GitRepository.fetch_commit):
3322 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
3324 Perf dashboard should have a script to sync git commits
3325 https://bugs.webkit.org/show_bug.cgi?id=157867
3327 Reviewed by Chris Dumez.
3329 Added the support to pull from a Git repo to pull-svn.py and renamed it to sync-commits.py.
3331 Added two classes SVNRepository and GitRepository which inherits from an abstract class, Repository.
3332 The code that fetches commit and format revision number / git hash is specialized in each.
3335 * tools/pull-svn.py: Removed.
3336 * tools/sync-commits.py: Renamed from Websites/perf.webkit.org/tools/pull-svn.py.
3337 (main): Renamed --svn-config-json to --repository-config-json. Also made it robust against exceptions
3338 inside fetch_commits_and_submit of each Repository class.
3339 (load_repository): A factory function for SVNRepository and GitRepository.
3340 (Repository): Added.
3341 (Repository.__init__): Added.
3342 (Repository.fetch_commits_and_submit): Extracted from standalone fetch_commits_and_submit.
3343 (Repository.fetch_commit): Added. Implemented by a subclass.
3344 (Repository.format_revision): Ditto.
3345 (Repository.determine_last_reported_revision): Extracted from alonealone
3346 determine_first_revision_to_fetch. The fallback to use "oldest" has been moved to SVNRepository's
3347 fetch_commit since it doesn't work in Git.
3348 (Repository.fetch_revision_from_dasbhoard): Extracted from fetch_revision_from_dasbhoard.
3349 (SVNRepository): Added.
3350 (SVNRepository.__init__): Added.
3351 (SVNRepository.fetch_commit): Extracted from standalone fetch_commit_and_resolve_author and fetch_commit.
3352 (SVNRepository._resolve_author_name): Renamed from resolve_author_name_from_account.
3353 (SVNRepository.format_revision): Added.
3354 (GitRepository): Added.
3355 (GitRepository.__init__):
3356 (GitRepository.fetch_commit): Added. Fetches the list of all git hashes if needed, and finds the next hash.
3357 (GitRepository._find_next_hash): Added. Finds the first commit that appears after the specified hash.
3358 (GitRepository._fetch_all_hashes): Added. Gets the list of all git hashs chronologically (old to new).
3359 (GitRepository._run_git_command): Added.
3360 (GitRepository.format_revision): Added. Use the first 8 characters of the hash.
3362 2016-05-17 Ryosuke Niwa <rniwa@webkit.org>
3364 Add a subtitle under platform name in the summary page
3365 https://bugs.webkit.org/show_bug.cgi?id=157809
3367 Reviewed by Chris Dumez.
3369 Add a description beneath the platform names.
3371 * public/v3/pages/summary-page.js:
3372 (SummaryPage.prototype._constructTable): Add a br and a span if subtitle is present.
3373 (SummaryPage.cssTemplate): Added CSS rules for .subtitle.
3375 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
3377 v3 UI shows full git hash instead of the first 8 characters for a blame range
3378 https://bugs.webkit.org/show_bug.cgi?id=157691
3380 Reviewed by Stephanie Lewis.
3382 Fixed the bug that v3 UI shows the full 40 character git hash instead of the first 8 character as done in v2 UI.
3384 * public/v3/models/commit-log.js:
3385 (CommitLog.prototype.diff): Fixed the bug.
3386 * tools/run-tests.py:
3387 (main): Add the support for running a subset of tests as mocha does.
3388 * unit-tests/commit-log-tests.js: Added.
3390 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
3392 Unreviewed. Added the missing executable bits.
3394 * tools/bundle-v3-scripts.py: Added property svn:executable.
3395 * tools/detect-changes.js: Added property svn:executable.
3396 * tools/process-maintenance-backlog.py: Added property svn:executable.
3398 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
3400 Summary page doesn't report some missing platforms
3401 https://bugs.webkit.org/show_bug.cgi?id=157670
3403 Reviewed by Darin Adler.
3405 This patch improves the warning text for missing platforms and fixes the bug that platforms that don't have
3406 any data reported for a given test would not be reported as missing.
3408 * public/v3/pages/summary-page.js:
3409 (SummaryPage.prototype.render): Added instrumentations.
3410 (SummaryPage.prototype._constructRatioGraph): Always create both the ratio bar graph and the spinner icon.
3411 (SummaryPage.prototype._renderCell): Extracted from _constructRatioGraph. Toggle the displayed-ness of the
3412 spinner and the ratio bar graph in the cell by CSS for better performance.
3413 (SummaryPage.prototype._warningTextForGroup): Extracted from _constructRatioGraph. Rephrased warning text
3414 for clarity and adopted new API of SummaryPageConfigurationGroup.
3415 (SummaryPage.prototype._warningTextForGroup.mapAndSortByName): Added.
3416 (SummaryPage.prototype._warningTextForGroup.pluralizeIfNeeded): Added.
3417 (SummaryPage.cssTemplate): Added rules to toggle the visibility of spinner icons and bar graphs.
3418 (SummaryPageConfigurationGroup): Replaced this._warnings by more explicitly named this._missingPlatforms
3419 and this._platformsWithoutBaseline. Also add a platform to this._missingPlatforms if it didn't appear in
3420 any metrics. Note that adding a platform whenever it doesn't in any one metric would be incorrect since
3421 some tests uses a different test name on different platforms: e.g. PLT-Mac and PLT-iPhone.
3422 (SummaryPageConfigurationGroup.prototype.missingPlatforms): Added.
3423 (SummaryPageConfigurationGroup.prototype.platformsWithoutBaseline): Added.
3424 (SummaryPageConfigurationGroup.prototype._fetchAndComputeRatio):
3426 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
3428 Always use v3 UI for dashboards and analysis task pages
3429 https://bugs.webkit.org/show_bug.cgi?id=157647
3431 Reviewed by Darin Adler.
3433 Redirect dashboard pages from v1 and v2 to v3's summary page. Also redirect v1 UI's charts page and v2 UI's
3434 analysis task pages to the corresponding v3 pages.
3436 Keep v2's charts page accessible since some features such as segmentation is still only available on v2 UI.
3438 * public/index.html:
3439 (init.showCharts): Redirect to v3 UI once the chart list has been parsed.
3440 (init.redirectChartsToV3): Added.
3441 * public/v2/index.html:
3443 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
3445 Show a spinner while fetching data on summary page
3446 https://bugs.webkit.org/show_bug.cgi?id=157658
3448 Reviewed by Darin Adler.
3450 Show a spinner while fetching JSON files on the summary page.
3452 * public/v3/components/base.js:
3453 (ComponentBase.prototype.renderReplace): Added a new implementation that simply calls the static version.
3454 (ComponentBase.renderReplace): Made this static.
3456 * public/v3/pages/summary-page.js:
3457 (SummaryPage.prototype._constructRatioGraph): Show a spinner icon when SummaryPageConfigurationGroup's
3458 isFetching returns true.
3459 (SummaryPage.cssTemplate): Force the height of each cell to be 2.5rem so that the height of cell doesn't
3460 change when a spinner is replaced by a ratio bar graph.
3462 (SummaryPageConfigurationGroup): Added this._isFetching as an instance variable.
3463 (SummaryPageConfigurationGroup.prototype.isFetching): Added.
3464 (SummaryPageConfigurationGroup.prototype.fetchAndComputeSummary): Set this._isFetching while waiting for
3465 the promises to resolve after 50ms. We don't immediately set this._isFetching to avoid FOC when all JSON
3466 files have been cached.
3468 2016-05-07 Ryosuke Niwa <rniwa@webkit.org>
3470 Add horizontal between categories of tests
3471 https://bugs.webkit.org/show_bug.cgi?id=157386
3473 Reviewed by Darin Adler.
3475 Wrap tests in each category by tbody and add a horizontal bar between each category.
3477 * public/v3/pages/summary-page.js:
3478 (SummaryPage.prototype._constructTable):
3479 (SummaryPage.cssTemplate):
3481 2016-05-04 Dewei Zhu <dewei_zhu@apple.com>
3483 Summary page should show warnings when current or baseline data is missing.
3484 https://bugs.webkit.org/show_bug.cgi?id=157339
3486 Reviewed by Ryosuke Niwa.
3488 Set summary page to be the default page of v3 UI.
3489 Show warning icon when either baseline or current data is missing.
3490 Make fetchBetween returns a promise.
3491 Update unit tests for MeasurementSet.fetchBetween since it returns a promise now.
3492 Add a workaround to skip some platform and metric configurations.
3494 * public/v3/components/ratio-bar-graph.js:
3496 (RatioBarGraph.prototype.update): Add showWarningIcon flag to indicate whether we should show warning icon.
3497 (RatioBarGraph.prototype.render): Show warning icon when showWarningIcon is true.
3498 (RatioBarGraph.cssTemplate): Add style for warning icon.
3499 * public/v3/components/warning-icon.js: Add warning icon.
3501 (WarningIcon.cssTemplate):
3502 * public/v3/index.html:
3503 * public/v3/main.js:
3504 (main): Set summary page to be the default page of v3 UI.
3505 * public/v3/models/measurement-set.js:
3507 (MeasurementSet.prototype.fetchBetween): Returns a promise. Fix the bug in previous implementation that we miss
3508 some callbacks sometimes. Basically, we will fetch primary cluster first, then secondary clusters. For each
3509 secondary cluster fetch, we will always invoke callback even when it fails.
3510 (MeasurementSet.prototype._fetchSecondaryClusters): Deleted.
3511 (MeasurementSet.prototype._fetch.else.url.api.measurement.set platform): Deleted.
3512 * public/v3/pages/summary-page.js:
3513 (SummaryPage): Add a variable for excluded configurations.
3514 (SummaryPage.prototype._createConfigurationGroup): Pass excluded configurations while building config groups.
3515 (SummaryPage.prototype._constructTable): Remove the logic for unified header since it breaks consistency of the table appearance.
3516 (SummaryPage.prototype.this._renderQueue.push): Show warning message when baseline/current data is missing.
3517 (SummaryPageConfigurationGroup): Add a variable to keep track of the warnings while computing summary.
3518 (SummaryPageConfigurationGroup.prototype.warnings): A getter for warnings.
3519 (SummaryPageConfigurationGroup._computeSummary): Fix a bug in calculating ratios. We should always use
3520 current/baseline for ratio and present the difference between ratio and 1 in the summary page.
3521 (SummaryPageConfigurationGroup.set then): Deleted.
3522 (SummaryPageConfigurationGroup.set var): Deleted.
3523 * unit-tests/measurement-set-tests.js: Add a helper function to wait for fetchBetween. Update unit tests since fetchBetween returns a promise now.
3524 (promise.set fetchBetween):
3525 (set MeasurementSet):
3526 (set fetchBetween): Deleted.
3528 2016-04-26 Ryosuke Niwa <rniwa@webkit.org>
3530 Chart status should always be computed against prior values
3531 https://bugs.webkit.org/show_bug.cgi?id=157014
3533 Reviewed by Darin Adler.
3535 Compare the current value against the last baseline or target value that appear before the current value in time
3536 so that the comparison stay the same even when new baseline and target values are reported. Also include the compared
3537 baseline or target value in the label for clarity.
3539 * public/v3/components/chart-status-view.js:
3540 (ChartStatusView.prototype._computeChartStatus):
3541 (ChartStatusView.prototype._computeChartStatus.labelForDiff):
3542 (ChartStatusView.prototype._findLastPointPriorToTime): Extracted from _relativeDifferenceToLaterPointInTimeSeries.
3543 Now finds the last point before the current point's time if there is any, or the last point in baseline / target.
3544 (ChartStatusView.prototype._relativeDifferenceToLaterPointInTimeSeries): Deleted.
3545 * public/v3/models/metric.js:
3546 (Metric.prototype.makeFormatter): Don't use SI units for unit-less metrics.
3548 2016-04-13 Ryosuke Niwa <rniwa@webkit.org>
3550 REGRESSION(r199444): Perf dashboard always fetches all measurement sets
3551 https://bugs.webkit.org/show_bug.cgi?id=156534
3553 Reviewed by Darin Adler.
3555 The bug was cased by SummaryPage's constructor fetching all measurement sets. Since each page is always
3556 constructed in main(), this resulted in all measurement sets being fetched on all pages.
3558 * public/v3/pages/summary-page.js:
3560 (SummaryPage.prototype.open): Fetch measurement set JSONs here.
3561 (SummaryPage.prototype._createConfigurationGroup): Renamed from _createConfigurationGroupAndStartFetchingData.
3563 2016-04-12 Ryosuke Niwa <rniwa@webkit.org>
3565 Add a summary page to v3 UI
3566 https://bugs.webkit.org/show_bug.cgi?id=156531
3568 Reviewed by Stephanie Lewis.
3570 Add new "Summary" page, which shows the average difference (better or worse) from the baseline across
3571 multiple platforms and tests by a single number.
3573 * public/include/manifest.php:
3574 (ManifestGenerator::generate): Include "summary" in manifest.json.
3575 * public/shared/statistics.js:
3576 (Statistics.mean): Added.
3577 (Statistics.median): Added.
3578 * public/v3/components/ratio-bar-graph.js: Added.
3579 (RatioBarGraph): Shows a horizontal bar graph that visualizes the relative difference (e.g. 3% better).
3580 (RatioBarGraph.prototype.update):
3581 (RatioBarGraph.prototype.render):
3582 (RatioBarGraph.cssTemplate):
3583 (RatioBarGraph.htmlTemplate):
3584 * public/v3/index.html:
3585 * public/v3/main.js:
3586 (main): Instantiate SummaryPage and add it to the navigation bar and the router.
3587 * public/v3/models/manifest.js:
3588 (Manifest._didFetchManifest): Let "summary" pass through from manifest.json to main().