1 2016-07-19 Ryosuke Niwa <rniwa@webkit.org>
3 Perf dashboard always re-generate measurement set JSON
4 https://bugs.webkit.org/show_bug.cgi?id=159951
6 Reviewed by Chris Dumez.
8 The bug was caused by manifest.json reporting the last modified date of a measurement set in floating point,
9 and a measurement set JSON reporting it as an integer. Fixed the bug by always using an integer.
11 * public/api/measurement-set.php:
12 (main): Return 404 when the results is empty.
13 (MeasurementSetFetcher::execute_query): Use "extract(epoch from commit_time)" like ManifestGenerator to improve
14 the generation speed. This is ~10% runtime improvement.
15 (MeasurementSetFetcher::format_map): Updated to reflect the above change.
16 (MeasurementSetFetcher::parse_revisions_array): Ditto.
18 * public/include/manifest.php:
19 (ManifestGenerator::platforms): Fixed the bug by coercing lastModified to integer (instead of float).
21 * server-tests/api-measurement-set-tests.js: Added a test case for returning empty results, and a test case for
22 making sure lastModified dates in manifest.json and measurement sets match.
25 (RemoteAPI.prototype.sendHttpRequest): Reject the promise when HTTP status code is not 200.
27 2016-07-09 Ryosuke Niwa <rniwa@webkit.org>
29 Perf dashboard can consume 50-70% of CPU on MacBook even if user is not interacting at all
30 https://bugs.webkit.org/show_bug.cgi?id=159597
32 Reviewed by Chris Dumez.
34 TimeSeriesChart and InteractiveTimeSeriesChart had been relying on continually polling on requestAnimationFrame
35 to update itself in response to its canvas resizing. Even though there as an early exit in the case there was
36 nothing to update, this is still causing a significant power drain when the user is not interacting at all.
38 Let TimeSeriesChart use the regular top-down render path like other components with exceptions of listening to
39 window's resize eventas well as when new JSONs are fetched from the server. The render() call to the latter case
40 will be coerced into a single callback on requestAnimationFrame to avoid DOM-mutation-layout churn.
42 * public/v3/components/base.js:
43 (ComponentBase.isElementInViewport): Deleted.
44 * public/v3/components/chart-pane-base.js:
45 (ChartPaneBase.prototype.render): Enqueue charts to render.
46 * public/v3/components/chart-styles.js:
47 (ChartStyles.dashboardOptions): Removed updateOnRequestAnimationFrame which is no longer an available option.
48 * public/v3/components/time-series-chart.js:
49 (TimeSeriesChart): Replaced the code to register itself for rAF by the code to listen to resize events on window.
50 (TimeSeriesChart._updateOnRAF): Deleted.
51 (TimeSeriesChart._updateAllCharts): Added.
52 (TimeSeriesChart.prototype._enqueueToRender): Added.
53 (TimeSeriesChart._renderEnqueuedCharts): Added.
54 (TimeSeriesChart.prototype.fetchMeasurementSets): Avoid calling fetchBetween when the range had been fetched.
55 Without this change, we can incur a significant number of redundant calls to render() when adjusting the domain
56 in charts page by the slider. When no new JSON is fetched, simply enqueue this chart to render on rAF.
57 (TimeSeriesChart.prototype._didFetchMeasurementSet): Enqueue this chart to render on rAF.
58 (TimeSeriesChart.prototype.render): Removed the check for isElementInViewport since we no longer get render() call
59 when this chart moves into the viewport (as we no longer listen to every rAF or scroll event).
60 * public/v3/models/measurement-set.js:
61 (MeasurementSet.prototype.hasFetchedRange): Fixed various bugs revealed by the new use in fetchMeasurementSets.
62 * public/v3/pages/chart-pane-status-view.js:
63 (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Removed the dead code. It was probably
64 copied from when this code was in InteractiveTimeSeries chart. There is no this._forceRender in this component.
65 * public/v3/pages/dashboard-page.js:
66 (DashboardPage.prototype.render): Enqueue charts to render.
67 * public/v3/pages/heading.js:
68 (SummaryPage.prototype.open): Removed the call to isElementInViewport. This wasn't really doing anything useful in
70 * unit-tests/measurement-set-tests.js: Added tests for hasFetchedRange.
71 (.waitForMeasurementSet): Moved to be used in a newly added test case.
73 2016-07-09 Ryosuke Niwa <rniwa@webkit.org>
75 REGRESSION: manifest.json generation takes multiple seconds on perf dashboard
76 https://bugs.webkit.org/show_bug.cgi?id=159596
78 Reviewed by Chris Dumez.
80 The most of CPU time was spent looking for a duplicate entry in an array of metrics by array_search.
81 This patch moves to postgres by using aggregate functions in the query. Also moved the code to convert
82 datetime to UNIX epoch timestamp from PHP to within postgres query.
84 These improvements reduce total runtime of Manifest::generate from ~4s to ~350ms on my machine.
86 * public/include/manifest.php:
87 (Manifest::generate): No longer fetches test_configurations table as this is done in Manifest::platforms now.
88 Also moved calls to each method in the class to separate lines for easier instrumentation.
89 (Manifest::platforms): Group test configurations (current, baseline, target) by platform and metric.
90 Use the max of the last modified dates in UNIX epoch timestamps (ms to be compatible with JS's representation).
91 A given platform, metric pair is considered to be in the v1 dashboard if any test configuration is in.
93 2016-07-08 Ryosuke Niwa <rniwa@webkit.org>
95 bundle-v3-scripts.py should compress HTML/CSS templates
96 https://bugs.webkit.org/show_bug.cgi?id=159582
98 Reviewed by Joseph Pecoraro.
100 Strip leading and trailing whitespaces from HTML and CSS templates. This is a 8% progression on the file size.
102 * Install.md: Updated the list of MIME types to apply deflate for newer versions of Apache.
103 * tools/bundle-v3-scripts.py:
105 (compress_template): Added.
107 2016-06-13 Ryosuke Niwa <rniwa@webkit.org>
109 Build fix. Strip out "use strict" everywhere so that the perf dashboard works on the shipping Safari.
111 * tools/bundle-v3-scripts.py:
114 2016-06-13 Ryosuke Niwa <rniwa@webkit.org>
116 Invalid token error when trying to create an A/B analysis for a range
117 https://bugs.webkit.org/show_bug.cgi?id=158679
119 Reviewed by Chris Dumez.
121 The problem in this particular case was due to another website overriding cookies for our subdomain.
122 Make PrivilegedAPI robust against its token becoming invalid in general to fix the bug since the cookie
123 is only available under /privileged-api/ and the v3 UI can't access it for security reasons.
125 This patch factors out PrivilegedAPI out of remote.js so that it can be tested separately in server tests
126 as well as unit tests even though RemoteAPI itself is implemented differently in each case.
128 * init-database.sql: Added a forgotten default value "false" to run_marked_outlier.
129 * public/v3/index.html:
130 * public/v3/privileged-api.js: Added. Extracted out of public/v3/remote.js.
131 (PrivilegedAPI.sendRequest): Fixed the bug. When the initial request fails with "InvalidToken" error,
132 re-generate the token and re-issue the request.
133 (PrivilegedAPI.requestCSRFToken):
134 * public/v3/remote.js:
135 (RemoteAPI.postJSON): Added to match tools/js/remote.js.
136 (RemoteAPI.postJSONWithStatus): Ditto.
137 (PrivilegedAPI): Moved to privileged-api.js.
138 * server-tests/api-measurement-set-tests.js: Removed the unused require for crypto.
139 * server-tests/privileged-api-upate-run-status.js: Added tests for /privileged-api/update-run-status.
140 * server-tests/resources/test-server.js:
141 (TestServer.prototype.inject): Clear the cookies as well as tokens in PrivilegedAPI.
142 * tools/js/remote.js:
143 (RemoteAPI): Added the support for PrivilegedAPI by making cookie set by the server persist.
144 (RemoteAPI.prototype.clearCookies): Added for tests.
145 (RemoteAPI.prototype.postJSON): Make sure sendHttpRequest always sends a valid JSON.
146 (RemoteAPI.prototype.postJSONWithStatus): Added since this API is used PrivilegedAPI.
147 (RemoteAPI.prototype.sendHttpRequest): Retain the cookie set by the server and send it back in each request.
148 * tools/js/v3-models.js:
149 * unit-tests/privileged-api-tests.js: Added unit tests for PrivilegedAPI.
150 * unit-tests/resources/mock-remote-api.js:
151 (MockRemoteAPI.postJSON): Added for unit testing.
152 (MockRemoteAPI.postJSONWithStatus): Ditto.
154 2016-06-13 Ryosuke Niwa <rniwa@webkit.org>
156 /admin/tests is very slow
157 https://bugs.webkit.org/show_bug.cgi?id=158682
159 Reviewed by Chris Dumez.
161 The slowness came from TestNameResolver::__construct, which was fetching the entire table of test_configurations,
162 which at this point contains more than 32,000 rows. Don't fetch the entire table in the constructor. Instead,
163 fetch a subset of rows as needed in configurations_for_metric_and_platform. Even though this results in many SQL
164 queries being issued, that's a lot more efficient in practice because we only fetch a few dozen rows in practice.
166 Also removed a whole bunch of features from /admin/tests to simplify the page. In particular, the ability to update
167 the list of triggerables has been removed now that sync-buildbot.js automatically updates that for us. This removed
168 the last use of test_exists_on_platform, which was also dependent on fetching test_configurations upfront.
170 * public/admin/tests.php:
171 * public/include/test-name-resolver.php:
172 (TestNameResolver::__construct): Don't fetch the entire table of test_configurations.
173 (TestNameResolver::configurations_for_metric_and_platform): Just issue a SQL query for the specified platform and metric.
174 (TestNameResolver::test_exists_on_platform): Removed.
176 2016-06-08 Ryosuke Niwa <rniwa@webkit.org>
178 sync-buildbot.js should update the list of tests and platforms associated with a triggerable
179 https://bugs.webkit.org/show_bug.cgi?id=158406
181 Reviewed by Chris Dumez.
183 Add /api/update-triggerable and a test for it, which were supposed to be added in r201718
184 but for which I forgot to run svn add.
186 * public/api/update-triggerable.php: Added.
188 * server-tests/api-update-triggerable.js: Added.
190 2016-06-07 Ryosuke Niwa <rniwa@webkit.org>
192 Build fix after r201739. attachShadow was throwing an exception on this component.
194 * public/v3/pages/analysis-category-toolbar.js:
195 (AnalysisCategoryToolbar):
197 2016-06-06 Ryosuke Niwa <rniwa@webkit.org>
199 sync-buildbot.js should update the list of tests and platforms associated with a triggerable
200 https://bugs.webkit.org/show_bug.cgi?id=158406
201 <rdar://problem/26185737>
203 Reviewed by Darin Adler.
205 Added /api/update-triggerable to update the list of configurations (platform and test pairs)
206 associated with a given triggerable, and make sync-buildbot.js use this JSON API before each
207 syncing cycle so that the association gets updated automatically by simply updating the JSON.
209 * server-tests/api-manifest.js: Use const for imported modules.
210 * server-tests/api-report-commits-tests.js: Removed unnecessary importing of crypto.
211 * server-tests/resources/mock-data.js:
212 (MockData.someTestId): Added.
213 (MockData.somePlatformId): Added.
214 (MockData.addMockData):
215 * server-tests/tools-buildbot-triggerable-tests.js: Use const for imported modules. Also added
216 a test for BuildbotTriggerable's updateTriggerable.
217 * tools/js/buildbot-triggerable.js:
218 (BuildbotTriggerable.prototype.updateTriggerable): Added. Find the list of all configurations
219 associated with this triggeerable and post it to /api/update-triggerable.
220 * tools/js/database.js: Added triggerable_configurations to the list of tables.
221 * tools/js/remote.js:
222 (RemoteAPI.prototype.postJSON): Print the whole response when JSON parsing fails for debugging.
223 * tools/sync-buildbot.js:
224 (syncLoop): Call BuildbotTriggerable's updateTriggerable before syncing.
226 2016-06-02 Ryosuke Niwa <rniwa@webkit.org>
228 Build fix after r201564.
230 * public/v3/pages/analysis-category-page.js:
231 (AnalysisCategoryPage.prototype.updateFromSerializedState):
232 * public/v3/pages/create-analysis-task-page.js:
233 (CreateAnalysisTaskPage.prototype.updateFromSerializedState):
234 (CreateAnalysisTaskPage.prototype.render):
236 2016-05-31 Ryosuke Niwa <rniwa@webkit.org>
238 v3 UI should support marking and unmarking outliers as well as hiding them
239 https://bugs.webkit.org/show_bug.cgi?id=158248
241 Rubber-stamped by Chris Dumez.
243 Added the support for marking and unmarking a sequence of points as outliers. Unlike v2, we now support marking
244 multiple points as outliers in a single click. Also fixed a bug that outliers are never explicitly hidden in v3 UI.
246 This patch splits ChartStyles.createChartSourceList into two functions: resolveConfiguration and createSourceList
247 to separate the work of resolving platform and metric IDs to their respective model objects, and creating a source
248 list used by TimeSeriesChart to fetch measurement sets. createSourceList is called again when filtering options are
251 It also adds noCache option to TimeSeriesChart's fetchMeasurementSets, MeasurementSet's fetchBetween and
252 _fetchPrimaryCluster to update the measurement sets after marking or unmarking points as outliers. In addition, it
253 fixes a bug that the annotation bars for analysis tasks are not updated in charts page after creating an analysis
254 task by adding noCache option to ChartPaneBase's fetchAnalysisTasks, AnalysisTask's fetchByPlatformAndMetric and
257 Finally, this patch splits ChartPane._makeAnchorToOpenPane into _makePopoverActionItem, _makePopoverOpenOnHover and
258 _setPopoverVisibility for clarity.
260 * public/v3/components/chart-pane-base.js:
261 (ChartPaneBase): Added _disableSampling and _showOutliers as instance variables.
262 (ChartPaneBase.prototype.configure):
263 (ChartPaneBase.prototype.isSamplingEnabled): Added.
264 (ChartPaneBase.prototype.setSamplingEnabled): Added. When a filtering option is updated, recreate the source list
265 so that TimeSeriesChart.setSourceList can re-fetch the measurement set JSONs.
266 (ChartPaneBase.prototype.isShowingOutliers): Added.
267 (ChartPaneBase.prototype.setShowOutliers): Added. Ditto for calling _updateSourceList.
268 (ChartPaneBase.prototype._updateSourceList): Added.
269 (ChartPaneBase.prototype.fetchAnalysisTasks): Renamed from _fetchAnalysisTasks. Now takes noCache as an argument
270 instead of platform and metric IDs since they're on instance variables.
272 * public/v3/components/chart-styles.js:
273 (ChartStyles.resolveConfiguration): Renamed from createChartSourceList. Just resolves platform and metric IDs.
274 (ChartStyles.createSourceList): Extracted from createChartSourceList since it needs to be called when a filtering
275 option is changed as well as when ChartPaneBase.prototype.configure is called.
276 (ChartStyles.baselineStyle): Now takes filtering options.
277 (ChartStyles.targetStyle): Ditto.
278 (ChartStyles.currentStyle): Ditto.
280 * public/v3/components/interactive-time-series-chart.js:
281 (InteractiveTimeSeriesChart.prototype.currentPoint): Find the point in _fetchedTimeSeries when
282 _sampledTimeSeriesData hasn't been computed yet as a fallback (e.g. when the chart hasn't been rendered yet).
283 (InteractiveTimeSeriesChart.prototype.selectedPoints): Added.
284 (InteractiveTimeSeriesChart.prototype.firstSelectedPoint): Added.
285 (InteractiveTimeSeriesChart.prototype.lockedIndicator): Added. Returns the current point if it's locked.
287 * public/v3/components/time-series-chart.js:
288 (TimeSeriesChart.prototype.setDomain):
289 (TimeSeriesChart.prototype.setSourceList): Added. Re-create _fetchedTimeSeries when filtering options have changed.
290 Don't re-fetch measurement set JSONs here since showing outliers can be done entirely in the front end.
291 (TimeSeriesChart.prototype.fetchMeasurementSets): Extracted out of setDomain. Now takes noCache as an argument.
292 ChartPane._markAsOutlier
293 (TimeSeriesChart.prototype.firstSampledPointBetweenTime): Added.
295 * public/v3/models/analysis-task.js:
296 (AnalysisTask.fetchByPlatformAndMetric): Added noCache as an argument.
297 (AnalysisTask._fetchSubset): Ditto.
299 * public/v3/models/measurement-adaptor.js:
300 (MeasurementAdaptor.prototype.isOutlier): Added.
301 (MeasurementAdaptor.prototype.applyToAnalysisResults): Add markedOutlier as a property on each point.
303 * public/v3/models/measurement-cluster.js:
304 (MeasurementCluster.prototype.addToSeries): Fixed the bug that filtering outliers was broken as _markedOutlierIndex
305 is undefined here. Use MeasurementAdaptor's isOutlier instead.
307 * public/v3/models/measurement-set.js:
308 (MeasurementSet.prototype.fetchBetween): Added noCache as an argument. Reset _primaryClusterPromise and _allFetches
309 when noCache is true since we need to re-fetch the primary cluster as well as all secondary clusters now.
310 (MeasurementSet.prototype._fetchPrimaryCluster): Added noCache as an argument. Directly invoke the JSON API at
311 /api/measurement-set to re-generate all clusters' JSON files instead of first fetching the cached version.
312 (MeasurementSet.prototype._fetchSecondaryCluster):
313 (MeasurementSet.prototype._didFetchJSON): Removed a bogus assertion since this function is called on secondary
314 clusters as well as primary clusters.
315 (MeasurementSet.prototype._addFetchedCluster): Reimplemented this function using an insertion sort. Also remove the
316 existing entry if the fetch cluster should replace it.
318 * public/v3/models/time-series.js:
319 (TimeSeries.prototype.dataBetweenPoints): Removed the dead code to filter out outliers. This is done in addToSeries
320 of MeasurementCluster instead.
322 * public/v3/pages/chart-pane.js:
323 (ChartPane): Renamed pane to popover since it was confusing to have a pane inside a pane class. As such, renamed
324 _paneOpenedByClick to _lockedPopover.
325 (ChartPane.prototype.serializeState): Added the code to serialize filtering options in the serialized state URL.
326 (ChartPane.prototype.updateFromSerializedState): Ditto for parsing.
327 (ChartPane.prototype._analyzeRange): Extracted out of render(). Also fixed a bug that the charts page don't show
328 the newly created analysis task by invoking fetchAnalysisTasks with noCache set to true.
329 (ChartPane.prototype._markAsOutlier): Added.
330 (ChartPane.prototype._renderActionToolbar): A bunch of changes due to pane -> popover rename. Also added a popover
331 for filtering options.
332 (ChartPane.prototype._makePopoverActionItem): Extracted from _makeAnchorToOpenPane.
333 (ChartPane.prototype._makePopoverOpenOnHover): Ditto.
334 (ChartPane.prototype._setPopoverVisibility): Ditto.
335 (ChartPane.prototype._renderFilteringPopover): Added.
336 (ChartPane.htmlTemplate): Added a popover for specifying filtering options. Also added .popover on each popover.
337 (ChartPane.cssTemplate): Updated the style to make use of .popover.
339 * public/v3/pages/charts-page.js:
340 (ChartsPage.prototype.graphOptionsDidChange): Added. Updates the URL state when a filtering option is modified.
342 * public/v3/pages/dashboard-page.js:
343 (DashboardPage.prototype._createChartForCell):
345 * public/v3/pages/page-router.js:
346 (PageRouter.prototype._serializeHashQueryValue): Serialize a set of strings as | separated tokens.
347 (PageRouter.prototype._deserializeHashQueryValue): Rewrote the function as the serialized URL can no longer be
348 parsed as a JSON as | separated tokens can't be converted into a valid JSON construct with a simple regex.
350 * unit-tests/measurement-set-tests.js: Added a test case for fetchBetween with noCache=true.
352 2016-05-24 Ryosuke Niwa <rniwa@webkit.org>
354 Another build fix after r201307.
356 * public/v3/pages/page-router.js:
357 (PageRouter.prototype._deserializeHashQueryValue):
358 (PageRouter.prototype._countOccurrences): Moved from _deserializeHashQueryValue.
360 2016-05-23 Ryosuke Niwa <rniwa@webkit.org>
362 Build fix after r201307.
364 * public/v3/pages/chart-pane.js:
365 (ChartPane.prototype.serializeState):
367 2016-05-23 Ryosuke Niwa <rniwa@webkit.org>
369 Some applications truncates the last closing parenthesis in perf dashboard URL
370 https://bugs.webkit.org/show_bug.cgi?id=157976
372 Reviewed by Tim Horton.
374 Unfortunately, different applications use different heuristics to determine the end of each URL. Two trailing
375 parentheses, for example, is just fine in Radar as well as Apple Mail if the URL is short enough. Using other
376 characters such as ] and } wouldn't work either because they would be %-escaped. At that point, we might as well
377 as %-escape everything.
379 Work around the bug by parsing the URL as if it had one extra ')' if the parsing had failed. Also shorten the charts
380 page's URL by avoid emitting "-null" for each pane when the pane doesn't have a currently selected point or selection.
381 This improves the odds of the entire URL being recognized by various applications.
383 We could, in theory, implement some sort of a URL shorter but that can wait until when we support real user accounts.
385 * public/v3/pages/chart-pane.js:
386 (ChartPane.prototype.serializeState): Don't serialize the selection or the current point if nothing is selected.
387 * public/v3/pages/page-router.js:
388 (PageRouter.prototype._deserializeHashQueryValue): Try parsing the value again with one extra ] at the end if
389 the JSON parsing had failed.
391 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
393 Perf dashboard "Add pane" should list first by test, then by machine
394 https://bugs.webkit.org/show_bug.cgi?id=157880
396 Reviewed by Stephanie Lewis.
398 Reversed the order which tests and platforms are selected. Also split .pane-selector-container into #tests and
399 #platform for the ease of DOM node manipulations.
401 * public/v3/components/pane-selector.js:
403 (PaneSelector.prototype._renderPlatformList): Renamed from _renderPlatformLists since there is a single list
404 for platforms. This list now disappears while a non-metric item is selected in the collection of test lists.
405 e.g. "Speedometer" instead of its "Score" metric. Remember the last metric we rendered to avoid churning.
406 (PaneSelector.prototype._renderTestLists): Render the top level tests once. The index of lists have been
407 decreased by one since test lists are now inside #tests instead of appearing after the platform list.
408 (PaneSelector.prototype._buildTestList): Don't filter tests since platform is chosen after tests now.
409 (PaneSelector.prototype._replaceList):
410 (PaneSelector.prototype._selectedItem): Don't reset the test path (specifies which subtest or metric is picked)
411 when a platform is selected since it happens after a test metric is chosen now.
412 (PaneSelector.prototype._clickedItem): Add a pane when a platform is clicked, not when a metric is clicked.
413 (PaneSelector.cssTemplate):
415 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
417 Analysis task should look for a git commit based on abridged hashes
418 https://bugs.webkit.org/show_bug.cgi?id=157877
419 <rdar://problem/26254374>
421 Reviewed by Chris Dumez.
423 Made /privileged-api/associate-commit look for commits using LIKE instead of an exact match.
424 Associate the commit when there is exactly one match.
426 * public/include/commit-log-fetcher.php:
427 (CommitLogFetcher::fetch_between):
428 * public/include/db.php:
429 (Database::escape_for_like): Extracted from CommitLogFetcher::fetch_between.
430 * public/privileged-api/associate-commit.php:
431 (main): Look for the commits using LIKE. Reject whenever there are multiple commits. We limit the number of
432 matches to two for performance when the user specifies something that almost thousands of commits: e.g. "1".
433 * public/v3/pages/analysis-task-page.js:
434 (AnalysisTaskPage.prototype._associateCommit): Added human friendly error messages for mismatching commits.
436 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
438 Unreviewed build fix. Use --date-order so that every child commit appears after its parent.
439 Otherwise we'll hit a FailedToFindParentCommit error while submitting a commit that appears before its parent.
441 * tools/sync-commits.py:
442 (GitRepository._fetch_all_hashes):
444 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
446 Removed the erroneously committed debug code.
448 * tools/sync-commits.py:
449 (GitRepository.fetch_commit):
451 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
453 Perf dashboard should have a script to sync git commits
454 https://bugs.webkit.org/show_bug.cgi?id=157867
456 Reviewed by Chris Dumez.
458 Added the support to pull from a Git repo to pull-svn.py and renamed it to sync-commits.py.
460 Added two classes SVNRepository and GitRepository which inherits from an abstract class, Repository.
461 The code that fetches commit and format revision number / git hash is specialized in each.
464 * tools/pull-svn.py: Removed.
465 * tools/sync-commits.py: Renamed from Websites/perf.webkit.org/tools/pull-svn.py.
466 (main): Renamed --svn-config-json to --repository-config-json. Also made it robust against exceptions
467 inside fetch_commits_and_submit of each Repository class.
468 (load_repository): A factory function for SVNRepository and GitRepository.
470 (Repository.__init__): Added.
471 (Repository.fetch_commits_and_submit): Extracted from standalone fetch_commits_and_submit.
472 (Repository.fetch_commit): Added. Implemented by a subclass.
473 (Repository.format_revision): Ditto.
474 (Repository.determine_last_reported_revision): Extracted from alonealone
475 determine_first_revision_to_fetch. The fallback to use "oldest" has been moved to SVNRepository's
476 fetch_commit since it doesn't work in Git.
477 (Repository.fetch_revision_from_dasbhoard): Extracted from fetch_revision_from_dasbhoard.
478 (SVNRepository): Added.
479 (SVNRepository.__init__): Added.
480 (SVNRepository.fetch_commit): Extracted from standalone fetch_commit_and_resolve_author and fetch_commit.
481 (SVNRepository._resolve_author_name): Renamed from resolve_author_name_from_account.
482 (SVNRepository.format_revision): Added.
483 (GitRepository): Added.
484 (GitRepository.__init__):
485 (GitRepository.fetch_commit): Added. Fetches the list of all git hashes if needed, and finds the next hash.
486 (GitRepository._find_next_hash): Added. Finds the first commit that appears after the specified hash.
487 (GitRepository._fetch_all_hashes): Added. Gets the list of all git hashs chronologically (old to new).
488 (GitRepository._run_git_command): Added.
489 (GitRepository.format_revision): Added. Use the first 8 characters of the hash.
491 2016-05-17 Ryosuke Niwa <rniwa@webkit.org>
493 Add a subtitle under platform name in the summary page
494 https://bugs.webkit.org/show_bug.cgi?id=157809
496 Reviewed by Chris Dumez.
498 Add a description beneath the platform names.
500 * public/v3/pages/summary-page.js:
501 (SummaryPage.prototype._constructTable): Add a br and a span if subtitle is present.
502 (SummaryPage.cssTemplate): Added CSS rules for .subtitle.
504 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
506 v3 UI shows full git hash instead of the first 8 characters for a blame range
507 https://bugs.webkit.org/show_bug.cgi?id=157691
509 Reviewed by Stephanie Lewis.
511 Fixed the bug that v3 UI shows the full 40 character git hash instead of the first 8 character as done in v2 UI.
513 * public/v3/models/commit-log.js:
514 (CommitLog.prototype.diff): Fixed the bug.
515 * tools/run-tests.py:
516 (main): Add the support for running a subset of tests as mocha does.
517 * unit-tests/commit-log-tests.js: Added.
519 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
521 Unreviewed. Added the missing executable bits.
523 * tools/bundle-v3-scripts.py: Added property svn:executable.
524 * tools/detect-changes.js: Added property svn:executable.
525 * tools/process-maintenance-backlog.py: Added property svn:executable.
527 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
529 Summary page doesn't report some missing platforms
530 https://bugs.webkit.org/show_bug.cgi?id=157670
532 Reviewed by Darin Adler.
534 This patch improves the warning text for missing platforms and fixes the bug that platforms that don't have
535 any data reported for a given test would not be reported as missing.
537 * public/v3/pages/summary-page.js:
538 (SummaryPage.prototype.render): Added instrumentations.
539 (SummaryPage.prototype._constructRatioGraph): Always create both the ratio bar graph and the spinner icon.
540 (SummaryPage.prototype._renderCell): Extracted from _constructRatioGraph. Toggle the displayed-ness of the
541 spinner and the ratio bar graph in the cell by CSS for better performance.
542 (SummaryPage.prototype._warningTextForGroup): Extracted from _constructRatioGraph. Rephrased warning text
543 for clarity and adopted new API of SummaryPageConfigurationGroup.
544 (SummaryPage.prototype._warningTextForGroup.mapAndSortByName): Added.
545 (SummaryPage.prototype._warningTextForGroup.pluralizeIfNeeded): Added.
546 (SummaryPage.cssTemplate): Added rules to toggle the visibility of spinner icons and bar graphs.
547 (SummaryPageConfigurationGroup): Replaced this._warnings by more explicitly named this._missingPlatforms
548 and this._platformsWithoutBaseline. Also add a platform to this._missingPlatforms if it didn't appear in
549 any metrics. Note that adding a platform whenever it doesn't in any one metric would be incorrect since
550 some tests uses a different test name on different platforms: e.g. PLT-Mac and PLT-iPhone.
551 (SummaryPageConfigurationGroup.prototype.missingPlatforms): Added.
552 (SummaryPageConfigurationGroup.prototype.platformsWithoutBaseline): Added.
553 (SummaryPageConfigurationGroup.prototype._fetchAndComputeRatio):
555 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
557 Always use v3 UI for dashboards and analysis task pages
558 https://bugs.webkit.org/show_bug.cgi?id=157647
560 Reviewed by Darin Adler.
562 Redirect dashboard pages from v1 and v2 to v3's summary page. Also redirect v1 UI's charts page and v2 UI's
563 analysis task pages to the corresponding v3 pages.
565 Keep v2's charts page accessible since some features such as segmentation is still only available on v2 UI.
568 (init.showCharts): Redirect to v3 UI once the chart list has been parsed.
569 (init.redirectChartsToV3): Added.
570 * public/v2/index.html:
572 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
574 Show a spinner while fetching data on summary page
575 https://bugs.webkit.org/show_bug.cgi?id=157658
577 Reviewed by Darin Adler.
579 Show a spinner while fetching JSON files on the summary page.
581 * public/v3/components/base.js:
582 (ComponentBase.prototype.renderReplace): Added a new implementation that simply calls the static version.
583 (ComponentBase.renderReplace): Made this static.
585 * public/v3/pages/summary-page.js:
586 (SummaryPage.prototype._constructRatioGraph): Show a spinner icon when SummaryPageConfigurationGroup's
587 isFetching returns true.
588 (SummaryPage.cssTemplate): Force the height of each cell to be 2.5rem so that the height of cell doesn't
589 change when a spinner is replaced by a ratio bar graph.
591 (SummaryPageConfigurationGroup): Added this._isFetching as an instance variable.
592 (SummaryPageConfigurationGroup.prototype.isFetching): Added.
593 (SummaryPageConfigurationGroup.prototype.fetchAndComputeSummary): Set this._isFetching while waiting for
594 the promises to resolve after 50ms. We don't immediately set this._isFetching to avoid FOC when all JSON
595 files have been cached.
597 2016-05-07 Ryosuke Niwa <rniwa@webkit.org>
599 Add horizontal between categories of tests
600 https://bugs.webkit.org/show_bug.cgi?id=157386
602 Reviewed by Darin Adler.
604 Wrap tests in each category by tbody and add a horizontal bar between each category.
606 * public/v3/pages/summary-page.js:
607 (SummaryPage.prototype._constructTable):
608 (SummaryPage.cssTemplate):
610 2016-05-04 Dewei Zhu <dewei_zhu@apple.com>
612 Summary page should show warnings when current or baseline data is missing.
613 https://bugs.webkit.org/show_bug.cgi?id=157339
615 Reviewed by Ryosuke Niwa.
617 Set summary page to be the default page of v3 UI.
618 Show warning icon when either baseline or current data is missing.
619 Make fetchBetween returns a promise.
620 Update unit tests for MeasurementSet.fetchBetween since it returns a promise now.
621 Add a workaround to skip some platform and metric configurations.
623 * public/v3/components/ratio-bar-graph.js:
625 (RatioBarGraph.prototype.update): Add showWarningIcon flag to indicate whether we should show warning icon.
626 (RatioBarGraph.prototype.render): Show warning icon when showWarningIcon is true.
627 (RatioBarGraph.cssTemplate): Add style for warning icon.
628 * public/v3/components/warning-icon.js: Add warning icon.
630 (WarningIcon.cssTemplate):
631 * public/v3/index.html:
633 (main): Set summary page to be the default page of v3 UI.
634 * public/v3/models/measurement-set.js:
636 (MeasurementSet.prototype.fetchBetween): Returns a promise. Fix the bug in previous implementation that we miss
637 some callbacks sometimes. Basically, we will fetch primary cluster first, then secondary clusters. For each
638 secondary cluster fetch, we will always invoke callback even when it fails.
639 (MeasurementSet.prototype._fetchSecondaryClusters): Deleted.
640 (MeasurementSet.prototype._fetch.else.url.api.measurement.set platform): Deleted.
641 * public/v3/pages/summary-page.js:
642 (SummaryPage): Add a variable for excluded configurations.
643 (SummaryPage.prototype._createConfigurationGroup): Pass excluded configurations while building config groups.
644 (SummaryPage.prototype._constructTable): Remove the logic for unified header since it breaks consistency of the table appearance.
645 (SummaryPage.prototype.this._renderQueue.push): Show warning message when baseline/current data is missing.
646 (SummaryPageConfigurationGroup): Add a variable to keep track of the warnings while computing summary.
647 (SummaryPageConfigurationGroup.prototype.warnings): A getter for warnings.
648 (SummaryPageConfigurationGroup._computeSummary): Fix a bug in calculating ratios. We should always use
649 current/baseline for ratio and present the difference between ratio and 1 in the summary page.
650 (SummaryPageConfigurationGroup.set then): Deleted.
651 (SummaryPageConfigurationGroup.set var): Deleted.
652 * unit-tests/measurement-set-tests.js: Add a helper function to wait for fetchBetween. Update unit tests since fetchBetween returns a promise now.
653 (promise.set fetchBetween):
654 (set MeasurementSet):
655 (set fetchBetween): Deleted.
657 2016-04-26 Ryosuke Niwa <rniwa@webkit.org>
659 Chart status should always be computed against prior values
660 https://bugs.webkit.org/show_bug.cgi?id=157014
662 Reviewed by Darin Adler.
664 Compare the current value against the last baseline or target value that appear before the current value in time
665 so that the comparison stay the same even when new baseline and target values are reported. Also include the compared
666 baseline or target value in the label for clarity.
668 * public/v3/components/chart-status-view.js:
669 (ChartStatusView.prototype._computeChartStatus):
670 (ChartStatusView.prototype._computeChartStatus.labelForDiff):
671 (ChartStatusView.prototype._findLastPointPriorToTime): Extracted from _relativeDifferenceToLaterPointInTimeSeries.
672 Now finds the last point before the current point's time if there is any, or the last point in baseline / target.
673 (ChartStatusView.prototype._relativeDifferenceToLaterPointInTimeSeries): Deleted.
674 * public/v3/models/metric.js:
675 (Metric.prototype.makeFormatter): Don't use SI units for unit-less metrics.
677 2016-04-13 Ryosuke Niwa <rniwa@webkit.org>
679 REGRESSION(r199444): Perf dashboard always fetches all measurement sets
680 https://bugs.webkit.org/show_bug.cgi?id=156534
682 Reviewed by Darin Adler.
684 The bug was cased by SummaryPage's constructor fetching all measurement sets. Since each page is always
685 constructed in main(), this resulted in all measurement sets being fetched on all pages.
687 * public/v3/pages/summary-page.js:
689 (SummaryPage.prototype.open): Fetch measurement set JSONs here.
690 (SummaryPage.prototype._createConfigurationGroup): Renamed from _createConfigurationGroupAndStartFetchingData.
692 2016-04-12 Ryosuke Niwa <rniwa@webkit.org>
694 Add a summary page to v3 UI
695 https://bugs.webkit.org/show_bug.cgi?id=156531
697 Reviewed by Stephanie Lewis.
699 Add new "Summary" page, which shows the average difference (better or worse) from the baseline across
700 multiple platforms and tests by a single number.
702 * public/include/manifest.php:
703 (ManifestGenerator::generate): Include "summary" in manifest.json.
704 * public/shared/statistics.js:
705 (Statistics.mean): Added.
706 (Statistics.median): Added.
707 * public/v3/components/ratio-bar-graph.js: Added.
708 (RatioBarGraph): Shows a horizontal bar graph that visualizes the relative difference (e.g. 3% better).
709 (RatioBarGraph.prototype.update):
710 (RatioBarGraph.prototype.render):
711 (RatioBarGraph.cssTemplate):
712 (RatioBarGraph.htmlTemplate):
713 * public/v3/index.html:
715 (main): Instantiate SummaryPage and add it to the navigation bar and the router.
716 * public/v3/models/manifest.js:
717 (Manifest._didFetchManifest): Let "summary" pass through from manifest.json to main().
718 * public/v3/models/measurement-set.js:
719 (MeasurementSet.prototype._failedToFetchJSON): Invoke the callback with an error or true in order for
720 the callback can detect a failure.
721 (MeasurementSet.prototype._invokeCallbacks): Ditto.
722 * public/v3/pages/charts-page.js:
723 (ChartsPage.createStateForConfigurationList): Added to add a hyperlink from summary page to charts page.
724 * public/v3/pages/summary-page.js: Added.
725 (SummaryPage): Added.
726 (SummaryPage.prototype.routeName): Added.
727 (SummaryPage.prototype.open): Added.
728 (SummaryPage.prototype.render): Added.
729 (SummaryPage.prototype._createConfigurationGroupAndStartFetchingData): Added.
730 (SummaryPage.prototype._constructTable): Added.
731 (SummaryPage.prototype._constructRatioGraph): Added.
732 (SummaryPage.htmlTemplate): Added.
733 (SummaryPage.cssTemplate): Added.
734 (SummaryPageConfigurationGroup): Added. Represents a set of platforms and tests shown in a single cell.
735 (SummaryPageConfigurationGroup.prototype.ratio): Added.
736 (SummaryPageConfigurationGroup.prototype.label): Added.
737 (SummaryPageConfigurationGroup.prototype.changeType): Added.
738 (SummaryPageConfigurationGroup.prototype.configurationList): Added.
739 (SummaryPageConfigurationGroup.prototype.fetchAndComputeSummary): Added.
740 (SummaryPageConfigurationGroup.prototype._computeSummary): Added.
741 (SummaryPageConfigurationGroup.prototype._fetchAndComputeRatio): Added. Invoked for each time series in
742 the set, and stores the computed ratio of the current values to the baseline in this._setToRatio.
743 The results are aggregated by _computeSummary as a single number later.
744 (SummaryPageConfigurationGroup._medianForTimeRange): Added.
745 (SummaryPageConfigurationGroup._fetchData): A thin wrapper to make MeasurementSet.fetchBetween promise
746 friendly since MeasurementSet doesn't support Promise at the moment (but it should!).
747 * server-tests/api-manifest.js: Updated a test case.
749 2016-04-12 Ryosuke Niwa <rniwa@webkit.org>
751 Make sync-buildbot.js fault safe
752 https://bugs.webkit.org/show_bug.cgi?id=156498
754 Reviewed by Chris Dumez.
756 Fixed a bug that sync-buildbot.js will continue to schedule build requests from multiple test groups
757 if multiple test groups are simultaneously in-progress on the same builder. Also fixed a bug that if
758 a build request had failed without leaving a trace (i.e. no entry on any of the builders we know of),
759 sync-buildbot.js throws an exception.
761 * server-tests/tools-buildbot-triggerable-tests.js: Added test cases.
762 * tools/js/buildbot-syncer.js:
763 (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Renamed. Optionally takes the slave name.
764 When this parameter is specified, schedule the request only if the specified slave is available.
765 * tools/js/buildbot-triggerable.js:
766 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Always use
767 scheduleRequestInGroupIfAvailable to schedule a new build request. Using scheduleRequest for non-first
768 build requests was problematic when there were multiple test groups with pending requests because then
769 we would schedule those pending requests without checking whether there is already a pending job or if
770 we have previously scheduled a job. Also fallback to use any syncer / builder when groupInfo.syncer is
771 not set even if the next request was not the first one in the test group since we can't determine on
772 which builder preceding requests are processed in such cases.
773 * unit-tests/buildbot-syncer-tests.js:
775 2016-04-11 Ryosuke Niwa <rniwa@webkit.org>
777 Replace script runner to use mocha.js tests
778 https://bugs.webkit.org/show_bug.cgi?id=156490
780 Reviewed by Chris Dumez.
782 Replaced run-tests.js, which was a whole test harness for running legacy tests by tools/run-tests.py
783 which is a thin wrapper around mocha.js.
785 * run-tests.js: Removed.
787 * tools/run-tests.py: Added.
790 2016-04-11 Ryosuke Niwa <rniwa@webkit.org>
792 New syncing script sometimes schedules a build request on a wrong builder
793 https://bugs.webkit.org/show_bug.cgi?id=156489
795 Reviewed by Stephanie Lewis.
797 The bug was caused by _scheduleNextRequestInGroupIfSlaveIsAvailable scheduling the next build request on
798 any available syncer regardless of whether the request is the first one in the test group or not because
799 BuildRequest.order was returning a string instead of a number.
801 Also fixed a bug that BuildbotTriggerable.syncOnce was re-ordering test groups by their id's instead of
802 respecting the order in which the perf dashboard returned.
804 * public/v3/models/build-request.js:
805 (BuildRequest.prototype.order): Force the order to be a number.
806 * server-tests/api-build-requests-tests.js: Assert the order as numbers.
807 * server-tests/resources/mock-data.js:
808 (MockData.addAnotherMockTestGroup): Changed the test group id to 601, which is after the first mock data.
809 The old number was masking a bug in BuildbotTriggerable that it was re-ordering test groups by their id's
810 instead of using the order set forth by the perf dashboard.
811 (MockData.mockTestSyncConfigWithSingleBuilder):
812 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for scheduling two build requests in
813 a single call to syncOnce. Each build request should be scheduled on the same builder as the previous build
814 requests in the same test group.
815 * tools/js/buildbot-triggerable.js:
816 (BuildbotTriggerable.prototype.syncOnce): Order test groups by groupOrder, which is the index at which first
817 build request in the group appeared.
818 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Don't re-order build requests
819 as they're already sorted on the server side.
820 (BuildbotTriggerable._testGroupMapForBuildRequests): Added groupOrder to test group info
822 2016-04-09 Ryosuke Niwa <rniwa@webkit.org>
824 Build fix. Don't treat a build number 0 as a pending build.
826 * tools/js/buildbot-syncer.js:
827 (BuildbotBuildEntry.prototype.isPending):
829 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
831 Escape builder names in url* and pathFor* methods of BuildbotSyncer
832 https://bugs.webkit.org/show_bug.cgi?id=156427
834 Reviewed by Darin Adler.
836 The build fix in r199251 breaks other usage of RemoteAPI. Fix it properly by escaping builder names in
837 various methods of BuildbotSyncer.
839 Also fixed a typo in the logging and a bug that the new syncing script never updated "scheduled" to "running".
841 * server-tests/resources/mock-data.js:
842 (MockData.mockTestSyncConfigWithTwoBuilders): Renamed "some-builder-2" to "some builder 2" to test the
843 new escaping behavior in tools-buildbot-triggerable-tests.js and buildbot-syncer-tests.js.
845 * server-tests/tools-buildbot-triggerable-tests.js: Added tests for status url, and added a new test case
846 for updating "scheduled" to "running".
848 * tools/js/buildbot-syncer.js:
849 (BuildbotBuildEntry.buildRequestStatusIfUpdateIsNeeded): Update the status to "running" when the request's
850 status is "scheduled" and the buildbot's build is currently in progress.
851 (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Escape the builder name.
852 (BuildbotSyncer.prototype.pathForBuildJSON): Ditto.
853 (BuildbotSyncer.prototype.pathForForceBuild): Ditto.
854 (BuildbotSyncer.prototype.url): Ditto.
855 (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
857 * tools/js/buildbot-triggerable.js:
858 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers):
859 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Fixed a typo. We are
860 scheduling new build requests, not syncing them.
861 * tools/js/remote.js:
862 (RemoteAPI.sendHttpRequest): Reverted r199251.
863 * unit-tests/buildbot-syncer-tests.js:
865 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
867 Build fix. We need to escape the path or http.request would fail.
869 * tools/js/remote.js:
871 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
873 Fix various bugs in the new syncing script
874 https://bugs.webkit.org/show_bug.cgi?id=156393
876 Reviewed by Darin Adler.
878 * server-tests/resources/common-operations.js: Added. This file was supposed to be added in r199191.
879 (addBuilderForReport):
881 (connectToDatabaseInEveryTest):
883 * tools/js/buildbot-triggerable.js:
884 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Don't log every time we pull from buildbot
885 builder as this dramatically increases the amount of log we generate.
886 * tools/js/parse-arguments.js:
887 (parseArguments): Fixed a typo. This should be parseArgument*s*, not parseArgument.
888 * tools/js/remote.js:
889 (RemoteAPI.prototype.url): Fixed a bug that portSuffix wasn't being expanded in the template literal.
890 (RemoteAPI.prototype.configure): Added more validations with nice error messages.
891 (RemoteAPI.prototype.sendHttpRequest): Falling back to port 80 isn't right when scheme is https. Compute
892 the right port in configure instead based on the scheme.
893 * tools/sync-buildbot.js:
894 (syncLoop): Fixed the bug that syncing multiple times fail because Manifest.fetch() create new Platform
895 and Test objects. This results in various references in BuildRequest objects to get outdated. Fixing this
896 properly in Manifest.fetch() because we do need to "forget" about some tests and platforms in some cases.
897 For now, delete all v3 model objects and start over in each syncing cycle.
898 * unit-tests/tools-js-remote-tests.js: Added. Unit tests for the aforementioned changes to RemoteAPI.
900 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
902 sync-buildbot.js doesn't mark disappeared builds as failed
903 https://bugs.webkit.org/show_bug.cgi?id=156386
905 Reviewed by Chris Dumez.
907 Fix a bug that new syncing script doesn't mark builds that it scheduled but doesn't appear when queried
908 by buildbot's JSON API. These are builds that got canceled by humans (e.g. buildbot was restarted, data
909 loss, pending build was canceled, etc...)
911 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case.
912 * tools/js/buildbot-triggerable.js:
913 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added a set of build requests we've matched
914 against BuildbotBuildEntry's. Mark build requests that didn't have any entry but supposed to be in either
915 'scheduled' or 'running' status as failed.
917 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
919 A/B testing bots should prioritize user created test groups
920 https://bugs.webkit.org/show_bug.cgi?id=156375
922 Reviewed by Chris Dumez.
924 Order build requests preferring user created ones over ones automatically created by detect-changes.js.
926 Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new
927 build request on a builder/slave even when we had previously scheduled another build request.
929 * public/include/build-requests-fetcher.php:
930 (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on
931 author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js.
932 Since we're using ascending order, this would put user created test groups first.
933 * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case
934 for testing that build requests for an user created test group shows up first.
935 * server-tests/resources/mock-data.js:
936 (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name.
937 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests
938 for an user created test group shows up first.
939 * tools/js/buildbot-syncer.js:
940 (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already
941 scheduled new build requests. Don't schedule more requests on these slaves.
942 (BuildbotSyncer.prototype.scheduleRequest):
943 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null
944 when slaveList is not specified) to _slavesWithNewRequests.
945 (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request
946 we have previously scheduled should be included in one of the entires now.
947 * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug.
948 (sampleiOSConfig): Added a second slave for new test cases.
950 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
952 Migrate legacy perf dashboard tests to mocha.js based tests
953 https://bugs.webkit.org/show_bug.cgi?id=156335
955 Reviewed by Chris Dumez.
957 Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise
958 for most of asynchronous operations, refactored the tests to use Promises as well, and added more
959 assertions where appropriate.
961 Also consolidated common helper functions into server-tests/resources/common-operations.js.
962 Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were
963 taking an array of reports while others were taking a single report. New shared implementation in
964 common-operations.js now takes a single report.
966 Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout.
967 Most of tests are passing under 100ms on my computer so 1s should be plenty still.
969 * run-tests.js: Removed.
970 * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js.
971 (reportsForDifferentPlatforms):
972 * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js.
973 (.addBuilder): Moved to common-operations.js.
974 * server-tests/api-build-requests-tests.js:
975 * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps.
976 * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js.
977 (.queryPlatformAndMetric):
979 * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js.
980 * server-tests/api-report-tests.js: Moved from tests/api-report.js.
983 (.reportWithSameSubtestName):
984 * server-tests/resources/common-operations.js: Added.
985 (addBuilderForReport): Extracted from tests.
986 (addSlaveForReport): Ditto.
987 (connectToDatabaseInEveryTest): Added.
988 (submitReport): Extracted from admin-platforms-tests.js.
989 * server-tests/resources/test-server.js:
990 (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start
991 its own Apache instance (that would certainly will fail).
992 * server-tests/tools-buildbot-triggerable-tests.js:
994 * tools/js/database.js:
995 (Database.prototype.selectAll): Added.
996 (Database.prototype.selectFirstRow): Added.
997 (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments.
999 2016-04-05 Ryosuke Niwa <rniwa@webkit.org>
1001 New buildbot syncing scripts that supports multiple builders and slaves
1002 https://bugs.webkit.org/show_bug.cgi?id=156269
1004 Reviewed by Chris Dumez.
1006 Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves.
1007 The old python script (sync-with-buildbot.py) could only support a single builder and slave
1008 for each platform, test pair.
1010 The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added
1011 throughout the codebase and tests have been refactored.
1013 BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible
1014 for syncing everything on each builder (on a buildbot).
1016 Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored
1017 test helpers and mocks as needed.
1019 * public/v3/models/build-request.js:
1020 (BuildRequest.prototype.status): Added.
1021 (BuildRequest.prototype.isScheduled): Added.
1022 * public/v3/models/metric.js:
1023 (Metric.prototype.fullName): Added.
1024 * public/v3/models/platform.js:
1025 (Platform): Added the map based on platform name.
1026 (Platform.findByName): Added.
1027 * public/v3/models/test.js:
1028 (Test.topLevelTests):
1029 (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would
1030 find the test whose name is "B" which has a parent test named "A".
1031 (Test.prototype.fullName): Added.
1032 * server-tests/api-build-requests-tests.js:
1033 (addMockData): Moved to resources/mock-data.js.
1034 (addAnotherMockTestGroup): Ditto.
1035 * server-tests/resources/mock-data.js: Added.
1036 (MockData.resetV3Models): Added.
1037 (MockData.addMockData): Moved from api-build-requests-tests.js.
1038 (MockData.addAnotherMockTestGroup): Ditto.
1039 (MockData.mockTestSyncConfigWithSingleBuilder): Added.
1040 (MockData.mockTestSyncConfigWithTwoBuilders): Added.
1041 (MockData.pendingBuild): Added.
1042 (MockData.runningBuild): Added.
1043 (MockData.finishedBuild): Added.
1044 * server-tests/resources/test-server.js:
1046 (TestServer.prototype.remoteAPI):
1047 (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit.
1048 (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever.
1049 (TestServer.prototype._waitForPid): Increase the timeout.
1050 (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards.
1051 * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce.
1052 (MockLogger): Added.
1053 (MockLogger.prototype.log): Added.
1054 (MockLogger.prototype.error): Added.
1055 * tools/detect-changes.js:
1056 (parseArgument): Moved to js/parse-arguments.js.
1057 * tools/js/buildbot-syncer.js:
1058 (BuildbotBuildEntry):
1059 (BuildbotBuildEntry.prototype.syncer): Added.
1060 (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status
1061 for a build request (of the matching build request ID) if it needs to be updated in the server.
1062 (BuildbotSyncer): This class
1063 (BuildbotSyncer.prototype.addTestConfiguration): Added.
1064 (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations.
1065 (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on
1067 (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request.
1068 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for
1069 the specified build request on the first slave that's available.
1070 (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object.
1071 Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it.
1072 (BuildbotSyncer.prototype._pullRecentBuilds):
1073 (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now
1074 only returns the path instead of the full URL since RemoteAPI takes a path, not full URL.
1075 (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON.
1076 (BuildbotSyncer.prototype.pathForForceBuild): Added.
1077 (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL.
1078 (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
1079 (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test
1080 configurations associated with it, find the one matching for this request.
1081 (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it.
1082 (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of
1083 slave names present on this builder.
1084 * tools/js/buildbot-triggerable.js: Added.
1085 (BuildbotTriggerable): Added.
1086 (BuildbotTriggerable.prototype.name): Added.
1087 (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls
1088 existing build requests from the perf dashboard, pulls buildbot for pending and running/completed
1089 builds on each builder (represented by each syncer), schedules build requests on buildbot if there
1090 is any builder/slave available, and updates the status of build requests in the database.
1091 (BuildbotTriggerable.prototype._validateRequests): Added.
1092 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added.
1093 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added.
1094 (BuildbotTriggerable._testGroupMapForBuildRequests): Added.
1095 * tools/js/database.js:
1096 * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js.
1098 * tools/js/remote.js:
1099 (RemoteAPI): Now optionally takes the server configuration.
1100 (RemoteAPI.prototype.url): Added.
1101 (RemoteAPI.prototype.getJSON): Removed the code for specifying request content.
1102 (RemoteAPI.prototype.getJSONWithStatus): Ditto.
1103 (RemoteAPI.prototype.postJSON): Added.
1104 (RemoteAPI.prototype.postFormUrlencodedData): Added.
1105 (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth.
1106 * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host.
1107 * tools/sync-buildbot.js: Added.
1108 (main): Added. Parse the arguments and start the loop.
1110 * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as
1111 scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed.
1113 (smallConfiguration): Added.
1114 (smallPendingBuild): Added.
1115 (smallInProgressBuild): Added.
1116 (smallFinishedBuild): Added.
1117 (createSampleBuildRequest): Create a unique build request for each platform.
1118 (samplePendingBuild): Optionally specify build time and slave name.
1119 (sampleInProgressBuild): Optionally specify slave name.
1120 (sampleFinishedBuild): Ditto.
1121 * unit-tests/resources/mock-remote-api.js:
1122 (assert.notReached.assert.notReached):
1123 (MockRemoteAPI.url): Added.
1124 (MockRemoteAPI.postFormUrlencodedData): Added.
1125 (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus.
1126 (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we
1127 need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI.
1128 (MockRemoteAPI.inject):
1129 (MockRemoteAPI.reset): Added.
1131 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
1133 Simplify API of Test model by removing Test.setParentTest
1134 https://bugs.webkit.org/show_bug.cgi?id=156055
1136 Reviewed by Joseph Pecoraro.
1138 Removed Test.setParentTest. Keep track of the child-parent relationship using the static map instead.
1140 Now each test only stores parent's id and uses the ID static map in Test.parentTest().
1142 * public/v3/models/manifest.js:
1143 (Manifest._didFetchManifest.buildObjectsFromIdMap): Removed the code to create the map of child-parent
1144 relationship and call setParentTest.
1145 * public/v3/models/test.js:
1146 (Test): Updated a static map by the name of "childTestMap" to store itself. We should probably sort
1147 child tests using some fixed criteria in the future instead of relying on the creation order but
1148 preserve the old code's ordering for now.
1149 (Test.prototype.parentTest): Look up the static map by the parent test's id.
1150 (Test.prototype.onlyContainsSingleMetric):
1151 (Test.prototype.setParentTest): Deleted.
1152 (Test.prototype.childTests): Look up the child test map.
1154 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
1156 BuildRequest should have associated platform and test
1157 https://bugs.webkit.org/show_bug.cgi?id=156054
1159 Reviewed by Joseph Pecoraro.
1161 Added methods to retrieve the platform and the test associated with a build request with tests.
1163 * public/v3/models/build-request.js:
1165 (BuildRequest.prototype.platform): Added.
1166 (BuildRequest.prototype.test): Added.
1167 * server-tests/api-build-requests-tests.js:
1168 * server-tests/api-manifest.js: Fixed a typo. This tests /api/manifest, not /api/build-requests.
1169 * unit-tests/buildbot-syncer-tests.js:
1170 (.createSampleBuildRequest): Now takes Platform and Test objects to avoid hitting assertions in
1171 BuildRequest's constructor.
1173 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
1175 BuildRequest should have a method to fetch all in-progress and pending requests for a triggerable
1176 https://bugs.webkit.org/show_bug.cgi?id=156008
1178 Reviewed by Darin Adler.
1180 Add a method to BuildRequest that fetches all pending and in-progress requests for a triggerable.
1182 Now, new syncing scripts must be able to figure out the build slave the first build requests in
1183 a given test group had used in order to schedule subsequent build requests in the test group.
1185 For this purpose, /api/build-requests has been modified to return all build requests whose test
1186 group had not finished yet. A test group is finished if all build requests in the test group had
1187 finished (completed, failed, or canceled).
1189 * public/include/build-requests-fetcher.php:
1190 (BuildRequestFetcher::fetch_incomplete_requests_for_triggerable): Return all build requests in test
1191 groups that have not been finished.
1192 * public/v3/models/build-request.js:
1194 (BuildRequest.prototype.testGroupId): Added.
1195 (BuildRequest.prototype.isPending): Renamed from hasPending to fix a bad grammar.
1196 (BuildRequest.fetchForTriggerable): Added.
1197 (BuildRequest.constructBuildRequestsFromData): Extracted from _createModelsFromFetchedTestGroups in
1199 * public/v3/models/manifest.js:
1200 (Manifest.fetch): Use the full path from root so that it works in server tests.
1201 * public/v3/models/test-group.js:
1202 (TestGroup.hasPending):
1203 (TestGroup._createModelsFromFetchedTestGroups):
1204 * server-tests/api-build-requests-tests.js: Added tests to ensure all build requests for a test group
1205 is present in the response returned by /api/build-requests iff any build request in the group had not
1208 (.addAnotherMockTestGroup): Added.
1209 * unit-tests/test-groups-tests.js:
1211 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
1213 Make dependency injection in unit tests more explicit
1214 https://bugs.webkit.org/show_bug.cgi?id=156006
1216 Reviewed by Joseph Pecoraro.
1218 Make the dependency injection of model objects in unit tests explicit so that server tests that create
1219 "real" model objects won't create these mock objects. Now each test that uses mock model objects would call
1220 MockModels.inject() to inject before / beforeEach and access each object using a property on MockModels
1221 instead of them being implicitly defined on the global object.
1223 Similarly, MockRemoteAPI now only replaces global.RemoteAPI during each test so that server tests can use
1224 real RemoteAPI to access the test Apache server.
1226 * unit-tests/analysis-task-tests.js:
1227 * unit-tests/buildbot-syncer-tests.js:
1228 (createSampleBuildRequest):
1229 * unit-tests/measurement-adaptor-tests.js:
1230 * unit-tests/measurement-set-tests.js:
1231 * unit-tests/resources/mock-remote-api.js:
1232 (MockRemoteAPI.getJSONWithStatus):
1233 (MockRemoteAPI.inject): Added. Override RemoteAPI on the global object during each test.
1234 * unit-tests/resources/mock-v3-models.js:
1235 (MockModels.inject): Added. Create mock model objects before each test, and clear all static maps of
1236 various v3 model classes (to remove all singleton objects for those model classes).
1237 * unit-tests/test-groups-tests.js:
1239 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
1241 BuildbotSyncer should be able to fetch JSON from buildbot
1242 https://bugs.webkit.org/show_bug.cgi?id=155921
1244 Reviewed by Joseph Pecoraro.
1246 Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot
1247 with lots of unit tests as this has historically been a source of subtle bugs in the old script.
1249 New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that
1250 the state of some builds may change between each HTTP request. In the old script, we fetched the list
1251 of the pending builds, and requested -1, -2, etc... builds for N times. But between each request,
1252 a pending build may start running or an in-progress build finish and shift the offset by one. The new
1253 script avoids this problem by first requesting all pending builds, then all in-progress and finished
1254 builds in a single HTTP request. The results are then merged so that entries for in-progress and
1255 finished builds would override the entries for pending builds if they overlap.
1257 Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes
1258 the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js).
1260 * server-tests/api-build-requests-tests.js:
1261 * server-tests/api-manifest.js:
1262 * tools/js/buildbot-syncer.js:
1263 (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as
1264 we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished
1265 builds as 'currentStep' is always defined but null in those builds.
1266 (BuildbotBuildEntry.prototype.buildNumber): Added.
1267 (BuildbotBuildEntry.prototype.isPending): Added.
1268 (BuildbotBuildEntry.prototype.hasFinished): Added.
1269 (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds.
1270 (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds.
1271 (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added.
1272 (BuildbotSyncer.prototype.urlForBuildJSON): Added.
1273 (BuildbotSyncer.prototype.url): Added.
1274 (BuildbotSyncer.prototype.urlForBuildNumber): Added.
1275 * tools/js/remote.js:
1276 (RemoteAPI.prototype.getJSON): Renamed from fetchJSON.
1277 (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus.
1278 * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node.
1279 * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot
1280 (samplePendingBuild):
1281 (sampleInProgressBuild): Added.
1282 (sampleFinishedBuild): Added.
1283 * unit-tests/resources/mock-remote-api.js:
1284 (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus.
1286 2016-03-24 Ryosuke Niwa <rniwa@webkit.org>
1288 Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code
1289 https://bugs.webkit.org/show_bug.cgi?id=155863
1291 Reviewed by Joseph Pecoraro.
1293 Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability
1294 added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed
1295 /admin/regenerate-manifest since it has been superseded by /api/manifest.
1297 This patch also extracts manifest.js out of main.js so that it could be used and tested without the
1298 DOM support in node.
1300 * public/admin/regenerate-manifest.php: Deleted.
1301 * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with
1302 a trailing backslash.
1303 * public/include/manifest.php:
1304 (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories.
1305 * public/v3/index.html:
1306 * public/v3/main.js:
1308 * public/v3/models/bug-tracker.js:
1309 (BugTracker.prototype.newBugUrl): Added.
1310 (BugTracker.prototype.repositories): Added.
1311 * public/v3/models/manifest.js: Added. Extracted from main.js.
1312 (Manifest.fetch): Moved from main.js' fetchManifest.
1313 (Manifest._didFetchManifest): Moved from main.js' didFetchManifest.
1314 * public/v3/models/platform.js:
1315 (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of
1316 the same name. This is tested by the newly added test cases.
1317 * server-tests/api-build-requests-tests.js:
1318 * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js
1319 with additional assertions for v3 UI model objects.
1320 * server-tests/resources/test-server.js:
1321 (TestServer.prototype.start):
1322 (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API.
1323 Also no longer takes dataDirectory as an argument since it's always the same.
1324 (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data.
1325 (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests.
1326 (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an
1327 unintended side effect of slowing down unit tests even through they don't need Postgres or Apache.
1328 * tests/admin-regenerate-manifest.js: Removed.
1329 * tools/js/database.js:
1330 * tools/js/v3-models.js:
1332 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
1334 Add mocha server tests for /api/build-requests
1335 https://bugs.webkit.org/show_bug.cgi?id=155831
1337 Reviewed by Chris Dumez.
1339 Added the new mocha.js based server-tests for /api/build-requests. The new harness automatically:
1340 - starts a new Apache instance
1341 - switches the database during testing via setting an environmental variable
1342 - backups and restores public/data directory during testing
1344 As a result, developer no longer has to manually setup Apache, edit config.json manually to use
1345 a testing database, or run /api/manifest.php to re-generate the manifest file after testing.
1347 This patch also makes ID resolution optional on /api/build-requests so that v3 model based syncing
1348 scripts can re-use the same code as the v3 UI to process the JSON. tools/sync-with-buildbot.py has
1349 been modified to use this option (useLegacyIdResolution).
1351 * config.json: Added configurations for the test httpd server.
1352 * init-database.sql: Don't error when tables and types don't exist (when database is empty).
1353 * public/api/build-requests.php:
1354 (main): Made the ID resolution optional with useLegacyIdResolution. Also removed "updates" from the
1355 results JSON since it's never used.
1356 * public/include/build-requests-fetcher.php:
1357 (BuildRequestsFetcher::__construct):
1358 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Fixed the bug that we would include the same
1359 commit multiple times for each root set.
1360 * public/include/db.php:
1361 (config): If present, use ORG_WEBKIT_PERF_CONFIG_PATH instead of Websites/perf.webkit.org/config.json.
1362 * server-tests: Added.
1363 * server-tests/api-build-requests-tests.js: Added. Tests for /api/build-requests.
1365 * server-tests/resources: Added.
1366 * server-tests/resources/test-server.conf: Added. Apache configuration file for testing.
1367 * server-tests/resources/test-server.js: Added.
1369 (TestSever.prototype.start): Added.
1370 (TestSever.prototype.stop): Added.
1371 (TestSever.prototype.remoteAPI): Added. Configures RemoteAPI to be used with the test sever.
1372 (TestSever.prototype.database): Added. Returns Database configured to use the test database.
1373 (TestSever.prototype._constructTestConfig): Creates config.json for testing. The file is generated by
1374 _start and db.php's config() reads it from the environmental variable: ORG_WEBKIT_PERF_CONFIG_PATH.
1375 (TestSever.prototype._ensureDataDirectory): Renames public/data to public/original-data if exists,
1376 and creates a new empty public/data.
1377 (TestSever.prototype._restoreDataDirectory): Deletes public/data and renames public/original-data
1378 back to public/data.
1379 (TestSever.prototype._ensureTestDatabase): Drops the test database if exists and creates a new one.
1380 (TestSever.prototype.initDatabase): Run init-database.sql to start each test with a consistent state.
1381 (TestSever.prototype._executePgsqlCommand): Executes a postgres command line tool such as psql.
1382 (TestSever.prototype._determinePgsqlDirectory): Finds the directory that contains psql.
1383 (TestSever.prototype._startApache): Starts an Apache instance for testing.
1384 (TestSever.prototype._stopApache): Stops the Apache instance for testing.
1385 (TestSever.prototype._waitForPid): Waits for the Apache pid file to appear or disappear.
1386 (before): Start the test server at the beginning.
1387 (beforeEach): Re-initialize all tables before each test.
1388 (after): Stop the test server at the end.
1389 * tools/js/config.js:
1390 (Config.prototype.path):
1391 (Config.prototype.serverRoot): Added. The path to Websites/perf.webkit.org/public/.
1392 (Config.prototype.pathFromRoot): Added. Resolves a path from Websites/perf.webkit.org.
1393 * tools/js/database.js:
1394 (Database): Now optionally takes the database name to use a different database during testing.
1395 (Database.prototype.connect):
1396 (Database.prototype.query): Added.
1397 (Database.prototype.insert): Added.
1398 (tableToPrefixMap): Maps table name to its prefix. Used by Database.insert.
1399 * tools/js/remote.js: Added.
1400 (RemoteAPI): Added. This is node.js equivalent of RemoteAPI in public/v3/remote.js.
1401 (RemoteAPI.prototype.configure): Added.
1402 (RemoteAPI.prototype.fetchJSON): Added.
1403 (RemoteAPI.prototype.fetchJSONWithStatus): Added.
1404 (RemoteAPI.prototype.sendHttpRequest): Added.
1405 * tools/sync-with-buildbot.py:
1406 (main): Use useLegacyIdResolution as this script relies on the legacy behavior.
1407 * unit-tests/checkconfig.js: pg was never directly used in this test.
1409 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
1411 Delete a file that was supposed to be removed in r198614 for real.
1413 * unit-tests/resources/v3-models.js: Removed.
1415 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
1417 Add a model for parsing buildbot JSON with unit tests
1418 https://bugs.webkit.org/show_bug.cgi?id=155814
1420 Reviewed by Joseph Pecoraro.
1422 Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests.
1423 They will be used in the new syncing scripts to improve A/B testing.
1425 * public/v3/models/build-request.js:
1427 * tools/js/buildbot-syncer.js: Added.
1428 (BuildbotBuildEntry): Added.
1429 (BuildbotBuildEntry.prototype.slaveName): Added.
1430 (BuildbotBuildEntry.prototype.buildRequestId): Added.
1431 (BuildbotBuildEntry.prototype.isInProgress): Added.
1432 (BuildbotSyncer): Added.
1433 (BuildbotSyncer.prototype.testPath): Added.
1434 (BuildbotSyncer.prototype.builderName): Added.
1435 (BuildbotSyncer.prototype.platformName): Added.
1436 (BuildbotSyncer.prototype.fetchPendingRequests): Added.
1437 (BuildbotSyncer.prototype._propertiesForBuildRequest): Added.
1438 (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added.
1439 (BuildbotSyncer._loadConfig): Added.
1440 (BuildbotSyncer._validateAndMergeConfig): Added.
1441 (BuildbotSyncer._validateAndMergeProperties): Added.
1442 * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js.
1443 (beforeEach): Deleted since this only defined inside mocha.
1444 * unit-tests/analysis-task-tests.js:
1445 * unit-tests/buildbot-syncer-tests.js: Added.
1447 (createSampleBuildRequest):
1448 (.smallConfiguration):
1449 * unit-tests/measurement-adaptor-tests.js:
1450 * unit-tests/measurement-set-tests.js:
1451 * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js.
1453 * unit-tests/test-groups-tests.js:
1456 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
1458 Add unit tests for test-group.js
1459 https://bugs.webkit.org/show_bug.cgi?id=155781
1461 Reviewed by Joseph Pecoraro.
1463 Added unit tests for test-group.js that would have caught regressions fixed in r198503.
1465 * public/v3/components/chart-pane-base.js:
1466 (ChartPaneBase.prototype._renderAnnotations): Added a forgotten break statement.
1467 * public/v3/models/build-request.js:
1468 (BuildRequest.prototype.setResult):
1470 * public/v3/models/test-group.js:
1471 * unit-tests/measurement-set-tests.js: Use ./resources/v3-models.js to reduce the code duplication.
1472 * unit-tests/resources/v3-models.js: Import more stuff from v3 models.
1474 * unit-tests/test-groups-tests.js: Added. Added some unit tests for TestGroup.
1476 (.testGroupWithStatusList):
1478 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
1484 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
1486 Commit log viewer repaints too frequently after r198499
1487 https://bugs.webkit.org/show_bug.cgi?id=155732
1489 Reviewed by Joseph Pecoraro.
1491 The bug was caused by InteractiveTimeSeriesChart invoking onchange callback whenever mouse moved even
1492 if the current point didn't change. Fixed the bug by avoiding the work if the indicator hadn't changed
1493 and avoiding work in the commit log viewer when the requested repository and the revision range were
1494 the same as those of the last request.
1496 * public/v3/components/commit-log-viewer.js:
1498 (CommitLogViewer.prototype.currentRepository): Exit early when repository and the revision range are
1499 identical to the one we already have to avoid repaints and issuing multiple network requests.
1500 * public/v3/components/interactive-time-series-chart.js:
1501 (InteractiveTimeSeriesChart.prototype._mouseMove): Don't invoke _notifyIndicatorChanged if the current
1502 indicator hadn't changed.
1503 * public/v3/pages/chart-pane.js:
1504 (ChartPane.prototype._indicatorDidChange): Fixed the bug that unlocking the indicator wouldn't update
1505 the URL. We need to check whether the lock state had changed. The old condition was also redundant
1506 since _mainChartIndicatorWasLocked is always identically equal to isLocked per the prior assignment.
1508 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
1510 Fix A/B testing after r198503.
1512 * public/include/build-requests-fetcher.php:
1514 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
1516 Analysis task page is broken after r198479
1517 https://bugs.webkit.org/show_bug.cgi?id=155735
1519 Rubber-stamped by Chris Dumez.
1521 * public/api/measurement-set.php:
1522 (AnalysisResultsFetcher::fetch_commits): We need to emit the commit ID as done for regular data.
1523 * public/include/build-requests-fetcher.php:
1524 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Ditto. Don't use a fake ID after r198479.
1525 * public/v3/models/commit-log.js:
1526 (CommitLog): Assert that all commit log IDs are integers to catch regressions like this in future.
1527 * public/v3/models/root-set.js:
1528 (RootSet): Don't resolve Repository here as doing so would modify the shared "root" entry in the JSON
1529 we fetched, and subsequent construction of RootSet would fail since this line would blow up trying to
1530 find the repository with "[object]" as the ID.
1531 * public/v3/models/test-group.js:
1532 (TestGroup._createModelsFromFetchedTestGroups): Resolve Repository here.
1534 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
1536 v3 UI sometimes don't update the list of revisions on the commit log viewer
1537 https://bugs.webkit.org/show_bug.cgi?id=155729
1539 Rubber-stamped by Chris Dumez.
1541 Fixed multiple bugs that were affecting the list of blame range and commit logs for the range weren't
1542 updated in some cases on v3 UI. Also, the commit log viewer state is now a part of the URL state so
1543 opening and closing the commit log viewer will persist across page loads.
1545 Also fixed a regression from r198479 that Test object can't be created for a top level test.
1547 * public/v3/components/chart-pane-base.js:
1548 (ChartPaneBase.prototype.configure):
1549 (ChartPaneBase.prototype._mainSelectionDidChange): Fixed the bug that the list of blame range nor the
1550 commit log viewer don't get updated when the selected range changes.
1551 (ChartPaneBase.prototype._indicatorDidChange):
1552 (ChartPaneBase.prototype._didFetchData):
1553 (ChartPaneBase.prototype._updateStatus): Extracted from _indicatorDidChange and _didFetchData.
1554 (ChartPaneBase.prototype._requestOpeningCommitViewer): Renamed from _openCommitViewer.
1556 * public/v3/components/chart-status-view.js:
1557 (ChartStatusView.prototype.updateStatusIfNeeded): Fixed the bug that the blame range doesn't get set
1558 on the initial page load when the selection range is set but the chart data hadn't been fetched yet.
1560 * public/v3/components/commit-log-viewer.js:
1561 (CommitLogViewer.prototype.view): Fixed the bug that we don't clear out the old list of commits while
1562 loading the next set of commits to show as it looked as if the list was never updated.
1563 (CommitLogViewer.prototype.render): Fixed the bug that the view always show the last repository name
1564 even if there were nothing being fetched or commits to show.
1566 * public/v3/components/pane-selector.js:
1567 (PaneSelector.prototype.focus): Removed superfluous call to console.log.
1569 * public/v3/models/data-model.js:
1570 (DataModelObject.listForStaticMap): Generalized the code for all to fix the bug in Test.
1571 (DataModelObject.all):
1573 * public/v3/models/test.js:
1574 (Test): Fixed the bug that this code was relying on the static map to be an array.
1575 (Test.topLevelTests): Use newly added listForStaticMap to convert the dictionary to an array.
1577 * public/v3/pages/chart-pane-status-view.js:
1578 (ChartPaneStatusView): Always initialize _usedRevisionRange as a triple to simplify code elsewhere.
1579 (ChartPaneStatusView.prototype.render): Invoke _revisionCallback when user clicks on a repository
1580 expansion mark (>>). Also fixed click handler from the row since this made selecting revision range
1581 on the view cumbersome. Now user has to explicitly click on the expansion mark (>>).
1582 (ChartPaneStatusView.prototype._setRevisionRange): Now takes shouldNotify, from, and to as arguments
1583 as this function must not invoke_revisionCallback inside _updateRevisionListForNewCurrentRepository.
1584 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Use newly added setCurrentRepository
1585 instead of manually invoking setCurrentRepository and updateRevisionListWithNotification.
1586 (ChartPaneStatusView.prototype.setCurrentRepository): Fixed the bug that we weren't updating the
1588 (ChartPaneStatusView.prototype.updateRevisionList): Renamed from updateRevisionListWithNotification
1589 since we no longer call _revisionCallback. In general, callbacks are only meant to communicate user
1590 initiated actions, and not program induced updates like this API so this was a bad pattern anyway.
1591 ChartPane now explicitly updates the commit log viewer instead of relying on this function calling
1592 _requestOpeningCommitViewer implicitly.
1593 (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Extracted from
1594 updateRevisionListWithNotification so that setCurrentRepository can also call this function.
1596 * public/v3/pages/chart-pane.js:
1597 (ChartPane.prototype._requestOpeningCommitViewer): Overrides ChartPaneBase's method. Open the same
1598 repository in other panes via ChartsPage.setOpenRepository.
1599 (ChartPane.prototype.setOpenRepository): This method is called when the user selected a repository in
1600 another pane. Open the same repository in this pane if it wasn't already open.
1602 * public/v3/pages/charts-page.js:
1603 (ChartsPage): Added this._currentRepositoryId.
1604 (ChartsPage.prototype.serializeState): Serialize _currentRepositoryId.
1605 (ChartsPage.prototype.updateFromSerializedState): Set the commit log viewer's
1606 (ChartsPage.prototype.setOpenRepository): Added.
1608 * tests/api-measurement-set.js: Fixed a test after r198479.
1610 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
1612 V3 Perf Dashboard should automatically select initial range when creating a new task
1613 https://bugs.webkit.org/show_bug.cgi?id=155677
1615 Reviewed by Joseph Pecoraro.
1617 Select the entire range of points for which the analysis task is created by default so that creating
1618 a test group to confirm the regression / progression is easy.
1620 * public/v3/pages/analysis-task-page.js:
1621 (AnalysisTaskPage): Added a boolean flag which indicates the user had modified main chart's selection.
1622 * public/v3/pages/analysis-task-page.js:
1623 (AnalysisTaskPage.prototype.render): Set the main chart's selection to the entire range of points in
1624 the analysis task if the user had never modified selection.
1625 (AnalysisTaskPage.prototype._chartSelectionDidChange): This callback is invoked only when the user had
1626 modified the selection so set _selectionWasModifiedByUser true here unconditionally.
1628 2016-03-19 Ryosuke Niwa <rniwa@webkit.org>
1630 Associated commits don't immediately show up on an analysis task page
1631 https://bugs.webkit.org/show_bug.cgi?id=155692
1633 Reviewed by Darin Adler.
1635 The bug was caused by resolveCommits in AnalysisTask._constructAnalysisTasksFromRawData not being
1636 able to find the matching commit log if the commit log had been created by the charts which don't
1637 set the remote identifiers on each CommitLog objects.
1639 Fixed the bug by modifying /api/measurement-set to include the commit ID, and making CommitLog
1640 use the real database ID as its ID instead of a fake ID we create from repository and revision.
1642 Also added a bunch of Mocha unit tests for AnalysisTask.fetchAll.
1644 * public/api/measurement-set.php:
1645 (MeasurementSetFetcher::execute_query): Fetch commit_id.
1646 (MeasurementSetFetcher::format_run): Use pass-by-reference to avoid making a copy of the row.
1647 (MeasurementSetFetcher::parse_revisions_array): Include commit_id as the first item in the result.
1648 * public/v3/instrumentation.js:
1649 * public/v3/models/analysis-task.js:
1650 (AnalysisTask): Fixed a bug that _buildRequestCount and _finishedBuildRequestCount could be kept
1651 as strings and hasPendingRequests() could return a wrong result because it would perform string
1652 inequality instead of numerical inequality.
1653 (AnalysisTask.prototype.updateSingleton): Ditto.
1654 (AnalysisTask.prototype.dissociateCommit):
1655 (AnalysisTask._constructAnalysisTasksFromRawData):
1656 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Use findById now that CommitLog
1657 objects all use the same id as the database id.
1658 * public/v3/models/commit-log.js:
1660 (CommitLog.prototype.remoteId): Deleted since we no longer create a fake id for commit logs for
1662 (CommitLog.findByRemoteId): Deleted.
1663 (CommitLog.ensureSingleton): Deleted.
1664 (CommitLog.fetchBetweenRevisions):
1666 * public/v3/models/data-model.js:
1667 (DataModelObject.clearStaticMap): Added to aid unit testing.
1668 (DataModelObject.ensureNamedStaticMap): Fixed a typo. Each map is a dictionary, not an array.
1669 * public/v3/models/metric.js:
1670 * public/v3/models/platform.js:
1671 * public/v3/models/root-set.js:
1672 (RootSet): Updated per the interface change in CommitLog.ensureSingleton.
1673 (MeasurementRootSet): Updated per /api/measurement-set change. Use the first value as the id.
1674 * public/v3/models/test.js:
1675 * unit-tests/analysis-task-tests.js: Added.
1676 (sampleAnalysisTask):
1677 (measurementCluster):
1678 * unit-tests/checkconfig.js: Added some assertion message to help aid diagnosing the failure.
1679 * unit-tests/measurement-adaptor-tests.js: Updated the sample data per the API change in
1680 /api/measurement-set and also added assertions for commit log ids.
1681 * unit-tests/measurement-set-tests.js:
1683 * unit-tests/resources: Added.
1684 * unit-tests/resources/mock-remote-api.js: Added. Extracted from measurement-set-tests.js to be
1685 used in analysis-task-tests.js.
1686 (assert.notReached.assert.notReached):
1687 (global.RemoteAPI.getJSON):
1688 (global.RemoteAPI.getJSONWithStatus):
1690 * unit-tests/resources/v3-models.js: Added. Extracted from measurement-set-tests.js to be used in
1691 analysis-task-tests.js and added more imports as needed.
1695 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1697 Build fix after r198464.
1699 * public/v3/components/analysis-results-viewer.js:
1700 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
1702 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1704 Build fix after r198234.
1706 * public/api/commits.php:
1707 (main): Typo: fetch_latest_reported -> fetch_last_reported.
1708 * public/include/commit-log-fetcher.php:
1709 (CommitLogFetcher::format_single_commit): commits should be an array.
1711 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1713 Perf Dashboard v3 confuses better and worse on A/B task page
1714 https://bugs.webkit.org/show_bug.cgi?id=155675
1715 <rdar://problem/25208723>
1717 Reviewed by Joseph Pecoraro.
1719 The analysis results viewer on v3 UI sometimes treats regressions as progressions and vice versa when
1720 the first set (i.e. set A) of the revisions used in an A/B testing never appears in the original graph,
1721 and its latest commit time matches that of the second set, which appears in the original graph.
1723 Because the analysis results viewer compares results in the increasing row number, this results in
1724 B to be compared to A instead of A to be compared to B. Fixed the bug by preventing the wrong ordering
1725 to occur in _buildRowsForPointsAndTestGroups by always inserting a root set A before B when B appears
1726 and A doesn't appear in the original graph.
1728 * public/v3/components/analysis-results-viewer.js:
1729 (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Remember the succeeding root set B
1730 when creating an entry for root set A.
1731 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Fixed the bug. Also un-duplicated
1732 the code to create a new row.
1733 (AnalysisResultsViewer.RootSetInTestGroup): Now takes a succeeding root set. e.g. it's B for A and
1734 undefined for B in A/B testing.
1735 (AnalysisResultsViewer.RootSetInTestGroup.prototype.succeedingRootSet): Added.
1736 * public/v3/components/time-series-chart.js:
1737 (TimeSeriesChart.computeTimeGrid): Fixed the bug that we would end up showing 0 AM instead of dates
1738 when both dates and months change.
1740 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1742 Add unit tests for measurement-set.js and measurement-adapter.js
1743 https://bugs.webkit.org/show_bug.cgi?id=155673
1745 Reviewed by Daniel Bates.
1747 Add tests which were supposed to be added in r198462.
1749 * unit-tests/measurement-adaptor-tests.js: Added.
1750 * unit-tests/measurement-set-tests.js: Added.
1751 (assert.notReached): Added.
1752 (global.RemoteAPI.getJSON): Added.
1753 (global.RemoteAPI.getJSONWithStatus): Added. A mock.
1755 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1757 Add unit tests for measurement-set.js and measurement-adapter.js
1758 https://bugs.webkit.org/show_bug.cgi?id=155673
1760 Reviewed by Darin Adler.
1762 Added mocha unit tests for MeasurementSet and MeasurementAdapter classes along with the necessary
1763 refactoring to run these tests in node.
1765 getJSON and getJSONStatus are now under RemoteAPI so that unit tests can mock them.
1767 Removed the dependency on v2 UI's TimeSeries and Measurement class by adding a new implementation
1768 of TimeSeries in v3 and removing the dependency on Measurement in chart-pane-status-view.js with
1769 new helper methods on Build and CommitLog.
1771 Many js files now use 'use strict' (node doesn't support class syntax in non-strict mode) and
1772 module.exports to export symbols in node's require function.
1774 * public/v3/index.html:
1775 * public/v3/main.js:
1776 * public/v3/models/analysis-results.js:
1777 (AnalysisResults.fetch):
1778 * public/v3/models/analysis-task.js:
1779 (AnalysisTask.fetchAll):
1780 * public/v3/models/builder.js:
1782 (Build.prototype.builder): Added. Used by ChartPaneStatusView.
1783 (Build.prototype.buildNumber): Ditto.
1784 (Build.prototype.buildTime): Ditto.
1785 * public/v3/models/commit-log.js:
1786 (CommitLog.prototype.diff): Ditto.
1787 (CommitLog.fetchBetweenRevisions):
1788 * public/v3/models/data-model.js:
1789 (DataModelObject.cachedFetch):
1790 * public/v3/models/measurement-adaptor.js:
1791 (MeasurementAdaptor.prototype.applyToAnalysisResults): Renamed from adoptToAnalysisResults.
1792 (MeasurementAdaptor.prototype.applyTo): Renamed from adoptToSeries. Now shares a lot more
1793 code with applyToAnalysisResults. The code to set 'series' and 'seriesIndex' has been moved
1794 to TimeSeries.append. 'measurement' is no longer needed as this patch removes its only use
1795 in ChartPaneStatusView.
1796 * public/v3/models/measurement-cluster.js:
1797 (MeasurementCluster.prototype.addToSeries): Use TimeSeries.append instead of directly mutating
1799 * public/v3/models/measurement-set.js:
1800 (Array.prototype.includes): Added a polyfill for node.
1801 (MeasurementSet.prototype._fetchSecondaryClusters): Removed a bogus assertion. When fetchBetween
1802 is called with a mixture of clusters that have been fetched and not fetched, this assertion fails.
1803 (MeasurementSet.prototype._fetch):
1804 (TimeSeries.prototype.findById): Moved to time-series.js.
1805 (TimeSeries.prototype.dataBetweenPoints): Ditto.
1806 (TimeSeries.prototype.firstPoint): Ditto.
1807 (TimeSeries.prototype.fetchedTimeSeries): Moved the code to extend the last point to TimeSeries'
1809 * public/v3/models/repository.js:
1810 * public/v3/models/root-set.js:
1811 (MeasurementRootSet): Ignore repositories that had not been defined (e.g. it could be added after
1812 manifest.json had been downloaded but before a given root set is created for an A/B testing).
1813 * public/v3/models/time-series.js:
1814 (TimeSeries): Added.
1815 (TimeSeries.prototype.append): Added.
1816 (TimeSeries.prototype.extendToFuture): Added.
1817 (TimeSeries.prototype.firstPoint): Moved from measurement-set.js.
1818 (TimeSeries.prototype.lastPoint): Added.
1819 (TimeSeries.prototype.previousPoint): Added.
1820 (TimeSeries.prototype.nextPoint): Added.
1821 (TimeSeries.prototype.findPointByIndex): Added.
1822 (TimeSeries.prototype.findById): Moved from measurement-set.js.
1823 (TimeSeries.prototype.findPointAfterTime): Added.
1824 (TimeSeries.prototype.dataBetweenPoints): Moved from measurement-set.js.
1825 * public/v3/pages/chart-pane-status-view.js:
1826 (ChartPaneStatusView.prototype.render): Use newly added helper functions on Build.
1827 (ChartPaneStatusView.prototype._formatTime): Added.
1828 (ChartPaneStatusView.prototype.setCurrentRepository):
1829 (ChartPaneStatusView.prototype.computeChartStatusLabels): Rewrote the code using RootSet object on
1830 currentPoint and previousPoint instead of Measurement class from v2 UI. Also sort the results using
1831 sortByNamePreferringOnesWithURL.
1832 * public/v3/remote.js:
1833 (RemoteAPI.getJSON): Moved under RemoteAPI.
1834 (RemoteAPI.getJSONWithStatus): Ditto.
1836 (PrivilegedAPI.requestCSRFToken):
1838 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1840 Add unit tests for config.json and statistics.js
1841 https://bugs.webkit.org/show_bug.cgi?id=155626
1843 Reviewed by Darin Adler.
1845 Added mocha unit tests for statistics.js and validating config.json. For segmentations, I've extracted
1846 real data from our internal perf dashboard.
1848 Also fixed some bugs covered by these new tests.
1850 * public/shared/statistics.js:
1851 (Statistics.movingAverage): Fixed a bug that forwardWindowSize was never used.
1852 (Statistics.exponentialMovingAverage): Fixed the bug that the moving average starts at 0. It should
1853 start at the first value instead.
1854 (.splitIntoSegmentsUntilGoodEnough): Fixed the bug that we may try to segment a time series into
1855 more parts than there are data points. Clearly, that doesn't make any sense.
1856 (.findOptimalSegmentation): Renamed local variables so that they're more descriptive, and rewrote
1857 the debugging code was the old code was emitting some useless data. Also fixed the bug that the length
1858 of "segmentation" was off by one (we need segmentCount + 1 elements in the array sine we always
1859 include the start of the first segment = 0 and the end of the last segment = values.length).
1860 (.SampleVarianceUpperTriangularMatrix):
1861 (Statistics): Modernized the export code.
1863 * tools/js/config.js: Added.
1865 (Config.prototype.configFilePath): Added.
1866 (Config.prototype.value): Added.
1867 (Config.prototype.path): Added.
1868 * tools/js/database.js: Added.
1870 (Database.prototype.connect): Added.
1871 (Database.prototype.disconnect): Added.
1872 * unit-tests: Added.
1873 * unit-tests/checkconfig.js: Added. Validates config.json. This is useful while setting up
1874 a local instance of the perf dashboard.
1875 * unit-tests/statistics-tests.js: Added.
1876 (assert.almostEqual): Added. Asserts that two floating values are within a given significant digits.
1881 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1883 Fix a typo which was supposed to be fixed in r198351.
1885 * public/v3/pages/analysis-task-page.js:
1886 (AnalysisTaskPage.prototype.render):
1888 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
1890 An analysis task should be closed if a progression cause is identified
1891 https://bugs.webkit.org/show_bug.cgi?id=155549
1893 Reviewed by Chris Dumez.
1895 Since a progression is desirable, we should close an analysis task once its cause is identified.
1897 Also fix some typos.
1899 * init-database.sql: Fixed a typo.
1900 * public/api/analysis-tasks.php:
1901 * public/v3/models/analysis-task.js:
1902 (AnalysisTask.prototype.dissociateBug): Renamed from dissociateBug.
1903 * public/v3/pages/analysis-task-page.js:
1904 (AnalysisTaskPage.prototype.render):
1905 (AnalysisTaskPage.prototype._dissociateBug): Renamed from _dissociateBug.
1906 (AnalysisTaskPage.prototype._dissociateCommit): Fixed the typo in the alert.
1908 2016-03-16 Ryosuke Niwa <rniwa@webkit.org>
1910 Analysis task page should allow specifying commits that caused or fixed a regression or a progression
1911 https://bugs.webkit.org/show_bug.cgi?id=155529
1913 Reviewed by Chris Dumez.
1915 Added the capability to associate revisions that caused or fixed a progression or a regression for which
1916 an analysis task was created. Added task_commits that stores this relationship and added the backend
1917 support to retrieve this table in /api/analysis-tasks and an privileged API to update this table at
1918 /privileged-api/associate-commit.
1920 Also extracted a new component, MutableListView, out of AnalysisTaskPage to render and manipulate a list
1921 of mutable items, and used it to render the list of associated bugs and commits. The view takes a list of
1922 kinds (e.g. repositories or bug trackers), and accepts a pair of a kind and arbitrary text as a new item
1925 * init-database.sql: Added task_commits table.
1927 * public/api/analysis-tasks.php:
1929 (fetch_associated_data_for_tasks): Renamed from fetch_and_push_bugs_to_tasks now that it also fetches
1930 the list of commits associated with each analysis task by calling CommitLogFetcher::fetch_for_tasks.
1931 Also fixe the bug that we were not taking
1932 (format_task): No longer sets 'category' since the computation of category now depends on the list of
1933 commits associated with this analysis task which aren't available until fetch_associated_data_for_tasks.
1934 (determine_category): Added. Categorize any analysis tasks with "fixes" commits as "closed" and "causes"
1935 commits as "identified".
1937 * public/include/commit-log-fetcher.php:
1938 (CommitLogFetcher::__construct): Remove the unused instance variable.
1939 (CommitLogFetcher::fetch_for_tasks): Added. Fetches all commits associated with a list of analysis tasks.
1940 Assumes the caller (fetch_associated_data_for_tasks) had setup "fixes" and "causes" fields on each task.
1942 * public/privileged-api/associate-commit.php: Added. Updates task_commits table to associate or disassociate
1943 a commit with an analysis task. When the specified analysis task and the specified commit are already
1944 associated, we simply update the table instead of adding a duplicating entry or error. For dissociation,
1945 the front-end specifies the commit ID.
1948 * public/v3/index.html:
1949 * public/v3/components/mutable-list-view.js: Added. Used by the list associated bugs and commits.
1950 (MutableListView): Added.
1951 (MutableListView.prototype.setList): Added.
1952 (MutableListView.prototype.setKindList): Added.
1953 (MutableListView.prototype.setAddCallback): Added. This callback is invoked when the user tries to add
1954 a new item to the list.
1955 (MutableListView.prototype.render): Added.
1956 (MutableListView.prototype._submitted): Added.
1957 (MutableListView.cssTemplate):
1958 (MutableListView.htmlTemplate):
1959 (MutableListItem): Added. RemovalLink could be a hyperlink or a callback and gets involved when the user
1960 tries to delete this item.
1961 (MutableListItem.prototype.content):
1963 * public/v3/models/analysis-task.js:
1964 (AnalysisTask): Added the support of the list of commits that fixed and caused changes.
1965 (AnalysisTask.prototype.updateSingleton): Ditto.
1966 (AnalysisTask.prototype.causes): Added.
1967 (AnalysisTask.prototype.fixes): Added.
1968 (AnalysisTask.prototype.associateCommit): Added. Use the API added at /privileged-api/associate-commit
1969 to associate a new commit with this analysis task. Each commit has either caused or fixed the change.
1970 (AnalysisTask.prototype.dissociateCommit): Added. Use the same API to disassociate each commit.
1971 (AnalysisTask._constructAnalysisTasksFromRawData): Find all commits associated with each analysis task.
1972 Because commit log objects use a fake ID fdue to /api/measurement-set not providing commit IDs, we must
1973 use CommitLog.findByRemoteId to find each commit instead of usual CommitLog.findById.
1974 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Added.
1976 * public/v3/models/build-request.js:
1977 (BuildRequest.prototype.hasFinished): Renamed from hasCompleted since it was confusing for this._status
1978 being "completed" wasn't a necessary condition for this function to return true.
1980 * public/v3/models/commit-log.js:
1981 (CommitLog): Added the static map for actual commit ID instead of a fake ID created in ensureSingleton.
1982 (CommitLog.prototype.remoteId): Added. Returns the real commit ID.
1983 (CommitLog.findByRemoteId): Added. Finds an CommitLog object using the real ID.
1985 * public/v3/models/test-group.js:
1986 (TestGroup.prototype.hasFinished): Renamed from hasCompleted to match the rename in BuildRequest.
1988 * public/v3/pages/analysis-task-page.js:
1989 (AnalysisTaskPage): Added lists for the commits that fixed and caused the change using MutableListView.
1990 Also adopted MutableListView for the list of associated bugs.
1991 (AnalysisTaskPage.prototype.render): Added the code to populate the newly added lists.
1992 (AnalysisTaskPage.prototype._makeCommitListItem): Added.
1993 (AnalysisTaskPage.prototype._associateBug): Now this is a callback from MutableListView.
1994 (AnalysisTaskPage.prototype._associateCommit): Added.
1995 (AnalysisTaskPage.prototype._dissociateCommit): Added.
1996 (AnalysisTaskPage.htmlTemplate):
1997 (AnalysisTaskPage.cssTemplate):
1999 * public/v3/remote.js:
2000 (getJSON): Spit out the entire responseText when JSON failed to parse to make debugging easier.
2002 2016-03-15 Ryosuke Niwa <rniwa@webkit.org>
2004 Extract the code to format commit logs into its own PHP file
2005 https://bugs.webkit.org/show_bug.cgi?id=155514
2007 Rubber-stamped by Chris Dumez.
2009 Extracted CommitLogFetcher out of /api/commits so that it could be used in analysis-tasks.php
2010 in the future to support associating cause/fix for each analysis task.
2012 * public/api/commits.php:
2013 * public/include/commit-log-fetcher.php: Added.
2015 (CommitLogFetcher::__construct): Added.
2016 (CommitLogFetcher::repository_id_from_name): Added.
2017 (CommitLogFetcher::fetch_between): Added.
2018 (CommitLogFetcher::fetch_oldest): Added.
2019 (CommitLogFetcher::fetch_latest): Added.
2020 (CommitLogFetcher::fetch_last_reported): Added.
2021 (CommitLogFetcher::fetch_revision): Added.
2022 (CommitLogFetcher::commit_for_revision): Added.
2023 (CommitLogFetcher::format_single_commit): Added.
2024 (CommitLogFetcher::format_commit): Added.
2026 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
2028 Build fix after r196870.
2030 * public/include/report-processor.php:
2032 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
2034 Add Size metric to perf dashboard
2035 https://bugs.webkit.org/show_bug.cgi?id=155266
2037 Reviewed by Chris Dumez.
2039 Added the "Size" metric and use bytes as its unit.
2041 * public/js/helper-classes.js:
2043 * public/v2/data.js:
2044 (RunsData.unitFromMetricName):
2046 2016-02-20 Ryosuke Niwa <rniwa@webkit.org>
2048 Add the support for universal slave password
2049 https://bugs.webkit.org/show_bug.cgi?id=154476
2051 Reviewed by David Kilzer.
2053 Added the support for universalSlavePassword.
2056 * public/include/report-processor.php:
2057 (ReportProcessor::process):
2058 (ReportProcessor::authenticate_and_construct_build_data): Extracted from process().
2060 2016-02-19 Ryosuke Niwa <rniwa@webkit.org>
2062 Analysis tasks page complains about missing repository but with a wrong name
2063 https://bugs.webkit.org/show_bug.cgi?id=154468
2065 Reviewed by Chris Dumez.
2067 Fixed the bug by using the right variable in the template literal.
2069 * public/v3/components/customizable-test-group-form.js:
2070 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use querySelector here since Chrome doesn't have
2071 getElementsByClassName on ShadowRoot.
2072 * public/v3/pages/analysis-task-page.js:
2073 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Use name which is the name of
2076 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
2078 Revert an unintended change made in the previous commit.
2080 * init-database.sql:
2082 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
2084 Perf dashboard should let user cancel pending A/B testing and hide failed ones
2085 https://bugs.webkit.org/show_bug.cgi?id=154433
2087 Reviewed by Chris Dumez.
2089 Added a button to hide a test group in the details view (the bottom table) in the analysis task page, and
2090 "Show hidden tests" link to show the hidden test groups on demand. When a test group is hidden, all pending
2091 requests in the group will also be canceled since a common scenario of using this feature is that the user
2092 had triggered an useless A/B testing; e.g. all builds will fail, wrong, etc... We can revisit and add the
2093 capability to just cancel the pending requests and leaving the group visible later if necessary.
2095 Run `ALTER TYPE build_request_status_type ADD VALUE 'canceled';` to add the new type.
2097 * init-database.sql: Added testgroup_hidden column to analysis_test_groups table and added 'canceled'
2098 as a value to build_request_status_type table.
2099 * public/api/test-groups.php:
2100 (format_test_group): Added 'hidden' field in the JSON result.
2101 * public/privileged-api/update-test-group.php:
2102 (main): Added the support for updating testgroup_hidden column. When this column is set to true, also
2103 cancel all pending build requests (by setting its request_status to 'canceled' which will be ignore by
2104 the syncing script).
2105 * public/v3/components/test-group-results-table.js:
2106 (TestGroupResultsTable.prototype.setTestGroup): Reset _renderedTestGroup here so that the next call to
2107 render() will update the table; e.g. when build requests' status change from 'Pending' to 'Canceled'.
2108 * public/v3/models/build-request.js:
2109 (BuildRequest.prototype.hasCompleted): A build request is considered complete/finished if it's canceled.
2110 (BuildRequest.prototype.hasPending): Added.
2111 (BuildRequest.prototype.statusLabel): Handle 'canceled' status.
2112 * public/v3/models/test-group.js:
2114 (TestGroup.prototype.updateSingleton): Added to update 'hidden' field.
2115 (TestGroup.prototype.isHidden): Added.
2116 (TestGroup.prototype.hasPending): Added.
2117 (TestGroup.prototype.hasPending): Added.
2118 (TestGroup.prototype.updateHiddenFlag): Added. Uses the privileged API to update testgroup_hidden column.
2119 The JSON API also updates the status of the 'pending' build requests in the group to 'canceled'.
2120 * public/v3/pages/analysis-task-page.js:
2121 (AnalysisTaskPage): Added _showHiddenTestGroups and _filteredTestGroups as instance variables.
2122 (AnalysisTaskPage.prototype._didFetchTestGroups):
2123 (AnalysisTaskPage.prototype._showAllTestGroups): Added.
2124 (AnalysisTaskPage.prototype._didUpdateTestGroupHiddenState): Extracted from _didFetchTestGroups.
2125 (AnalysisTaskPage.prototype._renderTestGroupList): Use the filtered list of test groups to show the list
2126 of test groups. When all test groups are shown, we would first show the hidden ones after the regular ones.
2127 (AnalysisTaskPage.prototype._createTestGroupListItem): Extracted from _renderTestGroupList.
2128 (AnalysisTaskPage.prototype._renderTestGroupDetails): Update the text inside the button to hide the test
2129 group. Also show a warning text that the pending requests will be canceled if there are any.
2130 (AnalysisTaskPage.prototype._hideCurrentTestGroup): Added.
2131 (AnalysisTaskPage.cssTemplate): Updated the style.
2133 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
2135 The rows in the analysis results table should be expandable
2136 https://bugs.webkit.org/show_bug.cgi?id=154427
2138 Reviewed by Chris Dumez.
2140 Added "(Expand)" link between rows that have hidden points. Upon click it inserts the hidden rows.
2142 We insert around five rows at a time when there are hundreds of hidden points but we also avoid leaving
2143 behind expandable rows of less than two rows.
2145 Also fixed a bug in CustomizableTestGroupForm that getElementsById would throw in the shipping Safari
2146 because getElementsById doesn't exist on Element.prototype by using class name instead.
2148 * public/v3/components/analysis-results-viewer.js:
2149 (AnalysisResultsViewer):
2150 (AnalysisResultsViewer.prototype.setCurrentTestGroup): Removed superfluous call to render().
2151 (AnalysisResultsViewer.prototype.setPoints): Always show the start and the end points.
2152 (AnalysisResultsViewer.prototype.buildRowGroups):
2153 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Add an instance of ExpandableRow which
2154 shows a "(Expand)" link to show hidden rows here.
2155 (AnalysisResultsViewer.prototype._expandBetween): Added. Expands rows between two points.
2156 (AnalysisResultsViewer.cssTemplate): Added rules for "(Expand)" links.
2157 (AnalysisResultsViewer.ExpandableRow): Added.
2158 (AnalysisResultsViewer.ExpandableRow.prototype.resultContent): Added. Overrides what's in the results column.
2159 (AnalysisResultsViewer.ExpandableRow.prototype.heading): Added. Generates "(Expand)" link.
2161 * public/v3/components/customizable-test-group-form.js:
2162 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use getElementsByClassName instead of
2164 (CustomizableTestGroupForm.prototype._classForLabelAndRepository): Renamed from _idForLabelAndRepository.
2165 (CustomizableTestGroupForm._constructRevisionRadioButtons): Set class name instead of id.
2167 * public/v3/components/results-table.js:
2168 (ResultsTable.prototype.render): Don't generate radio buttons to select a row when root set is missing;
2169 e.g. for rows that show "(Expand)" links.
2171 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
2173 Statistically significant A/B testing results should be color coded in details view
2174 https://bugs.webkit.org/show_bug.cgi?id=154414
2176 Reviewed by Chris Dumez.
2178 Color code the statistically significant comparisions in TestGroupResultsTable as done in the analysis
2181 * public/v3/components/customizable-test-group-form.js:
2182 (CustomizableTestGroupForm.cssTemplate): Build fix after r196768.
2183 * public/v3/components/test-group-results-table.js:
2184 (TestGroupResultsTable.prototype.buildRowGroups): Add the status as a class name.
2185 (TestGroupResultsTable.cssTemplate): Added styles to color-code statistically significant results.
2187 2016-02-17 Ryosuke Niwa <rniwa@webkit.org>
2189 v3 UI should allow custom revisions for A/B testing
2190 https://bugs.webkit.org/show_bug.cgi?id=154379
2192 Reviewed by Chris Dumez.
2194 Added the capability to customize revisions selected in the overview chart and the results viewer.
2196 Newly added CustomizableTestGroupForm is responsible for allowing users to modify the set of revisions in
2197 a new A/B testing group. Unlike TestGroupForm which doesn't know anything about which revisions are selected
2198 for each project/repository, CustomizableTestGroupForm is aware of the list of revisions used in each set.
2200 The list of revisions used in each set is represented by RootSet if users had not customized them, and
2201 CustomRootSet otherwise; the latter was added since regular RootSet object requires CommitLog and other
2202 DataModelObjects which are hard to create without corresponding database entries.
2204 * public/v3/components/customizable-test-group-form.js: Added.
2205 (CustomizableTestGroupForm): Added.
2206 (CustomizableTestGroupForm.prototype.setRootSetMap): Added.
2207 (CustomizableTestGroupForm.prototype._submitted): Overrides the superclass' method.
2208 (CustomizableTestGroupForm.prototype._customize): Ditto. Unlike TestGroupForm's callback, this class'
2209 callback passes in a root set map as the third argument.
2210 (CustomizableTestGroupForm.prototype._computeRootSetMap): Added. Returns this._rootSetMap, which is set by
2211 AnalysisTaskPage if user had not customized the root sets. Otherwise return a new map with CustomRootSet's.
2212 (CustomizableTestGroupForm.prototype.render): Added. Creates a table to allow customization of root sets.
2213 (CustomizableTestGroupForm._constructRevisionRadioButtons): Added.
2214 (CustomizableTestGroupForm._createRadioButton): Added.
2215 (CustomizableTestGroupForm.cssTemplate): Added.
2216 (CustomizableTestGroupForm.formContent): Added. This method is called by TestGroupForm.htmlTemplate.
2217 * public/v3/components/test-group-form.js:
2218 (TestGroupForm): Updated the various methods to not directly mutate DOM. Store the state in instance
2219 variables and update DOM in render() as done elsewhere.
2220 (TestGroupForm.prototype.setNeedsName): Deleted. We no longer need this flag since TestGroupForm which is
2221 used for retries never needs a name and CustomizableTestGroupForm which is used to create a new test group
2222 always requires a name.
2223 (TestGroupForm.prototype.setDisabled):
2224 (TestGroupForm.prototype.setLabel):
2225 (TestGroupForm.prototype.setRepetitionCount):
2226 (TestGroupForm.prototype.render): Added.
2227 (TestGroupForm.prototype._submitted): Moved the code to prevent the default action has been moved to the
2228 constructor since this method is overridden by CustomizableTestGroupForm.
2229 (TestGroupForm.cssTemplate): Added.
2230 (TestGroupForm.htmlTemplate):
2231 (TestGroupForm.formContent): Extracted from htmlTemplate.
2232 * public/v3/index.html:
2233 * public/v3/models/repository.js:
2234 (Repository.sortByNamePreferringOnesWithURL): Added.
2235 * public/v3/models/root-set.js:
2236 (RootSet.prototype.revisionForRepository): Added so that _createTestGroupAfterVerifyingRootSetList can retrieve
2237 the revision information from CustomRootSet without going through CommitLog objects since CustomRootSet doesn't
2238 have associated CommitLog objects.
2239 (CustomRootSet): Added. Used by CustomizableTestGroupForm to create a custom root map since regular RootSet
2240 requires CommitLog and other related objects which are hard to create without database entries.
2241 (CustomRootSet.prototype.setRevisionForRepository): Added.
2242 (CustomRootSet.prototype.repositories): Added.
2243 (CustomRootSet.prototype.revisionForRepository): Added.
2244 * public/v3/pages/analysis-task-page.js:
2246 (AnalysisTaskPage.prototype.render): Removed the reference to v2 UI since v3 UI is now strictly more powerful
2247 than v2 UI. Also update the root set maps in each form here.
2248 (AnalysisTaskPage.prototype._retryCurrentTestGroup): No longer takes unused name argument as it got removed
2250 (AnalysisTaskPage.prototype._chartSelectionDidChange): No longer updates the disabled-ness here since it's now
2251 done in render() via setRootSetMap().
2252 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Now takes rootSetMap as an argument.
2253 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): No longer updates the disabled-ness here
2254 since it's now done in render() via setRootSetMap().
2255 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Now takes rootSetMap as an argument.
2256 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Take a dictionary of root set labels
2257 such as A and B, which maps to a RootSet or a newly-added CustomRootSet.
2258 (AnalysisTaskPage.htmlTemplate): Use customizable-test-group-form for creating a new A/B testing group. Retry
2259 form will continue to use TestGroupForm since customizing revisions is non-sensical in retries.
2260 (AnalysisTaskPage.cssTemplate): Updated the style.
2262 2016-02-16 Ryosuke Niwa <rniwa@webkit.org>
2264 v3 UI has the capability to schedule an A/B testing in a specific range
2265 https://bugs.webkit.org/show_bug.cgi?id=154329
2267 Reviewed by Chris Dumez.
2269 Extended AnalysisTaskChartPane and ResultsTable so that users can select a range of points in either
2270 the overview chart pane and the results viewer table. Extracted TestGroupForm out of the analysis task
2271 page and used right below those two components in the analysis task page.
2273 * public/v3/components/results-table.js:
2275 (ResultsTable.prototype.setRangeSelectorLabels): Added.
2276 (ResultsTable.prototype.setRangeSelectorCallback): Added.
2277 (ResultsTable.prototype.selectedRange): Added.
2278 (ResultsTable.prototype._rangeSelectorClicked): Added.
2279 (ResultsTable.prototype.render): Generate radio boxes to select a range.
2281 * public/v3/components/test-group-form.js:
2283 (TestGroupForm.prototype.setStartCallback): Added.
2284 (TestGroupForm.prototype.setNeedsName): Added.
2285 (TestGroupForm.prototype.setDisabled): Added.
2286 (TestGroupForm.prototype.setLabel): Added.
2287 (TestGroupForm.prototype.setRepetitionCount): Added.
2288 (TestGroupForm.prototype._submitted): Added.
2289 (TestGroupForm.htmlTemplate): Extracted from AnalysisTaskPage.htmlTemplate.
2291 * public/v3/index.html:
2293 * public/v3/pages/analysis-task-page.js:
2294 (AnalysisTaskChartPane.prototype._mainSelectionDidChange): Added. Delegates the work to AnalysisTaskPage.
2295 (AnalysisTaskChartPane.prototype.selectedPoints): Added.
2297 (AnalysisTaskPage.prototype.title):
2298 (AnalysisTaskPage.prototype.render):
2299 (AnalysisTaskPage.prototype._renderTestGroupDetails): Use TestGroupForm's methods instead of mutating DOM.
2300 (AnalysisTaskPage.prototype._retryCurrentTestGroup):
2301 (AnalysisTaskPage.prototype._chartSelectionDidChange): Added.
2302 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Added.
2303 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): Added.
2304 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Added.
2305 (AnalysisTaskPage.prototype._createRetryNameForTestGroup):
2306 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Extracted from _retryCurrentTestGroup
2307 so that we can call it in _createNewTestGroupFromChart and _createNewTestGroupFromViewer.
2308 (AnalysisTaskPage.htmlTemplate):
2310 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
2312 Extract the code specific to v2 UI out of shared statistics.js
2313 https://bugs.webkit.org/show_bug.cgi?id=154277
2315 Reviewed by Chris Dumez.
2317 Extracted statistics-strategies.js out of statistics.js for v2 UI and detect-changes.js. The intent is to
2318 deprecate this file once we implement refined statistics tools in v3 UI and adopt it in detect-changes.js.
2320 * public/shared/statistics.js:
2321 (Statistics.movingAverage): Extracted from the "Simple Moving Average" strategy.
2322 (Statistics.cumultaiveMovingAverage): Extracted from the "Cumulative Moving Average" strategy.
2323 (Statistics.exponentialMovingAverage): Extracted from the "Exponential Moving Average" strategy.
2324 Use a temporary "movingAverage" to keep the last moving average instead of relying on the previous
2325 entry in "averages" array to avoid special casing an array of length 1 and starting the loop at i = 1.
2326 (Statistics.segmentTimeSeriesGreedyWithStudentsTTest): Extracted from "Segmentation: Recursive t-test"
2327 strategy. Don't create the list of averages to match segmentTimeSeriesByMaximizingSchwarzCriterion here.
2328 It's done in newly added averagesFromSegments.
2329 (Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Extracted from
2330 "Segmentation: Schwarz criterion" strategy.
2331 (.recursivelySplitIntoTwoSegmentsAtMaxTIfSignificantlyDifferent): Just store the start index to match
2333 (App.Pane.updateStatisticsTools):
2334 (App.Pane._computeMovingAverageAndOutliers):
2335 * public/v2/data.js:
2336 * public/v2/index.html:
2337 * public/v2/statistics-strategies.js: Added.
2338 (StatisticsStrategies.MovingAverageStrategies): Added.
2339 (averagesFromSegments): Extracted from "Segmentation: Schwarz criterion" strategy. Now used by both
2340 "Segmentation: Recursive t-test" and "Segmentation: Schwarz criterion" strategies.
2341 (StatisticsStrategies.EnvelopingStrategies): Moved from Statistics.EnvelopingStrategies.
2342 (StatisticsStrategies.TestRangeSelectionStrategies): Moved from Statistics.TestRangeSelectionStrategies.
2343 (createWesternElectricRule): Moved from statistics.js.
2344 (countValuesOnSameSide): Ditto.
2345 (StatisticsStrategies.executeStrategy): Moved from Statistics.executeStrategy.
2346 * tools/detect-changes.js:
2347 (computeRangesForTesting):
2349 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
2351 v1 UI and v2 UI should share statistics.js
2352 https://bugs.webkit.org/show_bug.cgi?id=154262
2354 Reviewed by Chris Dumez.
2356 Share statistics.js between v1 and v2 UI.
2358 * public/index.html:
2359 * public/js/shared.js: Deleted.
2360 * public/js/statistics.js: Removed.
2361 * public/shared: Added.
2362 * public/shared/statistics.js: Moved from Websites/perf.webkit.org/public/v2/js/statistics.js.
2363 * public/v2/index.html:
2364 * public/v2/js/statistics.js: Removed.
2365 * public/v3/index.html:
2366 * tools/detect-changes.js:
2368 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
2370 v3 UI sometimes shows same dates twice on the x-axis of time series charts
2371 https://bugs.webkit.org/show_bug.cgi?id=154210
2373 Reviewed by Chris Dumez.
2375 The bug was caused by the label generation code in TimeSeriesChart.computeTimeGrid never emitting hours.
2377 Use hours instead of dates as labels when the current time's date is same as the previous label's date.
2378 Always include dates before entering this mode to avoid just having hours as labels on the entire x-axis.
2380 * public/v3/components/time-series-chart.js:
2381 (TimeSeriesChart.prototype._renderXAxis): Slightly increase the "average" width of x-axis label.
2382 (TimeSeriesChart.computeTimeGrid): See above. Also assert that the number of labels we generate never
2383 exceeds maxLabels as a sanity check.
2384 (TimeSeriesChart._timeIterators): Added an iterator that increments by two hours for zoomed graphs.
2386 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
2388 v3 UI should show status and associated bugs on analysis task pages
2389 https://bugs.webkit.org/show_bug.cgi?id=154212
2391 Reviewed by Chris Dumez.
2393 Added the capability to see and modify the status and the list of associated of bugs on analysis task pages.
2395 Also added the list of related tasks, which are analysis tasks associated with the same bug or have
2396 overlapping time ranges with the same test metric but on a potentially different platform.
2398 In addition, categorize analysis tasks with the status of "no change" or "inconclusive" as "closed" as no
2399 further action can be taken (users can bring them back to non-closed state without any restrictions).
2401 * public/api/analysis-tasks.php:
2402 (format_task): Categorize 'unchanged' and 'inconclusive' analysis tasks as closed.
2404 * public/privileged-api/associate-bug.php:
2405 (main): Added shouldDelete as a new mechanism to disassociate a bug since v3 UI shares a single Bug object
2406 between multiple analysis tasks (as it should have been in the first place).
2408 * public/v3/components/chart-pane-base.js:
2410 (ChartPaneBase.prototype._fetchAnalysisTasks): Since each analysis task's change type (status/result) could
2411 change, we need to create annotation objects during each render() call.
2412 (ChartPaneBase.prototype.render):
2413 (ChartPaneBase.prototype._renderAnnotations): Extracted from ChartPaneBase.prototype._fetchAnalysisTasks to
2414 do that. I was afraid of the perf impact of this but it doesn't seem to be an issue in my testing.
2415 (ChartPaneBase.cssTemplate): Removed superfluous margins (moved to ChartPane.cssTemplate) around the charts
2416 since they are only useful in the charts page.
2418 * public/v3/models/analysis-task.js:
2420 (AnalysisTask.prototype.updateSingleton): Added a comment as to why object.result cannot be renamed to
2421 object.changeType in the JSON API.
2422 (AnalysisTask.prototype.updateName): Added.
2423 (AnalysisTask.prototype.updateChangeType): Added.
2424 (AnalysisTask.prototype._updateRemoteState): Added.
2425 (AnalysisTask.prototype.associateBug): Added.
2426 (AnalysisTask.prototype.disassociateBug): Added.
2427 (AnalysisTask.fetchRelatedTasks): Added. See above for the criteria of related-ness.
2429 * public/v3/pages/analysis-task-page.js:
2431 (AnalysisTaskPage.prototype.updateFromSerializedState):
2432 (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): Extracted from updateFromSerializedState.
2433 (AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks): Added.
2434 (AnalysisTaskPage.prototype.render): Render the list of associated bugs, the list of bug trackers (so that
2435 users can use it to associate with a new bug), and the list of related analysis tasks.
2436 (AnalysisTaskPage.prototype._renderTestGroupList): Extracted from render since it was getting too long.
2437 (AnalysisTaskPage.prototype._renderTestGroupDetails): Ditto.
2438 (AnalysisTaskPage.prototype._updateChangeType): Added.
2439 (AnalysisTaskPage.prototype._associateBug): Added.
2440 (AnalysisTaskPage.prototype._disassociateBug): Added.
2441 (AnalysisTaskPage.htmlTemplate): Added various elements to show and modify the status, associate bugs,
2442 and a list of related analysis tasks.
2443 (AnalysisTaskPage.cssTemplate): Added various styles for those form controls.
2445 * public/v3/pages/chart-pane.js:
2446 (ChartPane.cssTemplate): Moved the margins from ChartPaneBase.cssTemplate.
2448 2016-02-12 Ryosuke Niwa <rniwa@webkit.org>
2450 Perf dashboard should allow renaming analysis tasks and test groups
2451 https://bugs.webkit.org/show_bug.cgi?id=154200
2453 Reviewed by Chris Dumez.
2455 Allow editing names of analysis tasks and A/B testing groups in the v3 UI.
2457 Added the support for updating the name to the privileged API at /privileged-api/update-analysis-task
2458 and added a new prevailed API to update A/B testing groups at /privileged-api/update-test-group.
2460 * public/privileged-api/update-analysis-task.php: Added the support for renaming the analysis task.
2463 * public/privileged-api/update-test-group.php: Added. Supports updating the test group's name.
2466 * public/v3/components/editable-text.js: Added.
2467 (EditableText): Added. A new editable text label control. It looks like a text node with "(Edit)" link
2468 at the end which allow users to go into the "editing mode", which reveals an input element.
2469 The user can exit the editing mode by either moving the focus away from the control or clicking on
2470 "(Save)" at the end. It calls _updateCallback in the latter case.
2471 (EditableText.prototype.editedText): Returns the current value of the input element user.
2472 (EditableText.prototype.setText): Sets the label. This does not live-update the input element until
2473 the user exists the current editing mode and re-enters it.
2474 (EditableText.prototype.setStartedEditingCallback): Sets a callback which gets called when the user
2475 requested to enter the editing mode. Since EditableText relies on AnalysisTaskPage to render, this
2476 callback only exits to call EditableText.render() in AnalysisTask._didStartEditingTaskName.
2477 (EditableText.prototype.setUpdateCallback): Sets a callback which gets called when the user exits
2478 the editing mode by activating the "(Save)" link. This callback MUST return a promise upon resolution
2479 of which the control gets out of the editing mode. While the promise is in flight, the input element
2481 (EditableText.prototype.render): Updates various states of the elements. When _updatingPromise is not
2482 falsy, we make the input element readonly and show '(...)' on the link. Don't show the action link
2483 if the label is empty (e.g. analysis task or test group is still being fetched).
2484 (EditableText.prototype._didClick): Called when the user clicked on the action link. Enter the editing
2485 mode or save the edited label via _updateCallback.
2486 (EditableText.prototype._didBlur): Exit the editing mode without saving if the input element is not
2487 focused, there is no inflight promise returned by _updateCallback, and the action link "(Save)" does
2489 (EditableText.prototype._didUpdate): Called when exiting the editing mode.
2490 (EditableText.htmlTemplate):
2491 (EditableText.cssTemplate):
2493 * public/v3/index.html: Include newly added editable-text.js.
2495 * public/v3/models/analysis-task.js:
2496 (AnalysisTask.prototype.updateSingleton): Added.
2497 (AnalysisTask.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
2498 the analysis task from the sever.
2499 (AnalysisTask._constructAnalysisTasksFromRawData): Use ensureSingleton instead of manually calling
2500 findById since we need to update the name of the singleton object we found (via updateSingleton).
2502 * public/v3/models/bug.js:
2503 (Bug.ensureSingleton): Moved the code to compute the synthetic id from AnalysisTask's
2504 _constructAnalysisTasksFromRawData.
2505 (Bug.prototype.updateSingleton): Added. Just assert that nothing changes.
2507 * public/v3/models/build-request.js:
2508 (BuildRequest.prototype.updateSingleton): Added. Assert that the intrinsic values of a build request
2509 doesn't change and update status text, status url, and build id as they could change.
2511 * public/v3/models/commit-log.js:
2512 (CommitLog): Made the constructor argument conform to the convention of id, object pair so that we can
2513 use DataModelObject.ensureSingleton.
2514 (CommitLog.ensureSingleton):
2515 (CommitLog.prototype.updateSingleton): Extracted from CommitLog.ensureSingleton.
2517 * public/v3/models/data-model.js:
2518 (DataModelObject.ensureSingleton): Call newly added updateSingleton.
2519 (DataModelObject.prototype.updateSingleton):
2520 (LabeledObject): Removed the name map since it's never used (findByName is never called anywhere).
2521 (LabeledObject.prototype.updateSingleton): Added. Updates _name.
2522 (LabeledObject.findByName): Deleted.
2524 * public/v3/models/test-group.js:
2525 (TestGroup.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
2526 the test group from the sever.
2527 (TestGroup._createModelsFromFetchedTestGroups): Removed bogus code. A root set doesn't have a test
2528 group associated with it since multiple test groups can share a single root set (this property doesn't
2531 * public/v3/pages/analysis-task-page.js:
2532 (AnalysisTaskPage): Removed useless _taskId and added this._testGroupLabelMap and this._taskNameLabel.
2533 (AnalysisTaskPage.prototype.updateFromSerializedState): Cleanup.
2534 (AnalysisTaskPage.prototype._didFetchTask): Assert that this function is called exactly once.
2535 (AnalysisTaskPage.prototype.render): Use this._task.id() to show the v2 link. Use EditableText to show
2536 the names of the analysis task and the associated test groups. Hide the overview chart and the list of
2537 test groups (along with the retry/confirm button) when the analysis task failed to fetch. We always
2538 update the names of the analysis task and the associated test groups since they could be updated by
2540 (AnalysisTaskPage.prototype._didStartEditingTaskName): Added.
2541 (AnalysisTaskPage.prototype._updateTaskName): Added.
2542 (AnalysisTaskPage.prototype._updateTestGroupName): Added.
2543 (AnalysisTaskPage.htmlTemplate): Updated the style.
2545 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
2547 Land the change that was supposed to be the part of r196463.
2549 * public/v3/pages/analysis-task-page.js:
2550 (AnalysisTaskPage.prototype._didFetchTestGroups): Select the latest test group by default.
2552 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
2554 Refine v3 UI's analysis task page
2555 https://bugs.webkit.org/show_bug.cgi?id=154152
2557 Reviewed by Chris Dumez.
2559 This patch makes the following refinements to the analysis task page:
2560 - Always show the relative different of in-progress A/B testing.
2561 - Make the annotations (colored bars) in the chart open other analysis tasks.
2562 - Order the A/B testing groups in the reverse chronological order.
2563 - Select the time range corresponding to the current test group.
2565 * public/v3/components/analysis-results-viewer.js:
2566 (AnalysisResultsViewer.cssTemplate): Fixed the bug that pending and running testing groups are no longer
2567 colored after r196440. Use a slightly more opaque color for currently running groups compared to pending ones.
2569 * public/v3/components/chart-pane-base.js:
2570 (ChartPaneBase.prototype.setMainSelection): Added.
2571 (ChartPaneBase.prototype._openAnalysisTask): Moved the code from ChartPane._openAnalysisTask so that it can be
2572 reused in both AnalysisTaskChartPane and ChartPane (in charts page).
2573 (ChartPaneBase.prototype.router): Added. Overridden by each subclass.
2575 * public/v3/components/test-group-results-table.js:
2576 (TestGroupResultsTable.prototype.buildRowGroups): Always show the summary (relative difference of A to B) as
2577 long as there are some results in each set.
2579 * public/v3/models/test-group.js:
2580 (TestGroup.prototype.compareTestResults): Always set .label and .fullLabel with the relative change as long as
2581 there are some values. Keep using "pending" and "running" in .status since that would determine the color of
2582 stacking blocks representing those A/B testing groups.
2584 * public/v3/pages/analysis-task-page.js:
2585 (AnalysisTaskChartPane):
2586 (AnalysisTaskChartPane.prototype.setPage): Added.
2587 (AnalysisTaskChartPane.prototype.router): Added.
2589 (AnalysisTaskPage.prototype.render): Show the list of A/B testing groups in the reverse chronological order.
2590 Also set the main chart's selection to the time range of the current test group.
2592 * public/v3/pages/chart-pane.js:
2593 (ChartPane.prototype.router): Added.
2594 (ChartPane.prototype._openAnalysisTask): Moved to ChartPaneBase.prototype._openAnalysisTask.
2596 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
2598 Add a script to process backlogs created while perf dashboard was in the maintenance mode
2599 https://bugs.webkit.org/show_bug.cgi?id=154140
2601 Reviewed by Chris Dumez.
2603 Added a script to process the backlog JSONs created while the perf dashboard was put in the maintenance mode.
2604 It re-submits each JSON file to the perf dashboard using the same server config file used by syncing scripts.
2606 * public/include/report-processor.php:
2607 (TestRunsGenerator::test_value_list_to_values_by_iterations): Fixed a bug in the error message code. It was
2608 referencing an undeclared variable.
2609 * tools/process-maintenance-backlog.py: Added.
2611 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
2613 AnalysisResultsViewer never uses this._smallerIsBetter
2614 https://bugs.webkit.org/show_bug.cgi?id=154134
2616 Reviewed by Chris Dumez.
2618 Removed the unused instance variable _smallerIsBetter from AnalysisResultsViewer and TestGroupStackingBlock.
2620 * public/v3/components/analysis-results-viewer.js:
2621 (AnalysisResultsViewer): Removed the unused _smallerIsBetter.
2622 (AnalysisResultsViewer.prototype.setSmallerIsBetter): Deleted.
2623 (AnalysisResultsViewer.prototype.buildRowGroups):
2624 (AnalysisResultsViewer.TestGroupStackingBlock): Removed the unused _smallerIsBetter.
2625 * public/v3/pages/analysis-task-page.js:
2626 (AnalysisTaskPage.prototype._didFetchTask):
2628 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
2630 Build fix after r196440.
2632 * public/v3/models/test-group.js:
2633 (TestGroup.prototype.addBuildRequest): Clear the map instead of setting the property to null.
2635 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
2637 Perf dashboard should have UI to retry A/B testing
2638 https://bugs.webkit.org/show_bug.cgi?id=154090
2640 Reviewed by Chris Dumez.
2642 Added a button to re-try an existing A/B testing group with a custom repetition count. The same button functions
2643 as a way of confirming the progression/regression when there have been no A/B testing scheduled in the task.
2645 Also fixed the bug that A/B testing groups that have been waiting for other test groups will be shown as "running".
2647 * public/v3/components/results-table.js:
2648 (ResultsTable.cssTemplate): Don't pad the list of extra repositories when it's empty.
2650 * public/v3/components/test-group-results-table.js:
2651 (TestGroupResultsTable.prototype.buildRowGroups): Use TestGroup.labelForRootSet instead of manually
2652 computing the letter for each configuration set.
2654 * public/v3/models/build-request.js:
2655 (BuildRequest.prototype.hasStarted): Added.
2657 * public/v3/models/data-model.js:
2658 (DataModelObject.ensureSingleton): Added.
2659 (DataModelObject.cachedFetch): Added noCache option. This is used when re-fetching the test groups after
2662 * public/v3/models/measurement-cluster.js:
2663 (MeasurementCluster.prototype.startTime): Added.
2665 * public/v3/models/measurement-set.js:
2666 (MeasurementSet.prototype.hasFetchedRange): Added. Returns true only if there are no "holes" (cluster
2667 yet to be fetched) between the specified time range. This was added to fix a bug in AnalysisTaskPage's
2668 _didFetchMeasurement.
2670 * public/v3/models/test-group.js:
2671 (TestGroup): Added this._rootSetToLabel.
2672 (TestGroup.prototype.addBuildRequest): Reset this._rootSetToLabel along with this._requestedRootSets.
2673 (TestGroup.prototype.repetitionCount): Added. Returns the number of iterations executed per set. We assume that
2674 every root set in the test group shares a single repetition count.
2675 (TestGroup.prototype.requestedRootSets): Now populates this._rootSetToLabel for labelForRootSet.
2676 (TestGroup.prototype.labelForRootSet): Added.
2677 (TestGroup.prototype.hasStarted): Added.
2678 (TestGroup.prototype.compareTestResults): Use 'running' and 'pending' to differentiate test groups that are waiting
2679 for other groups to finish running from the ones that are actually running ('incomplete' before this patch).
2680 (TestGroup.fetchByTask):
2681 (TestGroup.createAndRefetchTestGroups): Added. Creates a new test group using the privileged-api/create-test-group
2682 and fetches the list of test groups for the specified analysis task.
2683 (TestGroup._createModelsFromFetchedTestGroups): Extracted from TestGroup.fetchByTask.
2685 * public/v3/pages/analysis-task-page.js:
2686 (AnalysisTaskPage): Initialize _renderedCurrentTestGroup to undefined so that we'd always can differentiate
2687 the initial call to AnalysisTaskPage.render and subsequent calls in which it's identical to _currentTestGroup.
2688 (AnalysisTaskPage.prototype._didFetchMeasurement): Fixed a bug that we don't exit early even when some
2689 clusters in between startPoint and endPoint are still being fetched via newly added hasFetchedRange.
2690 (AnalysisTaskPage.prototype.render): Update the default repetition count based on the current test group.
2691 Also update the label of the button to "Confirm the change" if there is no A/B testing in this task.
2692 (AnalysisTaskPage.prototype._retryCurrentTestGroup): Added. Re-triggers an existing A/B testing group or creates
2693 the A/B testing for the entire range of the analysis task.
2694 (AnalysisTaskPage.prototype._hasDuplicateTestGroupName): Added.
2695 (AnalysisTaskPage.prototype._createRetryNameForTestGroup): Added.
2696 (AnalysisTaskPage.htmlTemplate): Added form controls to re-trigger A/B testing.
2697 (AnalysisTaskPage.cssTemplate): Updated the style.
2699 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
2701 Removed the duplicated definition of ChartPaneBase.
2703 * public/v3/components/chart-pane-base.js:
2705 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
2707 Analysis task page on v3 UI should show charts
2708 https://bugs.webkit.org/show_bug.cgi?id=154057
2710 Reviewed by Chris Dumez.
2712 Extracted ChartPaneBase out of ChartPane and added an instance of its new subclass, AnalysisTaskChartPane,
2713 to the analysis task page. The main difference is that ChartPaneBase doesn't depend on the presence of
2714 this._chartsPage unlike ChartPane. It also doesn't have the header with toolbar (to show breakdown, etc...).
2716 * public/v3/components/base.js:
2717 (ComponentBase.prototype._constructShadowTree): Call htmlTemplate() and cssTemplate() with the right "this".
2719 * public/v3/components/chart-pane-base.js: Added.
2720 (ChartPaneBase): Extracted from ChartPane.
2721 (ChartPaneBase.prototype.configure): Extracted from the constructor. Separating this function allows the
2722 component to be instantiated inside a HTML template.
2723 (ChartPaneBase.prototype._fetchAnalysisTasks): Moved from ChartPane._fetchAnalysisTasks.
2724 (ChartPaneBase.prototype.platformId): Ditto.
2725 (ChartPaneBase.prototype.metricId): Ditto.
2726 (ChartPaneBase.prototype.setOverviewDomain): Ditto.
2727 (ChartPaneBase.prototype.setMainDomain): Ditto.
2728 (ChartPaneBase.prototype._overviewSelectionDidChange): Extracted from the constructor. This is overridden in
2729 ChartPane and unused in AnalysisTaskChartPane.
2730 (ChartPaneBase.prototype._mainSelectionDidChange): Extracted from ChartPane._mainSelectionDidChange.
2731 (ChartPaneBase.prototype._mainSelectionDidZoom): Extracted from ChartPane._mainSelectionDidZoom.
2732 (ChartPaneBase.prototype._indicatorDidChange): Extracted from ChartPane._indicatorDidChange.
2733 (ChartPaneBase.prototype._didFetchData): Moved from ChartPane._fetchAnalysisTasks.
2734 (ChartPaneBase.prototype._openAnalysisTask): Ditto.
2735 (ChartPaneBase.prototype._openCommitViewer): Ditto. Also fixed a bug that we don't show the spinner while
2736 waiting for the data to be fetched by calling this.render() here.
2737 (ChartPaneBase.prototype._keyup): Moved from ChartPane._keyup. Also fixed the bug that the revisions list
2738 doesn't update by calling this.render() here.
2739 (ChartPaneBase.prototype.render): Extracted from ChartPane.render.
2740 (ChartPaneBase.htmlTemplate): Extracted from ChartPane.htmlTemplate.
2741 (ChartPaneBase.paneHeaderTemplate): Added. This is overridden in ChartPane and unused in AnalysisTaskChartPane.
2742 (ChartPaneBase.cssTemplate): Extracted from ChartPane.htmlTemplate.
2744 * public/v3/components/chart-styles.js: Renamed from public/v3/pages/page-with-charts.js.
2745 (PageWithCharts): Renamed from PageWithCharts since it no longer extends PageWithHeading.
2746 (ChartStyles.createChartSourceList):
2748 * public/v3/components/commit-log-viewer.js:
2749 (CommitLogViewer.prototype.view): Set this._repository right away instead of waiting for the fetched data
2750 so that spinner will be shown while the data is being fetched.
2752 * public/v3/index.html:
2754 * public/v3/pages/analysis-task-page.js:
2755 (AnalysisTaskChartPane): Added extends ChartPaneBase.
2756 (AnalysisTaskPage): Added. this._chartPane.
2757 (AnalysisTaskPage.prototype._didFetchTask): Initialize this._chartPane with a domain.
2758 (AnalysisTaskPage.prototype.render): Render this._chartPane.
2759 (AnalysisTaskPage.htmlTemplate):
2761 * public/v3/pages/chart-pane-status-view.js:
2762 (ChartPaneStatusView): Removed the unused router from the argument list.
2763 (ChartPaneStatusView.prototype.pointsRangeForAnalysis): Renamed from analyzeData() since it was ambiguous.
2764 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Fixed the bug that we don't update the list
2765 of the revisions here.
2766 (ChartPaneStatusView.prototype.computeChartStatusLabels):
2768 * public/v3/pages/chart-pane.js:
2769 (ChartPane): Now extends ChartPaneBase.
2770 (ChartPane.prototype._overviewSelectionDidChange): Extracted from the constructor.
2771 (ChartPane.prototype._mainSelectionDidChange):
2772 (ChartPane.prototype._mainSelectionDidZoom):
2773 (ChartPane.prototype._indicatorDidChange):
2774 (ChartPane.prototype.render):
2775 (ChartPane.prototype._renderActionToolbar):
2776 (ChartPane.paneHeaderTemplate): Extracted from htmlTemplate.
2777 (ChartPane.cssTemplate):
2778 (ChartPane.overviewOptions.selection.onchange): Deleted.
2779 (ChartPane.prototype._fetchAnalysisTasks): Deleted.
2780 (ChartPane.prototype.platformId): Deleted.
2781 (ChartPane.prototype.metricId): Deleted.
2782 (ChartPane.prototype.setOverviewDomain): Deleted.
2783 (ChartPane.prototype.setMainDomain): Deleted.
2784 (ChartPane.prototype._openCommitViewer): Deleted.
2785 (ChartPane.prototype._didFetchData): Deleted.
2786 (ChartPane.prototype._keyup): Deleted.
2788 * public/v3/pages/charts-page.js:
2790 (ChartsPage.createDomainForAnalysisTask): Extracted by createDomainForAnalysisTask; used to set the domain
2791 of the charts in the analysis task page.
2792 (ChartsPage.createStateForAnalysisTask):
2794 * public/v3/pages/dashboard-page.js:
2796 (DashboardPage.prototype._createChartForCell):
2798 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
2800 Add the support for maintenance mode
2801 https://bugs.webkit.org/show_bug.cgi?id=154072
2803 Reviewed by Chris Dumez.
2805 Added the crude support for maintenance mode whereby which the reports are stored in the filesystem
2806 instead of the database.
2808 * config.json: Added maintenanceMode and maintenanceDirectory as well as forgotten siteTitle and
2809 remoteServer.httpdMutexDir.
2810 * public/api/report.php:
2811 (main): Don't connect to the database or modify database when maintenanceMode is set.
2812 * public/include/json-header.php:
2813 (ensure_privileged_api_data): Exit with InMaintenanceMode when maintenanceMode is set. This prevents
2814 privileged API such as creating analysis tasks and new A/B testing groups from modifying the database.
2816 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
2818 Analysis task page on v3 show progression as regressions
2819 https://bugs.webkit.org/show_bug.cgi?id=154045
2821 Reviewed by Chris Dumez.
2823 The bug was caused by TestGroup.compareTestResults referring to undefined _smallerIsBetter.
2824 Retrieve it from the associated metric object via the owner analysis task.
2826 * public/v3/models/test-group.js:
2828 2016-02-05 Ryosuke Niwa <rniwa@webkit.org>
2830 Testing with remote server cache is unusably slow
2831 https://bugs.webkit.org/show_bug.cgi?id=153928
2833 Reviewed by Chris Dumez.
2835 Don't use the single process mode of httpd as it's way too slow even for testing.
2836 Also we'll hit a null pointer crash (http://svn.apache.org/viewvc?view=revision&revision=1711479)
2838 Since httpd exits immediately when launched in multi-process mode, remote-cache-server.py (renamed from
2839 run-with-remote-server.py) now has "start" and "stop" commands to start/stop the Apache. Also added
2840 "reset" command to reset the cache for convenience.
2842 * Install.md: Updated the instruction.
2843 * config.json: Fixed a typo: httpdErro*r*Log.
2844 * tools/remote-cache-server.py: Copied from Websites/perf.webkit.org/tools/run-with-remote-server.py.
2845 Now takes one of the following commands: "start", "stop", and "reset".
2847 (start_httpd): Extracted from main.
2848 (stop_httpd): Added.
2849 * tools/remote-server-relay.conf: Removed redundant (duplicate) LoadModule's.
2850 * tools/run-with-remote-server.py: Removed.
2852 2016-02-04 Ryosuke Niwa <rniwa@webkit.org>
2854 Perf dashboard should have a script to setup database
2855 https://bugs.webkit.org/show_bug.cgi?id=153906
2857 Reviewed by Chris Dumez.
2859 Added tools/setup-database.py to setup the database. It retrieves the database name, username, password
2860 and initializes a database at the specified location.
2862 * Install.md: Updated instruction to setup postgres to use setup-database.py.
2863 * tools/setup-database.py: Added.
2865 (load_database_config):
2866 (determine_psql_dir):
2867 (start_or_stop_database):
2868 (execute_psql_command):
2870 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
2872 buildbot syncing scripts sometimes schedule more than one requests per builder
2873 https://bugs.webkit.org/show_bug.cgi?id=153047
2875 Reviewed by Chris Dumez.
2877 The bug was caused by the check for singularity of scheduledRequests being conducted per configuration
2878 instead of per builder. So if there were multiple test configurations (e.g. Speedometer and Octane) that
2879 both used the same builder, then we may end up scheduling both at once.
2881 Fixed the bug by sharing a single set to keep track of the scheduled requests for all configurations per
2884 * tools/sync-with-buildbot.py:
2885 (load_config): Share a set amongst test configurations for each builder.
2886 (find_request_updates): Instead of creating a new set for each configuration, reuse the existing sets to
2887 share a single set agmonst test configurations for each builder.
2889 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
2891 Analysis results viewer sometimes doesn't show the correct relative difference
2892 https://bugs.webkit.org/show_bug.cgi?id=152930
2894 Reviewed by Chris Dumez.
2896 The bug was caused by single A/B testing result associated with multiple rows when there are multiple data
2897 points with the same root set which matches that of an A/B testing.
2899 Fixed the bug by detecting such a case, and only associating each A/B testing result with the row created
2900 for the first matching point.
2902 * public/v3/components/analysis-results-viewer.js:
2903 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
2905 2016-01-08 Ryosuke Niwa <rniwa@webkit.org>
2907 Make v3 UI analysis task page is hard to understand
2908 https://bugs.webkit.org/show_bug.cgi?id=152917
2910 Reviewed by Antti Koivisto.
2912 Add a dark gray border around the selected block in the analysis results viewer instead of using darker
2913 shades since that looks as if they were bigger regression/progression.
2915 Explicitly show "Failed" as the label instead of omitting with "-" when all build requests in an A/B
2916 testing group fails.
2918 * public/v3/components/analysis-results-viewer.js:
2919 (AnalysisResultsViewer.cssTemplate): Tweaked the style to underline text in the hovered blocks and the
2920 selected blocks and show a dark gray border around the selected blocks.
2921 (AnalysisResultsViewer.TestGroupStackingBlock):
2922 (AnalysisResultsViewer.TestGroupStackingBlock.prototype.createStackingCell): Use this._title for title.
2923 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
2924 (AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForRootSet): Deleted.
2926 * public/v3/components/results-table.js:
2927 (ResultsTable.prototype.render):
2928 (ResultsTable.prototype._createRevisionListCells): Extracted from ResultsTable.prototype.render.
2929 (ResultsTable.cssTemplate): Tweaked the style.
2931 (ResultsTableRow.prototype.constructor): Added _labelForWholeRow to store the label for the entire row.
2932 This is used to show the comparison result of two root sets (e.g. A vs B).
2933 (ResultsTableRow.prototype.setLabelForWholeRow): Added.
2934 (ResultsTableRow.prototype.labelForWholeRow): Added.
2935 (ResultsTableRow.prototype.resultContent): Extracted from buildHeading. Creates a hyperlinked bar graph
2936 used for each A/B testing result.
2937 (ResultsTableRow.prototype.buildHeading): Deleted since we need to set colspan on the second table cell
2938 when we're creating a row with _labelForWholeRow.
2940 * public/v3/components/test-group-results-table.js:
2941 (TestGroupResultsTable.prototype.buildRowGroups): Added rows to show relative differences and statistical
2942 significance between root sets (e.g. A vs B).
2944 * public/v3/models/build-request.js:
2945 (BuildRequest.prototype.hasCompleted): Added.
2947 * public/v3/models/test-group.js:
2948 (TestGroup.prototype.compareTestResults): Extracted from AnalysisResultsViewer.TestGroupStackingBlock's
2949 _computeTestGroupStatus and generalized to be reused in TestGroupResultsTable.
2950 (TestGroup.prototype._valuesForRootSet): Moved from AnalysisResultsViewer.TestGroupStackingBlock.
2952 * public/v3/pages/analysis-task-page.js:
2953 (AnalysisTaskPage.cssTemplate): Tweaked the style.
2955 2016-01-07 Ryosuke Niwa <rniwa@webkit.org>
2957 Perf dashboard should automatically add aggregators
2958 https://bugs.webkit.org/show_bug.cgi?id=152818
2960 Reviewed by Chris Dumez.
2962 When an aggregator entry is missing in aggregators table, automatically insert it in /api/report.
2964 In a very early version of the perf dashboard, we had the ability to define a custom aggregator
2965 in an admin page. In practice, nobody used or needed this feature so we got rid of it even before
2966 the dashboard was landed into WebKit repository. This patch cleans up that mess.
2969 (main): Added the filtering capability.
2970 (TestEnvironment): Expose the config JSON in the test environment.
2972 * public/include/report-processor.php:
2973 (ReportProcessor): Renamed name_to_aggregator now that it only contains ID.
2974 (ReportProcessor::__construct): No longer fetches the aggregator table. An equivalent work is done
2975 in newly added ensure_aggregators.
2976 (ReportProcessor::process): Calls ensure_aggregators which populates name_to_aggregator_id.
2977 (ReportProcessor::ensure_aggregators): Added. Add the builtin aggregators: Arithmetic, Geometric,
2978 Harmonic, and Total.
2979 (TestRunsGenerator): Renamed name_to_aggregator now that it only contains ID.
2980 (TestRunsGenerator::__construct):
2981 (TestRunsGenerator::add_aggregated_metric): Don't include aggregator_definition here since it's
2982 never used now that all the aggregations are done natively in PHP.
2983 (TestRunsGenerator::$aggregators): Added. We don't include SquareSum since it's only used for
2984 computing run_square_sum_cache in test_runs table and it's useless elsewhere.
2985 (TestRunsGenerator::aggregate_values): Add a comment about that.
2987 * tests/api-report.js: Updated a test case to reflect the change.
2989 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
2991 Perf dashboard JSON API should fail gracefully when postgres is down
2992 https://bugs.webkit.org/show_bug.cgi?id=152812
2994 Reviewed by Chris Dumez.
2996 Even though all JSON APIs returned DatabaseConnectionFailure as the status when Database::connect
2997 returned a falsy value, PHP was spitting out warnings and producing HTTP responses that cannot be
2998 parsed as a JSON when pg_connect failed.
3000 Fixed the bug by suppressing warning messages in pg_connect.
3002 * public/include/db.php:
3003 (Database::connect): Use '@' prefix to suppress warning messages.
3005 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
3007 Perf dashboard should auto-generate manifest file when one is missing
3008 https://bugs.webkit.org/show_bug.cgi?id=152813
3010 Reviewed by Chris Dumez.
3012 When /data/manifest.json is missing, fall back to newly added /api/manifest instead of
3013 silently failing to show the UI. This will make the initial setup easier.
3015 * public/api/manifest.php: Added.
3017 * public/include/manifest.php:
3018 (Manifest::manifest): Added.
3019 * public/v3/main.js:
3021 (didFetchManifest): Extracted from fetchManifest.
3023 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
3025 Commit another forgotten change, this time, for r194653.
3027 * public/v3/models/measurement-set.js:
3029 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
3031 The sampling of time series on v3 UI is too aggressive
3032 https://bugs.webkit.org/show_bug.cgi?id=152804
3034 Reviewed by Chris Dumez.
3036 Fixed a bug that we were always halving the number of data points in _sampleTimeSeries
3037 and increased the number of data points allowed to make the sampling less aggressive.
3039 * public/v3/components/time-series-chart.js:
3040 (TimeSeriesChart.prototype._ensureSampledTimeSeries): Increase the number of maximum points
3041 to 2x the number of pixels divided by the radius of each point.
3042 (TimeSeriesChart.prototype._sampleTimeSeries.findMedian): Changed the semantics of endIndex
3043 to mean the index after the last point and renamed it to indexAfterEnd.
3044 (TimeSeriesChart.prototype._sampleTimeSeries): Fixed a bug that this code always coerced two
3045 data points into one sampled data point despite of the fact i and j are sufficiently apart
3046 since data[j].time - data[i].time > timePerSample by definition.
3048 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
3050 Commit the forgotten change for r194651.
3052 * public/v3/pages/domain-control-toolbar.js:
3053 (DomainControlToolbar.prototype.setStartTime):
3055 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
3057 The right hand side of main chart appears to be cut off as you zoom out on v3 UI
3058 https://bugs.webkit.org/show_bug.cgi?id=152778
3060 Reviewed by Antti Koivisto.
3062 Add a padding on x-axis after the end time to make the main chart more easily interactive.
3064 * public/v3/components/time-series-chart.js:
3065 (TimeSeriesChart.prototype._computeHorizontalRenderingMetrics):
3067 * public/v3/pages/page-with-charts.js:
3068 (PageWithCharts.mainChartOptions): Add a padding of 5px at the end of x-axis.
3070 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
3072 v3 UI should use four sig-figs to label y-axis of the main charts
3073 https://bugs.webkit.org/show_bug.cgi?id=152779
3075 Reviewed by Antti Koivisto.
3077 Increase the number of significant figures used in the main charts to four as done in v2 UI.
3079 * public/v3/pages/chart-pane.js:
3080 (ChartPane.constructor): Create a formatter with four significant figures.
3081 * public/v3/pages/page-with-charts.js:
3082 (PageWithCharts.mainChartOptions): Increase the width of y-axis labels.
3084 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
3086 v3 UI's time range slider is harder to use than that of v2 UI
3087 https://bugs.webkit.org/show_bug.cgi?id=152780
3089 Reviewed by Antti Koivisto.
3091 Improved the time range slider by using a cubic mapping to time range and providing a text field
3092 to directly edit the number of days to show.
3094 Now an user can enter the text mode to directly edit the number of days to show by clicking on
3095 the number of days (text field is always there with opacity=0).
3097 * public/v3/pages/charts-toolbar.js:
3098 (ChartsToolbar): Store the minimum and maximum number of days allowed. Also rename _inputElement
3099 to _slider and added a new type=number text field as _editor.
3100 (ChartsToolbar.prototype.render):
3101 (ChartsToolbar.prototype.setStartTime): Exit the text mode when the number of days is changed by
3102 an URL state transition (i.e. back/forward navigation).
3103 (ChartsToolbar.prototype._setInputElementValue): Added. Updates the values of _slider and _editor.
3104 (ChartsToolbar.prototype._enterTextMode): Added. Hide the elements used by the slider mode and
3105 show the text field.
3106 (ChartsToolbar.prototype._exitTextMode): Added. Does the opposite.
3107 (ChartsToolbar.prototype._sliderValueMayHaveChanged): Renamed from _inputValueMayHaveChanged.
3108 (ChartsToolbar.prototype._editorValueMayHaveChanged): Added. Similar to _sliderValueMayHaveChanged
3109 but also corrects the value of _editor if needed.
3110 (ChartsToolbar.prototype._callNumberOfDaysCallback): Extracted from _inputValueMayHaveChanged.
3111 Also fixed a bug that we didn't update the URL state when the change event was fired without
3112 modifying the effective number of days.
3113 (ChartsToolbar.cssTemplate): Tweaked the style to support the new mode. Also set a fixed width on
3114 the span showing the number of days in the slider mode.
3116 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
3118 Zooming button is broken on v3 UI
3119 https://bugs.webkit.org/show_bug.cgi?id=152777
3121 Reviewed by Chris Dumez.
3123 Bring up the zoom button in z-index so that users can click it.
3125 * public/v3/components/interactive-time-series-chart.js:
3126 (InteractiveTimeSeriesChart.cssTemplate):
3128 2016-01-06 Ryosuke Niwa <rniwa@webkit.org>
3130 v3 UI doesn't preserve the time range when charts page is opened from a dashboard
3131 https://bugs.webkit.org/show_bug.cgi?id=152776
3133 Reviewed by Chris Dumez.
3135 Fixed the bug by moving the construction of charts URL from DashboardPage.prototype.open to
3136 DashboardPage.prototype.render and re-rendering the entire page upon an URL state transition.
3138 * public/v3/pages/charts-page.js:
3139 (ChartsPage.createStateForDashboardItem): Takes the start time for the charts page.
3141 * public/v3/pages/dashboard-page.js:
3142 (DashboardPage.prototype.updateFromSerializedState): Merged _numberOfDaysDidChange and
3143 _updateChartsDomainFromToolbar into this function since they're not used elsewhere. Also re-render
3144 the entire page when transition between different number of days to show.
3145 (DashboardPage.prototype._numberOfDaysDidChange): Deleted.
3146 (DashboardPage.prototype._updateChartsDomainFromToolbar): Deleted.
3147 (DashboardPage.prototype.render): Construct URL for each charts here.
3148 (DashboardPage.prototype._createChartForCell): Don't construct URL here since this function is
3149 called once when the dashboard page is opened, and not when the time range is changed.
3151 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
3153 Build fix for an old version of PHP after r194618.
3155 * public/api/measurement-set.php:
3157 2016-01-05 Ryosuke Niwa <rniwa@webkit.org>
3159 A/B testing results should be visualized intuitively on v3 UI
3160 https://bugs.webkit.org/show_bug.cgi?id=152496
3162 Rubber-stamped by Chris Dumez.
3164 Add the "stacking block" view of A/B testing results to the analysis task page on v3 UI.
3166 The patch enhances JSON APIs at /api/analysis-task /api/measurement-set/ to reduce the number of
3167 HTTP requests, and adds two UI components: TestGroupResultsTable and AnalysisResultsViewer both
3168 of which inherits from an abstract superclass: ResultsTable.
3170 ResultsTable provides a tabular presentation of measured values in regular measurement sets and
3171 A/B testing results using groups of bar graphs created by BarGraphGroup. TestGroupResultsTable
3172 inherits from this class to display A/B testing configurations and the averaged results for each
3173 configuration, and AnalysisResultsViewer inherits from it to provide an intuitive visualization
3174 of the outcomes of all A/B testing results associated with a given analysis task.
3176 * public/api/analysis-tasks.php:
3177 (main): Add the capability to find the analysis task based on its build request.
3178 This allows /v3/#/analysis/task/?buildRequest=<id> to be hyperlinked on buildbot page.
3180 * public/api/measurement-set.php:
3181 (main): Removed the unused startTime and endTime, and added&