1 2017-02-24 Ryosuke Niwa <rniwa@webkit.org>
3 REGRESSION(r212853): Comparisons to baseline no longer shows up
4 https://bugs.webkit.org/show_bug.cgi?id=168863
6 Reviewed by Joseph Pecoraro.
8 The bug was caused by ChartStatusView's code not being updated to use TimeSeriesView's.
9 Updated the code to use TimeSeriesView's methods to fix the bug.
11 Also made InteractiveTimeSeriesChart's currentPoint to return a (TimeSeriesView, point, isLocked) tuple
12 to consolidate it with lockedIndicator() to work towards making the baseline data points selectable.
14 * browser-tests/time-series-chart-tests.js: Updated the test cases to use currentIndicator, and added
15 test cases for newly added lastPointInTimeRange.
17 * public/v3/components/chart-pane.js:
18 (ChartPane.prototype.serializeState): Updated to use currentIndicator.
19 (ChartPane.prototype._renderFilteringPopover): Ditto.
21 * public/v3/components/chart-status-view.js:
22 (ChartStatusView.prototype.updateStatusIfNeeded): Use currentIndicator for an interative time series.
23 Fixed the non-interactive chart's code path for TimeSeriesView.
24 (ChartStatusView.prototype._computeChartStatus): Modernized the code.
25 (ChartStatusView.prototype._findLastPointPriorToTime): Deleted. Replaced by TimeSeriesView's
28 * public/v3/components/interactive-time-series-chart.js:
29 (InteractiveTimeSeriesChart.prototype.currentIndicator):
30 (InteractiveTimeSeriesChart.prototype.moveLockedIndicatorWithNotification):
31 (InteractiveTimeSeriesChart.prototype._renderChartContent):
32 (InteractiveTimeSeriesChart):
34 * public/v3/models/time-series.js:
35 (TimeSeriesView.prototype.lastPointInTimeRange): Added.
36 (TimeSeriesView.prototype._reverse): Added. Traverses the view in the reverse order.
37 * unit-tests/time-series-tests.js:
39 2017-02-23 Dewei Zhu <dewei_zhu@apple.com>
41 Rename 'commit_parent' in 'commits' table to 'commit_previous_commit'.
42 https://bugs.webkit.org/show_bug.cgi?id=168816
44 Reviewed by Ryosuke Niwa.
46 Rename 'commit_parent' to avoid ambiguity in the coming feature.
47 For exisiting database, run
48 "ALTER TABLE commits RENAME commit_parent TO commit_previous_commit;"
49 to update the database.
52 * public/api/report-commits.php:
53 * public/include/commit-log-fetcher.php:
54 * server-tests/api-commits.js:
56 * server-tests/api-report-commits-tests.js:
58 * tools/sync-commits.py:
60 (Repository.fetch_commits_and_submit):
61 (GitRepository._revision_from_tokens):
62 * unit-tests/analysis-task-tests.js:
65 2017-02-23 Ryosuke Niwa <rniwa@webkit.org>
67 New sampling algorithm shows very few points when zoomed out
68 https://bugs.webkit.org/show_bug.cgi?id=168813
70 Reviewed by Saam Barati.
72 When a chart is zoomed out to a large time interval, the new sampling algorithm introduced in r212853 can
73 hide most of the data points because the difference between the preceding point's time and the succeeding
74 point's time of most points will be below the threshold we computed.
76 Instead, rank each data point based on the aforementioned time interval difference, and pick the first M data
77 points when M data points are to be shown.
79 This makes the new algorithm behave like our old algorithm while keeping it stable still. Note that this
80 algorithm still biases data points without a close neighboring point but this seems to work out in practice
81 because such a point tends to be an important sample anyway, and we don't have a lot of space between
82 data points since we aim to show about one point per pixel.
84 * browser-tests/index.html:
85 (CanvasTest.canvasContainsColor): Extracted from one of the test cases and generalized. Returns true when
86 the specified region of the canvas contains a specified color (alpha is optional).
87 * browser-tests/time-series-chart-tests.js: Added a test case for sampling. It checks that sampling happens
88 and that we always show some data point even when zoomed out to a large time interval.
89 (createChartWithSampleCluster):
91 * public/v3/components/interactive-time-series-chart.js:
92 (InteractiveTimeSeriesChart.prototype._sampleTimeSeries):
93 * public/v3/components/time-series-chart.js:
94 (TimeSeriesChart.prototype._ensureSampledTimeSeries): M, the number of data points we pick must be computed
95 based on the width of data points we're about to draw constrained by the canvas size. e.g. when the canvas
96 is only half filled, we shouldn't be showing two points per pixel in the filled region.
97 (TimeSeriesChart.prototype._sampleTimeSeries): Refined the algorithm. First, compute the time difference or
98 the rank for each N data points. Sort those ranks in descending order (in the order we prefer), and include
99 all data points above the M-th rank in the sample.
100 (TimeSeriesChart.prototype.computeTimeGrid): Revert the inadvertent change in r212935.
102 * public/v3/models/time-series.js:
103 (TimeSeriesView.prototype.filter): Fixed a bug that the indices passed onto the callback were shifted by the
105 * unit-tests/time-series-tests.js: Added a test case to ensure callbacks are called with correct data points
108 2017-02-23 Ryosuke Niwa <rniwa@webkit.org>
110 REGRESSION(r212542): Make TimeSeriesChart.computeTimeGrid stops x-axis grid prematurely
111 https://bugs.webkit.org/show_bug.cgi?id=168812
113 Reviewed by Joseph Pecoraro.
115 Add time iterator of two months, three months, and four months with some tests.
117 Also for one-month time iterator, round the day of month to 1 or 15 whichever is closer.
119 * browser-tests/time-series-chart-tests.js: Added more tests.
120 * public/v3/components/time-series-chart.js:
121 (TimeSeriesChart._timeIterators.next):
122 (TimeSeriesChart._timeIterators):
124 2017-02-22 Ryosuke Niwa <rniwa@webkit.org>
126 Add tests for InteractiveTimeSeriesChart and adopt actions
127 https://bugs.webkit.org/show_bug.cgi?id=168750
129 Reviewed by Chris Dumez.
131 Added tests for InteractiveTimeSeriesChart.
133 Also replaced selection.onchange, selection.onzoom, indicator.onchange, annotations.onclick callbacks
134 by "selectionChange", "zoom", "indicatorChange", and "annotationClick" actions respectively.
136 Also fixed various bugs and bad code I encountered while writing these tests.
138 * browser-tests/index.html:
139 (waitForComponentsToRender): Delay the call to enqueueToRender until the next run loop because there
140 might be outstanding promises that just got resolved. e.g. for fetching measurement sets JSONs. Let
141 all those promises get resolved first. Otherwise, some tests become racy.
142 (canvasImageData): Extracted from time-series-chart-tests.js.
143 (canvasRefTest): Ditto.
145 (CanvasTest.fillCanvasBeforeRedrawCheck): Ditto.
146 (CanvasTest.hasCanvasBeenRedrawn): Ditto.
147 (CanvasTest.canvasImageData): Ditto.
148 (CanvasTest.expectCanvasesMatch): Ditto.
149 (CanvasTest.expectCanvasesMismatch): Ditto.
151 * browser-tests/time-series-chart-tests.js: Fixed some test cases where dpr multipler was not doing
152 the right thing anymore in Safari under a high DPI screen. Also added a lot of test cases for interactive
153 time series chart and one for rendering annotations.
155 (posixTime): Added. A helper function for sampleCluster.
156 (dayInMilliseconds): Ditto.
157 (sampleCluster): Moved here. Made the same cluster more artifical for an easier testing.
158 (createChartWithSampleCluster): Moved out of one of the tests.
159 (respondWithSampleCluster): Ditto.
161 * public/v3/components/chart-pane-base.js:
162 (ChartPaneBase.prototype.configure): Adopted new actions in InteractiveTimeSeriesChart.
164 * public/v3/components/chart-status-view.js:
165 (ChartStatusView.prototype.updateStatusIfNeeded): Removed a superflous console.log.
167 * public/v3/components/chart-styles.js:
168 (ChartStyles.mainChartOptions): Set zoomButton to true. InteractiveTimeSeriesChart used to determine
169 whether to show the zoom button or not based on the precense of the zoom callback. We made it explicit.
171 * public/v3/components/interactive-time-series-chart.js:
172 (InteractiveTimeSeriesChart.prototype.setIndicator): Explicitly call _notifySelectionChanged with false
173 instead of relying on undefined to be treated as falsey.
174 (InteractiveTimeSeriesChart.prototype._createCanvas): Use id instead of selector to find elements.
175 (InteractiveTimeSeriesChart.htmlTemplate):
176 (InteractiveTimeSeriesChart.cssTemplate):
177 (InteractiveTimeSeriesChart.prototype._mouseMove): Explicitly call _startOrContinueDragging with false
178 instead of relying on undefined treated as falsey. Also added the missing call to enqueueToRender found
179 by new tests. This was working fine on the dashboard due to other components invoking enqueueToRender
180 but won't work in a standalone instance of InteractiveTimeSeriesChart.
181 (InteractiveTimeSeriesChart.prototype._mouseLeave): Ditto, adding the missing call to enqueueToRender.
182 (InteractiveTimeSeriesChart.prototype._click): Removed the assignment to _forceRender when calling
183 _mouseMove in an early exist, which does set this flag and invokes enqueueToRender, and added the missing
184 call to enqueueToRender in the other code path.
185 (InteractiveTimeSeriesChart.prototype._startOrContinueDragging): Replaced annotations.onclick callback
186 by the newly added "annotationClick" action, and added the missing call to enqueueToRender.
187 (InteractiveTimeSeriesChart.prototype._endDragging): Use arrow function.
188 (InteractiveTimeSeriesChart.prototype._notifyIndicatorChanged): Replaced indicator.onchange callback by
189 the newly added "indicatorChange" action.
190 (InteractiveTimeSeriesChart.prototype._notifySelectionChanged): Replaced selection.onchange callback by
191 the newly added "selectionChange" action.
192 (InteractiveTimeSeriesChart.prototype._renderChartContent): Show the zoom button when options.zoomButton
193 is set instead of relying on the presence of selection.onzoom especially now that the callback has been
194 replaced by the "zoom" action.
196 * public/v3/components/time-series-chart.js:
197 (TimeSeriesChart.prototype.setAnnotations): Added the missing call to enqueueToRender.
201 2017-02-21 Ryosuke Niwa <rniwa@webkit.org>
203 Make sampling algorithm more stable and introduce an abstraction for sampled data
204 https://bugs.webkit.org/show_bug.cgi?id=168693
206 Reviewed by Chris Dumez.
208 Before this patch, TimeSeriesChart's resampling resulted in some points poping up and disappearing as
209 the width of a chart is changed. e.g. when resizing the browser window. The bug was by caused by
210 the sample for a given width not always including all points for a smaller width so as the width is
211 expanded, some point may be dropped.
213 Fixed this by using a much simpler algorithm of always picking a point when the time interval between
214 the preceding point and the succeeding point is larger than the minimum space we allow for a given width.
216 Also introduced a new abstraction around the sample data: TimeSeriesView. A TimeSeriesView provides
217 a similar API to TimeSeries for a subset of the time series filtered by a time range a custom function.
218 This paves a way to adding the ability to select baseline, etc... on the chart status view.
220 TimeSeriesView can be in two modes:
221 Mode 1. The view represents a contiguous subrange of TimeSeries - In this mode, this._data references
222 the underlying TimeSeries's _data directly, and we use _startingIndex to adjust index given to
223 find the relative index. Finding the next point or the previous point of a given point is done
224 via looking up the point's seriesIndex and doing a simple arithmetic. In general, an index is
225 converted to the absolute index in the underlying TimeSeries's _data array.
227 Mode 2. The view represents a filtered non-contiguous subset of TimeSeries - In this mode, this._data is
228 its own array. Finding the next point or the previous point of a given point requires finding
229 a sibling point in the underlying TimeSeries which is in this view. Since this may result in O(n)
230 traversal and a hash lookup, we lazily build a map of each point to its position in _data instead.
232 * public/v3/components/chart-status-view.js:
233 (ChartStatusView.prototype.updateStatusIfNeeded): Call selectedPoints instead of sampledDataBetween for
234 clarity. This function now returns a TimeSeriesView instead of a raw array.
236 * public/v3/components/interactive-time-series-chart.js:
237 (InteractiveTimeSeriesChart.prototype.currentPoint): Updated now that _sampledTimeSeriesData contains
238 an array of TimeSeriesView's. Note that diff is either 0, -1, or 1.
239 (InteractiveTimeSeriesChart.prototype.selectedPoints): Ditto. sampledDataBetween no longer exists since
240 we can simply call viewTimeRange on TimeSeriesView returned by sampledDataBetween.
241 (InteractiveTimeSeriesChart.prototype.firstSelectedPoint): Ditto.
242 (InteractiveTimeSeriesChart.prototype._sampleTimeSeries): Use add since excludedPoints is now a Set.
244 * public/v3/components/time-series-chart.js:
245 (TimeSeriesChart.prototype.sampledDataBetween): Deleted.
246 (TimeSeriesChart.prototype.firstSampledPointBetweenTime): Deleted.
247 (TimeSeriesChart.prototype._ensureSampledTimeSeries): Modernized the code. Use the the time interval of
248 the chart divided by the number of allowed points as the time interval used in the new sampling algorithm.
249 (TimeSeriesChart.prototype._sampleTimeSeries): Rewritten. We also create TimeSeriesView here.
250 (TimeSeriesChart.prototype._sampleTimeSeries.findMedian): Deleted.
251 (TimeSeriesChart.prototype._updateCanvasSizeIfClientSizeChanged): Fixed a bug that the canvas size wasn't
252 set to the correct value on Chrome when a high DPI screen is used.
254 * public/v3/models/time-series.js:
255 (TimeSeries.prototype.viewBetweenPoints): Renamed from dataBetweenPoints. Now returns a TimeSeriesView.
256 (TimeSeriesView): Added. This constructor is to be called by viewBetweenPoints, viewTimeRange, and filter.
257 (TimeSeriesView.prototype._buildPointIndexMap): Added. Used in mode (2).
258 (TimeSeriesView.prototype.length): Added.
259 (TimeSeriesView.prototype.firstPoint): Added.
260 (TimeSeriesView.prototype.lastPoint): Added.
261 (TimeSeriesView.prototype.nextPoint): Added. Note index is always a position in this._data. In mode (1),
262 this is the position of the point in the underlying TimeSeries' _data. In mode (2), this is the position
263 of the point in this._data which is dictinct from the underlying TimeSeries' _data.
264 (TimeSeriesView.prototype.previousPoint): Ditto.
265 (TimeSeriesView.prototype.findPointByIndex): Added. Finds the point using the positional index from the
266 beginning of this view. findPointByIndex(0) on one view may not be same as findPointByIndex(0) of another.
267 (TimeSeriesView.prototype.findById): Added. This is O(n).
268 (TimeSeriesView.prototype.values): Added. Returns the value of each point in this view.
269 (TimeSeriesView.prototype.filter): Added. Creates a new view with a subset of data points the predicate
270 function returned true.
271 (TimeSeriesView.prototype.viewTimeRange): Added. Creates a new view with a subset of data points for the
272 given time ragne. When the resultant view would include all points of this view, it simply returns itself
274 (TimeSeriesView.prototype.firstPointInTimeRange): Added. Returns the first point in the view which lies
275 within the specified time range.
276 (TimeSeriesView.prototype.Symbol.iterator): Added. Iterates over each point in the view.
278 * public/v3/pages/analysis-task-page.js:
279 (AnalysisTaskChartPane.prototype.selectedPoints): Use selectedPoints in lieu of getting selection and then
280 calling sampledDataBetween with that range.
282 * public/v3/pages/summary-page.js:
283 (SummaryPageConfigurationGroup.set _medianForTimeRange): Modernized.
285 * unit-tests/time-series-tests.js: Added tests for TimeSeries and TimeSeriesView. Already caught bugs!
288 2017-02-17 Ryosuke Niwa <rniwa@webkit.org>
290 Add tests for the time series chart and fix bugs I found along the way
291 https://bugs.webkit.org/show_bug.cgi?id=168499
293 Reviewed by Antti Koivisto.
295 Add basic tests for the time series chart.
297 Replaced the "ondata" callback set in the options by "dataChange" action now that ComponentBase provides
298 a facility for defining event-like actions.
300 Also fixed bugs I encountered while writing these tests see below for descriptions.
302 * browser-tests/editable-text-tests.js:
303 (waitToRender): Moved to index.html
304 * browser-tests/index.html:
305 (waitToRender): Moved from editable-text-tests.js.
307 * browser-tests/time-series-chart-tests.js: Added.
308 * public/v3/components/chart-pane-base.js:
309 (ChartPaneBase.prototype.configure):
310 * public/v3/components/time-series-chart.js:
311 (TimeSeriesChart): Removed the code to set display and position inline properties. This is now done inside
312 cssTemplate with :host pseudo class.
313 (TimeSeriesChart.prototype._ensureCanvas): Don't strech the canvas to 100% of width and height. This was
314 causing a flush of contents where the canvas is momentarily streched by the browser and the script later
315 updates with the content with the correct aspect ratio.
316 (TimeSeriesChart.cssTemplate): Added :host rule to set display: block and position: relative.
317 (TimeSeriesChart._updateAllCharts): Deleted.
318 (TimeSeriesChart.prototype.render): Only run the code for axis when options.axis is defined. Also, avoid
319 setting the fill style because we never fill for axis drawing.
320 (TimeSeriesChart.prototype._computeHorizontalRenderingMetrics): Ditto. Fallback to sensible values when
321 options.axis is not defined.
322 (TimeSeriesChart.prototype._renderYAxis): Now computeValueGrid generates a sequence of {time, label}.
323 (TimeSeriesChart.prototype._renderTimeSeries): Don't draw the shades for confidence intervals unless its
324 fill style is defined. Otherwise, we'd end up drawing black shade and mask the actual data points.
325 (TimeSeriesChart.prototype._ensureSampledTimeSeries): Dispatch newly added "dataChange" action instead of
326 calling "ondata" callback in options dictionary.
327 (TimeSeriesChart.computeTimeGrid): Modernized to use const/let. Also fixed the bug that we were emitting
328 the date even when the entire time range fit within a 24-hour interval.
329 (TimeSeriesChart.computeValueGrid): Rewritten to make MB/GB use a nice round number instead of 0.98GB.
330 We were using a power of 10 to round up the stepping value but the value formatter used a power of 1024
331 to divide byte measurements (e.g. for memory). Use formatter.divisor to find the right scaling factor for
333 * public/v3/models/metric.js:
334 (Metric.prototype.makeFormatter):
335 (Metric.makeFormatter): Extracted from the one on the prototype so that tests don't need a metric object
336 just to test TimeSeriesChart. Added the second argument which specifies the maximum absolute value of the
337 range we're formatting. This is needed to use the same number of decimal points when the most significant
338 digit of some value is smaller than that of the biggest one. For example, we were emitting 0.50GB instead
339 of 0.5G along with 2.0GB. The "adjustment" reduces the number of significant figures in these cases.
340 * public/v3/pages/dashboard-page.js:
341 (DashboardPage.prototype._createChartForCell):
343 2017-02-16 Ryosuke Niwa <rniwa@webkit.org>
345 Use expect.js instead of expect in browser tests
346 https://bugs.webkit.org/show_bug.cgi?id=168492
348 Reviewed by Joseph Pecoraro.
350 Use expect.js (https://github.com/Automattic/expect.js) instead of expect (https://github.com/mjackson/expect).
352 * browser-tests/close-button-tests.js:
353 * browser-tests/component-base-tests.js:
354 * browser-tests/editable-text-tests.js:
355 * browser-tests/index.html:
357 2017-02-16 Ryosuke Niwa <rniwa@webkit.org>
359 Modernize and fix measurement-set tests
360 https://bugs.webkit.org/show_bug.cgi?id=168484
362 Reviewed by Joseph Pecoraro.
364 Modernized and fixed the tests in measurement-set-tests.js.
366 1. Return a promise instead of manually calling done in then/catch hanlders.
367 2. Use arrow function everywhere.
368 3. Explicitly assert the number of calls to callbacks instead of asserting never reached.
370 The test case labled "should return false when the range ends after the fetched cluster"
371 was incorrectly asserting that hasFetchedRange returns false when the end time is after
372 the primary cluster's end time. Test an interval before the primary cluster instead.
374 Added a test case for hasFetchedRange returning true when the end time appears after
375 the end of the primary cluster and fixed hasFetchedRange to that end. Since there are
376 no data points after the primary cluster which is chronologically the last cluster,
377 there is nothing to fetch beyond its end time.
379 * public/v3/models/measurement-set.js:
380 (MeasurementSet.prototype.hasFetchedRange): Fixed the bug that this function returned
381 false when the end time was after the primary cluster's end by truncating the range by
382 the end of the primary cluster.
383 * unit-tests/measurement-set-tests.js:
384 * unit-tests/resources/mock-remote-api.js:
385 (assert.notReached.assert.notReached): Deleted. It's no longer used by any tests.
387 2017-02-15 Ryosuke Niwa <rniwa@webkit.org>
389 Update ReadMe.md and merge it with Install.md
390 https://bugs.webkit.org/show_bug.cgi?id=168405
392 Reviewed by Michael Catanzaro.
394 Merged Install.md and ReadMe.md into one file.
396 * Install.md: Removed.
397 * ReadMe.md: Merged Install.md at the top and updated the rest of the content.
399 2017-01-24 Ryosuke Niwa <rniwa@webkit.org>
401 Modernize editable-text component and add tests
402 https://bugs.webkit.org/show_bug.cgi?id=167398
404 Reviewed by Yusuke Suzuki.
406 Modernized EditableText component to use the action feature added in r210938.
408 * browser-tests/editable-text-tests.js: Added. Added tests for EditableText component.
410 * browser-tests/index.html:
411 * public/v3/components/base.js:
412 (ComponentBase.prototype.dispatchAction): Return the result from the callback.
413 * public/v3/components/editable-text.js:
414 (EditableText): Removed a bunch of instance variables that are no longer needed.
415 (EditableText.prototype.didConstructShadowTree): Added. Add event listeners on the Edit/Save button and the host.
416 (EditableText.prototype.editedText): Return the text field's value directly.
417 (EditableText.prototype.text): Added.
418 (EditableText.prototype.setText): Call enqueueToRender automatically instead of relying on the parent component
419 to do so in _startedEditingCallback, which has been removed.
420 (EditableText.prototype.render): Modernized the code.
421 (EditableText.prototype._didClick): No longer prevents the default action manually since that's automatically done
422 in createEventHandler. Handle the case where the update action is not handled.
423 (EditableText.prototype._endEditingMode): Renamed from _didUpdate.
424 (EditableText.htmlTemplate): Added ids on various elements in the shadow tree.
425 (EditableText.cssTemplate): Updated the CSS selectors per above change.
427 (main): Fixed a typo.
428 * public/v3/pages/analysis-task-page.js:
429 (AnalysisTaskPage): Use the action listener instead of manually setting callbacks.
430 (AnalysisTaskPage.prototype._createTestGroupListItem): Ditto.
431 (AnalysisTaskPage.prototype._didStartEditingTaskName): Deleted.
433 2017-01-20 Ryosuke Niwa <rniwa@webkit.org>
435 Build fix after r210783. Didn't mean to require custom elements API.
440 2017-01-20 Ryosuke Niwa <rniwa@webkit.org>
442 Make sync-commits.py robust against missing Subversion authors and missing parent Git commits
443 https://bugs.webkit.org/show_bug.cgi?id=167231
445 Reviewed by Antti Koivisto.
447 Fixed a bug that a subversion commit that's missing author name (anonymous commit) results in an out of bound
448 exception, and a bug that syncing a git repository starts failing once there was a merge commit which pulled
449 in a commit data earlier than that of the last reported commit.
451 For the latter fix, added --max-ancestor-fetch-count to specify the number of maximum commits to look back.
453 * tools/sync-commits.py:
454 (main): Added --max-ancestor-fetch-count.
455 (Repository.fetch_commits_and_submit): If submit_commits fails with FailedToFindParentCommit, fetch the parent
456 commit's information until we've resolved them all.
457 (Repository.fetch_next_commit): Renamed from fetch_commit.
458 (SVNRepository.fetch_next_commit): Renamed from fetch_commit. Don't try to get the author name if it's missing
459 due to an anonymous commit. It's important to never include the "author" field in the JSON submitted to
460 a dashboard since it rejects when "author" field is not an array (e.g. null).
461 (GitRepository.fetch_next_commit): Renamed from fetch_commit.
462 (GitRepository.fetch_commit): Added. Fetches the commit information for a given git hash. Used to retrieve
463 missing parent commits.
464 (GitRepository._revision_from_tokens): Extracted from fetch_commit.
467 (submit_commits): Optionally takes status_to_accept to avoid throwing in the case of FailedToFindParentCommit
468 and returns the response JSON.
470 2017-01-20 Ryosuke Niwa <rniwa@webkit.org>
472 REGRESSION(r198234): /api/commits/%revision% always fails
473 https://bugs.webkit.org/show_bug.cgi?id=167235
475 Reviewed by Antti Koivisto.
477 The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on
478 $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there.
480 Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest,
481 and /last-reported would return a commit with all values set to null instead of an empty list.
483 Finally, added server API tests for /api/commits.
485 * public/api/commits.php:
486 (main): Add a comment for APIs that only exist for v2 UI.
488 * public/include/commit-log-fetcher.php:
489 (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the
490 the latest commit as desired.
491 (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception
492 because commit_for_revision is defined on $this, not $this->db.
493 (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with
494 all values set to null.
496 * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits.
497 (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits
498 to one sent to /api/report-commits.
500 2017-01-19 Ryosuke Niwa <rniwa@webkit.org>
502 measurement-sets API can incorrectly order points with OS version without commit time
503 https://bugs.webkit.org/show_bug.cgi?id=167227
505 Reviewed by Chris Dumez.
507 Ignore revision_order for the purpose of ordering data points in /api/measurement-sets.
509 These orderings are used in some UI (e.g A/B testing) to order OS build numbers which do not have a timestamp
510 associated with each "revision".
512 The baseline measurements made in our internal dashboard were using these ordering numbers before ordering
513 results with build time. Because those data points don't have an associated Webkit revisions, all data points
514 were ordered first by macOS's revision_order, then build time. Because v3 UI completely ignores revision_order
515 for the purpose of plotting data points, this resulted in some data points being plotted in a wrong order
516 with some lines going backwards in time.
518 This patch addresses this discrepancy by stop ordering data points with revision_order in the JSON API.
520 * public/api/measurement-set.php:
521 (MeasurementSetFetcher::execute_query): Fixed the bug.
522 * server-tests/api-measurement-set-tests.js: Added a test.
524 2017-01-19 Ryosuke Niwa <rniwa@webkit.org>
526 Build fix after r210626. We need to clear Triggerable's static map in each iteration.
528 * tools/sync-buildbot.js:
531 2017-01-18 Ryosuke Niwa <rniwa@webkit.org>
533 Add a mechanism to dispatch and listen to an action
534 https://bugs.webkit.org/show_bug.cgi?id=167191
536 Reviewed by Antti Koivisto.
538 Added the notion of an action to components. Like DOM events, it can be dispatched or listen to.
540 Also added ComponentBase.prototype.part which finds a sub-component inside a component's shadow tree,
541 and made ComponentBase.prototype.content take an id to find an element that matches it.
543 * browser-tests/close-button-tests.js: Added. Tests for CloseButton.
544 * browser-tests/component-base-tests.js: Added tests for ComponentBase's part(~), content(id), dispatchEvent.
545 * browser-tests/index.html:
546 * public/v3/components/base.js:
547 (ComponentBase): Added this._actionCallbacks, which is a map of an action name to a callback to be invoked.
548 (ComponentBase.prototype.content): Return an element of the given id if one is specified.
549 (ComponentBase.prototype.part): Find a component whose element has the matching id.
550 (ComponentBase.prototype.dispatchAction): Added.
551 (ComponentBase.prototype.listenToAction): Added.
552 (ComponentBase.prototype._ensureShadowTree): Call didConstructShadowTree.
553 (ComponentBase.prototype.didConstructShadowTree): Added.
554 (ComponentBase.prototype._recursivelyReplaceUnknownElementsByComponents): Copy attributes when instantiating
555 an element for a component when the browser doesn't support custom elements API.
556 (ComponentBase.createLink):
557 (ComponentBase.prototype.createEventHandler): Added.
558 (ComponentBase.createEventHandler): Renamed from createActionHandler.
559 * public/v3/components/button-base.js:
560 (ButtonBase.prototype.didConstructShadowTree): Added. Dispatch "activate" action when the button is clicked.
561 (ButtonBase.prototype.setCallback): Deleted.
562 (ButtonBase.htmlTemplate): Use id instead of class so that this.content() can find it.
563 (ButtonBase.cssTemplate): Updated style rules.
564 * public/v3/pages/chart-pane.js:
566 (ChartPane.prototype.didConstructShadowTree): Added. Listen to "activate" action on the close button.
567 (ChartPane.prototype.render): Fixed a bug that we were never calling enqueueToRender on the close button.
568 (ChartPane.htmlTemplate): Add the id on the close button.
570 2017-01-18 Dewei Zhu <dewei_zhu@apple.com>
572 'buildbot-syncer.js' should be able to determine force build argument from a list of possible repositories.
573 https://bugs.webkit.org/show_bug.cgi?id=167152
575 Reviewed by Ryosuke Niwa.
577 Add 'rootOptions' key which maps to a list of possible repositories.
578 For a build request, only one of the repositories in the list is valid.
580 * tools/js/buildbot-syncer.js:
581 (BuildbotSyncer.prototype._propertiesForBuildRequest):
582 (BuildbotSyncer._validateAndMergeProperties):
584 * unit-tests/buildbot-syncer-tests.js:
586 (sampleiOSConfigWithExpansions):
587 (createSampleBuildRequest):
588 (Promise.resolve.then):
589 * unit-tests/resources/mock-v3-models.js:
592 2017-01-17 Ryosuke Niwa <rniwa@webkit.org>
594 Make calls to render() functions async
595 https://bugs.webkit.org/show_bug.cgi?id=167151
597 Reviewed by Andreas Kling.
599 Make calls to render() async by coalescing calls inside enqueueToRender(), which has been renamed from
600 updateRendering(). We now queue up all the components and wait until the next animation frame to invoke
601 render() on all those components.
603 This reduces render() calls in the summary page of our internal dashboard by 15x from ~9400 to ~600 by
604 eliminating pathological O(n^2) behavior between render() calls.
606 Consolidated TimeSeriesChart's enqueueRender into this newly added feature of ComponentBase along with
607 the support to call render() on a resize event. New implementation makes use of connectedCallback and
608 disconnectedCallback to avoid the work when the component is not in a document tree.
610 The rest of the patch concerns with renaming updateRendering to enqueueToRender and fixing a few minor bugs
611 that I encountered while working on this patch.
613 * browser-tests/component-base-tests.js: Added tests for ComponentBase.enqueueToRender().
614 * browser-tests/index.html:
615 (BrowserContext.prototype.importScripts): Renamed from importScript; Now supports loading multiple scripts.
616 (BrowserContext.prototype.importScript): Added.
617 (BrowserContext): Removed the unused createWithScripts.
619 * public/v3/components/analysis-results-viewer.js:
620 (AnalysisResultsViewer.prototype._expandBetween):
621 * public/v3/components/bar-graph-group.js:
622 (BarGraphGroup.prototype.updateGroupRendering):
624 * public/v3/components/base.js:
625 (ComponentBase): When the browser doesn't support custom elements and
626 (ComponentBase.prototype.enqueueToRender): Renamed from updateRendering. Queues up the component to call
627 render() instead of immediately invoking it.
628 (ComponentBase.renderingTimerDidFire): Call render(). Since render() function often calls enqueueToRender
629 on child components, go ahead and invoke render() on any components enqueued during render() calls.
630 (ComponentBase._connectedComponentToRenderOnResize): Added.
631 (ComponentBase._disconnectedComponentToRenderOnResize): Added.
632 (ComponentBase.defineElement.elementClass.prototype.connectedCallback): Added. This is an optimization to
633 avoid the work when the component is not in the document; e.g. because the entire page component has been
634 detached from the document. The old implementation in TimeSeriesChart was not doing this.
635 (ComponentBase.defineElement.elementClass.prototype.disconnectedCallback): Added.
636 (ComponentBase): Replaced unused static variables with _componentsToRender and _componentsToRenderOnResize.
638 * public/v3/components/chart-pane-base.js:
639 (ChartPaneBase.prototype.fetchAnalysisTasks):
640 (ChartPaneBase.prototype.didUpdateAnnotations): Added. Addresses the bug that the annotation bars in the
641 charts shown an an analysis task doesn't update its color when the state is updated in the UI.
642 (ChartPaneBase.prototype._mainSelectionDidZoom):
643 (ChartPaneBase.prototype._updateStatus):
644 (ChartPaneBase.prototype._requestOpeningCommitViewer):
645 (ChartPaneBase.prototype._keyup):
646 (ChartPaneBase.prototype.render):
647 * public/v3/components/commit-log-viewer.js:
648 * public/v3/components/customizable-test-group-form.js:
649 (CustomizableTestGroupForm):
650 (CustomizableTestGroupForm.prototype._customize):
651 * public/v3/components/editable-text.js:
652 (EditableText.prototype._didUpdate):
653 * public/v3/components/interactive-time-series-chart.js:
654 * public/v3/components/pane-selector.js:
655 (PaneSelector.prototype._selectedItem):
656 * public/v3/components/time-series-chart.js:
657 (TimeSeriesChart): Removed the logic to update upon resize. See _connectedComponentToRenderOnResize above.
658 (TimeSeriesChart.prototype.get enqueueToRenderOnResize): Added. Returns true.
659 (TimeSeriesChart.prototype.enqueueToRender): Deleted.
660 (TimeSeriesChart._renderEnqueuedCharts): Deleted.
661 (TimeSeriesChart): Call ComponentBase.defineElement to make this a proper component so that the logic in
662 connectedCallback to update upon resize event would work.
663 * public/v3/instrumentation.js:
664 (Instrumentation.dumpStatistics): Sort results by the key names.
665 * public/v3/models/time-series.js:
666 (TimeSeries.prototype.values): Added. This method was never ported to v3 in r198462, and broke the feature
667 to show moving averages, etc... on the charts page.
668 * public/v3/pages/analysis-category-page.js:
669 (AnalysisCategoryPage.prototype.open):
670 (AnalysisCategoryPage.prototype.updateFromSerializedState):
671 (AnalysisCategoryPage.prototype.filterDidChange):
672 (AnalysisCategoryPage.prototype.render):
673 * public/v3/pages/analysis-task-page.js:
674 (AnalysisTaskChartPane.prototype._updateStatus):
675 (AnalysisTaskPage.prototype.updateFromSerializedState):
676 (AnalysisTaskPage.prototype._didFetchTask):
677 (AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks):
678 (AnalysisTaskPage.prototype._didFetchMeasurement):
679 (AnalysisTaskPage.prototype._didFetchTestGroups):
680 (AnalysisTaskPage.prototype._showAllTestGroups):
681 (AnalysisTaskPage.prototype._didFetchAnalysisResults):
682 (AnalysisTaskPage.prototype.render):
683 (AnalysisTaskPage.prototype._renderTestGroupList.):
684 (AnalysisTaskPage.prototype._renderTestGroupList):
685 (AnalysisTaskPage.prototype._createTestGroupListItem):
686 (AnalysisTaskPage.prototype._showTestGroup):
687 (AnalysisTaskPage.prototype._didStartEditingTaskName):
688 (AnalysisTaskPage.prototype._updateTaskName):
689 (AnalysisTaskPage.prototype._updateTestGroupName):
690 (AnalysisTaskPage.prototype._hideCurrentTestGroup):
691 (AnalysisTaskPage.prototype._updateChangeType): Fixed the bug that we were never updating annotation bars
692 in the main chart by calling didUpdateAnnotations.
693 (AnalysisTaskPage.prototype._associateBug):
694 (AnalysisTaskPage.prototype._dissociateBug):
695 (AnalysisTaskPage.prototype._associateCommit):
696 (AnalysisTaskPage.prototype._dissociateCommit):
697 (AnalysisTaskPage.prototype._chartSelectionDidChange):
698 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer):
699 * public/v3/pages/build-request-queue-page.js:
700 (BuildRequestQueuePage.prototype.open.):
701 (BuildRequestQueuePage.prototype.open):
702 * public/v3/pages/chart-pane.js:
703 (ChartPane.prototype.setOpenRepository):
704 (ChartPane.prototype._renderTrendLinePopover): Fixed a race condition. Insert a select element as needed
705 before trying to assign the current value on it.
706 (ChartPane.prototype._trendLineTypeDidChange):
707 (ChartPane.prototype._updateTrendLine):
708 * public/v3/pages/charts-page.js:
709 (ChartsPage.prototype.updateFromSerializedState):
710 (ChartsPage.prototype._updateDomainsFromSerializedState):
711 (ChartsPage.prototype.setNumberOfDaysFromToolbar):
712 (ChartsPage.prototype._didMutatePaneList):
713 (ChartsPage.prototype.render):
714 * public/v3/pages/charts-toolbar.js:
715 (ChartsToolbar.prototype.render):
716 * public/v3/pages/create-analysis-task-page.js:
717 (CreateAnalysisTaskPage.prototype.updateFromSerializedState):
718 * public/v3/pages/dashboard-page.js:
719 (DashboardPage.prototype.updateFromSerializedState):
720 (DashboardPage.prototype._fetchedData):
721 * public/v3/pages/heading.js:
722 (Heading.prototype.render):
723 * public/v3/pages/page-with-heading.js:
724 (PageWithHeading.prototype.render):
725 * public/v3/pages/page.js:
726 (Page.prototype.open):
727 * public/v3/pages/summary-page.js:
728 (SummaryPage.prototype.open):
729 (SummaryPage.prototype.this._renderQueue.push):
731 (SummaryPage.prototype._renderCell):
733 2017-01-15 Ryosuke Niwa <rniwa@webkit.org>
735 Add the build fix for browsers that don't yet support custom elements SPI.
736 It was supposedly to be a part of the previous commit.
738 * public/v3/components/base.js:
739 (ComponentBase.defineElement):
741 2017-01-12 Ryosuke Niwa <rniwa@webkit.org>
743 Adopt custom elements API in perf dashboard
744 https://bugs.webkit.org/show_bug.cgi?id=167045
746 Reviewed by Darin Adler.
748 Adopt custom elements API in ComponentBase, and create the shadow tree lazily in content() and render()
749 instead of eagerly creating it inside the constructor.
751 For now, create a separate element class for each component in ComponentBase.defineElement instead of
752 making ComponentBase inherit from HTMLElement to preserve the semantics we have as well as to test
753 the boundaries of what custom elements API allows for framework authors.
755 In order to ensure one-to-one correspondence between elements and their components, we use a static map,
756 ComponentBase._currentlyConstructedByInterface, to remember which element or component is being created
757 and use that in custom element's constructor to update element.component() and this._element.
759 Also dropped the support for not having attachShadow as we've shipped this feature in Safari 10.
761 Finally, added tests to be ran inside a browser to test the front end code in browser-tests.
763 * browser-tests/component-base-tests.js: Added. Basic tests for ComponentBase.
764 * browser-tests/index.html: Added.
766 * public/v3/components/base.js:
767 (ComponentBase): Don't create the shadow tree. Use the currently constructed element as this._element if
768 there is one (the custom element's constructor is getting called). Otherwise create a new element but
769 store this component in the map to avoid creating a new component in the custom element's constructor.
770 (ComponentBase.prototype.content): Lazily create the shadow tree now.
771 (ComponentBase.prototype.render): Ditto.
772 (ComponentBase.prototype._ensureShadowTree): Renamed from _constructShadowTree. Dropped the support for
773 not having shadow DOM API. This is now required. Also use importNode instead of cloneNode in cloning
774 the template content since the latter would not get upgraded.
775 (ComponentBase.prototype._recursivelyReplaceUnknownElementsByComponents): Modernized the code. Don't
776 re-create a component if its element had already been upgraded by its custom element constructor.
777 (ComponentBase.defineElement): Add this component to the static maps. _componentByName is used by
778 _recursivelyReplaceUnknownElementsByComponents to instantiate new components in the browsers that don't
779 support custom elements API and _componentByClass is used by ComponentBase's constructor to lookup the
780 element name. The latter should go away once all components fully adopt ComponentBase.defineElement.
781 (ComponentBase.defineElement.elementClass): A class to define a custom element for the component.
782 We need to reconfigure the property since class's name is not writable but configurable.
784 * public/v3/components/button-base.js:
785 (ButtonBase.htmlTemplate): Added. Extracted the common code from CloseButton and WarningIcon.
786 (ButtonBase.buttonContent): Added. An abstract method overridden by CloseButton and WarningIcon.
787 (ButtonBase.sizeFactor): Added. Overridden by WarningIcon.
788 (ButtonBase.cssTemplate): Updated to use :host.
789 * public/v3/components/close-button.js:
790 (CloseButton.buttonContent): Renamed from htmlTemplate.
791 * public/v3/components/spinner-icon.js:
792 (SpinnerIcon.cssTemplate): Removed webkit prefixed properties, and updated it to animate stroke instead
793 of opacity to reduce the power usage.
794 (SpinnerIcon.htmlTemplate): Factored stroke, stroke-width, and stroke-linecap into cssTemplate.
795 * public/v3/components/warning-icon.js:
796 (WarningIcon.cssTemplate): Deleted.
797 (WarningIcon.sizeFactor): Added.
798 (WarningIcon.buttonContent): Renamed from htmlTemplate.
799 * public/v3/pages/summary-page.js:
800 (SummaryPage._constructRatioGraph): Fixed a bug that we were not never calling spinner.updateRendering().
801 (SummaryPage.prototype._renderCell):
803 2017-01-13 Ryosuke Niwa <rniwa@webkit.org>
805 Instrument calls to render()
806 https://bugs.webkit.org/show_bug.cgi?id=167037
808 Reviewed by Sam Weinig.
810 Wrap every call to render() by newly added ComponentBase.updateRendering() to instrument it.
811 Also, use arrow functions instead of this.render.bind or regular closures for simplicity.
813 Currently, we're making 5100 calls to render() while opening the summary page, and that's way too high.
815 * public/v3/components/analysis-results-viewer.js:
816 (AnalysisResultsViewer.prototype._expandBetween):
817 * public/v3/components/bar-graph-group.js:
818 (BarGraphGroup.prototype.updateGroupRendering): Renamed form render() as BarGraphGroup is not a component.
819 * public/v3/components/base.js:
820 (ComponentBase.prototype.updateRendering): Added. Instruments render() call.
821 * public/v3/components/chart-pane-base.js:
822 (ChartPaneBase.prototype.fetchAnalysisTasks):
823 (ChartPaneBase.prototype._mainSelectionDidZoom):
824 (ChartPaneBase.prototype._updateStatus):
825 (ChartPaneBase.prototype._requestOpeningCommitViewer):
826 (ChartPaneBase.prototype._keyup):
827 (ChartPaneBase.prototype.render):
828 * public/v3/components/commit-log-viewer.js:
829 * public/v3/components/customizable-test-group-form.js:
830 (CustomizableTestGroupForm):
831 (CustomizableTestGroupForm.prototype._customize):
832 * public/v3/components/editable-text.js:
833 (EditableText.prototype._didUpdate):
834 * public/v3/components/pane-selector.js:
835 (PaneSelector.prototype._selectedItem):
836 * public/v3/components/results-table.js:
837 (ResultsTable.prototype.render):
838 * public/v3/components/time-series-chart.js:
839 (TimeSeriesChart._renderEnqueuedCharts):
840 * public/v3/pages/analysis-category-page.js:
841 (AnalysisCategoryPage.prototype.open):
842 (AnalysisCategoryPage.prototype.updateFromSerializedState):
843 (AnalysisCategoryPage.prototype.filterDidChange):
844 (AnalysisCategoryPage.prototype.render):
845 * public/v3/pages/analysis-task-page.js:
846 (AnalysisTaskChartPane.prototype._updateStatus):
847 (AnalysisTaskPage.prototype.updateFromSerializedState):
848 (AnalysisTaskPage.prototype._didFetchTask):
849 (AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks):
850 (AnalysisTaskPage.prototype._didFetchMeasurement):
851 (AnalysisTaskPage.prototype._didFetchTestGroups):
852 (AnalysisTaskPage.prototype._showAllTestGroups):
853 (AnalysisTaskPage.prototype._didFetchAnalysisResults):
854 (AnalysisTaskPage.prototype.render):
855 (AnalysisTaskPage.prototype._renderTestGroupList.):
856 (AnalysisTaskPage.prototype._renderTestGroupList):
857 (AnalysisTaskPage.prototype._createTestGroupListItem):
858 (AnalysisTaskPage.prototype._showTestGroup):
859 (AnalysisTaskPage.prototype._didStartEditingTaskName):
860 (AnalysisTaskPage.prototype._updateTaskName):
861 (AnalysisTaskPage.prototype._updateTestGroupName):
862 (AnalysisTaskPage.prototype._hideCurrentTestGroup):
863 (AnalysisTaskPage.prototype._updateChangeType):
864 (AnalysisTaskPage.prototype._associateBug):
865 (AnalysisTaskPage.prototype._dissociateBug):
866 (AnalysisTaskPage.prototype._associateCommit):
867 (AnalysisTaskPage.prototype._dissociateCommit):
868 (AnalysisTaskPage.prototype._chartSelectionDidChange):
869 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer):
870 * public/v3/pages/build-request-queue-page.js:
871 (BuildRequestQueuePage.prototype.open.):
872 (BuildRequestQueuePage.prototype.open):
873 * public/v3/pages/chart-pane.js:
874 (ChartPane.prototype.setOpenRepository):
875 (ChartPane.prototype._trendLineTypeDidChange):
876 (ChartPane.prototype._updateTrendLine):
877 * public/v3/pages/charts-page.js:
878 (ChartsPage.prototype.updateFromSerializedState):
879 (ChartsPage.prototype._updateDomainsFromSerializedState):
880 (ChartsPage.prototype.setNumberOfDaysFromToolbar):
881 (ChartsPage.prototype._didMutatePaneList):
882 (ChartsPage.prototype.render):
883 * public/v3/pages/charts-toolbar.js:
884 (ChartsToolbar.prototype.render):
885 * public/v3/pages/create-analysis-task-page.js:
886 (CreateAnalysisTaskPage.prototype.updateFromSerializedState):
887 * public/v3/pages/dashboard-page.js:
888 (DashboardPage.prototype.updateFromSerializedState):
889 (DashboardPage.prototype._fetchedData):
890 * public/v3/pages/heading.js:
891 (Heading.prototype.render):
892 * public/v3/pages/page-with-heading.js:
893 (PageWithHeading.prototype.render):
894 * public/v3/pages/page.js:
895 (Page.prototype.open):
896 * public/v3/pages/summary-page.js:
897 (SummaryPage.prototype.open):
898 (SummaryPage.prototype.this._renderQueue.push):
900 (SummaryPage.prototype._renderCell):
902 2017-01-12 Ryosuke Niwa <rniwa@webkit.org>
904 Outliers are not hidden in v3 UI
905 https://bugs.webkit.org/show_bug.cgi?id=166966
907 Reviewed by Andreas Kling.
909 Fixed the typo in addToSeries. An outlier has markedOutlier set to true, not isOutlier.
911 Also fixed a bug unveiled by new tests in MeasurementRootSet.ensureSingleton. It was was creating
912 a new MeasurementRootSet each time it was called instead of finding an existing instance. Fixed the bug
913 by merging the static maps of MeasurementRootSet and RootSet.
915 * public/v3/models/measurement-cluster.js:
916 (MeasurementCluster.prototype.addToSeries): Fixed the bug.
917 * public/v3/models/root-set.js:
918 (MeasurementRootSet.prototype.namedStaticMap): Added.
919 (MeasurementRootSet.prototype.ensureNamedStaticMap): Added.
920 (MeasurementRootSet.namedStaticMap): Added.
921 (MeasurementRootSet.ensureNamedStaticMap): Added.
922 * unit-tests/measurement-set-tests.js: Added tests for adopting time series data from a cluster.
924 2017-01-12 Ryosuke Niwa <rniwa@webkit.org>
926 Hide the UI to trigger an A/B testing when there are no triggerables
927 https://bugs.webkit.org/show_bug.cgi?id=166964
929 Reviewed by Yusuke Suzuki.
931 Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later
932 when the user tries to create one it with a TriggerableNotFound error.
934 Added the list of triggerables to the manifest JSON so that we can determine this condition without
935 having to fetch /api/triggerable for each analysis task as done in v2 UI.
937 * public/admin/reprocess-report.php:
938 * public/api/manifest.php:
939 * public/api/report.php:
940 * public/include/admin-header.php:
941 * public/include/manifest-generator.php: Moved from public/include/manifest.php.
942 (ManifestGenerator::generate):
943 (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts
944 as well as the list of (test, platform) pairs on which this triggerable is available.
945 Use [testId, platformId] instead of a dictionary to reduce the file size.
946 * public/v3/components/customizable-test-group-form.js:
947 (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to
948 disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute
949 the visibility of the button in render() function instead.
950 (CustomizableTestGroupForm.prototype.setRootSetMap):
951 (CustomizableTestGroupForm.prototype._submitted):
952 (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed.
953 The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed.
954 "Customize" button must be hidden when no range is selected.
955 * public/v3/components/test-group-form.js:
956 (TestGroupForm): Removed _disabled since it's no longer used.
957 (TestGroupForm.prototype.setDisabled): Ditto.
958 (TestGroupForm.prototype.render): Ditto.
959 * public/v3/index.html: Include triggerable.js.
960 * public/v3/models/manifest.js:
961 (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON.
962 * public/v3/models/triggerable.js: Added.
963 (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair.
964 (Triggerable.prototype.acceptedRepositories): Added.
965 (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map.
966 * public/v3/pages/analysis-task-page.js:
967 (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data
968 points that were previously not available may have become available. The lack of this update was
969 causing a race condition in which the "Start A/B Testing" button for the charts is disabled even
970 after a group name had been specified because setRootSetMap was never called with a valid set.
971 (AnalysisTaskPage): Added this._triggerable.
972 (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task.
973 (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely
974 when there are no groups to show. Also hide the forms to start A/B testing when there are no matching
975 triggerable, which is the main feature of this patch.
976 * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON.
977 * server-tests/resources/mock-data.js:
978 (MockData.resetV3Models): Reset Triggerable's static map.
979 * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed
980 with appropriate list of repositories and (test, platform) associations.
981 * tools/js/database.js:
982 (tableToPrefixMap): Added triggerable_repositories's prefix.
983 * tools/js/remote.js:
984 (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging.
985 * tools/js/v3-models.js: Import triggerable.js.
987 2017-01-11 Ryosuke Niwa <rniwa@webkit.org>
989 fetch-from-remote doesn’t work with some websites
990 https://bugs.webkit.org/show_bug.cgi?id=166963
992 Reviewed by Yusuke Suzuki.
994 Apparently file_get_contents is not compatible with some SSL/TLS connections.
995 Use curl_* functions to access remote servers instead.
997 * public/admin/fetch-from-remote.php:
1000 2017-01-10 Ryosuke Niwa <rniwa@webkit.org>
1002 Another build fix. Always use UTC when expressing commit times in UNIX-epoch timestamps.
1004 * public/api/measurement-set.php:
1006 2017-01-10 Ryosuke Niwa <rniwa@webkit.org>
1008 Fix a typo in the previous commit.
1010 * public/api/measurement-set.php:
1012 2017-01-10 Ryosuke Niwa <rniwa@webkit.org>
1014 Build fixes for older versions of Postgres.
1016 Also redirect / and /# to /v3/ as intended in r200820.
1018 * public/api/measurement-set.php:
1019 * public/api/runs.php:
1020 * public/index.html:
1022 2016-10-18 Dewei Zhu <dewei_zhu@apple.com>
1024 Update test cases for change r206465.
1025 https://bugs.webkit.org/show_bug.cgi?id=163618
1027 Reviewed by Ryosuke Niwa.
1029 Update test case for change r206465 which added support for multiple summary pages.
1030 Use deepStrictEqual instead of deepEqual as deepEqual will not complain in the case like 'deepEqual([],{})'.
1031 Fix a test failure in tools-buildbot-triggerable-tests.js.
1032 Fix a bug in generating manifest.
1035 * public/include/manifest.php:
1036 * server-tests/api-manifest.js:
1037 (TestServer.remoteAPI.getJSON.string_appeared_here.then):
1038 * server-tests/tools-buildbot-triggerable-tests.js:
1041 2016-09-27 Dewei Zhu <dewei_zhu@apple.com>
1043 Extend perf dashboard to support multiple summary pages.
1044 https://bugs.webkit.org/show_bug.cgi?id=162594
1046 Reviewed by Ryosuke Niwa.
1048 Start support multiple summary pages instead of one.
1049 Specify 'summaryPages' as key that map to a list of summaries which follows
1050 current 'summary' format in 'config.json' but with 2 more properties:
1051 'name': specifying the name shows on perf dashboard,
1052 'route': specifying the path to this page.
1054 * public/include/manifest.php:
1055 * public/v3/main.js:
1058 * public/v3/models/manifest.js:
1059 (Manifest._didFetchManifest):
1061 * public/v3/pages/summary-page.js:
1063 (SummaryPage.prototype.routeName):
1065 2016-08-09 Ryosuke Niwa <rniwa@webkit.org>
1067 Don't filter out the latest data point in chart data sampling
1068 https://bugs.webkit.org/show_bug.cgi?id=160714
1070 Reviewed by Chris Dumez.
1072 Exclude the last data point from sampling so that it's always included in the "sampled" charts data.
1073 Without this, the last data point can change as we zoom out the time domain.
1075 Luckily, we already had a mechanism to exclude the user selected point from sampling. Extend this
1076 feature by supporting an array of point IDs instead of a single ID to exclude from filering.
1078 * public/v3/components/interactive-time-series-chart.js:
1079 (InteractiveTimeSeriesChart.prototype._sampleTimeSeries): Replaced exclusionPointID by excludedPoints.
1081 * public/v3/components/time-series-chart.js:
1082 (TimeSeriesChart.prototype._ensureSampledTimeSeries): Put the last data point in excludedPoints.
1083 (TimeSeriesChart.prototype._sampleTimeSeries): Check point's id against the list of IDs.
1085 2016-08-09 Ryosuke Niwa <rniwa@webkit.org>
1087 Build fix after r204187. interval has to be a getter, not a method.
1089 * public/v3/components/time-series-chart.js:
1090 (TimeSeriesChart.prototype._renderTimeSeries):
1091 * public/v3/models/measurement-adaptor.js:
1092 (MeasurementAdaptor.prototype.applyTo):
1094 2016-08-09 Ryosuke Niwa <rniwa@webkit.org>
1096 Fix a typo that was supposed to be fixed in r204296 before landing.
1098 * public/v3/pages/chart-pane.js:
1100 (ChartPane.prototype.updateFromSerializedState):
1101 (ChartPane.prototype._analyzeRange):
1102 (ChartPane.prototype._renderTrendLinePopover):
1103 (ChartPane.prototype._trendLineTypeDidChange):
1105 2016-08-08 Ryosuke Niwa <rniwa@webkit.org>
1107 Always show segmentation on v3 charts page
1108 https://bugs.webkit.org/show_bug.cgi?id=160576
1110 Rubber-stamped by Chris Dumez.
1112 Added "Trend Lines" popover to select and customize a moving average or a segmentation to show on charts page
1113 and made Schwarz criterion segmentation the default trend line for all charts.
1115 Because computing the segmentation is expensive, we use WebWorker to parallelize the computation via AsyncTask.
1116 We also compute and cache the segmentation for each cluster separately to avoid processing the entire measurement
1117 set as that could take 10-20s total, which was a huge problem in v2 UI. v3 UI's approach is more incremental and
1118 even opens up an opportunity to cache the results in the server side.
1120 Also brought back "shading" for the confidence interval drawing as done in v1 and v2 UI.
1122 * public/shared/statistics.js:
1123 (Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Added segmentCountWeight and gridSize as arguments
1124 to customize the algorithm.
1125 (Statistics.splitIntoSegmentsUntilGoodEnough): Takes segmentCountWeight as BirgeAndMassartC.
1127 * public/v3/async-task.js: Added.
1128 (AsyncTask): Added. This class represents a task such as computing segmentation to be executed in a worker.
1129 (AsyncTask.prototype.execute): Added. Returns a promise that gets resolved when the specified task completes.
1130 (AsyncTaskWorker.waitForAvailableWorker): Added. Calls the given callback with the first available worker. When
1131 all workers are processing some tasks, it waits until one becomes available by putting the callback into a queue.
1132 _didRecieveMessage pops an item out of this queue when a worker completes a task. We don't use a promise here
1133 because calling this function multiple times synchronously could result in all the returned promises getting
1134 resolved with the same worker as none of the callers get to lock away the first available worker until the end
1135 of the current micro-task.
1136 (AsyncTaskWorker._makeWorkerEventuallyAvailable): Added. A helper function for waitForAvailableWorker. Start
1137 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
1138 8 cores on the machine). Avoid starting a new worker if we've started a new worker within the last 50 ms since
1139 starting a new worker takes some time.
1140 (AsyncTaskWorker._findAvailableWorker): Added. Finds a worker that's available right now if there is any.
1141 (AsyncTaskWorker): Added. An instance of AsyncTaskWorker represents a Web worker.
1142 (AsyncTaskWorker.prototype.id): Added.
1143 (AsyncTaskWorker.prototype.sendTask): Added. Sends a task represented by AsyncTask to the worker.
1144 (AsyncTaskWorker.prototype._didRecieveMessage): Added. This function gets called when the current task completes
1145 in the worker. Pop the next callback if some caller of waitForAvailableWorker is still waiting. Otherwise stop
1146 the worker after one second of waiting to avoid worker churning.
1147 (AsyncTaskWorker.workerDidRecieveMessage): Added. Called by onmessage on the worker. Executes the specified task
1148 and sends back a message upon completion with the appropriate timing data.
1150 * public/v3/components/chart-pane-base.js:
1151 (ChartPaneBase.prototype.configure): Uses _createSourceList.
1152 (ChartPaneBase.prototype._createSourceList): Added. Extracted from configure to customize the source list for
1153 the main chart and the overview chart.
1154 (ChartPaneBase.prototype._updateSourceList): Uses _createSourceList.
1156 * public/v3/components/chart-styles.js:
1157 (ChartStyles.createSourceList): Added a boolean showPoint as an extra argument. This specifies whether circles
1158 are drawn for each data point.
1159 (ChartStyles.baselineStyle): Added styles for foreground lines and background lines. They're used for trend lines
1160 and underlying raw data respectively when trend lines are shown.
1161 (ChartStyles.targetStyle): Ditto.
1162 (ChartStyles.currentStyle): Ditto.
1164 * public/v3/components/time-series-chart.js:
1165 (TimeSeriesChart): Added _trendLines, _renderedTrendLines, and _fetchedTimeSeries as instance variables.
1166 (TimeSeriesChart.prototype.setSourceList): Clear _fetchedTimeSeries before calling setSourceList for consistency.
1167 (TimeSeriesChart.prototype.sourceList): Added.
1168 (TimeSeriesChart.prototype.clearTrendLines): Added.
1169 (TimeSeriesChart.prototype.setTrendLine): Added. Preserves the existing trend lines for other sources. This is
1170 necessary because segmentation for "current" and "baseline" lines may become available at different times, and we
1171 don't want to clear one or the other when setting one.
1172 (TimeSeriesChart.prototype._layout): Added a call to _ensureTrendLines.
1173 (TimeSeriesChart.prototype._renderChartContent): Call _renderTimeSeries for trend lines. Trend lines are always
1174 foreground lines and "regular" raw data points are drawn as background if there are trend lines.
1175 (TimeSeriesChart.prototype._renderTimeSeries): Added layerName as an argument. It could be an empty string,
1176 "foreground", or "background". Draw a "shade" just like v1 and v2 UI instead of vertical lines for the confidence
1177 intervals. Pick "foreground", "background", or "regular" chart style based on layerName. Also avoid drawing data
1178 points when *PointRadius is set to zero to reduce the runtime of this function.
1179 (TimeSeriesChart.prototype._sourceOptionWithFallback): Added.
1180 (TimeSeriesChart.prototype._ensureSampledTimeSeries): When *PointRadius is 0, show as many points as there are x
1181 coordinates as a fallback instead of showing every point.
1182 (TimeSeriesChart.prototype._ensureTrendLines): Added. Returns true if the chart contents haven't been re-rendered
1183 since the last update to trend lines. This flag is unset by setTrendLine.
1185 * public/v3/index.html:
1187 * public/v3/models/measurement-cluster.js:
1188 (MeasurementCluster.prototype.addToSeries): Store the data points' index to idMap to help aid MeasurementSet's
1189 _cachedClusterSegmentation efficiently re-create the segmentation from the cache.
1191 * public/v3/models/measurement-set.js:
1192 (MeasurementSet): Added _segmentationCache as an instance variable.
1193 (MeasurementSet.prototype.fetchSegmentation): Added. Calls _cachedClusterSegmentation on each cluster, and
1194 constructs the time series representation of the segmentation from the results.
1195 (MeasurementSet.prototype._cachedClusterSegmentation): Computes and caches the segmentation for each cluster.
1196 The cache of segmentation stores ID of each measurement set at which segment changes instead of its index since
1197 the latter could change in any moment when a new test result is reported, or an existing test result is removed
1198 from the time series; e.g. when it's marked as an outlier.
1199 (MeasurementSet.prototype._validateSegmentationCache): Added. Checks whether the cached segmentation's name and
1200 its parameters match that of the requested one.
1201 (MeasurementSet.prototype._invokeSegmentationAlgorithm): Added. Invokes the segmentation algorithm either in the
1202 main thread or in a Web worker via AsyncTask API based on the size of the time series. While parallelizing the
1203 work is beneficial when the data set is large, the overhead can add up if we keep processing a very small data
1206 * public/v3/models/time-series.js: Made the file compatible with Node.
1207 (TimeSeries.prototype.length): Added.
1208 (TimeSeries.prototype.valuesBetweenRange): Added.
1210 * public/v3/pages/chart-pane.js:
1211 (createTrendLineExecutableFromAveragingFunction): Added.
1212 (ChartTrendLineTypes): Added. Similar to StatisticsStrategies (statistics-strategies.js) in v2 UI.
1213 (ChartPane): Added _trendLineType, _trendLineParameters, _trendLineVersion, and _renderedTrendLineOptions as
1215 (ChartPane.prototype.serializeState): Serialize the trend line option. This format is compatible with v2 UI.
1216 (ChartPane.prototype.updateFromSerializedState): Ditto. Parsing is compatible with v2 UI except that we now have
1217 the default trend line set when the specified ID doesn't match an existing type ID.
1218 (ChartPane.prototype._renderActionToolbar): Added a call to _renderTrendLinePopover. This is the popover that
1219 specifies the type of a trend line to show as well as its parameters.
1220 (ChartPane.prototype._renderTrendLinePopover): Added. A popover for specifying and customizing a trend line.
1221 (ChartPane.prototype._trendLineTypeDidChange): Added. Called when a new trend line is selected.
1222 (ChartPane.prototype._defaultParametersForTrendLine): Added.
1223 (ChartPane.prototype._trendLineParameterDidChange): Added. Called when the trend lines' parameters are changed.
1224 (ChartPane.prototype._didFetchData): Added. Overrides the one in ChartPaneBase to trigger a trend line update.
1225 (ChartPane.prototype._updateTrendLine): Added. Update the trend line. Since segmentation can take an arbitrary
1226 long time, avoid updating trend lines if this function had been called again (possibly for a different trend line
1227 type or with different parameters) before the results become available; hence the versioning.
1228 (ChartPane.paneHeaderTemplate): Added the trend line popover.
1229 (ChartPane.cssTemplate): Added styles for the trend line popover. Also use a more opaque background color behind
1230 popovers when the -webkit-backdrop-filter property is not supported.
1232 * public/v3/pages/dashboard-page.js:
1233 (DashboardPage.prototype._createChartForCell): Call createSourceList with showPoints set to true to preserve the
1236 * tools/js/v3-models.js: Include TimeSeries object.
1238 * unit-tests/measurement-set-tests.js: Added two test cases for MeasurementSet's fetchSegmentation.
1240 * unit-tests/resources/almost-equal.js: Added.
1241 (almostEqual): Extracted out of statistics-tests.js.
1243 * unit-tests/statistics-tests.js:
1245 2016-08-05 Ryosuke Niwa <rniwa@webkit.org>
1247 segmentTimeSeriesByMaximizingSchwarzCriterion returns a bogus result on empty charts
1248 https://bugs.webkit.org/show_bug.cgi?id=160575
1250 Rubber-stamped by Chris Dumez.
1252 The bug was caused by an early return in segmentTimeSeriesByMaximizingSchwarzCriterion.
1253 Removed this early return as the one in splitIntoSegmentsUntilGoodEnough was sufficient.
1255 Also factored out a few functions in findOptimalSegmentation so that they can be better
1256 optimized in JSC's DFG and FTL tiers, and removed unused debuggingTestingRangeNomination.
1258 * public/shared/statistics.js:
1259 (Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Removed an early return.
1260 (Statistics.splitIntoSegmentsUntilGoodEnough):
1261 (.allocateCostUpperTriangularForSegmentation): Extracted from findOptimalSegmentation.
1262 (.allocatePreviousNodeForSegmentation): Ditto.
1263 (.findOptimalSegmentationInternal): Ditto.
1264 (.findOptimalSegmentation):
1266 * unit-tests/statistics-tests.js: Added a test case.
1268 2016-08-05 Ryosuke Niwa <rniwa@webkit.org>
1270 Perf dashboard sometimes tries to fetch a non-existent measurement-set JSON
1271 https://bugs.webkit.org/show_bug.cgi?id=160577
1273 Rubber-stamped by Chris Dumez.
1275 The bug was caused by findClusters computing the first cluster's endTime incorrectly. Namely, we were
1276 multiplying the number of clusters by clusterStart instead of clusterSize with an off-by-one error.
1278 * public/v3/models/measurement-set.js:
1279 (MeasurementSet.prototype.findClusters): Folded computeClusterStart into where clusterEnd is computed
1280 for clarity. Also fixed a bug that we were not computing the first cluster to fetch correctly when
1281 the fetched time range started before clusterStart (i.e. when startTime - clusterStart is negative).
1282 Finally, fixed the main bug by multiplying the number of clusters by clusterSize instead of
1283 clusterStart to compute the end time of the very first cluster in this measurement set. Because what
1284 we're computing here is the end time of the first cluster, not the start time, we also need to subtract
1285 one from the number of clusters. e.g. if there was exactly one cluster, then firstClusterEndTime is
1286 identically equal to lastClusterEndTime.
1287 (MeasurementSet.prototype.fetchedTimeSeries): Removed the unused argument to TimeSeries's constructor.
1289 * unit-tests/analysis-task-tests.js: Fixed the tests for the latest version of Mocha which complains if
1290 we returned a promise in unit tests when "done" function is used.
1291 * unit-tests/checkconfig.js: Ditto.
1292 * unit-tests/measurement-set-tests.js: Added a test case for findClusters and a test to make sure
1293 fetchBetween doesn't try to fetch a cluster before the first cluster in the set. Also fixed other test
1294 cases which were relying on the bug this patch fixed.
1296 2016-08-04 Ryosuke Niwa <rniwa@webkit.org>
1298 MeasurementCluster's addToSeries is slow
1299 https://bugs.webkit.org/show_bug.cgi?id=160581
1301 Rubber-stamped by Chris Dumez.
1303 The bulk of time was spent in MeasurementAdaptor.prototype.applyTo where we computed the interval.
1305 Since some of data points are filtered out by TimeSeriesChart component before intervals are used,
1306 we can significantly reduce the CPU time by lazily compute them. This patch reduces the runtime of
1307 applyTo from ~60ms to ~30ms on my machine.
1309 * public/v3/models/measurement-adaptor.js:
1310 (MeasurementAdaptor.prototype.applyTo): Lazily compute and cache the interval. Also cache the build
1311 object instead of always creating a new object.
1312 * public/v3/models/measurement-cluster.js:
1313 (MeasurementCluster.prototype.addToSeries): Call applyTo first before checking whether the point is
1314 an outlier or its id to avoid extracting those values twice since they show up in the profiler. Also
1315 use "of" instead "forEach" since "of" seems to be faster here.
1317 2016-08-04 Ryosuke Niwa <rniwa@webkit.org>
1319 Syncing script's configuration duplicates a lot of boilerplate
1320 https://bugs.webkit.org/show_bug.cgi?id=160574
1322 Rubber-stamped by Chris Dumez.
1324 This patch makes each configuration accept an array of platforms and types so that we can write:
1326 {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"},
1327 {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"},
1328 {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"},
1329 {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"},
1330 {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"},
1331 {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"},
1332 {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"},
1333 {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"},
1337 {"builder": "mba", "types": ["speedometer", "jetstream"],
1338 "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]},
1339 {"builder": "mbp", "types": ["speedometer", "jetstream"],
1340 "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]},
1342 * tools/js/buildbot-syncer.js:
1343 (BuildbotSyncer._loadConfig):
1344 (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type
1346 (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig.
1347 (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that
1348 shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms',
1349 and merged the code for verify an array of strings. Finally, allow the appearance of 'properties'
1350 since this function can now be called on a cloned configuration in which 'arguments' had already
1351 been renamed to 'properties'.
1353 * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration.
1354 (sampleiOSConfigWithExpansions): Added.
1356 * unit-tests/resources/mock-v3-models.js:
1357 (MockModels.inject): Added a few more mock models for the newly added test.
1359 2016-07-26 Ryosuke Niwa <rniwa@webkit.org>
1361 REGRESSION: Tooltip for analysis tasks doesn't show up on charts
1362 https://bugs.webkit.org/show_bug.cgi?id=160221
1364 Rubber-stamped by Chris Dumez.
1366 The bug was caused by ChartPaneBase resetting annotation bars every time the current point has moved.
1367 Avoid doing this in ChartPaneBase's _renderAnnotations().
1369 * public/v3/components/chart-pane-base.js:
1371 (ChartPaneBase.prototype.fetchAnalysisTasks):
1372 (ChartPaneBase.prototype._renderAnnotations):
1374 2016-07-26 Ryosuke Niwa <rniwa@webkit.org>
1376 REGRESSION: The arrow indicating the current page doesn't get updated
1377 https://bugs.webkit.org/show_bug.cgi?id=160185
1379 Reviewed by Chris Dumez.
1381 The bug was caused by Heading's render() function not updating the DOM more than once. I don't understand
1382 how this has ever worked. Fixed the bug by rendering DOM whenever the current page has changed.
1384 * public/v3/pages/heading.js:
1386 (Heading.prototype.render):
1388 2016-07-25 Ryosuke Niwa <rniwa@webkit.org>
1390 Build fix for Safari 9.
1392 * public/v3/models/build-request.js:
1393 (BuildRequest.prototype.waitingTime): Don't use "const" in strict mode.
1395 2016-07-23 Ryosuke Niwa <rniwa@webkit.org>
1397 Perf dashboard should show the list of a pending A/B testing jobs
1398 https://bugs.webkit.org/show_bug.cgi?id=160138
1400 Rubber-stamped by Chris Dumez.
1402 Add a page to show the list of A/B testing build requests per triggerable. Ideally, we would like to
1403 see a queue per builder but that would require changes to database tables and syncing scripts.
1405 Because this page is most useful when the analysis task with which each build request is associated,
1406 JSON API at /api/build-requests/ has been modified to return the analysis task ID for each request.
1408 Also streamlined the page that shows the list of analysis tasks per Chris' feedback by consolidating
1409 "Bisecting" and "Identified" into "Investigated" and moving the toolbar from the upper left corner
1410 inside the heading to right beneath the heading above the table. Also made the category page serialize
1411 the filter an user had typed in so that reloading the page doesn't clear it.
1413 * public/api/analysis-tasks.php:
1414 (fetch_associated_data_for_tasks): Removed 'category' from the list of columns returned as the notion
1415 of 'category' is only relevant in UI, and it's better computed in the front-end.
1416 (format_task): Ditto.
1417 (determine_category): Deleted.
1419 * public/api/test-groups.php:
1422 * public/include/build-requests-fetcher.php:
1423 (BuildRequestsFetcher::fetch_for_task): Include the analysis task ID in the rows.
1424 (BuildRequestsFetcher::fetch_for_group): Ditto. Ditto.
1425 (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Ditto.
1426 (BuildRequestsFetcher::results_internal): Ditto.
1428 * public/v3/index.html:
1430 * public/v3/main.js:
1431 (main): Create a newly introduced BuildRequestQueuePage as a subpage of AnalysisCategoryPage.
1433 * public/v3/components/ratio-bar-graph.js:
1434 (RatioBarGraph.prototype.update): Fixed a bogus assertion here. ratio can be any number. The coercion
1435 into [-1, 1] is done inside RatioBarGraph's render() function.
1437 * public/v3/models/analysis-task.js:
1438 (AnalysisTask.prototype.category): Moved the code to compute the analysis task's category from
1439 determine_category in analysis-tasks.php. Also merged "bisecting" and "identified" into "investigated".
1440 (AnalysisTask.categories): Merged "bisecting" and "identified" into "investigated".
1442 * public/v3/models/build-request.js:
1443 (BuildRequest): Remember the triggerable and the analysis task associated with this request as well as
1444 the time at when this request was created.
1445 (BuildRequest.prototype.analysisTaskId): Added.
1446 (BuildRequest.prototype.statusLabel): Use a shorter label: "Waiting" for "pending" status.
1447 (BuildRequest.prototype.createdAt): Added.
1448 (BuildRequest.prototype.waitingTime): Added. Returns a human readable time duration since the creation
1449 of this build request such as "2 hours 21 minutes" against a reference time.
1450 (BuildRequest.fetchTriggerables): Added.
1451 (BuildRequest.cachedRequestsForTriggerableID): Added. Used when navigating back to
1453 * public/v3/pages/analysis-category-page.js:
1454 (AnalysisCategoryPage): Construct AnalysisCategoryToolbar and store it in this._categoryToolbar since it
1455 no longer inherits from Toolbar class, which PageWithHeading recognizes and stores.
1456 (AnalysisCategoryPage.prototype.title):
1457 (AnalysisCategoryPage.prototype.serializeState): Added.
1458 (AnalysisCategoryPage.prototype.stateForCategory): Added. Include the filter in the serialization.
1459 (AnalysisCategoryPage.prototype.updateFromSerializedState): Restore the filter from the URL state.
1460 (AnalysisCategoryPage.prototype.filterDidChange): Added. Called by AnalysisCategoryToolbar to update
1461 the URL state in addition to calling render() as done previously via setFilterCallback.
1462 (AnalysisCategoryPage.prototype.render): Always call _categoryToolbar.render() since the hyperlinks for
1463 the category pages now include the filter, which can be updated in each call.
1464 (AnalysisCategoryPage.cssTemplate):
1466 * public/v3/pages/analysis-category-toolbar.js:
1467 (AnalysisCategoryToolbar): Inherits from ComponentBase instead of Toolbar since AnalysisCategoryToolbar
1468 no longer works with Heading class unlike other subclasses of Toolbar class.
1469 (AnalysisCategoryToolbar.prototype.setCategoryPage): Added.
1470 (AnalysisCategoryToolbar.prototype.setFilterCallback): Deleted.
1471 (AnalysisCategoryToolbar.prototype.setFilter): Added. Used to restore from a serialized URL state.
1472 (AnalysisCategoryToolbar.prototype.render): Don't recreate the input element as it clears the value as
1473 well as the selection of the element. Also use AnalysisCategoryPage's stateForCategory to serialize the
1474 category name and the current filter for each hyperlink.
1475 (AnalysisCategoryToolbar.prototype._filterMayHaveChanged): Now takes an boolean argument specifying
1476 whether the URL state should be updated or not. We update the URL only when a change event is fired to
1477 avoid constantly updating it while an user is still typing.
1478 (AnalysisCategoryToolbar.cssTemplate): Added.
1479 (AnalysisCategoryToolbar.htmlTemplate): Added a button to open the newly added queue page.
1481 * public/v3/pages/build-request-queue-page.js:
1482 (BuildRequestQueuePage): Added.
1483 (BuildRequestQueuePage.prototype.routeName): Added.
1484 (BuildRequestQueuePage.prototype.pageTitle): Added.
1485 (BuildRequestQueuePage.prototype.open): Added. Fetch open build requests for every triggerables using
1486 the same API as the syncing scripts.
1487 (BuildRequestQueuePage.prototype.render): Added.
1488 (BuildRequestQueuePage.prototype._constructBuildRequestTable): Added. Construct a table for the list of
1489 pending, scheduled or running build requests in the order syncing scripts would see. Note that the list
1490 of build requests returned by /api/build-requests/* can contain completed, canceled, or failed requests
1491 since the JSON returns all build requests associated with each test group if one of the requests of the
1492 group have not finished. This helps syncing scripts picking the right builder for A/B testing when it
1493 had previously been unloaded or crashed in the middle of processing a test group. This characteristics
1494 of the API actually helps us here because we can reliably compute the total number of build requests in
1495 the group. The first half of this function does this counting as well as collapses all but the first
1496 unfinished build requests into a "contraction" row, which just shows the number of build requests that
1497 are remaining in the group.
1498 (BuildRequestQueuePage.cssTemplate): Added.
1499 (BuildRequestQueuePage.htmlTemplate): Added.
1501 * public/v3/pages/summary-page.js:
1502 (SummaryPage.prototype.open): Use one-day median instead of seven-day median to compute the status.
1503 (SummaryPageConfigurationGroup): Initialize _ratio to NaN. This was causing assertion failures in
1504 RatioBarGraph's update() while measurement sets are being fetched.
1506 * server-tests/api-build-requests-tests.js: Updated the tests per change in BuildRequest's statusLabel.
1507 * unit-tests/analysis-task-tests.js: Ditto.
1508 * unit-tests/test-groups-tests.js: Ditto.
1509 * unit-tests/build-request-tests.js: Added tests for BuildRequest's waitingTime.
1511 2016-07-22 Ryosuke Niwa <rniwa@webkit.org>
1513 REGRESSION(r203035): Marking points as an outlier no longer updates charts
1514 https://bugs.webkit.org/show_bug.cgi?id=160106
1516 Reviewed by Darin Adler.
1518 The bug was caused by MeasurementSet's fetchBetween clearing previously registered callbacks when noCache
1519 option is specified.
1521 * public/v3/components/time-series-chart.js:
1522 (TimeSeriesChart.prototype.setSourceList): Clear this._fetchedTimeSeries when changing chart options.
1523 e.g. need to start including or excluding outliers.
1524 (TimeSeriesChart.prototype.fetchMeasurementSets): Don't skip the fetching when noCache is true.
1526 * public/v3/models/measurement-set.js:
1527 (MeasurementSet): Added this._callbackMap as an instance variable to keep track of all callbacks on every
1528 cluster since we may need to call each callback multiple times per cluster when noCache option is used.
1529 (MeasurementSet.prototype.fetchBetween): Moved the code to add _primaryClusterPromise to _allFetches here
1530 so that now this function and _ensureClusterPromise are only functions that touch _allFetches.
1531 (MeasurementSet.prototype._ensureClusterPromise): Extracted out of fetchBetween. Queue up all callbacks
1532 for each cluster when creating a new promise.
1533 (MeasurementSet.prototype._fetchPrimaryCluster): Removed the code to add _primaryClusterPromise now that
1534 it's done in fetchBetween.
1536 * public/v3/remote.js:
1537 (RemoteAPI.postJSONWithStatus): Removed superfluous call to console.log.
1539 * unit-tests/measurement-set-tests.js: Updated the test case for noCache. The callback registered before
1540 fetchBetween is called with noCache=true is now invoked so callCount must be 3 instead of 2.
1542 2016-07-19 Ryosuke Niwa <rniwa@webkit.org>
1544 Perf dashboard always re-generate measurement set JSON
1545 https://bugs.webkit.org/show_bug.cgi?id=159951
1547 Reviewed by Chris Dumez.
1549 The bug was caused by manifest.json reporting the last modified date of a measurement set in floating point,
1550 and a measurement set JSON reporting it as an integer. Fixed the bug by always using an integer.
1552 * public/api/measurement-set.php:
1553 (main): Return 404 when the results is empty.
1554 (MeasurementSetFetcher::execute_query): Use "extract(epoch from commit_time)" like ManifestGenerator to improve
1555 the generation speed. This is ~10% runtime improvement.
1556 (MeasurementSetFetcher::format_map): Updated to reflect the above change.
1557 (MeasurementSetFetcher::parse_revisions_array): Ditto.
1559 * public/include/manifest.php:
1560 (ManifestGenerator::platforms): Fixed the bug by coercing lastModified to integer (instead of float).
1562 * server-tests/api-measurement-set-tests.js: Added a test case for returning empty results, and a test case for
1563 making sure lastModified dates in manifest.json and measurement sets match.
1565 * tools/js/remote.js:
1566 (RemoteAPI.prototype.sendHttpRequest): Reject the promise when HTTP status code is not 200.
1568 2016-07-09 Ryosuke Niwa <rniwa@webkit.org>
1570 Perf dashboard can consume 50-70% of CPU on MacBook even if user is not interacting at all
1571 https://bugs.webkit.org/show_bug.cgi?id=159597
1573 Reviewed by Chris Dumez.
1575 TimeSeriesChart and InteractiveTimeSeriesChart had been relying on continually polling on requestAnimationFrame
1576 to update itself in response to its canvas resizing. Even though there as an early exit in the case there was
1577 nothing to update, this is still causing a significant power drain when the user is not interacting at all.
1579 Let TimeSeriesChart use the regular top-down render path like other components with exceptions of listening to
1580 window's resize eventas well as when new JSONs are fetched from the server. The render() call to the latter case
1581 will be coerced into a single callback on requestAnimationFrame to avoid DOM-mutation-layout churn.
1583 * public/v3/components/base.js:
1584 (ComponentBase.isElementInViewport): Deleted.
1585 * public/v3/components/chart-pane-base.js:
1586 (ChartPaneBase.prototype.render): Enqueue charts to render.
1587 * public/v3/components/chart-styles.js:
1588 (ChartStyles.dashboardOptions): Removed updateOnRequestAnimationFrame which is no longer an available option.
1589 * public/v3/components/time-series-chart.js:
1590 (TimeSeriesChart): Replaced the code to register itself for rAF by the code to listen to resize events on window.
1591 (TimeSeriesChart._updateOnRAF): Deleted.
1592 (TimeSeriesChart._updateAllCharts): Added.
1593 (TimeSeriesChart.prototype._enqueueToRender): Added.
1594 (TimeSeriesChart._renderEnqueuedCharts): Added.
1595 (TimeSeriesChart.prototype.fetchMeasurementSets): Avoid calling fetchBetween when the range had been fetched.
1596 Without this change, we can incur a significant number of redundant calls to render() when adjusting the domain
1597 in charts page by the slider. When no new JSON is fetched, simply enqueue this chart to render on rAF.
1598 (TimeSeriesChart.prototype._didFetchMeasurementSet): Enqueue this chart to render on rAF.
1599 (TimeSeriesChart.prototype.render): Removed the check for isElementInViewport since we no longer get render() call
1600 when this chart moves into the viewport (as we no longer listen to every rAF or scroll event).
1601 * public/v3/models/measurement-set.js:
1602 (MeasurementSet.prototype.hasFetchedRange): Fixed various bugs revealed by the new use in fetchMeasurementSets.
1603 * public/v3/pages/chart-pane-status-view.js:
1604 (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Removed the dead code. It was probably
1605 copied from when this code was in InteractiveTimeSeries chart. There is no this._forceRender in this component.
1606 * public/v3/pages/dashboard-page.js:
1607 (DashboardPage.prototype.render): Enqueue charts to render.
1608 * public/v3/pages/heading.js:
1609 (SummaryPage.prototype.open): Removed the call to isElementInViewport. This wasn't really doing anything useful in
1611 * unit-tests/measurement-set-tests.js: Added tests for hasFetchedRange.
1612 (.waitForMeasurementSet): Moved to be used in a newly added test case.
1614 2016-07-09 Ryosuke Niwa <rniwa@webkit.org>
1616 REGRESSION: manifest.json generation takes multiple seconds on perf dashboard
1617 https://bugs.webkit.org/show_bug.cgi?id=159596
1619 Reviewed by Chris Dumez.
1621 The most of CPU time was spent looking for a duplicate entry in an array of metrics by array_search.
1622 This patch moves to postgres by using aggregate functions in the query. Also moved the code to convert
1623 datetime to UNIX epoch timestamp from PHP to within postgres query.
1625 These improvements reduce total runtime of Manifest::generate from ~4s to ~350ms on my machine.
1627 * public/include/manifest.php:
1628 (Manifest::generate): No longer fetches test_configurations table as this is done in Manifest::platforms now.
1629 Also moved calls to each method in the class to separate lines for easier instrumentation.
1630 (Manifest::platforms): Group test configurations (current, baseline, target) by platform and metric.
1631 Use the max of the last modified dates in UNIX epoch timestamps (ms to be compatible with JS's representation).
1632 A given platform, metric pair is considered to be in the v1 dashboard if any test configuration is in.
1634 2016-07-08 Ryosuke Niwa <rniwa@webkit.org>
1636 bundle-v3-scripts.py should compress HTML/CSS templates
1637 https://bugs.webkit.org/show_bug.cgi?id=159582
1639 Reviewed by Joseph Pecoraro.
1641 Strip leading and trailing whitespaces from HTML and CSS templates. This is a 8% progression on the file size.
1643 * Install.md: Updated the list of MIME types to apply deflate for newer versions of Apache.
1644 * tools/bundle-v3-scripts.py:
1646 (compress_template): Added.
1648 2016-06-13 Ryosuke Niwa <rniwa@webkit.org>
1650 Build fix. Strip out "use strict" everywhere so that the perf dashboard works on the shipping Safari.
1652 * tools/bundle-v3-scripts.py:
1655 2016-06-13 Ryosuke Niwa <rniwa@webkit.org>
1657 Invalid token error when trying to create an A/B analysis for a range
1658 https://bugs.webkit.org/show_bug.cgi?id=158679
1660 Reviewed by Chris Dumez.
1662 The problem in this particular case was due to another website overriding cookies for our subdomain.
1663 Make PrivilegedAPI robust against its token becoming invalid in general to fix the bug since the cookie
1664 is only available under /privileged-api/ and the v3 UI can't access it for security reasons.
1666 This patch factors out PrivilegedAPI out of remote.js so that it can be tested separately in server tests
1667 as well as unit tests even though RemoteAPI itself is implemented differently in each case.
1669 * init-database.sql: Added a forgotten default value "false" to run_marked_outlier.
1670 * public/v3/index.html:
1671 * public/v3/privileged-api.js: Added. Extracted out of public/v3/remote.js.
1672 (PrivilegedAPI.sendRequest): Fixed the bug. When the initial request fails with "InvalidToken" error,
1673 re-generate the token and re-issue the request.
1674 (PrivilegedAPI.requestCSRFToken):
1675 * public/v3/remote.js:
1676 (RemoteAPI.postJSON): Added to match tools/js/remote.js.
1677 (RemoteAPI.postJSONWithStatus): Ditto.
1678 (PrivilegedAPI): Moved to privileged-api.js.
1679 * server-tests/api-measurement-set-tests.js: Removed the unused require for crypto.
1680 * server-tests/privileged-api-upate-run-status.js: Added tests for /privileged-api/update-run-status.
1681 * server-tests/resources/test-server.js:
1682 (TestServer.prototype.inject): Clear the cookies as well as tokens in PrivilegedAPI.
1683 * tools/js/remote.js:
1684 (RemoteAPI): Added the support for PrivilegedAPI by making cookie set by the server persist.
1685 (RemoteAPI.prototype.clearCookies): Added for tests.
1686 (RemoteAPI.prototype.postJSON): Make sure sendHttpRequest always sends a valid JSON.
1687 (RemoteAPI.prototype.postJSONWithStatus): Added since this API is used PrivilegedAPI.
1688 (RemoteAPI.prototype.sendHttpRequest): Retain the cookie set by the server and send it back in each request.
1689 * tools/js/v3-models.js:
1690 * unit-tests/privileged-api-tests.js: Added unit tests for PrivilegedAPI.
1691 * unit-tests/resources/mock-remote-api.js:
1692 (MockRemoteAPI.postJSON): Added for unit testing.
1693 (MockRemoteAPI.postJSONWithStatus): Ditto.
1695 2016-06-13 Ryosuke Niwa <rniwa@webkit.org>
1697 /admin/tests is very slow
1698 https://bugs.webkit.org/show_bug.cgi?id=158682
1700 Reviewed by Chris Dumez.
1702 The slowness came from TestNameResolver::__construct, which was fetching the entire table of test_configurations,
1703 which at this point contains more than 32,000 rows. Don't fetch the entire table in the constructor. Instead,
1704 fetch a subset of rows as needed in configurations_for_metric_and_platform. Even though this results in many SQL
1705 queries being issued, that's a lot more efficient in practice because we only fetch a few dozen rows in practice.
1707 Also removed a whole bunch of features from /admin/tests to simplify the page. In particular, the ability to update
1708 the list of triggerables has been removed now that sync-buildbot.js automatically updates that for us. This removed
1709 the last use of test_exists_on_platform, which was also dependent on fetching test_configurations upfront.
1711 * public/admin/tests.php:
1712 * public/include/test-name-resolver.php:
1713 (TestNameResolver::__construct): Don't fetch the entire table of test_configurations.
1714 (TestNameResolver::configurations_for_metric_and_platform): Just issue a SQL query for the specified platform and metric.
1715 (TestNameResolver::test_exists_on_platform): Removed.
1717 2016-06-08 Ryosuke Niwa <rniwa@webkit.org>
1719 sync-buildbot.js should update the list of tests and platforms associated with a triggerable
1720 https://bugs.webkit.org/show_bug.cgi?id=158406
1722 Reviewed by Chris Dumez.
1724 Add /api/update-triggerable and a test for it, which were supposed to be added in r201718
1725 but for which I forgot to run svn add.
1727 * public/api/update-triggerable.php: Added.
1729 * server-tests/api-update-triggerable.js: Added.
1731 2016-06-07 Ryosuke Niwa <rniwa@webkit.org>
1733 Build fix after r201739. attachShadow was throwing an exception on this component.
1735 * public/v3/pages/analysis-category-toolbar.js:
1736 (AnalysisCategoryToolbar):
1738 2016-06-06 Ryosuke Niwa <rniwa@webkit.org>
1740 sync-buildbot.js should update the list of tests and platforms associated with a triggerable
1741 https://bugs.webkit.org/show_bug.cgi?id=158406
1742 <rdar://problem/26185737>
1744 Reviewed by Darin Adler.
1746 Added /api/update-triggerable to update the list of configurations (platform and test pairs)
1747 associated with a given triggerable, and make sync-buildbot.js use this JSON API before each
1748 syncing cycle so that the association gets updated automatically by simply updating the JSON.
1750 * server-tests/api-manifest.js: Use const for imported modules.
1751 * server-tests/api-report-commits-tests.js: Removed unnecessary importing of crypto.
1752 * server-tests/resources/mock-data.js:
1753 (MockData.someTestId): Added.
1754 (MockData.somePlatformId): Added.
1755 (MockData.addMockData):
1756 * server-tests/tools-buildbot-triggerable-tests.js: Use const for imported modules. Also added
1757 a test for BuildbotTriggerable's updateTriggerable.
1758 * tools/js/buildbot-triggerable.js:
1759 (BuildbotTriggerable.prototype.updateTriggerable): Added. Find the list of all configurations
1760 associated with this triggeerable and post it to /api/update-triggerable.
1761 * tools/js/database.js: Added triggerable_configurations to the list of tables.
1762 * tools/js/remote.js:
1763 (RemoteAPI.prototype.postJSON): Print the whole response when JSON parsing fails for debugging.
1764 * tools/sync-buildbot.js:
1765 (syncLoop): Call BuildbotTriggerable's updateTriggerable before syncing.
1767 2016-06-02 Ryosuke Niwa <rniwa@webkit.org>
1769 Build fix after r201564.
1771 * public/v3/pages/analysis-category-page.js:
1772 (AnalysisCategoryPage.prototype.updateFromSerializedState):
1773 * public/v3/pages/create-analysis-task-page.js:
1774 (CreateAnalysisTaskPage.prototype.updateFromSerializedState):
1775 (CreateAnalysisTaskPage.prototype.render):
1777 2016-05-31 Ryosuke Niwa <rniwa@webkit.org>
1779 v3 UI should support marking and unmarking outliers as well as hiding them
1780 https://bugs.webkit.org/show_bug.cgi?id=158248
1782 Rubber-stamped by Chris Dumez.
1784 Added the support for marking and unmarking a sequence of points as outliers. Unlike v2, we now support marking
1785 multiple points as outliers in a single click. Also fixed a bug that outliers are never explicitly hidden in v3 UI.
1787 This patch splits ChartStyles.createChartSourceList into two functions: resolveConfiguration and createSourceList
1788 to separate the work of resolving platform and metric IDs to their respective model objects, and creating a source
1789 list used by TimeSeriesChart to fetch measurement sets. createSourceList is called again when filtering options are
1792 It also adds noCache option to TimeSeriesChart's fetchMeasurementSets, MeasurementSet's fetchBetween and
1793 _fetchPrimaryCluster to update the measurement sets after marking or unmarking points as outliers. In addition, it
1794 fixes a bug that the annotation bars for analysis tasks are not updated in charts page after creating an analysis
1795 task by adding noCache option to ChartPaneBase's fetchAnalysisTasks, AnalysisTask's fetchByPlatformAndMetric and
1798 Finally, this patch splits ChartPane._makeAnchorToOpenPane into _makePopoverActionItem, _makePopoverOpenOnHover and
1799 _setPopoverVisibility for clarity.
1801 * public/v3/components/chart-pane-base.js:
1802 (ChartPaneBase): Added _disableSampling and _showOutliers as instance variables.
1803 (ChartPaneBase.prototype.configure):
1804 (ChartPaneBase.prototype.isSamplingEnabled): Added.
1805 (ChartPaneBase.prototype.setSamplingEnabled): Added. When a filtering option is updated, recreate the source list
1806 so that TimeSeriesChart.setSourceList can re-fetch the measurement set JSONs.
1807 (ChartPaneBase.prototype.isShowingOutliers): Added.
1808 (ChartPaneBase.prototype.setShowOutliers): Added. Ditto for calling _updateSourceList.
1809 (ChartPaneBase.prototype._updateSourceList): Added.
1810 (ChartPaneBase.prototype.fetchAnalysisTasks): Renamed from _fetchAnalysisTasks. Now takes noCache as an argument
1811 instead of platform and metric IDs since they're on instance variables.
1813 * public/v3/components/chart-styles.js:
1814 (ChartStyles.resolveConfiguration): Renamed from createChartSourceList. Just resolves platform and metric IDs.
1815 (ChartStyles.createSourceList): Extracted from createChartSourceList since it needs to be called when a filtering
1816 option is changed as well as when ChartPaneBase.prototype.configure is called.
1817 (ChartStyles.baselineStyle): Now takes filtering options.
1818 (ChartStyles.targetStyle): Ditto.
1819 (ChartStyles.currentStyle): Ditto.
1821 * public/v3/components/interactive-time-series-chart.js:
1822 (InteractiveTimeSeriesChart.prototype.currentPoint): Find the point in _fetchedTimeSeries when
1823 _sampledTimeSeriesData hasn't been computed yet as a fallback (e.g. when the chart hasn't been rendered yet).
1824 (InteractiveTimeSeriesChart.prototype.selectedPoints): Added.
1825 (InteractiveTimeSeriesChart.prototype.firstSelectedPoint): Added.
1826 (InteractiveTimeSeriesChart.prototype.lockedIndicator): Added. Returns the current point if it's locked.
1828 * public/v3/components/time-series-chart.js:
1829 (TimeSeriesChart.prototype.setDomain):
1830 (TimeSeriesChart.prototype.setSourceList): Added. Re-create _fetchedTimeSeries when filtering options have changed.
1831 Don't re-fetch measurement set JSONs here since showing outliers can be done entirely in the front end.
1832 (TimeSeriesChart.prototype.fetchMeasurementSets): Extracted out of setDomain. Now takes noCache as an argument.
1833 ChartPane._markAsOutlier
1834 (TimeSeriesChart.prototype.firstSampledPointBetweenTime): Added.
1836 * public/v3/models/analysis-task.js:
1837 (AnalysisTask.fetchByPlatformAndMetric): Added noCache as an argument.
1838 (AnalysisTask._fetchSubset): Ditto.
1840 * public/v3/models/measurement-adaptor.js:
1841 (MeasurementAdaptor.prototype.isOutlier): Added.
1842 (MeasurementAdaptor.prototype.applyToAnalysisResults): Add markedOutlier as a property on each point.
1844 * public/v3/models/measurement-cluster.js:
1845 (MeasurementCluster.prototype.addToSeries): Fixed the bug that filtering outliers was broken as _markedOutlierIndex
1846 is undefined here. Use MeasurementAdaptor's isOutlier instead.
1848 * public/v3/models/measurement-set.js:
1849 (MeasurementSet.prototype.fetchBetween): Added noCache as an argument. Reset _primaryClusterPromise and _allFetches
1850 when noCache is true since we need to re-fetch the primary cluster as well as all secondary clusters now.
1851 (MeasurementSet.prototype._fetchPrimaryCluster): Added noCache as an argument. Directly invoke the JSON API at
1852 /api/measurement-set to re-generate all clusters' JSON files instead of first fetching the cached version.
1853 (MeasurementSet.prototype._fetchSecondaryCluster):
1854 (MeasurementSet.prototype._didFetchJSON): Removed a bogus assertion since this function is called on secondary
1855 clusters as well as primary clusters.
1856 (MeasurementSet.prototype._addFetchedCluster): Reimplemented this function using an insertion sort. Also remove the
1857 existing entry if the fetch cluster should replace it.
1859 * public/v3/models/time-series.js:
1860 (TimeSeries.prototype.dataBetweenPoints): Removed the dead code to filter out outliers. This is done in addToSeries
1861 of MeasurementCluster instead.
1863 * public/v3/pages/chart-pane.js:
1864 (ChartPane): Renamed pane to popover since it was confusing to have a pane inside a pane class. As such, renamed
1865 _paneOpenedByClick to _lockedPopover.
1866 (ChartPane.prototype.serializeState): Added the code to serialize filtering options in the serialized state URL.
1867 (ChartPane.prototype.updateFromSerializedState): Ditto for parsing.
1868 (ChartPane.prototype._analyzeRange): Extracted out of render(). Also fixed a bug that the charts page don't show
1869 the newly created analysis task by invoking fetchAnalysisTasks with noCache set to true.
1870 (ChartPane.prototype._markAsOutlier): Added.
1871 (ChartPane.prototype._renderActionToolbar): A bunch of changes due to pane -> popover rename. Also added a popover
1872 for filtering options.
1873 (ChartPane.prototype._makePopoverActionItem): Extracted from _makeAnchorToOpenPane.
1874 (ChartPane.prototype._makePopoverOpenOnHover): Ditto.
1875 (ChartPane.prototype._setPopoverVisibility): Ditto.
1876 (ChartPane.prototype._renderFilteringPopover): Added.
1877 (ChartPane.htmlTemplate): Added a popover for specifying filtering options. Also added .popover on each popover.
1878 (ChartPane.cssTemplate): Updated the style to make use of .popover.
1880 * public/v3/pages/charts-page.js:
1881 (ChartsPage.prototype.graphOptionsDidChange): Added. Updates the URL state when a filtering option is modified.
1883 * public/v3/pages/dashboard-page.js:
1884 (DashboardPage.prototype._createChartForCell):
1886 * public/v3/pages/page-router.js:
1887 (PageRouter.prototype._serializeHashQueryValue): Serialize a set of strings as | separated tokens.
1888 (PageRouter.prototype._deserializeHashQueryValue): Rewrote the function as the serialized URL can no longer be
1889 parsed as a JSON as | separated tokens can't be converted into a valid JSON construct with a simple regex.
1891 * unit-tests/measurement-set-tests.js: Added a test case for fetchBetween with noCache=true.
1893 2016-05-24 Ryosuke Niwa <rniwa@webkit.org>
1895 Another build fix after r201307.
1897 * public/v3/pages/page-router.js:
1898 (PageRouter.prototype._deserializeHashQueryValue):
1899 (PageRouter.prototype._countOccurrences): Moved from _deserializeHashQueryValue.
1901 2016-05-23 Ryosuke Niwa <rniwa@webkit.org>
1903 Build fix after r201307.
1905 * public/v3/pages/chart-pane.js:
1906 (ChartPane.prototype.serializeState):
1908 2016-05-23 Ryosuke Niwa <rniwa@webkit.org>
1910 Some applications truncates the last closing parenthesis in perf dashboard URL
1911 https://bugs.webkit.org/show_bug.cgi?id=157976
1913 Reviewed by Tim Horton.
1915 Unfortunately, different applications use different heuristics to determine the end of each URL. Two trailing
1916 parentheses, for example, is just fine in Radar as well as Apple Mail if the URL is short enough. Using other
1917 characters such as ] and } wouldn't work either because they would be %-escaped. At that point, we might as well
1918 as %-escape everything.
1920 Work around the bug by parsing the URL as if it had one extra ')' if the parsing had failed. Also shorten the charts
1921 page's URL by avoid emitting "-null" for each pane when the pane doesn't have a currently selected point or selection.
1922 This improves the odds of the entire URL being recognized by various applications.
1924 We could, in theory, implement some sort of a URL shorter but that can wait until when we support real user accounts.
1926 * public/v3/pages/chart-pane.js:
1927 (ChartPane.prototype.serializeState): Don't serialize the selection or the current point if nothing is selected.
1928 * public/v3/pages/page-router.js:
1929 (PageRouter.prototype._deserializeHashQueryValue): Try parsing the value again with one extra ] at the end if
1930 the JSON parsing had failed.
1932 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
1934 Perf dashboard "Add pane" should list first by test, then by machine
1935 https://bugs.webkit.org/show_bug.cgi?id=157880
1937 Reviewed by Stephanie Lewis.
1939 Reversed the order which tests and platforms are selected. Also split .pane-selector-container into #tests and
1940 #platform for the ease of DOM node manipulations.
1942 * public/v3/components/pane-selector.js:
1944 (PaneSelector.prototype._renderPlatformList): Renamed from _renderPlatformLists since there is a single list
1945 for platforms. This list now disappears while a non-metric item is selected in the collection of test lists.
1946 e.g. "Speedometer" instead of its "Score" metric. Remember the last metric we rendered to avoid churning.
1947 (PaneSelector.prototype._renderTestLists): Render the top level tests once. The index of lists have been
1948 decreased by one since test lists are now inside #tests instead of appearing after the platform list.
1949 (PaneSelector.prototype._buildTestList): Don't filter tests since platform is chosen after tests now.
1950 (PaneSelector.prototype._replaceList):
1951 (PaneSelector.prototype._selectedItem): Don't reset the test path (specifies which subtest or metric is picked)
1952 when a platform is selected since it happens after a test metric is chosen now.
1953 (PaneSelector.prototype._clickedItem): Add a pane when a platform is clicked, not when a metric is clicked.
1954 (PaneSelector.cssTemplate):
1956 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
1958 Analysis task should look for a git commit based on abridged hashes
1959 https://bugs.webkit.org/show_bug.cgi?id=157877
1960 <rdar://problem/26254374>
1962 Reviewed by Chris Dumez.
1964 Made /privileged-api/associate-commit look for commits using LIKE instead of an exact match.
1965 Associate the commit when there is exactly one match.
1967 * public/include/commit-log-fetcher.php:
1968 (CommitLogFetcher::fetch_between):
1969 * public/include/db.php:
1970 (Database::escape_for_like): Extracted from CommitLogFetcher::fetch_between.
1971 * public/privileged-api/associate-commit.php:
1972 (main): Look for the commits using LIKE. Reject whenever there are multiple commits. We limit the number of
1973 matches to two for performance when the user specifies something that almost thousands of commits: e.g. "1".
1974 * public/v3/pages/analysis-task-page.js:
1975 (AnalysisTaskPage.prototype._associateCommit): Added human friendly error messages for mismatching commits.
1977 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
1979 Unreviewed build fix. Use --date-order so that every child commit appears after its parent.
1980 Otherwise we'll hit a FailedToFindParentCommit error while submitting a commit that appears before its parent.
1982 * tools/sync-commits.py:
1983 (GitRepository._fetch_all_hashes):
1985 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
1987 Removed the erroneously committed debug code.
1989 * tools/sync-commits.py:
1990 (GitRepository.fetch_commit):
1992 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
1994 Perf dashboard should have a script to sync git commits
1995 https://bugs.webkit.org/show_bug.cgi?id=157867
1997 Reviewed by Chris Dumez.
1999 Added the support to pull from a Git repo to pull-svn.py and renamed it to sync-commits.py.
2001 Added two classes SVNRepository and GitRepository which inherits from an abstract class, Repository.
2002 The code that fetches commit and format revision number / git hash is specialized in each.
2005 * tools/pull-svn.py: Removed.
2006 * tools/sync-commits.py: Renamed from Websites/perf.webkit.org/tools/pull-svn.py.
2007 (main): Renamed --svn-config-json to --repository-config-json. Also made it robust against exceptions
2008 inside fetch_commits_and_submit of each Repository class.
2009 (load_repository): A factory function for SVNRepository and GitRepository.
2010 (Repository): Added.
2011 (Repository.__init__): Added.
2012 (Repository.fetch_commits_and_submit): Extracted from standalone fetch_commits_and_submit.
2013 (Repository.fetch_commit): Added. Implemented by a subclass.
2014 (Repository.format_revision): Ditto.
2015 (Repository.determine_last_reported_revision): Extracted from alonealone
2016 determine_first_revision_to_fetch. The fallback to use "oldest" has been moved to SVNRepository's
2017 fetch_commit since it doesn't work in Git.
2018 (Repository.fetch_revision_from_dasbhoard): Extracted from fetch_revision_from_dasbhoard.
2019 (SVNRepository): Added.
2020 (SVNRepository.__init__): Added.
2021 (SVNRepository.fetch_commit): Extracted from standalone fetch_commit_and_resolve_author and fetch_commit.
2022 (SVNRepository._resolve_author_name): Renamed from resolve_author_name_from_account.
2023 (SVNRepository.format_revision): Added.
2024 (GitRepository): Added.
2025 (GitRepository.__init__):
2026 (GitRepository.fetch_commit): Added. Fetches the list of all git hashes if needed, and finds the next hash.
2027 (GitRepository._find_next_hash): Added. Finds the first commit that appears after the specified hash.
2028 (GitRepository._fetch_all_hashes): Added. Gets the list of all git hashs chronologically (old to new).
2029 (GitRepository._run_git_command): Added.
2030 (GitRepository.format_revision): Added. Use the first 8 characters of the hash.
2032 2016-05-17 Ryosuke Niwa <rniwa@webkit.org>
2034 Add a subtitle under platform name in the summary page
2035 https://bugs.webkit.org/show_bug.cgi?id=157809
2037 Reviewed by Chris Dumez.
2039 Add a description beneath the platform names.
2041 * public/v3/pages/summary-page.js:
2042 (SummaryPage.prototype._constructTable): Add a br and a span if subtitle is present.
2043 (SummaryPage.cssTemplate): Added CSS rules for .subtitle.
2045 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
2047 v3 UI shows full git hash instead of the first 8 characters for a blame range
2048 https://bugs.webkit.org/show_bug.cgi?id=157691
2050 Reviewed by Stephanie Lewis.
2052 Fixed the bug that v3 UI shows the full 40 character git hash instead of the first 8 character as done in v2 UI.
2054 * public/v3/models/commit-log.js:
2055 (CommitLog.prototype.diff): Fixed the bug.
2056 * tools/run-tests.py:
2057 (main): Add the support for running a subset of tests as mocha does.
2058 * unit-tests/commit-log-tests.js: Added.
2060 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
2062 Unreviewed. Added the missing executable bits.
2064 * tools/bundle-v3-scripts.py: Added property svn:executable.
2065 * tools/detect-changes.js: Added property svn:executable.
2066 * tools/process-maintenance-backlog.py: Added property svn:executable.
2068 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
2070 Summary page doesn't report some missing platforms
2071 https://bugs.webkit.org/show_bug.cgi?id=157670
2073 Reviewed by Darin Adler.
2075 This patch improves the warning text for missing platforms and fixes the bug that platforms that don't have
2076 any data reported for a given test would not be reported as missing.
2078 * public/v3/pages/summary-page.js:
2079 (SummaryPage.prototype.render): Added instrumentations.
2080 (SummaryPage.prototype._constructRatioGraph): Always create both the ratio bar graph and the spinner icon.
2081 (SummaryPage.prototype._renderCell): Extracted from _constructRatioGraph. Toggle the displayed-ness of the
2082 spinner and the ratio bar graph in the cell by CSS for better performance.
2083 (SummaryPage.prototype._warningTextForGroup): Extracted from _constructRatioGraph. Rephrased warning text
2084 for clarity and adopted new API of SummaryPageConfigurationGroup.
2085 (SummaryPage.prototype._warningTextForGroup.mapAndSortByName): Added.
2086 (SummaryPage.prototype._warningTextForGroup.pluralizeIfNeeded): Added.
2087 (SummaryPage.cssTemplate): Added rules to toggle the visibility of spinner icons and bar graphs.
2088 (SummaryPageConfigurationGroup): Replaced this._warnings by more explicitly named this._missingPlatforms
2089 and this._platformsWithoutBaseline. Also add a platform to this._missingPlatforms if it didn't appear in
2090 any metrics. Note that adding a platform whenever it doesn't in any one metric would be incorrect since
2091 some tests uses a different test name on different platforms: e.g. PLT-Mac and PLT-iPhone.
2092 (SummaryPageConfigurationGroup.prototype.missingPlatforms): Added.
2093 (SummaryPageConfigurationGroup.prototype.platformsWithoutBaseline): Added.
2094 (SummaryPageConfigurationGroup.prototype._fetchAndComputeRatio):
2096 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
2098 Always use v3 UI for dashboards and analysis task pages
2099 https://bugs.webkit.org/show_bug.cgi?id=157647
2101 Reviewed by Darin Adler.
2103 Redirect dashboard pages from v1 and v2 to v3's summary page. Also redirect v1 UI's charts page and v2 UI's
2104 analysis task pages to the corresponding v3 pages.
2106 Keep v2's charts page accessible since some features such as segmentation is still only available on v2 UI.
2108 * public/index.html:
2109 (init.showCharts): Redirect to v3 UI once the chart list has been parsed.
2110 (init.redirectChartsToV3): Added.
2111 * public/v2/index.html:
2113 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
2115 Show a spinner while fetching data on summary page
2116 https://bugs.webkit.org/show_bug.cgi?id=157658
2118 Reviewed by Darin Adler.
2120 Show a spinner while fetching JSON files on the summary page.
2122 * public/v3/components/base.js:
2123 (ComponentBase.prototype.renderReplace): Added a new implementation that simply calls the static version.
2124 (ComponentBase.renderReplace): Made this static.
2126 * public/v3/pages/summary-page.js:
2127 (SummaryPage.prototype._constructRatioGraph): Show a spinner icon when SummaryPageConfigurationGroup's
2128 isFetching returns true.
2129 (SummaryPage.cssTemplate): Force the height of each cell to be 2.5rem so that the height of cell doesn't
2130 change when a spinner is replaced by a ratio bar graph.
2132 (SummaryPageConfigurationGroup): Added this._isFetching as an instance variable.
2133 (SummaryPageConfigurationGroup.prototype.isFetching): Added.
2134 (SummaryPageConfigurationGroup.prototype.fetchAndComputeSummary): Set this._isFetching while waiting for
2135 the promises to resolve after 50ms. We don't immediately set this._isFetching to avoid FOC when all JSON
2136 files have been cached.
2138 2016-05-07 Ryosuke Niwa <rniwa@webkit.org>
2140 Add horizontal between categories of tests
2141 https://bugs.webkit.org/show_bug.cgi?id=157386
2143 Reviewed by Darin Adler.
2145 Wrap tests in each category by tbody and add a horizontal bar between each category.
2147 * public/v3/pages/summary-page.js:
2148 (SummaryPage.prototype._constructTable):
2149 (SummaryPage.cssTemplate):
2151 2016-05-04 Dewei Zhu <dewei_zhu@apple.com>
2153 Summary page should show warnings when current or baseline data is missing.
2154 https://bugs.webkit.org/show_bug.cgi?id=157339
2156 Reviewed by Ryosuke Niwa.
2158 Set summary page to be the default page of v3 UI.
2159 Show warning icon when either baseline or current data is missing.
2160 Make fetchBetween returns a promise.
2161 Update unit tests for MeasurementSet.fetchBetween since it returns a promise now.
2162 Add a workaround to skip some platform and metric configurations.
2164 * public/v3/components/ratio-bar-graph.js:
2166 (RatioBarGraph.prototype.update): Add showWarningIcon flag to indicate whether we should show warning icon.
2167 (RatioBarGraph.prototype.render): Show warning icon when showWarningIcon is true.
2168 (RatioBarGraph.cssTemplate): Add style for warning icon.
2169 * public/v3/components/warning-icon.js: Add warning icon.
2171 (WarningIcon.cssTemplate):
2172 * public/v3/index.html:
2173 * public/v3/main.js:
2174 (main): Set summary page to be the default page of v3 UI.
2175 * public/v3/models/measurement-set.js:
2177 (MeasurementSet.prototype.fetchBetween): Returns a promise. Fix the bug in previous implementation that we miss
2178 some callbacks sometimes. Basically, we will fetch primary cluster first, then secondary clusters. For each
2179 secondary cluster fetch, we will always invoke callback even when it fails.
2180 (MeasurementSet.prototype._fetchSecondaryClusters): Deleted.
2181 (MeasurementSet.prototype._fetch.else.url.api.measurement.set platform): Deleted.
2182 * public/v3/pages/summary-page.js:
2183 (SummaryPage): Add a variable for excluded configurations.
2184 (SummaryPage.prototype._createConfigurationGroup): Pass excluded configurations while building config groups.
2185 (SummaryPage.prototype._constructTable): Remove the logic for unified header since it breaks consistency of the table appearance.
2186 (SummaryPage.prototype.this._renderQueue.push): Show warning message when baseline/current data is missing.
2187 (SummaryPageConfigurationGroup): Add a variable to keep track of the warnings while computing summary.
2188 (SummaryPageConfigurationGroup.prototype.warnings): A getter for warnings.
2189 (SummaryPageConfigurationGroup._computeSummary): Fix a bug in calculating ratios. We should always use
2190 current/baseline for ratio and present the difference between ratio and 1 in the summary page.
2191 (SummaryPageConfigurationGroup.set then): Deleted.
2192 (SummaryPageConfigurationGroup.set var): Deleted.
2193 * unit-tests/measurement-set-tests.js: Add a helper function to wait for fetchBetween. Update unit tests since fetchBetween returns a promise now.
2194 (promise.set fetchBetween):
2195 (set MeasurementSet):
2196 (set fetchBetween): Deleted.
2198 2016-04-26 Ryosuke Niwa <rniwa@webkit.org>
2200 Chart status should always be computed against prior values
2201 https://bugs.webkit.org/show_bug.cgi?id=157014
2203 Reviewed by Darin Adler.
2205 Compare the current value against the last baseline or target value that appear before the current value in time
2206 so that the comparison stay the same even when new baseline and target values are reported. Also include the compared
2207 baseline or target value in the label for clarity.
2209 * public/v3/components/chart-status-view.js:
2210 (ChartStatusView.prototype._computeChartStatus):
2211 (ChartStatusView.prototype._computeChartStatus.labelForDiff):
2212 (ChartStatusView.prototype._findLastPointPriorToTime): Extracted from _relativeDifferenceToLaterPointInTimeSeries.
2213 Now finds the last point before the current point's time if there is any, or the last point in baseline / target.
2214 (ChartStatusView.prototype._relativeDifferenceToLaterPointInTimeSeries): Deleted.
2215 * public/v3/models/metric.js:
2216 (Metric.prototype.makeFormatter): Don't use SI units for unit-less metrics.
2218 2016-04-13 Ryosuke Niwa <rniwa@webkit.org>
2220 REGRESSION(r199444): Perf dashboard always fetches all measurement sets
2221 https://bugs.webkit.org/show_bug.cgi?id=156534
2223 Reviewed by Darin Adler.
2225 The bug was cased by SummaryPage's constructor fetching all measurement sets. Since each page is always
2226 constructed in main(), this resulted in all measurement sets being fetched on all pages.
2228 * public/v3/pages/summary-page.js:
2230 (SummaryPage.prototype.open): Fetch measurement set JSONs here.
2231 (SummaryPage.prototype._createConfigurationGroup): Renamed from _createConfigurationGroupAndStartFetchingData.
2233 2016-04-12 Ryosuke Niwa <rniwa@webkit.org>
2235 Add a summary page to v3 UI
2236 https://bugs.webkit.org/show_bug.cgi?id=156531
2238 Reviewed by Stephanie Lewis.
2240 Add new "Summary" page, which shows the average difference (better or worse) from the baseline across
2241 multiple platforms and tests by a single number.
2243 * public/include/manifest.php:
2244 (ManifestGenerator::generate): Include "summary" in manifest.json.
2245 * public/shared/statistics.js:
2246 (Statistics.mean): Added.
2247 (Statistics.median): Added.
2248 * public/v3/components/ratio-bar-graph.js: Added.
2249 (RatioBarGraph): Shows a horizontal bar graph that visualizes the relative difference (e.g. 3% better).
2250 (RatioBarGraph.prototype.update):
2251 (RatioBarGraph.prototype.render):
2252 (RatioBarGraph.cssTemplate):
2253 (RatioBarGraph.htmlTemplate):
2254 * public/v3/index.html:
2255 * public/v3/main.js:
2256 (main): Instantiate SummaryPage and add it to the navigation bar and the router.
2257 * public/v3/models/manifest.js:
2258 (Manifest._didFetchManifest): Let "summary" pass through from manifest.json to main().
2259 * public/v3/models/measurement-set.js:
2260 (MeasurementSet.prototype._failedToFetchJSON): Invoke the callback with an error or true in order for
2261 the callback can detect a failure.
2262 (MeasurementSet.prototype._invokeCallbacks): Ditto.
2263 * public/v3/pages/charts-page.js:
2264 (ChartsPage.createStateForConfigurationList): Added to add a hyperlink from summary page to charts page.
2265 * public/v3/pages/summary-page.js: Added.
2266 (SummaryPage): Added.
2267 (SummaryPage.prototype.routeName): Added.
2268 (SummaryPage.prototype.open): Added.
2269 (SummaryPage.prototype.render): Added.
2270 (SummaryPage.prototype._createConfigurationGroupAndStartFetchingData): Added.
2271 (SummaryPage.prototype._constructTable): Added.
2272 (SummaryPage.prototype._constructRatioGraph): Added.
2273 (SummaryPage.htmlTemplate): Added.
2274 (SummaryPage.cssTemplate): Added.
2275 (SummaryPageConfigurationGroup): Added. Represents a set of platforms and tests shown in a single cell.
2276 (SummaryPageConfigurationGroup.prototype.ratio): Added.
2277 (SummaryPageConfigurationGroup.prototype.label): Added.
2278 (SummaryPageConfigurationGroup.prototype.changeType): Added.
2279 (SummaryPageConfigurationGroup.prototype.configurationList): Added.
2280 (SummaryPageConfigurationGroup.prototype.fetchAndComputeSummary): Added.
2281 (SummaryPageConfigurationGroup.prototype._computeSummary): Added.
2282 (SummaryPageConfigurationGroup.prototype._fetchAndComputeRatio): Added. Invoked for each time series in
2283 the set, and stores the computed ratio of the current values to the baseline in this._setToRatio.
2284 The results are aggregated by _computeSummary as a single number later.
2285 (SummaryPageConfigurationGroup._medianForTimeRange): Added.
2286 (SummaryPageConfigurationGroup._fetchData): A thin wrapper to make MeasurementSet.fetchBetween promise
2287 friendly since MeasurementSet doesn't support Promise at the moment (but it should!).
2288 * server-tests/api-manifest.js: Updated a test case.
2290 2016-04-12 Ryosuke Niwa <rniwa@webkit.org>
2292 Make sync-buildbot.js fault safe
2293 https://bugs.webkit.org/show_bug.cgi?id=156498
2295 Reviewed by Chris Dumez.
2297 Fixed a bug that sync-buildbot.js will continue to schedule build requests from multiple test groups
2298 if multiple test groups are simultaneously in-progress on the same builder. Also fixed a bug that if
2299 a build request had failed without leaving a trace (i.e. no entry on any of the builders we know of),
2300 sync-buildbot.js throws an exception.
2302 * server-tests/tools-buildbot-triggerable-tests.js: Added test cases.
2303 * tools/js/buildbot-syncer.js:
2304 (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Renamed. Optionally takes the slave name.
2305 When this parameter is specified, schedule the request only if the specified slave is available.
2306 * tools/js/buildbot-triggerable.js:
2307 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Always use
2308 scheduleRequestInGroupIfAvailable to schedule a new build request. Using scheduleRequest for non-first
2309 build requests was problematic when there were multiple test groups with pending requests because then
2310 we would schedule those pending requests without checking whether there is already a pending job or if
2311 we have previously scheduled a job. Also fallback to use any syncer / builder when groupInfo.syncer is
2312 not set even if the next request was not the first one in the test group since we can't determine on
2313 which builder preceding requests are processed in such cases.
2314 * unit-tests/buildbot-syncer-tests.js:
2316 2016-04-11 Ryosuke Niwa <rniwa@webkit.org>
2318 Replace script runner to use mocha.js tests
2319 https://bugs.webkit.org/show_bug.cgi?id=156490
2321 Reviewed by Chris Dumez.
2323 Replaced run-tests.js, which was a whole test harness for running legacy tests by tools/run-tests.py
2324 which is a thin wrapper around mocha.js.
2326 * run-tests.js: Removed.
2328 * tools/run-tests.py: Added.
2331 2016-04-11 Ryosuke Niwa <rniwa@webkit.org>
2333 New syncing script sometimes schedules a build request on a wrong builder
2334 https://bugs.webkit.org/show_bug.cgi?id=156489
2336 Reviewed by Stephanie Lewis.
2338 The bug was caused by _scheduleNextRequestInGroupIfSlaveIsAvailable scheduling the next build request on
2339 any available syncer regardless of whether the request is the first one in the test group or not because
2340 BuildRequest.order was returning a string instead of a number.
2342 Also fixed a bug that BuildbotTriggerable.syncOnce was re-ordering test groups by their id's instead of
2343 respecting the order in which the perf dashboard returned.
2345 * public/v3/models/build-request.js:
2346 (BuildRequest.prototype.order): Force the order to be a number.
2347 * server-tests/api-build-requests-tests.js: Assert the order as numbers.
2348 * server-tests/resources/mock-data.js:
2349 (MockData.addAnotherMockTestGroup): Changed the test group id to 601, which is after the first mock data.
2350 The old number was masking a bug in BuildbotTriggerable that it was re-ordering test groups by their id's
2351 instead of using the order set forth by the perf dashboard.
2352 (MockData.mockTestSyncConfigWithSingleBuilder):
2353 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for scheduling two build requests in
2354 a single call to syncOnce. Each build request should be scheduled on the same builder as the previous build
2355 requests in the same test group.
2356 * tools/js/buildbot-triggerable.js:
2357 (BuildbotTriggerable.prototype.syncOnce): Order test groups by groupOrder, which is the index at which first
2358 build request in the group appeared.
2359 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Don't re-order build requests
2360 as they're already sorted on the server side.
2361 (BuildbotTriggerable._testGroupMapForBuildRequests): Added groupOrder to test group info
2363 2016-04-09 Ryosuke Niwa <rniwa@webkit.org>
2365 Build fix. Don't treat a build number 0 as a pending build.
2367 * tools/js/buildbot-syncer.js:
2368 (BuildbotBuildEntry.prototype.isPending):
2370 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
2372 Escape builder names in url* and pathFor* methods of BuildbotSyncer
2373 https://bugs.webkit.org/show_bug.cgi?id=156427
2375 Reviewed by Darin Adler.
2377 The build fix in r199251 breaks other usage of RemoteAPI. Fix it properly by escaping builder names in
2378 various methods of BuildbotSyncer.
2380 Also fixed a typo in the logging and a bug that the new syncing script never updated "scheduled" to "running".
2382 * server-tests/resources/mock-data.js:
2383 (MockData.mockTestSyncConfigWithTwoBuilders): Renamed "some-builder-2" to "some builder 2" to test the
2384 new escaping behavior in tools-buildbot-triggerable-tests.js and buildbot-syncer-tests.js.
2386 * server-tests/tools-buildbot-triggerable-tests.js: Added tests for status url, and added a new test case
2387 for updating "scheduled" to "running".
2389 * tools/js/buildbot-syncer.js:
2390 (BuildbotBuildEntry.buildRequestStatusIfUpdateIsNeeded): Update the status to "running" when the request's
2391 status is "scheduled" and the buildbot's build is currently in progress.
2392 (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Escape the builder name.
2393 (BuildbotSyncer.prototype.pathForBuildJSON): Ditto.
2394 (BuildbotSyncer.prototype.pathForForceBuild): Ditto.
2395 (BuildbotSyncer.prototype.url): Ditto.
2396 (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
2398 * tools/js/buildbot-triggerable.js:
2399 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers):
2400 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Fixed a typo. We are
2401 scheduling new build requests, not syncing them.
2402 * tools/js/remote.js:
2403 (RemoteAPI.sendHttpRequest): Reverted r199251.
2404 * unit-tests/buildbot-syncer-tests.js:
2406 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
2408 Build fix. We need to escape the path or http.request would fail.
2410 * tools/js/remote.js:
2412 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
2414 Fix various bugs in the new syncing script
2415 https://bugs.webkit.org/show_bug.cgi?id=156393
2417 Reviewed by Darin Adler.
2419 * server-tests/resources/common-operations.js: Added. This file was supposed to be added in r199191.
2420 (addBuilderForReport):
2421 (addSlaveForReport):
2422 (connectToDatabaseInEveryTest):
2424 * tools/js/buildbot-triggerable.js:
2425 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Don't log every time we pull from buildbot
2426 builder as this dramatically increases the amount of log we generate.
2427 * tools/js/parse-arguments.js:
2428 (parseArguments): Fixed a typo. This should be parseArgument*s*, not parseArgument.
2429 * tools/js/remote.js:
2430 (RemoteAPI.prototype.url): Fixed a bug that portSuffix wasn't being expanded in the template literal.
2431 (RemoteAPI.prototype.configure): Added more validations with nice error messages.
2432 (RemoteAPI.prototype.sendHttpRequest): Falling back to port 80 isn't right when scheme is https. Compute
2433 the right port in configure instead based on the scheme.
2434 * tools/sync-buildbot.js:
2435 (syncLoop): Fixed the bug that syncing multiple times fail because Manifest.fetch() create new Platform
2436 and Test objects. This results in various references in BuildRequest objects to get outdated. Fixing this
2437 properly in Manifest.fetch() because we do need to "forget" about some tests and platforms in some cases.
2438 For now, delete all v3 model objects and start over in each syncing cycle.
2439 * unit-tests/tools-js-remote-tests.js: Added. Unit tests for the aforementioned changes to RemoteAPI.
2441 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
2443 sync-buildbot.js doesn't mark disappeared builds as failed
2444 https://bugs.webkit.org/show_bug.cgi?id=156386
2446 Reviewed by Chris Dumez.
2448 Fix a bug that new syncing script doesn't mark builds that it scheduled but doesn't appear when queried
2449 by buildbot's JSON API. These are builds that got canceled by humans (e.g. buildbot was restarted, data
2450 loss, pending build was canceled, etc...)
2452 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case.
2453 * tools/js/buildbot-triggerable.js:
2454 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added a set of build requests we've matched
2455 against BuildbotBuildEntry's. Mark build requests that didn't have any entry but supposed to be in either
2456 'scheduled' or 'running' status as failed.
2458 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
2460 A/B testing bots should prioritize user created test groups
2461 https://bugs.webkit.org/show_bug.cgi?id=156375
2463 Reviewed by Chris Dumez.
2465 Order build requests preferring user created ones over ones automatically created by detect-changes.js.
2467 Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new
2468 build request on a builder/slave even when we had previously scheduled another build request.
2470 * public/include/build-requests-fetcher.php:
2471 (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on
2472 author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js.
2473 Since we're using ascending order, this would put user created test groups first.
2474 * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case
2475 for testing that build requests for an user created test group shows up first.
2476 * server-tests/resources/mock-data.js:
2477 (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name.
2478 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests
2479 for an user created test group shows up first.
2480 * tools/js/buildbot-syncer.js:
2481 (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already
2482 scheduled new build requests. Don't schedule more requests on these slaves.
2483 (BuildbotSyncer.prototype.scheduleRequest):
2484 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null
2485 when slaveList is not specified) to _slavesWithNewRequests.
2486 (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request
2487 we have previously scheduled should be included in one of the entires now.
2488 * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug.
2489 (sampleiOSConfig): Added a second slave for new test cases.
2491 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
2493 Migrate legacy perf dashboard tests to mocha.js based tests
2494 https://bugs.webkit.org/show_bug.cgi?id=156335
2496 Reviewed by Chris Dumez.
2498 Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise
2499 for most of asynchronous operations, refactored the tests to use Promises as well, and added more
2500 assertions where appropriate.
2502 Also consolidated common helper functions into server-tests/resources/common-operations.js.
2503 Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were
2504 taking an array of reports while others were taking a single report. New shared implementation in
2505 common-operations.js now takes a single report.
2507 Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout.
2508 Most of tests are passing under 100ms on my computer so 1s should be plenty still.
2510 * run-tests.js: Removed.
2511 * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js.
2512 (reportsForDifferentPlatforms):
2513 * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js.
2514 (.addBuilder): Moved to common-operations.js.
2515 * server-tests/api-build-requests-tests.js:
2516 * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps.
2517 * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js.
2518 (.queryPlatformAndMetric):
2520 * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js.
2521 * server-tests/api-report-tests.js: Moved from tests/api-report.js.
2523 (.emptySlaveReport):
2524 (.reportWithSameSubtestName):
2525 * server-tests/resources/common-operations.js: Added.
2526 (addBuilderForReport): Extracted from tests.
2527 (addSlaveForReport): Ditto.
2528 (connectToDatabaseInEveryTest): Added.
2529 (submitReport): Extracted from admin-platforms-tests.js.
2530 * server-tests/resources/test-server.js:
2531 (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start
2532 its own Apache instance (that would certainly will fail).
2533 * server-tests/tools-buildbot-triggerable-tests.js:
2535 * tools/js/database.js:
2536 (Database.prototype.selectAll): Added.
2537 (Database.prototype.selectFirstRow): Added.
2538 (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments.
2540 2016-04-05 Ryosuke Niwa <rniwa@webkit.org>
2542 New buildbot syncing scripts that supports multiple builders and slaves
2543 https://bugs.webkit.org/show_bug.cgi?id=156269
2545 Reviewed by Chris Dumez.
2547 Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves.
2548 The old python script (sync-with-buildbot.py) could only support a single builder and slave
2549 for each platform, test pair.
2551 The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added
2552 throughout the codebase and tests have been refactored.
2554 BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible
2555 for syncing everything on each builder (on a buildbot).
2557 Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored
2558 test helpers and mocks as needed.
2560 * public/v3/models/build-request.js:
2561 (BuildRequest.prototype.status): Added.
2562 (BuildRequest.prototype.isScheduled): Added.
2563 * public/v3/models/metric.js:
2564 (Metric.prototype.fullName): Added.
2565 * public/v3/models/platform.js:
2566 (Platform): Added the map based on platform name.
2567 (Platform.findByName): Added.
2568 * public/v3/models/test.js:
2569 (Test.topLevelTests):
2570 (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would
2571 find the test whose name is "B" which has a parent test named "A".
2572 (Test.prototype.fullName): Added.
2573 * server-tests/api-build-requests-tests.js:
2574 (addMockData): Moved to resources/mock-data.js.
2575 (addAnotherMockTestGroup): Ditto.
2576 * server-tests/resources/mock-data.js: Added.
2577 (MockData.resetV3Models): Added.
2578 (MockData.addMockData): Moved from api-build-requests-tests.js.
2579 (MockData.addAnotherMockTestGroup): Ditto.
2580 (MockData.mockTestSyncConfigWithSingleBuilder): Added.
2581 (MockData.mockTestSyncConfigWithTwoBuilders): Added.
2582 (MockData.pendingBuild): Added.
2583 (MockData.runningBuild): Added.
2584 (MockData.finishedBuild): Added.
2585 * server-tests/resources/test-server.js:
2587 (TestServer.prototype.remoteAPI):
2588 (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit.
2589 (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever.
2590 (TestServer.prototype._waitForPid): Increase the timeout.
2591 (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards.
2592 * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce.
2593 (MockLogger): Added.
2594 (MockLogger.prototype.log): Added.
2595 (MockLogger.prototype.error): Added.
2596 * tools/detect-changes.js:
2597 (parseArgument): Moved to js/parse-arguments.js.
2598 * tools/js/buildbot-syncer.js:
2599 (BuildbotBuildEntry):
2600 (BuildbotBuildEntry.prototype.syncer): Added.
2601 (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status
2602 for a build request (of the matching build request ID) if it needs to be updated in the server.
2603 (BuildbotSyncer): This class
2604 (BuildbotSyncer.prototype.addTestConfiguration): Added.
2605 (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations.
2606 (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on
2608 (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request.
2609 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for
2610 the specified build request on the first slave that's available.
2611 (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object.
2612 Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it.
2613 (BuildbotSyncer.prototype._pullRecentBuilds):
2614 (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now
2615 only returns the path instead of the full URL since RemoteAPI takes a path, not full URL.
2616 (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON.
2617 (BuildbotSyncer.prototype.pathForForceBuild): Added.
2618 (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL.
2619 (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
2620 (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test
2621 configurations associated with it, find the one matching for this request.
2622 (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it.
2623 (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of
2624 slave names present on this builder.
2625 * tools/js/buildbot-triggerable.js: Added.
2626 (BuildbotTriggerable): Added.
2627 (BuildbotTriggerable.prototype.name): Added.
2628 (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls
2629 existing build requests from the perf dashboard, pulls buildbot for pending and running/completed
2630 builds on each builder (represented by each syncer), schedules build requests on buildbot if there
2631 is any builder/slave available, and updates the status of build requests in the database.
2632 (BuildbotTriggerable.prototype._validateRequests): Added.
2633 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added.
2634 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added.
2635 (BuildbotTriggerable._testGroupMapForBuildRequests): Added.
2636 * tools/js/database.js:
2637 * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js.
2639 * tools/js/remote.js:
2640 (RemoteAPI): Now optionally takes the server configuration.
2641 (RemoteAPI.prototype.url): Added.
2642 (RemoteAPI.prototype.getJSON): Removed the code for specifying request content.
2643 (RemoteAPI.prototype.getJSONWithStatus): Ditto.
2644 (RemoteAPI.prototype.postJSON): Added.
2645 (RemoteAPI.prototype.postFormUrlencodedData): Added.
2646 (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth.
2647 * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host.
2648 * tools/sync-buildbot.js: Added.
2649 (main): Added. Parse the arguments and start the loop.
2651 * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as
2652 scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed.
2654 (smallConfiguration): Added.
2655 (smallPendingBuild): Added.
2656 (smallInProgressBuild): Added.
2657 (smallFinishedBuild): Added.
2658 (createSampleBuildRequest): Create a unique build request for each platform.
2659 (samplePendingBuild): Optionally specify build time and slave name.
2660 (sampleInProgressBuild): Optionally specify slave name.
2661 (sampleFinishedBuild): Ditto.
2662 * unit-tests/resources/mock-remote-api.js:
2663 (assert.notReached.assert.notReached):
2664 (MockRemoteAPI.url): Added.
2665 (MockRemoteAPI.postFormUrlencodedData): Added.
2666 (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus.
2667 (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we
2668 need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI.
2669 (MockRemoteAPI.inject):
2670 (MockRemoteAPI.reset): Added.
2672 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
2674 Simplify API of Test model by removing Test.setParentTest
2675 https://bugs.webkit.org/show_bug.cgi?id=156055
2677 Reviewed by Joseph Pecoraro.
2679 Removed Test.setParentTest. Keep track of the child-parent relationship using the static map instead.
2681 Now each test only stores parent's id and uses the ID static map in Test.parentTest().
2683 * public/v3/models/manifest.js:
2684 (Manifest._didFetchManifest.buildObjectsFromIdMap): Removed the code to create the map of child-parent
2685 relationship and call setParentTest.
2686 * public/v3/models/test.js:
2687 (Test): Updated a static map by the name of "childTestMap" to store itself. We should probably sort
2688 child tests using some fixed criteria in the future instead of relying on the creation order but
2689 preserve the old code's ordering for now.
2690 (Test.prototype.parentTest): Look up the static map by the parent test's id.
2691 (Test.prototype.onlyContainsSingleMetric):
2692 (Test.prototype.setParentTest): Deleted.
2693 (Test.prototype.childTests): Look up the child test map.
2695 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
2697 BuildRequest should have associated platform and test
2698 https://bugs.webkit.org/show_bug.cgi?id=156054
2700 Reviewed by Joseph Pecoraro.
2702 Added methods to retrieve the platform and the test associated with a build request with tests.
2704 * public/v3/models/build-request.js:
2706 (BuildRequest.prototype.platform): Added.
2707 (BuildRequest.prototype.test): Added.
2708 * server-tests/api-build-requests-tests.js:
2709 * server-tests/api-manifest.js: Fixed a typo. This tests /api/manifest, not /api/build-requests.
2710 * unit-tests/buildbot-syncer-tests.js:
2711 (.createSampleBuildRequest): Now takes Platform and Test objects to avoid hitting assertions in
2712 BuildRequest's constructor.
2714 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
2716 BuildRequest should have a method to fetch all in-progress and pending requests for a triggerable
2717 https://bugs.webkit.org/show_bug.cgi?id=156008
2719 Reviewed by Darin Adler.
2721 Add a method to BuildRequest that fetches all pending and in-progress requests for a triggerable.
2723 Now, new syncing scripts must be able to figure out the build slave the first build requests in
2724 a given test group had used in order to schedule subsequent build requests in the test group.
2726 For this purpose, /api/build-requests has been modified to return all build requests whose test
2727 group had not finished yet. A test group is finished if all build requests in the test group had
2728 finished (completed, failed, or canceled).
2730 * public/include/build-requests-fetcher.php:
2731 (BuildRequestFetcher::fetch_incomplete_requests_for_triggerable): Return all build requests in test
2732 groups that have not been finished.
2733 * public/v3/models/build-request.js:
2735 (BuildRequest.prototype.testGroupId): Added.
2736 (BuildRequest.prototype.isPending): Renamed from hasPending to fix a bad grammar.
2737 (BuildRequest.fetchForTriggerable): Added.
2738 (BuildRequest.constructBuildRequestsFromData): Extracted from _createModelsFromFetchedTestGroups in
2740 * public/v3/models/manifest.js:
2741 (Manifest.fetch): Use the full path from root so that it works in server tests.
2742 * public/v3/models/test-group.js:
2743 (TestGroup.hasPending):
2744 (TestGroup._createModelsFromFetchedTestGroups):
2745 * server-tests/api-build-requests-tests.js: Added tests to ensure all build requests for a test group
2746 is present in the response returned by /api/build-requests iff any build request in the group had not
2749 (.addAnotherMockTestGroup): Added.
2750 * unit-tests/test-groups-tests.js:
2752 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
2754 Make dependency injection in unit tests more explicit
2755 https://bugs.webkit.org/show_bug.cgi?id=156006
2757 Reviewed by Joseph Pecoraro.
2759 Make the dependency injection of model objects in unit tests explicit so that server tests that create
2760 "real" model objects won't create these mock objects. Now each test that uses mock model objects would call
2761 MockModels.inject() to inject before / beforeEach and access each object using a property on MockModels
2762 instead of them being implicitly defined on the global object.
2764 Similarly, MockRemoteAPI now only replaces global.RemoteAPI during each test so that server tests can use
2765 real RemoteAPI to access the test Apache server.
2767 * unit-tests/analysis-task-tests.js:
2768 * unit-tests/buildbot-syncer-tests.js:
2769 (createSampleBuildRequest):
2770 * unit-tests/measurement-adaptor-tests.js:
2771 * unit-tests/measurement-set-tests.js:
2772 * unit-tests/resources/mock-remote-api.js:
2773 (MockRemoteAPI.getJSONWithStatus):
2774 (MockRemoteAPI.inject): Added. Override RemoteAPI on the global object during each test.
2775 * unit-tests/resources/mock-v3-models.js:
2776 (MockModels.inject): Added. Create mock model objects before each test, and clear all static maps of
2777 various v3 model classes (to remove all singleton objects for those model classes).
2778 * unit-tests/test-groups-tests.js:
2780 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
2782 BuildbotSyncer should be able to fetch JSON from buildbot
2783 https://bugs.webkit.org/show_bug.cgi?id=155921
2785 Reviewed by Joseph Pecoraro.
2787 Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot
2788 with lots of unit tests as this has historically been a source of subtle bugs in the old script.
2790 New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that
2791 the state of some builds may change between each HTTP request. In the old script, we fetched the list
2792 of the pending builds, and requested -1, -2, etc... builds for N times. But between each request,
2793 a pending build may start running or an in-progress build finish and shift the offset by one. The new
2794 script avoids this problem by first requesting all pending builds, then all in-progress and finished
2795 builds in a single HTTP request. The results are then merged so that entries for in-progress and
2796 finished builds would override the entries for pending builds if they overlap.
2798 Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes
2799 the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js).
2801 * server-tests/api-build-requests-tests.js:
2802 * server-tests/api-manifest.js:
2803 * tools/js/buildbot-syncer.js:
2804 (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as
2805 we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished
2806 builds as 'currentStep' is always defined but null in those builds.
2807 (BuildbotBuildEntry.prototype.buildNumber): Added.
2808 (BuildbotBuildEntry.prototype.isPending): Added.
2809 (BuildbotBuildEntry.prototype.hasFinished): Added.
2810 (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds.
2811 (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds.
2812 (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added.
2813 (BuildbotSyncer.prototype.urlForBuildJSON): Added.
2814 (BuildbotSyncer.prototype.url): Added.
2815 (BuildbotSyncer.prototype.urlForBuildNumber): Added.
2816 * tools/js/remote.js:
2817 (RemoteAPI.prototype.getJSON): Renamed from fetchJSON.
2818 (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus.
2819 * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node.
2820 * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot
2821 (samplePendingBuild):
2822 (sampleInProgressBuild): Added.
2823 (sampleFinishedBuild): Added.
2824 * unit-tests/resources/mock-remote-api.js:
2825 (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus.
2827 2016-03-24 Ryosuke Niwa <rniwa@webkit.org>
2829 Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code
2830 https://bugs.webkit.org/show_bug.cgi?id=155863
2832 Reviewed by Joseph Pecoraro.
2834 Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability
2835 added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed
2836 /admin/regenerate-manifest since it has been superseded by /api/manifest.
2838 This patch also extracts manifest.js out of main.js so that it could be used and tested without the
2839 DOM support in node.
2841 * public/admin/regenerate-manifest.php: Deleted.
2842 * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with
2843 a trailing backslash.
2844 * public/include/manifest.php:
2845 (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories.
2846 * public/v3/index.html:
2847 * public/v3/main.js:
2849 * public/v3/models/bug-tracker.js:
2850 (BugTracker.prototype.newBugUrl): Added.
2851 (BugTracker.prototype.repositories): Added.
2852 * public/v3/models/manifest.js: Added. Extracted from main.js.
2853 (Manifest.fetch): Moved from main.js' fetchManifest.
2854 (Manifest._didFetchManifest): Moved from main.js' didFetchManifest.
2855 * public/v3/models/platform.js:
2856 (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of
2857 the same name. This is tested by the newly added test cases.
2858 * server-tests/api-build-requests-tests.js:
2859 * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js
2860 with additional assertions for v3 UI model objects.
2861 * server-tests/resources/test-server.js:
2862 (TestServer.prototype.start):
2863 (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API.
2864 Also no longer takes dataDirectory as an argument since it's always the same.
2865 (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data.
2866 (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests.
2867 (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an
2868 unintended side effect of slowing down unit tests even through they don't need Postgres or Apache.
2869 * tests/admin-regenerate-manifest.js: Removed.
2870 * tools/js/database.js:
2871 * tools/js/v3-models.js:
2873 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
2875 Add mocha server tests for /api/build-requests
2876 https://bugs.webkit.org/show_bug.cgi?id=155831
2878 Reviewed by Chris Dumez.
2880 Added the new mocha.js based server-tests for /api/build-requests. The new harness automatically:
2881 - starts a new Apache instance
2882 - switches the database during testing via setting an environmental variable
2883 - backups and restores public/data directory during testing
2885 As a result, developer no longer has to manually setup Apache, edit config.json manually to use
2886 a testing database, or run /api/manifest.php to re-generate the manifest file after testing.
2888 This patch also makes ID resolution optional on /api/build-requests so that v3 model based syncing
2889 scripts can re-use the same code as the v3 UI to process the JSON. tools/sync-with-buildbot.py has
2890 been modified to use this option (useLegacyIdResolution).
2892 * config.json: Added configurations for the test httpd server.
2893 * init-database.sql: Don't error when tables and types don't exist (when database is empty).
2894 * public/api/build-requests.php:
2895 (main): Made the ID resolution optional with useLegacyIdResolution. Also removed "updates" from the
2896 results JSON since it's never used.
2897 * public/include/build-requests-fetcher.php:
2898 (BuildRequestsFetcher::__construct):
2899 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Fixed the bug that we would include the same
2900 commit multiple times for each root set.
2901 * public/include/db.php:
2902 (config): If present, use ORG_WEBKIT_PERF_CONFIG_PATH instead of Websites/perf.webkit.org/config.json.
2903 * server-tests: Added.
2904 * server-tests/api-build-requests-tests.js: Added. Tests for /api/build-requests.
2906 * server-tests/resources: Added.
2907 * server-tests/resources/test-server.conf: Added. Apache configuration file for testing.
2908 * server-tests/resources/test-server.js: Added.
2910 (TestSever.prototype.start): Added.
2911 (TestSever.prototype.stop): Added.
2912 (TestSever.prototype.remoteAPI): Added. Configures RemoteAPI to be used with the test sever.
2913 (TestSever.prototype.database): Added. Returns Database configured to use the test database.
2914 (TestSever.prototype._constructTestConfig): Creates config.json for testing. The file is generated by
2915 _start and db.php's config() reads it from the environmental variable: ORG_WEBKIT_PERF_CONFIG_PATH.
2916 (TestSever.prototype._ensureDataDirectory): Renames public/data to public/original-data if exists,
2917 and creates a new empty public/data.
2918 (TestSever.prototype._restoreDataDirectory): Deletes public/data and renames public/original-data
2919 back to public/data.
2920 (TestSever.prototype._ensureTestDatabase): Drops the test database if exists and creates a new one.
2921 (TestSever.prototype.initDatabase): Run init-database.sql to start each test with a consistent state.
2922 (TestSever.prototype._executePgsqlCommand): Executes a postgres command line tool such as psql.
2923 (TestSever.prototype._determinePgsqlDirectory): Finds the directory that contains psql.
2924 (TestSever.prototype._startApache): Starts an Apache instance for testing.
2925 (TestSever.prototype._stopApache): Stops the Apache instance for testing.
2926 (TestSever.prototype._waitForPid): Waits for the Apache pid file to appear or disappear.
2927 (before): Start the test server at the beginning.
2928 (beforeEach): Re-initialize all tables before each test.
2929 (after): Stop the test server at the end.
2930 * tools/js/config.js:
2931 (Config.prototype.path):
2932 (Config.prototype.serverRoot): Added. The path to Websites/perf.webkit.org/public/.
2933 (Config.prototype.pathFromRoot): Added. Resolves a path from Websites/perf.webkit.org.
2934 * tools/js/database.js:
2935 (Database): Now optionally takes the database name to use a different database during testing.
2936 (Database.prototype.connect):
2937 (Database.prototype.query): Added.
2938 (Database.prototype.insert): Added.
2939 (tableToPrefixMap): Maps table name to its prefix. Used by Database.insert.
2940 * tools/js/remote.js: Added.
2941 (RemoteAPI): Added. This is node.js equivalent of RemoteAPI in public/v3/remote.js.
2942 (RemoteAPI.prototype.configure): Added.
2943 (RemoteAPI.prototype.fetchJSON): Added.
2944 (RemoteAPI.prototype.fetchJSONWithStatus): Added.
2945 (RemoteAPI.prototype.sendHttpRequest): Added.
2946 * tools/sync-with-buildbot.py:
2947 (main): Use useLegacyIdResolution as this script relies on the legacy behavior.
2948 * unit-tests/checkconfig.js: pg was never directly used in this test.
2950 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
2952 Delete a file that was supposed to be removed in r198614 for real.
2954 * unit-tests/resources/v3-models.js: Removed.
2956 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
2958 Add a model for parsing buildbot JSON with unit tests
2959 https://bugs.webkit.org/show_bug.cgi?id=155814
2961 Reviewed by Joseph Pecoraro.
2963 Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests.
2964 They will be used in the new syncing scripts to improve A/B testing.
2966 * public/v3/models/build-request.js:
2968 * tools/js/buildbot-syncer.js: Added.
2969 (BuildbotBuildEntry): Added.
2970 (BuildbotBuildEntry.prototype.slaveName): Added.
2971 (BuildbotBuildEntry.prototype.buildRequestId): Added.
2972 (BuildbotBuildEntry.prototype.isInProgress): Added.
2973 (BuildbotSyncer): Added.
2974 (BuildbotSyncer.prototype.testPath): Added.
2975 (BuildbotSyncer.prototype.builderName): Added.
2976 (BuildbotSyncer.prototype.platformName): Added.
2977 (BuildbotSyncer.prototype.fetchPendingRequests): Added.
2978 (BuildbotSyncer.prototype._propertiesForBuildRequest): Added.
2979 (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added.
2980 (BuildbotSyncer._loadConfig): Added.
2981 (BuildbotSyncer._validateAndMergeConfig): Added.
2982 (BuildbotSyncer._validateAndMergeProperties): Added.
2983 * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js.
2984 (beforeEach): Deleted since this only defined inside mocha.
2985 * unit-tests/analysis-task-tests.js:
2986 * unit-tests/buildbot-syncer-tests.js: Added.
2988 (createSampleBuildRequest):
2989 (.smallConfiguration):
2990 * unit-tests/measurement-adaptor-tests.js:
2991 * unit-tests/measurement-set-tests.js:
2992 * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js.
2994 * unit-tests/test-groups-tests.js:
2997 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
2999 Add unit tests for test-group.js
3000 https://bugs.webkit.org/show_bug.cgi?id=155781
3002 Reviewed by Joseph Pecoraro.
3004 Added unit tests for test-group.js that would have caught regressions fixed in r198503.
3006 * public/v3/components/chart-pane-base.js:
3007 (ChartPaneBase.prototype._renderAnnotations): Added a forgotten break statement.
3008 * public/v3/models/build-request.js:
3009 (BuildRequest.prototype.setResult):
3011 * public/v3/models/test-group.js:
3012 * unit-tests/measurement-set-tests.js: Use ./resources/v3-models.js to reduce the code duplication.
3013 * unit-tests/resources/v3-models.js: Import more stuff from v3 models.
3015 * unit-tests/test-groups-tests.js: Added. Added some unit tests for TestGroup.
3017 (.testGroupWithStatusList):
3019 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
3025 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
3027 Commit log viewer repaints too frequently after r198499
3028 https://bugs.webkit.org/show_bug.cgi?id=155732
3030 Reviewed by Joseph Pecoraro.
3032 The bug was caused by InteractiveTimeSeriesChart invoking onchange callback whenever mouse moved even
3033 if the current point didn't change. Fixed the bug by avoiding the work if the indicator hadn't changed
3034 and avoiding work in the commit log viewer when the requested repository and the revision range were
3035 the same as those of the last request.
3037 * public/v3/components/commit-log-viewer.js:
3039 (CommitLogViewer.prototype.currentRepository): Exit early when repository and the revision range are
3040 identical to the one we already have to avoid repaints and issuing multiple network requests.
3041 * public/v3/components/interactive-time-series-chart.js:
3042 (InteractiveTimeSeriesChart.prototype._mouseMove): Don't invoke _notifyIndicatorChanged if the current
3043 indicator hadn't changed.
3044 * public/v3/pages/chart-pane.js:
3045 (ChartPane.prototype._indicatorDidChange): Fixed the bug that unlocking the indicator wouldn't update
3046 the URL. We need to check whether the lock state had changed. The old condition was also redundant
3047 since _mainChartIndicatorWasLocked is always identically equal to isLocked per the prior assignment.
3049 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
3051 Fix A/B testing after r198503.
3053 * public/include/build-requests-fetcher.php:
3055 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
3057 Analysis task page is broken after r198479
3058 https://bugs.webkit.org/show_bug.cgi?id=155735
3060 Rubber-stamped by Chris Dumez.
3062 * public/api/measurement-set.php:
3063 (AnalysisResultsFetcher::fetch_commits): We need to emit the commit ID as done for regular data.
3064 * public/include/build-requests-fetcher.php:
3065 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Ditto. Don't use a fake ID after r198479.
3066 * public/v3/models/commit-log.js:
3067 (CommitLog): Assert that all commit log IDs are integers to catch regressions like this in future.
3068 * public/v3/models/root-set.js:
3069 (RootSet): Don't resolve Repository here as doing so would modify the shared "root" entry in the JSON
3070 we fetched, and subsequent construction of RootSet would fail since this line would blow up trying to
3071 find the repository with "[object]" as the ID.
3072 * public/v3/models/test-group.js:
3073 (TestGroup._createModelsFromFetchedTestGroups): Resolve Repository here.
3075 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
3077 v3 UI sometimes don't update the list of revisions on the commit log viewer
3078 https://bugs.webkit.org/show_bug.cgi?id=155729
3080 Rubber-stamped by Chris Dumez.
3082 Fixed multiple bugs that were affecting the list of blame range and commit logs for the range weren't
3083 updated in some cases on v3 UI. Also, the commit log viewer state is now a part of the URL state so
3084 opening and closing the commit log viewer will persist across page loads.
3086 Also fixed a regression from r198479 that Test object can't be created for a top level test.
3088 * public/v3/components/chart-pane-base.js:
3089 (ChartPaneBase.prototype.configure):
3090 (ChartPaneBase.prototype._mainSelectionDidChange): Fixed the bug that the list of blame range nor the
3091 commit log viewer don't get updated when the selected range changes.