1 2016-08-04 Ryosuke Niwa <rniwa@webkit.org>
3 Syncing script's configuration duplicates a lot of boilerplate
4 https://bugs.webkit.org/show_bug.cgi?id=160574
6 Rubber-stamped by Chris Dumez.
8 This patch makes each configuration accept an array of platforms and types so that we can write:
10 {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"},
11 {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"},
12 {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"},
13 {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"},
14 {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"},
15 {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"},
16 {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"},
17 {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"},
21 {"builder": "mba", "types": ["speedometer", "jetstream"],
22 "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]},
23 {"builder": "mbp", "types": ["speedometer", "jetstream"],
24 "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]},
26 * tools/js/buildbot-syncer.js:
27 (BuildbotSyncer._loadConfig):
28 (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type
30 (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig.
31 (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that
32 shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms',
33 and merged the code for verify an array of strings. Finally, allow the appearance of 'properties'
34 since this function can now be called on a cloned configuration in which 'arguments' had already
35 been renamed to 'properties'.
37 * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration.
38 (sampleiOSConfigWithExpansions): Added.
40 * unit-tests/resources/mock-v3-models.js:
41 (MockModels.inject): Added a few more mock models for the newly added test.
43 2016-07-26 Ryosuke Niwa <rniwa@webkit.org>
45 REGRESSION: Tooltip for analysis tasks doesn't show up on charts
46 https://bugs.webkit.org/show_bug.cgi?id=160221
48 Rubber-stamped by Chris Dumez.
50 The bug was caused by ChartPaneBase resetting annotation bars every time the current point has moved.
51 Avoid doing this in ChartPaneBase's _renderAnnotations().
53 * public/v3/components/chart-pane-base.js:
55 (ChartPaneBase.prototype.fetchAnalysisTasks):
56 (ChartPaneBase.prototype._renderAnnotations):
58 2016-07-26 Ryosuke Niwa <rniwa@webkit.org>
60 REGRESSION: The arrow indicating the current page doesn't get updated
61 https://bugs.webkit.org/show_bug.cgi?id=160185
63 Reviewed by Chris Dumez.
65 The bug was caused by Heading's render() function not updating the DOM more than once. I don't understand
66 how this has ever worked. Fixed the bug by rendering DOM whenever the current page has changed.
68 * public/v3/pages/heading.js:
70 (Heading.prototype.render):
72 2016-07-25 Ryosuke Niwa <rniwa@webkit.org>
74 Build fix for Safari 9.
76 * public/v3/models/build-request.js:
77 (BuildRequest.prototype.waitingTime): Don't use "const" in strict mode.
79 2016-07-23 Ryosuke Niwa <rniwa@webkit.org>
81 Perf dashboard should show the list of a pending A/B testing jobs
82 https://bugs.webkit.org/show_bug.cgi?id=160138
84 Rubber-stamped by Chris Dumez.
86 Add a page to show the list of A/B testing build requests per triggerable. Ideally, we would like to
87 see a queue per builder but that would require changes to database tables and syncing scripts.
89 Because this page is most useful when the analysis task with which each build request is associated,
90 JSON API at /api/build-requests/ has been modified to return the analysis task ID for each request.
92 Also streamlined the page that shows the list of analysis tasks per Chris' feedback by consolidating
93 "Bisecting" and "Identified" into "Investigated" and moving the toolbar from the upper left corner
94 inside the heading to right beneath the heading above the table. Also made the category page serialize
95 the filter an user had typed in so that reloading the page doesn't clear it.
97 * public/api/analysis-tasks.php:
98 (fetch_associated_data_for_tasks): Removed 'category' from the list of columns returned as the notion
99 of 'category' is only relevant in UI, and it's better computed in the front-end.
100 (format_task): Ditto.
101 (determine_category): Deleted.
103 * public/api/test-groups.php:
106 * public/include/build-requests-fetcher.php:
107 (BuildRequestsFetcher::fetch_for_task): Include the analysis task ID in the rows.
108 (BuildRequestsFetcher::fetch_for_group): Ditto. Ditto.
109 (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Ditto.
110 (BuildRequestsFetcher::results_internal): Ditto.
112 * public/v3/index.html:
115 (main): Create a newly introduced BuildRequestQueuePage as a subpage of AnalysisCategoryPage.
117 * public/v3/components/ratio-bar-graph.js:
118 (RatioBarGraph.prototype.update): Fixed a bogus assertion here. ratio can be any number. The coercion
119 into [-1, 1] is done inside RatioBarGraph's render() function.
121 * public/v3/models/analysis-task.js:
122 (AnalysisTask.prototype.category): Moved the code to compute the analysis task's category from
123 determine_category in analysis-tasks.php. Also merged "bisecting" and "identified" into "investigated".
124 (AnalysisTask.categories): Merged "bisecting" and "identified" into "investigated".
126 * public/v3/models/build-request.js:
127 (BuildRequest): Remember the triggerable and the analysis task associated with this request as well as
128 the time at when this request was created.
129 (BuildRequest.prototype.analysisTaskId): Added.
130 (BuildRequest.prototype.statusLabel): Use a shorter label: "Waiting" for "pending" status.
131 (BuildRequest.prototype.createdAt): Added.
132 (BuildRequest.prototype.waitingTime): Added. Returns a human readable time duration since the creation
133 of this build request such as "2 hours 21 minutes" against a reference time.
134 (BuildRequest.fetchTriggerables): Added.
135 (BuildRequest.cachedRequestsForTriggerableID): Added. Used when navigating back to
137 * public/v3/pages/analysis-category-page.js:
138 (AnalysisCategoryPage): Construct AnalysisCategoryToolbar and store it in this._categoryToolbar since it
139 no longer inherits from Toolbar class, which PageWithHeading recognizes and stores.
140 (AnalysisCategoryPage.prototype.title):
141 (AnalysisCategoryPage.prototype.serializeState): Added.
142 (AnalysisCategoryPage.prototype.stateForCategory): Added. Include the filter in the serialization.
143 (AnalysisCategoryPage.prototype.updateFromSerializedState): Restore the filter from the URL state.
144 (AnalysisCategoryPage.prototype.filterDidChange): Added. Called by AnalysisCategoryToolbar to update
145 the URL state in addition to calling render() as done previously via setFilterCallback.
146 (AnalysisCategoryPage.prototype.render): Always call _categoryToolbar.render() since the hyperlinks for
147 the category pages now include the filter, which can be updated in each call.
148 (AnalysisCategoryPage.cssTemplate):
150 * public/v3/pages/analysis-category-toolbar.js:
151 (AnalysisCategoryToolbar): Inherits from ComponentBase instead of Toolbar since AnalysisCategoryToolbar
152 no longer works with Heading class unlike other subclasses of Toolbar class.
153 (AnalysisCategoryToolbar.prototype.setCategoryPage): Added.
154 (AnalysisCategoryToolbar.prototype.setFilterCallback): Deleted.
155 (AnalysisCategoryToolbar.prototype.setFilter): Added. Used to restore from a serialized URL state.
156 (AnalysisCategoryToolbar.prototype.render): Don't recreate the input element as it clears the value as
157 well as the selection of the element. Also use AnalysisCategoryPage's stateForCategory to serialize the
158 category name and the current filter for each hyperlink.
159 (AnalysisCategoryToolbar.prototype._filterMayHaveChanged): Now takes an boolean argument specifying
160 whether the URL state should be updated or not. We update the URL only when a change event is fired to
161 avoid constantly updating it while an user is still typing.
162 (AnalysisCategoryToolbar.cssTemplate): Added.
163 (AnalysisCategoryToolbar.htmlTemplate): Added a button to open the newly added queue page.
165 * public/v3/pages/build-request-queue-page.js:
166 (BuildRequestQueuePage): Added.
167 (BuildRequestQueuePage.prototype.routeName): Added.
168 (BuildRequestQueuePage.prototype.pageTitle): Added.
169 (BuildRequestQueuePage.prototype.open): Added. Fetch open build requests for every triggerables using
170 the same API as the syncing scripts.
171 (BuildRequestQueuePage.prototype.render): Added.
172 (BuildRequestQueuePage.prototype._constructBuildRequestTable): Added. Construct a table for the list of
173 pending, scheduled or running build requests in the order syncing scripts would see. Note that the list
174 of build requests returned by /api/build-requests/* can contain completed, canceled, or failed requests
175 since the JSON returns all build requests associated with each test group if one of the requests of the
176 group have not finished. This helps syncing scripts picking the right builder for A/B testing when it
177 had previously been unloaded or crashed in the middle of processing a test group. This characteristics
178 of the API actually helps us here because we can reliably compute the total number of build requests in
179 the group. The first half of this function does this counting as well as collapses all but the first
180 unfinished build requests into a "contraction" row, which just shows the number of build requests that
181 are remaining in the group.
182 (BuildRequestQueuePage.cssTemplate): Added.
183 (BuildRequestQueuePage.htmlTemplate): Added.
185 * public/v3/pages/summary-page.js:
186 (SummaryPage.prototype.open): Use one-day median instead of seven-day median to compute the status.
187 (SummaryPageConfigurationGroup): Initialize _ratio to NaN. This was causing assertion failures in
188 RatioBarGraph's update() while measurement sets are being fetched.
190 * server-tests/api-build-requests-tests.js: Updated the tests per change in BuildRequest's statusLabel.
191 * unit-tests/analysis-task-tests.js: Ditto.
192 * unit-tests/test-groups-tests.js: Ditto.
193 * unit-tests/build-request-tests.js: Added tests for BuildRequest's waitingTime.
195 2016-07-22 Ryosuke Niwa <rniwa@webkit.org>
197 REGRESSION(r203035): Marking points as an outlier no longer updates charts
198 https://bugs.webkit.org/show_bug.cgi?id=160106
200 Reviewed by Darin Adler.
202 The bug was caused by MeasurementSet's fetchBetween clearing previously registered callbacks when noCache
205 * public/v3/components/time-series-chart.js:
206 (TimeSeriesChart.prototype.setSourceList): Clear this._fetchedTimeSeries when changing chart options.
207 e.g. need to start including or excluding outliers.
208 (TimeSeriesChart.prototype.fetchMeasurementSets): Don't skip the fetching when noCache is true.
210 * public/v3/models/measurement-set.js:
211 (MeasurementSet): Added this._callbackMap as an instance variable to keep track of all callbacks on every
212 cluster since we may need to call each callback multiple times per cluster when noCache option is used.
213 (MeasurementSet.prototype.fetchBetween): Moved the code to add _primaryClusterPromise to _allFetches here
214 so that now this function and _ensureClusterPromise are only functions that touch _allFetches.
215 (MeasurementSet.prototype._ensureClusterPromise): Extracted out of fetchBetween. Queue up all callbacks
216 for each cluster when creating a new promise.
217 (MeasurementSet.prototype._fetchPrimaryCluster): Removed the code to add _primaryClusterPromise now that
218 it's done in fetchBetween.
220 * public/v3/remote.js:
221 (RemoteAPI.postJSONWithStatus): Removed superfluous call to console.log.
223 * unit-tests/measurement-set-tests.js: Updated the test case for noCache. The callback registered before
224 fetchBetween is called with noCache=true is now invoked so callCount must be 3 instead of 2.
226 2016-07-19 Ryosuke Niwa <rniwa@webkit.org>
228 Perf dashboard always re-generate measurement set JSON
229 https://bugs.webkit.org/show_bug.cgi?id=159951
231 Reviewed by Chris Dumez.
233 The bug was caused by manifest.json reporting the last modified date of a measurement set in floating point,
234 and a measurement set JSON reporting it as an integer. Fixed the bug by always using an integer.
236 * public/api/measurement-set.php:
237 (main): Return 404 when the results is empty.
238 (MeasurementSetFetcher::execute_query): Use "extract(epoch from commit_time)" like ManifestGenerator to improve
239 the generation speed. This is ~10% runtime improvement.
240 (MeasurementSetFetcher::format_map): Updated to reflect the above change.
241 (MeasurementSetFetcher::parse_revisions_array): Ditto.
243 * public/include/manifest.php:
244 (ManifestGenerator::platforms): Fixed the bug by coercing lastModified to integer (instead of float).
246 * server-tests/api-measurement-set-tests.js: Added a test case for returning empty results, and a test case for
247 making sure lastModified dates in manifest.json and measurement sets match.
249 * tools/js/remote.js:
250 (RemoteAPI.prototype.sendHttpRequest): Reject the promise when HTTP status code is not 200.
252 2016-07-09 Ryosuke Niwa <rniwa@webkit.org>
254 Perf dashboard can consume 50-70% of CPU on MacBook even if user is not interacting at all
255 https://bugs.webkit.org/show_bug.cgi?id=159597
257 Reviewed by Chris Dumez.
259 TimeSeriesChart and InteractiveTimeSeriesChart had been relying on continually polling on requestAnimationFrame
260 to update itself in response to its canvas resizing. Even though there as an early exit in the case there was
261 nothing to update, this is still causing a significant power drain when the user is not interacting at all.
263 Let TimeSeriesChart use the regular top-down render path like other components with exceptions of listening to
264 window's resize eventas well as when new JSONs are fetched from the server. The render() call to the latter case
265 will be coerced into a single callback on requestAnimationFrame to avoid DOM-mutation-layout churn.
267 * public/v3/components/base.js:
268 (ComponentBase.isElementInViewport): Deleted.
269 * public/v3/components/chart-pane-base.js:
270 (ChartPaneBase.prototype.render): Enqueue charts to render.
271 * public/v3/components/chart-styles.js:
272 (ChartStyles.dashboardOptions): Removed updateOnRequestAnimationFrame which is no longer an available option.
273 * public/v3/components/time-series-chart.js:
274 (TimeSeriesChart): Replaced the code to register itself for rAF by the code to listen to resize events on window.
275 (TimeSeriesChart._updateOnRAF): Deleted.
276 (TimeSeriesChart._updateAllCharts): Added.
277 (TimeSeriesChart.prototype._enqueueToRender): Added.
278 (TimeSeriesChart._renderEnqueuedCharts): Added.
279 (TimeSeriesChart.prototype.fetchMeasurementSets): Avoid calling fetchBetween when the range had been fetched.
280 Without this change, we can incur a significant number of redundant calls to render() when adjusting the domain
281 in charts page by the slider. When no new JSON is fetched, simply enqueue this chart to render on rAF.
282 (TimeSeriesChart.prototype._didFetchMeasurementSet): Enqueue this chart to render on rAF.
283 (TimeSeriesChart.prototype.render): Removed the check for isElementInViewport since we no longer get render() call
284 when this chart moves into the viewport (as we no longer listen to every rAF or scroll event).
285 * public/v3/models/measurement-set.js:
286 (MeasurementSet.prototype.hasFetchedRange): Fixed various bugs revealed by the new use in fetchMeasurementSets.
287 * public/v3/pages/chart-pane-status-view.js:
288 (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Removed the dead code. It was probably
289 copied from when this code was in InteractiveTimeSeries chart. There is no this._forceRender in this component.
290 * public/v3/pages/dashboard-page.js:
291 (DashboardPage.prototype.render): Enqueue charts to render.
292 * public/v3/pages/heading.js:
293 (SummaryPage.prototype.open): Removed the call to isElementInViewport. This wasn't really doing anything useful in
295 * unit-tests/measurement-set-tests.js: Added tests for hasFetchedRange.
296 (.waitForMeasurementSet): Moved to be used in a newly added test case.
298 2016-07-09 Ryosuke Niwa <rniwa@webkit.org>
300 REGRESSION: manifest.json generation takes multiple seconds on perf dashboard
301 https://bugs.webkit.org/show_bug.cgi?id=159596
303 Reviewed by Chris Dumez.
305 The most of CPU time was spent looking for a duplicate entry in an array of metrics by array_search.
306 This patch moves to postgres by using aggregate functions in the query. Also moved the code to convert
307 datetime to UNIX epoch timestamp from PHP to within postgres query.
309 These improvements reduce total runtime of Manifest::generate from ~4s to ~350ms on my machine.
311 * public/include/manifest.php:
312 (Manifest::generate): No longer fetches test_configurations table as this is done in Manifest::platforms now.
313 Also moved calls to each method in the class to separate lines for easier instrumentation.
314 (Manifest::platforms): Group test configurations (current, baseline, target) by platform and metric.
315 Use the max of the last modified dates in UNIX epoch timestamps (ms to be compatible with JS's representation).
316 A given platform, metric pair is considered to be in the v1 dashboard if any test configuration is in.
318 2016-07-08 Ryosuke Niwa <rniwa@webkit.org>
320 bundle-v3-scripts.py should compress HTML/CSS templates
321 https://bugs.webkit.org/show_bug.cgi?id=159582
323 Reviewed by Joseph Pecoraro.
325 Strip leading and trailing whitespaces from HTML and CSS templates. This is a 8% progression on the file size.
327 * Install.md: Updated the list of MIME types to apply deflate for newer versions of Apache.
328 * tools/bundle-v3-scripts.py:
330 (compress_template): Added.
332 2016-06-13 Ryosuke Niwa <rniwa@webkit.org>
334 Build fix. Strip out "use strict" everywhere so that the perf dashboard works on the shipping Safari.
336 * tools/bundle-v3-scripts.py:
339 2016-06-13 Ryosuke Niwa <rniwa@webkit.org>
341 Invalid token error when trying to create an A/B analysis for a range
342 https://bugs.webkit.org/show_bug.cgi?id=158679
344 Reviewed by Chris Dumez.
346 The problem in this particular case was due to another website overriding cookies for our subdomain.
347 Make PrivilegedAPI robust against its token becoming invalid in general to fix the bug since the cookie
348 is only available under /privileged-api/ and the v3 UI can't access it for security reasons.
350 This patch factors out PrivilegedAPI out of remote.js so that it can be tested separately in server tests
351 as well as unit tests even though RemoteAPI itself is implemented differently in each case.
353 * init-database.sql: Added a forgotten default value "false" to run_marked_outlier.
354 * public/v3/index.html:
355 * public/v3/privileged-api.js: Added. Extracted out of public/v3/remote.js.
356 (PrivilegedAPI.sendRequest): Fixed the bug. When the initial request fails with "InvalidToken" error,
357 re-generate the token and re-issue the request.
358 (PrivilegedAPI.requestCSRFToken):
359 * public/v3/remote.js:
360 (RemoteAPI.postJSON): Added to match tools/js/remote.js.
361 (RemoteAPI.postJSONWithStatus): Ditto.
362 (PrivilegedAPI): Moved to privileged-api.js.
363 * server-tests/api-measurement-set-tests.js: Removed the unused require for crypto.
364 * server-tests/privileged-api-upate-run-status.js: Added tests for /privileged-api/update-run-status.
365 * server-tests/resources/test-server.js:
366 (TestServer.prototype.inject): Clear the cookies as well as tokens in PrivilegedAPI.
367 * tools/js/remote.js:
368 (RemoteAPI): Added the support for PrivilegedAPI by making cookie set by the server persist.
369 (RemoteAPI.prototype.clearCookies): Added for tests.
370 (RemoteAPI.prototype.postJSON): Make sure sendHttpRequest always sends a valid JSON.
371 (RemoteAPI.prototype.postJSONWithStatus): Added since this API is used PrivilegedAPI.
372 (RemoteAPI.prototype.sendHttpRequest): Retain the cookie set by the server and send it back in each request.
373 * tools/js/v3-models.js:
374 * unit-tests/privileged-api-tests.js: Added unit tests for PrivilegedAPI.
375 * unit-tests/resources/mock-remote-api.js:
376 (MockRemoteAPI.postJSON): Added for unit testing.
377 (MockRemoteAPI.postJSONWithStatus): Ditto.
379 2016-06-13 Ryosuke Niwa <rniwa@webkit.org>
381 /admin/tests is very slow
382 https://bugs.webkit.org/show_bug.cgi?id=158682
384 Reviewed by Chris Dumez.
386 The slowness came from TestNameResolver::__construct, which was fetching the entire table of test_configurations,
387 which at this point contains more than 32,000 rows. Don't fetch the entire table in the constructor. Instead,
388 fetch a subset of rows as needed in configurations_for_metric_and_platform. Even though this results in many SQL
389 queries being issued, that's a lot more efficient in practice because we only fetch a few dozen rows in practice.
391 Also removed a whole bunch of features from /admin/tests to simplify the page. In particular, the ability to update
392 the list of triggerables has been removed now that sync-buildbot.js automatically updates that for us. This removed
393 the last use of test_exists_on_platform, which was also dependent on fetching test_configurations upfront.
395 * public/admin/tests.php:
396 * public/include/test-name-resolver.php:
397 (TestNameResolver::__construct): Don't fetch the entire table of test_configurations.
398 (TestNameResolver::configurations_for_metric_and_platform): Just issue a SQL query for the specified platform and metric.
399 (TestNameResolver::test_exists_on_platform): Removed.
401 2016-06-08 Ryosuke Niwa <rniwa@webkit.org>
403 sync-buildbot.js should update the list of tests and platforms associated with a triggerable
404 https://bugs.webkit.org/show_bug.cgi?id=158406
406 Reviewed by Chris Dumez.
408 Add /api/update-triggerable and a test for it, which were supposed to be added in r201718
409 but for which I forgot to run svn add.
411 * public/api/update-triggerable.php: Added.
413 * server-tests/api-update-triggerable.js: Added.
415 2016-06-07 Ryosuke Niwa <rniwa@webkit.org>
417 Build fix after r201739. attachShadow was throwing an exception on this component.
419 * public/v3/pages/analysis-category-toolbar.js:
420 (AnalysisCategoryToolbar):
422 2016-06-06 Ryosuke Niwa <rniwa@webkit.org>
424 sync-buildbot.js should update the list of tests and platforms associated with a triggerable
425 https://bugs.webkit.org/show_bug.cgi?id=158406
426 <rdar://problem/26185737>
428 Reviewed by Darin Adler.
430 Added /api/update-triggerable to update the list of configurations (platform and test pairs)
431 associated with a given triggerable, and make sync-buildbot.js use this JSON API before each
432 syncing cycle so that the association gets updated automatically by simply updating the JSON.
434 * server-tests/api-manifest.js: Use const for imported modules.
435 * server-tests/api-report-commits-tests.js: Removed unnecessary importing of crypto.
436 * server-tests/resources/mock-data.js:
437 (MockData.someTestId): Added.
438 (MockData.somePlatformId): Added.
439 (MockData.addMockData):
440 * server-tests/tools-buildbot-triggerable-tests.js: Use const for imported modules. Also added
441 a test for BuildbotTriggerable's updateTriggerable.
442 * tools/js/buildbot-triggerable.js:
443 (BuildbotTriggerable.prototype.updateTriggerable): Added. Find the list of all configurations
444 associated with this triggeerable and post it to /api/update-triggerable.
445 * tools/js/database.js: Added triggerable_configurations to the list of tables.
446 * tools/js/remote.js:
447 (RemoteAPI.prototype.postJSON): Print the whole response when JSON parsing fails for debugging.
448 * tools/sync-buildbot.js:
449 (syncLoop): Call BuildbotTriggerable's updateTriggerable before syncing.
451 2016-06-02 Ryosuke Niwa <rniwa@webkit.org>
453 Build fix after r201564.
455 * public/v3/pages/analysis-category-page.js:
456 (AnalysisCategoryPage.prototype.updateFromSerializedState):
457 * public/v3/pages/create-analysis-task-page.js:
458 (CreateAnalysisTaskPage.prototype.updateFromSerializedState):
459 (CreateAnalysisTaskPage.prototype.render):
461 2016-05-31 Ryosuke Niwa <rniwa@webkit.org>
463 v3 UI should support marking and unmarking outliers as well as hiding them
464 https://bugs.webkit.org/show_bug.cgi?id=158248
466 Rubber-stamped by Chris Dumez.
468 Added the support for marking and unmarking a sequence of points as outliers. Unlike v2, we now support marking
469 multiple points as outliers in a single click. Also fixed a bug that outliers are never explicitly hidden in v3 UI.
471 This patch splits ChartStyles.createChartSourceList into two functions: resolveConfiguration and createSourceList
472 to separate the work of resolving platform and metric IDs to their respective model objects, and creating a source
473 list used by TimeSeriesChart to fetch measurement sets. createSourceList is called again when filtering options are
476 It also adds noCache option to TimeSeriesChart's fetchMeasurementSets, MeasurementSet's fetchBetween and
477 _fetchPrimaryCluster to update the measurement sets after marking or unmarking points as outliers. In addition, it
478 fixes a bug that the annotation bars for analysis tasks are not updated in charts page after creating an analysis
479 task by adding noCache option to ChartPaneBase's fetchAnalysisTasks, AnalysisTask's fetchByPlatformAndMetric and
482 Finally, this patch splits ChartPane._makeAnchorToOpenPane into _makePopoverActionItem, _makePopoverOpenOnHover and
483 _setPopoverVisibility for clarity.
485 * public/v3/components/chart-pane-base.js:
486 (ChartPaneBase): Added _disableSampling and _showOutliers as instance variables.
487 (ChartPaneBase.prototype.configure):
488 (ChartPaneBase.prototype.isSamplingEnabled): Added.
489 (ChartPaneBase.prototype.setSamplingEnabled): Added. When a filtering option is updated, recreate the source list
490 so that TimeSeriesChart.setSourceList can re-fetch the measurement set JSONs.
491 (ChartPaneBase.prototype.isShowingOutliers): Added.
492 (ChartPaneBase.prototype.setShowOutliers): Added. Ditto for calling _updateSourceList.
493 (ChartPaneBase.prototype._updateSourceList): Added.
494 (ChartPaneBase.prototype.fetchAnalysisTasks): Renamed from _fetchAnalysisTasks. Now takes noCache as an argument
495 instead of platform and metric IDs since they're on instance variables.
497 * public/v3/components/chart-styles.js:
498 (ChartStyles.resolveConfiguration): Renamed from createChartSourceList. Just resolves platform and metric IDs.
499 (ChartStyles.createSourceList): Extracted from createChartSourceList since it needs to be called when a filtering
500 option is changed as well as when ChartPaneBase.prototype.configure is called.
501 (ChartStyles.baselineStyle): Now takes filtering options.
502 (ChartStyles.targetStyle): Ditto.
503 (ChartStyles.currentStyle): Ditto.
505 * public/v3/components/interactive-time-series-chart.js:
506 (InteractiveTimeSeriesChart.prototype.currentPoint): Find the point in _fetchedTimeSeries when
507 _sampledTimeSeriesData hasn't been computed yet as a fallback (e.g. when the chart hasn't been rendered yet).
508 (InteractiveTimeSeriesChart.prototype.selectedPoints): Added.
509 (InteractiveTimeSeriesChart.prototype.firstSelectedPoint): Added.
510 (InteractiveTimeSeriesChart.prototype.lockedIndicator): Added. Returns the current point if it's locked.
512 * public/v3/components/time-series-chart.js:
513 (TimeSeriesChart.prototype.setDomain):
514 (TimeSeriesChart.prototype.setSourceList): Added. Re-create _fetchedTimeSeries when filtering options have changed.
515 Don't re-fetch measurement set JSONs here since showing outliers can be done entirely in the front end.
516 (TimeSeriesChart.prototype.fetchMeasurementSets): Extracted out of setDomain. Now takes noCache as an argument.
517 ChartPane._markAsOutlier
518 (TimeSeriesChart.prototype.firstSampledPointBetweenTime): Added.
520 * public/v3/models/analysis-task.js:
521 (AnalysisTask.fetchByPlatformAndMetric): Added noCache as an argument.
522 (AnalysisTask._fetchSubset): Ditto.
524 * public/v3/models/measurement-adaptor.js:
525 (MeasurementAdaptor.prototype.isOutlier): Added.
526 (MeasurementAdaptor.prototype.applyToAnalysisResults): Add markedOutlier as a property on each point.
528 * public/v3/models/measurement-cluster.js:
529 (MeasurementCluster.prototype.addToSeries): Fixed the bug that filtering outliers was broken as _markedOutlierIndex
530 is undefined here. Use MeasurementAdaptor's isOutlier instead.
532 * public/v3/models/measurement-set.js:
533 (MeasurementSet.prototype.fetchBetween): Added noCache as an argument. Reset _primaryClusterPromise and _allFetches
534 when noCache is true since we need to re-fetch the primary cluster as well as all secondary clusters now.
535 (MeasurementSet.prototype._fetchPrimaryCluster): Added noCache as an argument. Directly invoke the JSON API at
536 /api/measurement-set to re-generate all clusters' JSON files instead of first fetching the cached version.
537 (MeasurementSet.prototype._fetchSecondaryCluster):
538 (MeasurementSet.prototype._didFetchJSON): Removed a bogus assertion since this function is called on secondary
539 clusters as well as primary clusters.
540 (MeasurementSet.prototype._addFetchedCluster): Reimplemented this function using an insertion sort. Also remove the
541 existing entry if the fetch cluster should replace it.
543 * public/v3/models/time-series.js:
544 (TimeSeries.prototype.dataBetweenPoints): Removed the dead code to filter out outliers. This is done in addToSeries
545 of MeasurementCluster instead.
547 * public/v3/pages/chart-pane.js:
548 (ChartPane): Renamed pane to popover since it was confusing to have a pane inside a pane class. As such, renamed
549 _paneOpenedByClick to _lockedPopover.
550 (ChartPane.prototype.serializeState): Added the code to serialize filtering options in the serialized state URL.
551 (ChartPane.prototype.updateFromSerializedState): Ditto for parsing.
552 (ChartPane.prototype._analyzeRange): Extracted out of render(). Also fixed a bug that the charts page don't show
553 the newly created analysis task by invoking fetchAnalysisTasks with noCache set to true.
554 (ChartPane.prototype._markAsOutlier): Added.
555 (ChartPane.prototype._renderActionToolbar): A bunch of changes due to pane -> popover rename. Also added a popover
556 for filtering options.
557 (ChartPane.prototype._makePopoverActionItem): Extracted from _makeAnchorToOpenPane.
558 (ChartPane.prototype._makePopoverOpenOnHover): Ditto.
559 (ChartPane.prototype._setPopoverVisibility): Ditto.
560 (ChartPane.prototype._renderFilteringPopover): Added.
561 (ChartPane.htmlTemplate): Added a popover for specifying filtering options. Also added .popover on each popover.
562 (ChartPane.cssTemplate): Updated the style to make use of .popover.
564 * public/v3/pages/charts-page.js:
565 (ChartsPage.prototype.graphOptionsDidChange): Added. Updates the URL state when a filtering option is modified.
567 * public/v3/pages/dashboard-page.js:
568 (DashboardPage.prototype._createChartForCell):
570 * public/v3/pages/page-router.js:
571 (PageRouter.prototype._serializeHashQueryValue): Serialize a set of strings as | separated tokens.
572 (PageRouter.prototype._deserializeHashQueryValue): Rewrote the function as the serialized URL can no longer be
573 parsed as a JSON as | separated tokens can't be converted into a valid JSON construct with a simple regex.
575 * unit-tests/measurement-set-tests.js: Added a test case for fetchBetween with noCache=true.
577 2016-05-24 Ryosuke Niwa <rniwa@webkit.org>
579 Another build fix after r201307.
581 * public/v3/pages/page-router.js:
582 (PageRouter.prototype._deserializeHashQueryValue):
583 (PageRouter.prototype._countOccurrences): Moved from _deserializeHashQueryValue.
585 2016-05-23 Ryosuke Niwa <rniwa@webkit.org>
587 Build fix after r201307.
589 * public/v3/pages/chart-pane.js:
590 (ChartPane.prototype.serializeState):
592 2016-05-23 Ryosuke Niwa <rniwa@webkit.org>
594 Some applications truncates the last closing parenthesis in perf dashboard URL
595 https://bugs.webkit.org/show_bug.cgi?id=157976
597 Reviewed by Tim Horton.
599 Unfortunately, different applications use different heuristics to determine the end of each URL. Two trailing
600 parentheses, for example, is just fine in Radar as well as Apple Mail if the URL is short enough. Using other
601 characters such as ] and } wouldn't work either because they would be %-escaped. At that point, we might as well
602 as %-escape everything.
604 Work around the bug by parsing the URL as if it had one extra ')' if the parsing had failed. Also shorten the charts
605 page's URL by avoid emitting "-null" for each pane when the pane doesn't have a currently selected point or selection.
606 This improves the odds of the entire URL being recognized by various applications.
608 We could, in theory, implement some sort of a URL shorter but that can wait until when we support real user accounts.
610 * public/v3/pages/chart-pane.js:
611 (ChartPane.prototype.serializeState): Don't serialize the selection or the current point if nothing is selected.
612 * public/v3/pages/page-router.js:
613 (PageRouter.prototype._deserializeHashQueryValue): Try parsing the value again with one extra ] at the end if
614 the JSON parsing had failed.
616 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
618 Perf dashboard "Add pane" should list first by test, then by machine
619 https://bugs.webkit.org/show_bug.cgi?id=157880
621 Reviewed by Stephanie Lewis.
623 Reversed the order which tests and platforms are selected. Also split .pane-selector-container into #tests and
624 #platform for the ease of DOM node manipulations.
626 * public/v3/components/pane-selector.js:
628 (PaneSelector.prototype._renderPlatformList): Renamed from _renderPlatformLists since there is a single list
629 for platforms. This list now disappears while a non-metric item is selected in the collection of test lists.
630 e.g. "Speedometer" instead of its "Score" metric. Remember the last metric we rendered to avoid churning.
631 (PaneSelector.prototype._renderTestLists): Render the top level tests once. The index of lists have been
632 decreased by one since test lists are now inside #tests instead of appearing after the platform list.
633 (PaneSelector.prototype._buildTestList): Don't filter tests since platform is chosen after tests now.
634 (PaneSelector.prototype._replaceList):
635 (PaneSelector.prototype._selectedItem): Don't reset the test path (specifies which subtest or metric is picked)
636 when a platform is selected since it happens after a test metric is chosen now.
637 (PaneSelector.prototype._clickedItem): Add a pane when a platform is clicked, not when a metric is clicked.
638 (PaneSelector.cssTemplate):
640 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
642 Analysis task should look for a git commit based on abridged hashes
643 https://bugs.webkit.org/show_bug.cgi?id=157877
644 <rdar://problem/26254374>
646 Reviewed by Chris Dumez.
648 Made /privileged-api/associate-commit look for commits using LIKE instead of an exact match.
649 Associate the commit when there is exactly one match.
651 * public/include/commit-log-fetcher.php:
652 (CommitLogFetcher::fetch_between):
653 * public/include/db.php:
654 (Database::escape_for_like): Extracted from CommitLogFetcher::fetch_between.
655 * public/privileged-api/associate-commit.php:
656 (main): Look for the commits using LIKE. Reject whenever there are multiple commits. We limit the number of
657 matches to two for performance when the user specifies something that almost thousands of commits: e.g. "1".
658 * public/v3/pages/analysis-task-page.js:
659 (AnalysisTaskPage.prototype._associateCommit): Added human friendly error messages for mismatching commits.
661 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
663 Unreviewed build fix. Use --date-order so that every child commit appears after its parent.
664 Otherwise we'll hit a FailedToFindParentCommit error while submitting a commit that appears before its parent.
666 * tools/sync-commits.py:
667 (GitRepository._fetch_all_hashes):
669 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
671 Removed the erroneously committed debug code.
673 * tools/sync-commits.py:
674 (GitRepository.fetch_commit):
676 2016-05-18 Ryosuke Niwa <rniwa@webkit.org>
678 Perf dashboard should have a script to sync git commits
679 https://bugs.webkit.org/show_bug.cgi?id=157867
681 Reviewed by Chris Dumez.
683 Added the support to pull from a Git repo to pull-svn.py and renamed it to sync-commits.py.
685 Added two classes SVNRepository and GitRepository which inherits from an abstract class, Repository.
686 The code that fetches commit and format revision number / git hash is specialized in each.
689 * tools/pull-svn.py: Removed.
690 * tools/sync-commits.py: Renamed from Websites/perf.webkit.org/tools/pull-svn.py.
691 (main): Renamed --svn-config-json to --repository-config-json. Also made it robust against exceptions
692 inside fetch_commits_and_submit of each Repository class.
693 (load_repository): A factory function for SVNRepository and GitRepository.
695 (Repository.__init__): Added.
696 (Repository.fetch_commits_and_submit): Extracted from standalone fetch_commits_and_submit.
697 (Repository.fetch_commit): Added. Implemented by a subclass.
698 (Repository.format_revision): Ditto.
699 (Repository.determine_last_reported_revision): Extracted from alonealone
700 determine_first_revision_to_fetch. The fallback to use "oldest" has been moved to SVNRepository's
701 fetch_commit since it doesn't work in Git.
702 (Repository.fetch_revision_from_dasbhoard): Extracted from fetch_revision_from_dasbhoard.
703 (SVNRepository): Added.
704 (SVNRepository.__init__): Added.
705 (SVNRepository.fetch_commit): Extracted from standalone fetch_commit_and_resolve_author and fetch_commit.
706 (SVNRepository._resolve_author_name): Renamed from resolve_author_name_from_account.
707 (SVNRepository.format_revision): Added.
708 (GitRepository): Added.
709 (GitRepository.__init__):
710 (GitRepository.fetch_commit): Added. Fetches the list of all git hashes if needed, and finds the next hash.
711 (GitRepository._find_next_hash): Added. Finds the first commit that appears after the specified hash.
712 (GitRepository._fetch_all_hashes): Added. Gets the list of all git hashs chronologically (old to new).
713 (GitRepository._run_git_command): Added.
714 (GitRepository.format_revision): Added. Use the first 8 characters of the hash.
716 2016-05-17 Ryosuke Niwa <rniwa@webkit.org>
718 Add a subtitle under platform name in the summary page
719 https://bugs.webkit.org/show_bug.cgi?id=157809
721 Reviewed by Chris Dumez.
723 Add a description beneath the platform names.
725 * public/v3/pages/summary-page.js:
726 (SummaryPage.prototype._constructTable): Add a br and a span if subtitle is present.
727 (SummaryPage.cssTemplate): Added CSS rules for .subtitle.
729 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
731 v3 UI shows full git hash instead of the first 8 characters for a blame range
732 https://bugs.webkit.org/show_bug.cgi?id=157691
734 Reviewed by Stephanie Lewis.
736 Fixed the bug that v3 UI shows the full 40 character git hash instead of the first 8 character as done in v2 UI.
738 * public/v3/models/commit-log.js:
739 (CommitLog.prototype.diff): Fixed the bug.
740 * tools/run-tests.py:
741 (main): Add the support for running a subset of tests as mocha does.
742 * unit-tests/commit-log-tests.js: Added.
744 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
746 Unreviewed. Added the missing executable bits.
748 * tools/bundle-v3-scripts.py: Added property svn:executable.
749 * tools/detect-changes.js: Added property svn:executable.
750 * tools/process-maintenance-backlog.py: Added property svn:executable.
752 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
754 Summary page doesn't report some missing platforms
755 https://bugs.webkit.org/show_bug.cgi?id=157670
757 Reviewed by Darin Adler.
759 This patch improves the warning text for missing platforms and fixes the bug that platforms that don't have
760 any data reported for a given test would not be reported as missing.
762 * public/v3/pages/summary-page.js:
763 (SummaryPage.prototype.render): Added instrumentations.
764 (SummaryPage.prototype._constructRatioGraph): Always create both the ratio bar graph and the spinner icon.
765 (SummaryPage.prototype._renderCell): Extracted from _constructRatioGraph. Toggle the displayed-ness of the
766 spinner and the ratio bar graph in the cell by CSS for better performance.
767 (SummaryPage.prototype._warningTextForGroup): Extracted from _constructRatioGraph. Rephrased warning text
768 for clarity and adopted new API of SummaryPageConfigurationGroup.
769 (SummaryPage.prototype._warningTextForGroup.mapAndSortByName): Added.
770 (SummaryPage.prototype._warningTextForGroup.pluralizeIfNeeded): Added.
771 (SummaryPage.cssTemplate): Added rules to toggle the visibility of spinner icons and bar graphs.
772 (SummaryPageConfigurationGroup): Replaced this._warnings by more explicitly named this._missingPlatforms
773 and this._platformsWithoutBaseline. Also add a platform to this._missingPlatforms if it didn't appear in
774 any metrics. Note that adding a platform whenever it doesn't in any one metric would be incorrect since
775 some tests uses a different test name on different platforms: e.g. PLT-Mac and PLT-iPhone.
776 (SummaryPageConfigurationGroup.prototype.missingPlatforms): Added.
777 (SummaryPageConfigurationGroup.prototype.platformsWithoutBaseline): Added.
778 (SummaryPageConfigurationGroup.prototype._fetchAndComputeRatio):
780 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
782 Always use v3 UI for dashboards and analysis task pages
783 https://bugs.webkit.org/show_bug.cgi?id=157647
785 Reviewed by Darin Adler.
787 Redirect dashboard pages from v1 and v2 to v3's summary page. Also redirect v1 UI's charts page and v2 UI's
788 analysis task pages to the corresponding v3 pages.
790 Keep v2's charts page accessible since some features such as segmentation is still only available on v2 UI.
793 (init.showCharts): Redirect to v3 UI once the chart list has been parsed.
794 (init.redirectChartsToV3): Added.
795 * public/v2/index.html:
797 2016-05-13 Ryosuke Niwa <rniwa@webkit.org>
799 Show a spinner while fetching data on summary page
800 https://bugs.webkit.org/show_bug.cgi?id=157658
802 Reviewed by Darin Adler.
804 Show a spinner while fetching JSON files on the summary page.
806 * public/v3/components/base.js:
807 (ComponentBase.prototype.renderReplace): Added a new implementation that simply calls the static version.
808 (ComponentBase.renderReplace): Made this static.
810 * public/v3/pages/summary-page.js:
811 (SummaryPage.prototype._constructRatioGraph): Show a spinner icon when SummaryPageConfigurationGroup's
812 isFetching returns true.
813 (SummaryPage.cssTemplate): Force the height of each cell to be 2.5rem so that the height of cell doesn't
814 change when a spinner is replaced by a ratio bar graph.
816 (SummaryPageConfigurationGroup): Added this._isFetching as an instance variable.
817 (SummaryPageConfigurationGroup.prototype.isFetching): Added.
818 (SummaryPageConfigurationGroup.prototype.fetchAndComputeSummary): Set this._isFetching while waiting for
819 the promises to resolve after 50ms. We don't immediately set this._isFetching to avoid FOC when all JSON
820 files have been cached.
822 2016-05-07 Ryosuke Niwa <rniwa@webkit.org>
824 Add horizontal between categories of tests
825 https://bugs.webkit.org/show_bug.cgi?id=157386
827 Reviewed by Darin Adler.
829 Wrap tests in each category by tbody and add a horizontal bar between each category.
831 * public/v3/pages/summary-page.js:
832 (SummaryPage.prototype._constructTable):
833 (SummaryPage.cssTemplate):
835 2016-05-04 Dewei Zhu <dewei_zhu@apple.com>
837 Summary page should show warnings when current or baseline data is missing.
838 https://bugs.webkit.org/show_bug.cgi?id=157339
840 Reviewed by Ryosuke Niwa.
842 Set summary page to be the default page of v3 UI.
843 Show warning icon when either baseline or current data is missing.
844 Make fetchBetween returns a promise.
845 Update unit tests for MeasurementSet.fetchBetween since it returns a promise now.
846 Add a workaround to skip some platform and metric configurations.
848 * public/v3/components/ratio-bar-graph.js:
850 (RatioBarGraph.prototype.update): Add showWarningIcon flag to indicate whether we should show warning icon.
851 (RatioBarGraph.prototype.render): Show warning icon when showWarningIcon is true.
852 (RatioBarGraph.cssTemplate): Add style for warning icon.
853 * public/v3/components/warning-icon.js: Add warning icon.
855 (WarningIcon.cssTemplate):
856 * public/v3/index.html:
858 (main): Set summary page to be the default page of v3 UI.
859 * public/v3/models/measurement-set.js:
861 (MeasurementSet.prototype.fetchBetween): Returns a promise. Fix the bug in previous implementation that we miss
862 some callbacks sometimes. Basically, we will fetch primary cluster first, then secondary clusters. For each
863 secondary cluster fetch, we will always invoke callback even when it fails.
864 (MeasurementSet.prototype._fetchSecondaryClusters): Deleted.
865 (MeasurementSet.prototype._fetch.else.url.api.measurement.set platform): Deleted.
866 * public/v3/pages/summary-page.js:
867 (SummaryPage): Add a variable for excluded configurations.
868 (SummaryPage.prototype._createConfigurationGroup): Pass excluded configurations while building config groups.
869 (SummaryPage.prototype._constructTable): Remove the logic for unified header since it breaks consistency of the table appearance.
870 (SummaryPage.prototype.this._renderQueue.push): Show warning message when baseline/current data is missing.
871 (SummaryPageConfigurationGroup): Add a variable to keep track of the warnings while computing summary.
872 (SummaryPageConfigurationGroup.prototype.warnings): A getter for warnings.
873 (SummaryPageConfigurationGroup._computeSummary): Fix a bug in calculating ratios. We should always use
874 current/baseline for ratio and present the difference between ratio and 1 in the summary page.
875 (SummaryPageConfigurationGroup.set then): Deleted.
876 (SummaryPageConfigurationGroup.set var): Deleted.
877 * unit-tests/measurement-set-tests.js: Add a helper function to wait for fetchBetween. Update unit tests since fetchBetween returns a promise now.
878 (promise.set fetchBetween):
879 (set MeasurementSet):
880 (set fetchBetween): Deleted.
882 2016-04-26 Ryosuke Niwa <rniwa@webkit.org>
884 Chart status should always be computed against prior values
885 https://bugs.webkit.org/show_bug.cgi?id=157014
887 Reviewed by Darin Adler.
889 Compare the current value against the last baseline or target value that appear before the current value in time
890 so that the comparison stay the same even when new baseline and target values are reported. Also include the compared
891 baseline or target value in the label for clarity.
893 * public/v3/components/chart-status-view.js:
894 (ChartStatusView.prototype._computeChartStatus):
895 (ChartStatusView.prototype._computeChartStatus.labelForDiff):
896 (ChartStatusView.prototype._findLastPointPriorToTime): Extracted from _relativeDifferenceToLaterPointInTimeSeries.
897 Now finds the last point before the current point's time if there is any, or the last point in baseline / target.
898 (ChartStatusView.prototype._relativeDifferenceToLaterPointInTimeSeries): Deleted.
899 * public/v3/models/metric.js:
900 (Metric.prototype.makeFormatter): Don't use SI units for unit-less metrics.
902 2016-04-13 Ryosuke Niwa <rniwa@webkit.org>
904 REGRESSION(r199444): Perf dashboard always fetches all measurement sets
905 https://bugs.webkit.org/show_bug.cgi?id=156534
907 Reviewed by Darin Adler.
909 The bug was cased by SummaryPage's constructor fetching all measurement sets. Since each page is always
910 constructed in main(), this resulted in all measurement sets being fetched on all pages.
912 * public/v3/pages/summary-page.js:
914 (SummaryPage.prototype.open): Fetch measurement set JSONs here.
915 (SummaryPage.prototype._createConfigurationGroup): Renamed from _createConfigurationGroupAndStartFetchingData.
917 2016-04-12 Ryosuke Niwa <rniwa@webkit.org>
919 Add a summary page to v3 UI
920 https://bugs.webkit.org/show_bug.cgi?id=156531
922 Reviewed by Stephanie Lewis.
924 Add new "Summary" page, which shows the average difference (better or worse) from the baseline across
925 multiple platforms and tests by a single number.
927 * public/include/manifest.php:
928 (ManifestGenerator::generate): Include "summary" in manifest.json.
929 * public/shared/statistics.js:
930 (Statistics.mean): Added.
931 (Statistics.median): Added.
932 * public/v3/components/ratio-bar-graph.js: Added.
933 (RatioBarGraph): Shows a horizontal bar graph that visualizes the relative difference (e.g. 3% better).
934 (RatioBarGraph.prototype.update):
935 (RatioBarGraph.prototype.render):
936 (RatioBarGraph.cssTemplate):
937 (RatioBarGraph.htmlTemplate):
938 * public/v3/index.html:
940 (main): Instantiate SummaryPage and add it to the navigation bar and the router.
941 * public/v3/models/manifest.js:
942 (Manifest._didFetchManifest): Let "summary" pass through from manifest.json to main().
943 * public/v3/models/measurement-set.js:
944 (MeasurementSet.prototype._failedToFetchJSON): Invoke the callback with an error or true in order for
945 the callback can detect a failure.
946 (MeasurementSet.prototype._invokeCallbacks): Ditto.
947 * public/v3/pages/charts-page.js:
948 (ChartsPage.createStateForConfigurationList): Added to add a hyperlink from summary page to charts page.
949 * public/v3/pages/summary-page.js: Added.
950 (SummaryPage): Added.
951 (SummaryPage.prototype.routeName): Added.
952 (SummaryPage.prototype.open): Added.
953 (SummaryPage.prototype.render): Added.
954 (SummaryPage.prototype._createConfigurationGroupAndStartFetchingData): Added.
955 (SummaryPage.prototype._constructTable): Added.
956 (SummaryPage.prototype._constructRatioGraph): Added.
957 (SummaryPage.htmlTemplate): Added.
958 (SummaryPage.cssTemplate): Added.
959 (SummaryPageConfigurationGroup): Added. Represents a set of platforms and tests shown in a single cell.
960 (SummaryPageConfigurationGroup.prototype.ratio): Added.
961 (SummaryPageConfigurationGroup.prototype.label): Added.
962 (SummaryPageConfigurationGroup.prototype.changeType): Added.
963 (SummaryPageConfigurationGroup.prototype.configurationList): Added.
964 (SummaryPageConfigurationGroup.prototype.fetchAndComputeSummary): Added.
965 (SummaryPageConfigurationGroup.prototype._computeSummary): Added.
966 (SummaryPageConfigurationGroup.prototype._fetchAndComputeRatio): Added. Invoked for each time series in
967 the set, and stores the computed ratio of the current values to the baseline in this._setToRatio.
968 The results are aggregated by _computeSummary as a single number later.
969 (SummaryPageConfigurationGroup._medianForTimeRange): Added.
970 (SummaryPageConfigurationGroup._fetchData): A thin wrapper to make MeasurementSet.fetchBetween promise
971 friendly since MeasurementSet doesn't support Promise at the moment (but it should!).
972 * server-tests/api-manifest.js: Updated a test case.
974 2016-04-12 Ryosuke Niwa <rniwa@webkit.org>
976 Make sync-buildbot.js fault safe
977 https://bugs.webkit.org/show_bug.cgi?id=156498
979 Reviewed by Chris Dumez.
981 Fixed a bug that sync-buildbot.js will continue to schedule build requests from multiple test groups
982 if multiple test groups are simultaneously in-progress on the same builder. Also fixed a bug that if
983 a build request had failed without leaving a trace (i.e. no entry on any of the builders we know of),
984 sync-buildbot.js throws an exception.
986 * server-tests/tools-buildbot-triggerable-tests.js: Added test cases.
987 * tools/js/buildbot-syncer.js:
988 (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Renamed. Optionally takes the slave name.
989 When this parameter is specified, schedule the request only if the specified slave is available.
990 * tools/js/buildbot-triggerable.js:
991 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Always use
992 scheduleRequestInGroupIfAvailable to schedule a new build request. Using scheduleRequest for non-first
993 build requests was problematic when there were multiple test groups with pending requests because then
994 we would schedule those pending requests without checking whether there is already a pending job or if
995 we have previously scheduled a job. Also fallback to use any syncer / builder when groupInfo.syncer is
996 not set even if the next request was not the first one in the test group since we can't determine on
997 which builder preceding requests are processed in such cases.
998 * unit-tests/buildbot-syncer-tests.js:
1000 2016-04-11 Ryosuke Niwa <rniwa@webkit.org>
1002 Replace script runner to use mocha.js tests
1003 https://bugs.webkit.org/show_bug.cgi?id=156490
1005 Reviewed by Chris Dumez.
1007 Replaced run-tests.js, which was a whole test harness for running legacy tests by tools/run-tests.py
1008 which is a thin wrapper around mocha.js.
1010 * run-tests.js: Removed.
1012 * tools/run-tests.py: Added.
1015 2016-04-11 Ryosuke Niwa <rniwa@webkit.org>
1017 New syncing script sometimes schedules a build request on a wrong builder
1018 https://bugs.webkit.org/show_bug.cgi?id=156489
1020 Reviewed by Stephanie Lewis.
1022 The bug was caused by _scheduleNextRequestInGroupIfSlaveIsAvailable scheduling the next build request on
1023 any available syncer regardless of whether the request is the first one in the test group or not because
1024 BuildRequest.order was returning a string instead of a number.
1026 Also fixed a bug that BuildbotTriggerable.syncOnce was re-ordering test groups by their id's instead of
1027 respecting the order in which the perf dashboard returned.
1029 * public/v3/models/build-request.js:
1030 (BuildRequest.prototype.order): Force the order to be a number.
1031 * server-tests/api-build-requests-tests.js: Assert the order as numbers.
1032 * server-tests/resources/mock-data.js:
1033 (MockData.addAnotherMockTestGroup): Changed the test group id to 601, which is after the first mock data.
1034 The old number was masking a bug in BuildbotTriggerable that it was re-ordering test groups by their id's
1035 instead of using the order set forth by the perf dashboard.
1036 (MockData.mockTestSyncConfigWithSingleBuilder):
1037 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for scheduling two build requests in
1038 a single call to syncOnce. Each build request should be scheduled on the same builder as the previous build
1039 requests in the same test group.
1040 * tools/js/buildbot-triggerable.js:
1041 (BuildbotTriggerable.prototype.syncOnce): Order test groups by groupOrder, which is the index at which first
1042 build request in the group appeared.
1043 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Don't re-order build requests
1044 as they're already sorted on the server side.
1045 (BuildbotTriggerable._testGroupMapForBuildRequests): Added groupOrder to test group info
1047 2016-04-09 Ryosuke Niwa <rniwa@webkit.org>
1049 Build fix. Don't treat a build number 0 as a pending build.
1051 * tools/js/buildbot-syncer.js:
1052 (BuildbotBuildEntry.prototype.isPending):
1054 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
1056 Escape builder names in url* and pathFor* methods of BuildbotSyncer
1057 https://bugs.webkit.org/show_bug.cgi?id=156427
1059 Reviewed by Darin Adler.
1061 The build fix in r199251 breaks other usage of RemoteAPI. Fix it properly by escaping builder names in
1062 various methods of BuildbotSyncer.
1064 Also fixed a typo in the logging and a bug that the new syncing script never updated "scheduled" to "running".
1066 * server-tests/resources/mock-data.js:
1067 (MockData.mockTestSyncConfigWithTwoBuilders): Renamed "some-builder-2" to "some builder 2" to test the
1068 new escaping behavior in tools-buildbot-triggerable-tests.js and buildbot-syncer-tests.js.
1070 * server-tests/tools-buildbot-triggerable-tests.js: Added tests for status url, and added a new test case
1071 for updating "scheduled" to "running".
1073 * tools/js/buildbot-syncer.js:
1074 (BuildbotBuildEntry.buildRequestStatusIfUpdateIsNeeded): Update the status to "running" when the request's
1075 status is "scheduled" and the buildbot's build is currently in progress.
1076 (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Escape the builder name.
1077 (BuildbotSyncer.prototype.pathForBuildJSON): Ditto.
1078 (BuildbotSyncer.prototype.pathForForceBuild): Ditto.
1079 (BuildbotSyncer.prototype.url): Ditto.
1080 (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
1082 * tools/js/buildbot-triggerable.js:
1083 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers):
1084 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Fixed a typo. We are
1085 scheduling new build requests, not syncing them.
1086 * tools/js/remote.js:
1087 (RemoteAPI.sendHttpRequest): Reverted r199251.
1088 * unit-tests/buildbot-syncer-tests.js:
1090 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
1092 Build fix. We need to escape the path or http.request would fail.
1094 * tools/js/remote.js:
1096 2016-04-08 Ryosuke Niwa <rniwa@webkit.org>
1098 Fix various bugs in the new syncing script
1099 https://bugs.webkit.org/show_bug.cgi?id=156393
1101 Reviewed by Darin Adler.
1103 * server-tests/resources/common-operations.js: Added. This file was supposed to be added in r199191.
1104 (addBuilderForReport):
1105 (addSlaveForReport):
1106 (connectToDatabaseInEveryTest):
1108 * tools/js/buildbot-triggerable.js:
1109 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Don't log every time we pull from buildbot
1110 builder as this dramatically increases the amount of log we generate.
1111 * tools/js/parse-arguments.js:
1112 (parseArguments): Fixed a typo. This should be parseArgument*s*, not parseArgument.
1113 * tools/js/remote.js:
1114 (RemoteAPI.prototype.url): Fixed a bug that portSuffix wasn't being expanded in the template literal.
1115 (RemoteAPI.prototype.configure): Added more validations with nice error messages.
1116 (RemoteAPI.prototype.sendHttpRequest): Falling back to port 80 isn't right when scheme is https. Compute
1117 the right port in configure instead based on the scheme.
1118 * tools/sync-buildbot.js:
1119 (syncLoop): Fixed the bug that syncing multiple times fail because Manifest.fetch() create new Platform
1120 and Test objects. This results in various references in BuildRequest objects to get outdated. Fixing this
1121 properly in Manifest.fetch() because we do need to "forget" about some tests and platforms in some cases.
1122 For now, delete all v3 model objects and start over in each syncing cycle.
1123 * unit-tests/tools-js-remote-tests.js: Added. Unit tests for the aforementioned changes to RemoteAPI.
1125 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
1127 sync-buildbot.js doesn't mark disappeared builds as failed
1128 https://bugs.webkit.org/show_bug.cgi?id=156386
1130 Reviewed by Chris Dumez.
1132 Fix a bug that new syncing script doesn't mark builds that it scheduled but doesn't appear when queried
1133 by buildbot's JSON API. These are builds that got canceled by humans (e.g. buildbot was restarted, data
1134 loss, pending build was canceled, etc...)
1136 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case.
1137 * tools/js/buildbot-triggerable.js:
1138 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added a set of build requests we've matched
1139 against BuildbotBuildEntry's. Mark build requests that didn't have any entry but supposed to be in either
1140 'scheduled' or 'running' status as failed.
1142 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
1144 A/B testing bots should prioritize user created test groups
1145 https://bugs.webkit.org/show_bug.cgi?id=156375
1147 Reviewed by Chris Dumez.
1149 Order build requests preferring user created ones over ones automatically created by detect-changes.js.
1151 Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new
1152 build request on a builder/slave even when we had previously scheduled another build request.
1154 * public/include/build-requests-fetcher.php:
1155 (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on
1156 author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js.
1157 Since we're using ascending order, this would put user created test groups first.
1158 * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case
1159 for testing that build requests for an user created test group shows up first.
1160 * server-tests/resources/mock-data.js:
1161 (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name.
1162 * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests
1163 for an user created test group shows up first.
1164 * tools/js/buildbot-syncer.js:
1165 (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already
1166 scheduled new build requests. Don't schedule more requests on these slaves.
1167 (BuildbotSyncer.prototype.scheduleRequest):
1168 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null
1169 when slaveList is not specified) to _slavesWithNewRequests.
1170 (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request
1171 we have previously scheduled should be included in one of the entires now.
1172 * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug.
1173 (sampleiOSConfig): Added a second slave for new test cases.
1175 2016-04-07 Ryosuke Niwa <rniwa@webkit.org>
1177 Migrate legacy perf dashboard tests to mocha.js based tests
1178 https://bugs.webkit.org/show_bug.cgi?id=156335
1180 Reviewed by Chris Dumez.
1182 Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise
1183 for most of asynchronous operations, refactored the tests to use Promises as well, and added more
1184 assertions where appropriate.
1186 Also consolidated common helper functions into server-tests/resources/common-operations.js.
1187 Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were
1188 taking an array of reports while others were taking a single report. New shared implementation in
1189 common-operations.js now takes a single report.
1191 Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout.
1192 Most of tests are passing under 100ms on my computer so 1s should be plenty still.
1194 * run-tests.js: Removed.
1195 * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js.
1196 (reportsForDifferentPlatforms):
1197 * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js.
1198 (.addBuilder): Moved to common-operations.js.
1199 * server-tests/api-build-requests-tests.js:
1200 * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps.
1201 * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js.
1202 (.queryPlatformAndMetric):
1204 * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js.
1205 * server-tests/api-report-tests.js: Moved from tests/api-report.js.
1207 (.emptySlaveReport):
1208 (.reportWithSameSubtestName):
1209 * server-tests/resources/common-operations.js: Added.
1210 (addBuilderForReport): Extracted from tests.
1211 (addSlaveForReport): Ditto.
1212 (connectToDatabaseInEveryTest): Added.
1213 (submitReport): Extracted from admin-platforms-tests.js.
1214 * server-tests/resources/test-server.js:
1215 (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start
1216 its own Apache instance (that would certainly will fail).
1217 * server-tests/tools-buildbot-triggerable-tests.js:
1219 * tools/js/database.js:
1220 (Database.prototype.selectAll): Added.
1221 (Database.prototype.selectFirstRow): Added.
1222 (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments.
1224 2016-04-05 Ryosuke Niwa <rniwa@webkit.org>
1226 New buildbot syncing scripts that supports multiple builders and slaves
1227 https://bugs.webkit.org/show_bug.cgi?id=156269
1229 Reviewed by Chris Dumez.
1231 Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves.
1232 The old python script (sync-with-buildbot.py) could only support a single builder and slave
1233 for each platform, test pair.
1235 The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added
1236 throughout the codebase and tests have been refactored.
1238 BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible
1239 for syncing everything on each builder (on a buildbot).
1241 Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored
1242 test helpers and mocks as needed.
1244 * public/v3/models/build-request.js:
1245 (BuildRequest.prototype.status): Added.
1246 (BuildRequest.prototype.isScheduled): Added.
1247 * public/v3/models/metric.js:
1248 (Metric.prototype.fullName): Added.
1249 * public/v3/models/platform.js:
1250 (Platform): Added the map based on platform name.
1251 (Platform.findByName): Added.
1252 * public/v3/models/test.js:
1253 (Test.topLevelTests):
1254 (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would
1255 find the test whose name is "B" which has a parent test named "A".
1256 (Test.prototype.fullName): Added.
1257 * server-tests/api-build-requests-tests.js:
1258 (addMockData): Moved to resources/mock-data.js.
1259 (addAnotherMockTestGroup): Ditto.
1260 * server-tests/resources/mock-data.js: Added.
1261 (MockData.resetV3Models): Added.
1262 (MockData.addMockData): Moved from api-build-requests-tests.js.
1263 (MockData.addAnotherMockTestGroup): Ditto.
1264 (MockData.mockTestSyncConfigWithSingleBuilder): Added.
1265 (MockData.mockTestSyncConfigWithTwoBuilders): Added.
1266 (MockData.pendingBuild): Added.
1267 (MockData.runningBuild): Added.
1268 (MockData.finishedBuild): Added.
1269 * server-tests/resources/test-server.js:
1271 (TestServer.prototype.remoteAPI):
1272 (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit.
1273 (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever.
1274 (TestServer.prototype._waitForPid): Increase the timeout.
1275 (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards.
1276 * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce.
1277 (MockLogger): Added.
1278 (MockLogger.prototype.log): Added.
1279 (MockLogger.prototype.error): Added.
1280 * tools/detect-changes.js:
1281 (parseArgument): Moved to js/parse-arguments.js.
1282 * tools/js/buildbot-syncer.js:
1283 (BuildbotBuildEntry):
1284 (BuildbotBuildEntry.prototype.syncer): Added.
1285 (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status
1286 for a build request (of the matching build request ID) if it needs to be updated in the server.
1287 (BuildbotSyncer): This class
1288 (BuildbotSyncer.prototype.addTestConfiguration): Added.
1289 (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations.
1290 (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on
1292 (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request.
1293 (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for
1294 the specified build request on the first slave that's available.
1295 (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object.
1296 Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it.
1297 (BuildbotSyncer.prototype._pullRecentBuilds):
1298 (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now
1299 only returns the path instead of the full URL since RemoteAPI takes a path, not full URL.
1300 (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON.
1301 (BuildbotSyncer.prototype.pathForForceBuild): Added.
1302 (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL.
1303 (BuildbotSyncer.prototype.urlForBuildNumber): Ditto.
1304 (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test
1305 configurations associated with it, find the one matching for this request.
1306 (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it.
1307 (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of
1308 slave names present on this builder.
1309 * tools/js/buildbot-triggerable.js: Added.
1310 (BuildbotTriggerable): Added.
1311 (BuildbotTriggerable.prototype.name): Added.
1312 (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls
1313 existing build requests from the perf dashboard, pulls buildbot for pending and running/completed
1314 builds on each builder (represented by each syncer), schedules build requests on buildbot if there
1315 is any builder/slave available, and updates the status of build requests in the database.
1316 (BuildbotTriggerable.prototype._validateRequests): Added.
1317 (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added.
1318 (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added.
1319 (BuildbotTriggerable._testGroupMapForBuildRequests): Added.
1320 * tools/js/database.js:
1321 * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js.
1323 * tools/js/remote.js:
1324 (RemoteAPI): Now optionally takes the server configuration.
1325 (RemoteAPI.prototype.url): Added.
1326 (RemoteAPI.prototype.getJSON): Removed the code for specifying request content.
1327 (RemoteAPI.prototype.getJSONWithStatus): Ditto.
1328 (RemoteAPI.prototype.postJSON): Added.
1329 (RemoteAPI.prototype.postFormUrlencodedData): Added.
1330 (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth.
1331 * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host.
1332 * tools/sync-buildbot.js: Added.
1333 (main): Added. Parse the arguments and start the loop.
1335 * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as
1336 scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed.
1338 (smallConfiguration): Added.
1339 (smallPendingBuild): Added.
1340 (smallInProgressBuild): Added.
1341 (smallFinishedBuild): Added.
1342 (createSampleBuildRequest): Create a unique build request for each platform.
1343 (samplePendingBuild): Optionally specify build time and slave name.
1344 (sampleInProgressBuild): Optionally specify slave name.
1345 (sampleFinishedBuild): Ditto.
1346 * unit-tests/resources/mock-remote-api.js:
1347 (assert.notReached.assert.notReached):
1348 (MockRemoteAPI.url): Added.
1349 (MockRemoteAPI.postFormUrlencodedData): Added.
1350 (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus.
1351 (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we
1352 need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI.
1353 (MockRemoteAPI.inject):
1354 (MockRemoteAPI.reset): Added.
1356 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
1358 Simplify API of Test model by removing Test.setParentTest
1359 https://bugs.webkit.org/show_bug.cgi?id=156055
1361 Reviewed by Joseph Pecoraro.
1363 Removed Test.setParentTest. Keep track of the child-parent relationship using the static map instead.
1365 Now each test only stores parent's id and uses the ID static map in Test.parentTest().
1367 * public/v3/models/manifest.js:
1368 (Manifest._didFetchManifest.buildObjectsFromIdMap): Removed the code to create the map of child-parent
1369 relationship and call setParentTest.
1370 * public/v3/models/test.js:
1371 (Test): Updated a static map by the name of "childTestMap" to store itself. We should probably sort
1372 child tests using some fixed criteria in the future instead of relying on the creation order but
1373 preserve the old code's ordering for now.
1374 (Test.prototype.parentTest): Look up the static map by the parent test's id.
1375 (Test.prototype.onlyContainsSingleMetric):
1376 (Test.prototype.setParentTest): Deleted.
1377 (Test.prototype.childTests): Look up the child test map.
1379 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
1381 BuildRequest should have associated platform and test
1382 https://bugs.webkit.org/show_bug.cgi?id=156054
1384 Reviewed by Joseph Pecoraro.
1386 Added methods to retrieve the platform and the test associated with a build request with tests.
1388 * public/v3/models/build-request.js:
1390 (BuildRequest.prototype.platform): Added.
1391 (BuildRequest.prototype.test): Added.
1392 * server-tests/api-build-requests-tests.js:
1393 * server-tests/api-manifest.js: Fixed a typo. This tests /api/manifest, not /api/build-requests.
1394 * unit-tests/buildbot-syncer-tests.js:
1395 (.createSampleBuildRequest): Now takes Platform and Test objects to avoid hitting assertions in
1396 BuildRequest's constructor.
1398 2016-03-30 Ryosuke Niwa <rniwa@webkit.org>
1400 BuildRequest should have a method to fetch all in-progress and pending requests for a triggerable
1401 https://bugs.webkit.org/show_bug.cgi?id=156008
1403 Reviewed by Darin Adler.
1405 Add a method to BuildRequest that fetches all pending and in-progress requests for a triggerable.
1407 Now, new syncing scripts must be able to figure out the build slave the first build requests in
1408 a given test group had used in order to schedule subsequent build requests in the test group.
1410 For this purpose, /api/build-requests has been modified to return all build requests whose test
1411 group had not finished yet. A test group is finished if all build requests in the test group had
1412 finished (completed, failed, or canceled).
1414 * public/include/build-requests-fetcher.php:
1415 (BuildRequestFetcher::fetch_incomplete_requests_for_triggerable): Return all build requests in test
1416 groups that have not been finished.
1417 * public/v3/models/build-request.js:
1419 (BuildRequest.prototype.testGroupId): Added.
1420 (BuildRequest.prototype.isPending): Renamed from hasPending to fix a bad grammar.
1421 (BuildRequest.fetchForTriggerable): Added.
1422 (BuildRequest.constructBuildRequestsFromData): Extracted from _createModelsFromFetchedTestGroups in
1424 * public/v3/models/manifest.js:
1425 (Manifest.fetch): Use the full path from root so that it works in server tests.
1426 * public/v3/models/test-group.js:
1427 (TestGroup.hasPending):
1428 (TestGroup._createModelsFromFetchedTestGroups):
1429 * server-tests/api-build-requests-tests.js: Added tests to ensure all build requests for a test group
1430 is present in the response returned by /api/build-requests iff any build request in the group had not
1433 (.addAnotherMockTestGroup): Added.
1434 * unit-tests/test-groups-tests.js:
1436 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
1438 Make dependency injection in unit tests more explicit
1439 https://bugs.webkit.org/show_bug.cgi?id=156006
1441 Reviewed by Joseph Pecoraro.
1443 Make the dependency injection of model objects in unit tests explicit so that server tests that create
1444 "real" model objects won't create these mock objects. Now each test that uses mock model objects would call
1445 MockModels.inject() to inject before / beforeEach and access each object using a property on MockModels
1446 instead of them being implicitly defined on the global object.
1448 Similarly, MockRemoteAPI now only replaces global.RemoteAPI during each test so that server tests can use
1449 real RemoteAPI to access the test Apache server.
1451 * unit-tests/analysis-task-tests.js:
1452 * unit-tests/buildbot-syncer-tests.js:
1453 (createSampleBuildRequest):
1454 * unit-tests/measurement-adaptor-tests.js:
1455 * unit-tests/measurement-set-tests.js:
1456 * unit-tests/resources/mock-remote-api.js:
1457 (MockRemoteAPI.getJSONWithStatus):
1458 (MockRemoteAPI.inject): Added. Override RemoteAPI on the global object during each test.
1459 * unit-tests/resources/mock-v3-models.js:
1460 (MockModels.inject): Added. Create mock model objects before each test, and clear all static maps of
1461 various v3 model classes (to remove all singleton objects for those model classes).
1462 * unit-tests/test-groups-tests.js:
1464 2016-03-29 Ryosuke Niwa <rniwa@webkit.org>
1466 BuildbotSyncer should be able to fetch JSON from buildbot
1467 https://bugs.webkit.org/show_bug.cgi?id=155921
1469 Reviewed by Joseph Pecoraro.
1471 Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot
1472 with lots of unit tests as this has historically been a source of subtle bugs in the old script.
1474 New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that
1475 the state of some builds may change between each HTTP request. In the old script, we fetched the list
1476 of the pending builds, and requested -1, -2, etc... builds for N times. But between each request,
1477 a pending build may start running or an in-progress build finish and shift the offset by one. The new
1478 script avoids this problem by first requesting all pending builds, then all in-progress and finished
1479 builds in a single HTTP request. The results are then merged so that entries for in-progress and
1480 finished builds would override the entries for pending builds if they overlap.
1482 Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes
1483 the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js).
1485 * server-tests/api-build-requests-tests.js:
1486 * server-tests/api-manifest.js:
1487 * tools/js/buildbot-syncer.js:
1488 (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as
1489 we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished
1490 builds as 'currentStep' is always defined but null in those builds.
1491 (BuildbotBuildEntry.prototype.buildNumber): Added.
1492 (BuildbotBuildEntry.prototype.isPending): Added.
1493 (BuildbotBuildEntry.prototype.hasFinished): Added.
1494 (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds.
1495 (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds.
1496 (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added.
1497 (BuildbotSyncer.prototype.urlForBuildJSON): Added.
1498 (BuildbotSyncer.prototype.url): Added.
1499 (BuildbotSyncer.prototype.urlForBuildNumber): Added.
1500 * tools/js/remote.js:
1501 (RemoteAPI.prototype.getJSON): Renamed from fetchJSON.
1502 (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus.
1503 * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node.
1504 * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot
1505 (samplePendingBuild):
1506 (sampleInProgressBuild): Added.
1507 (sampleFinishedBuild): Added.
1508 * unit-tests/resources/mock-remote-api.js:
1509 (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus.
1511 2016-03-24 Ryosuke Niwa <rniwa@webkit.org>
1513 Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code
1514 https://bugs.webkit.org/show_bug.cgi?id=155863
1516 Reviewed by Joseph Pecoraro.
1518 Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability
1519 added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed
1520 /admin/regenerate-manifest since it has been superseded by /api/manifest.
1522 This patch also extracts manifest.js out of main.js so that it could be used and tested without the
1523 DOM support in node.
1525 * public/admin/regenerate-manifest.php: Deleted.
1526 * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with
1527 a trailing backslash.
1528 * public/include/manifest.php:
1529 (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories.
1530 * public/v3/index.html:
1531 * public/v3/main.js:
1533 * public/v3/models/bug-tracker.js:
1534 (BugTracker.prototype.newBugUrl): Added.
1535 (BugTracker.prototype.repositories): Added.
1536 * public/v3/models/manifest.js: Added. Extracted from main.js.
1537 (Manifest.fetch): Moved from main.js' fetchManifest.
1538 (Manifest._didFetchManifest): Moved from main.js' didFetchManifest.
1539 * public/v3/models/platform.js:
1540 (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of
1541 the same name. This is tested by the newly added test cases.
1542 * server-tests/api-build-requests-tests.js:
1543 * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js
1544 with additional assertions for v3 UI model objects.
1545 * server-tests/resources/test-server.js:
1546 (TestServer.prototype.start):
1547 (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API.
1548 Also no longer takes dataDirectory as an argument since it's always the same.
1549 (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data.
1550 (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests.
1551 (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an
1552 unintended side effect of slowing down unit tests even through they don't need Postgres or Apache.
1553 * tests/admin-regenerate-manifest.js: Removed.
1554 * tools/js/database.js:
1555 * tools/js/v3-models.js:
1557 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
1559 Add mocha server tests for /api/build-requests
1560 https://bugs.webkit.org/show_bug.cgi?id=155831
1562 Reviewed by Chris Dumez.
1564 Added the new mocha.js based server-tests for /api/build-requests. The new harness automatically:
1565 - starts a new Apache instance
1566 - switches the database during testing via setting an environmental variable
1567 - backups and restores public/data directory during testing
1569 As a result, developer no longer has to manually setup Apache, edit config.json manually to use
1570 a testing database, or run /api/manifest.php to re-generate the manifest file after testing.
1572 This patch also makes ID resolution optional on /api/build-requests so that v3 model based syncing
1573 scripts can re-use the same code as the v3 UI to process the JSON. tools/sync-with-buildbot.py has
1574 been modified to use this option (useLegacyIdResolution).
1576 * config.json: Added configurations for the test httpd server.
1577 * init-database.sql: Don't error when tables and types don't exist (when database is empty).
1578 * public/api/build-requests.php:
1579 (main): Made the ID resolution optional with useLegacyIdResolution. Also removed "updates" from the
1580 results JSON since it's never used.
1581 * public/include/build-requests-fetcher.php:
1582 (BuildRequestsFetcher::__construct):
1583 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Fixed the bug that we would include the same
1584 commit multiple times for each root set.
1585 * public/include/db.php:
1586 (config): If present, use ORG_WEBKIT_PERF_CONFIG_PATH instead of Websites/perf.webkit.org/config.json.
1587 * server-tests: Added.
1588 * server-tests/api-build-requests-tests.js: Added. Tests for /api/build-requests.
1590 * server-tests/resources: Added.
1591 * server-tests/resources/test-server.conf: Added. Apache configuration file for testing.
1592 * server-tests/resources/test-server.js: Added.
1594 (TestSever.prototype.start): Added.
1595 (TestSever.prototype.stop): Added.
1596 (TestSever.prototype.remoteAPI): Added. Configures RemoteAPI to be used with the test sever.
1597 (TestSever.prototype.database): Added. Returns Database configured to use the test database.
1598 (TestSever.prototype._constructTestConfig): Creates config.json for testing. The file is generated by
1599 _start and db.php's config() reads it from the environmental variable: ORG_WEBKIT_PERF_CONFIG_PATH.
1600 (TestSever.prototype._ensureDataDirectory): Renames public/data to public/original-data if exists,
1601 and creates a new empty public/data.
1602 (TestSever.prototype._restoreDataDirectory): Deletes public/data and renames public/original-data
1603 back to public/data.
1604 (TestSever.prototype._ensureTestDatabase): Drops the test database if exists and creates a new one.
1605 (TestSever.prototype.initDatabase): Run init-database.sql to start each test with a consistent state.
1606 (TestSever.prototype._executePgsqlCommand): Executes a postgres command line tool such as psql.
1607 (TestSever.prototype._determinePgsqlDirectory): Finds the directory that contains psql.
1608 (TestSever.prototype._startApache): Starts an Apache instance for testing.
1609 (TestSever.prototype._stopApache): Stops the Apache instance for testing.
1610 (TestSever.prototype._waitForPid): Waits for the Apache pid file to appear or disappear.
1611 (before): Start the test server at the beginning.
1612 (beforeEach): Re-initialize all tables before each test.
1613 (after): Stop the test server at the end.
1614 * tools/js/config.js:
1615 (Config.prototype.path):
1616 (Config.prototype.serverRoot): Added. The path to Websites/perf.webkit.org/public/.
1617 (Config.prototype.pathFromRoot): Added. Resolves a path from Websites/perf.webkit.org.
1618 * tools/js/database.js:
1619 (Database): Now optionally takes the database name to use a different database during testing.
1620 (Database.prototype.connect):
1621 (Database.prototype.query): Added.
1622 (Database.prototype.insert): Added.
1623 (tableToPrefixMap): Maps table name to its prefix. Used by Database.insert.
1624 * tools/js/remote.js: Added.
1625 (RemoteAPI): Added. This is node.js equivalent of RemoteAPI in public/v3/remote.js.
1626 (RemoteAPI.prototype.configure): Added.
1627 (RemoteAPI.prototype.fetchJSON): Added.
1628 (RemoteAPI.prototype.fetchJSONWithStatus): Added.
1629 (RemoteAPI.prototype.sendHttpRequest): Added.
1630 * tools/sync-with-buildbot.py:
1631 (main): Use useLegacyIdResolution as this script relies on the legacy behavior.
1632 * unit-tests/checkconfig.js: pg was never directly used in this test.
1634 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
1636 Delete a file that was supposed to be removed in r198614 for real.
1638 * unit-tests/resources/v3-models.js: Removed.
1640 2016-03-23 Ryosuke Niwa <rniwa@webkit.org>
1642 Add a model for parsing buildbot JSON with unit tests
1643 https://bugs.webkit.org/show_bug.cgi?id=155814
1645 Reviewed by Joseph Pecoraro.
1647 Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests.
1648 They will be used in the new syncing scripts to improve A/B testing.
1650 * public/v3/models/build-request.js:
1652 * tools/js/buildbot-syncer.js: Added.
1653 (BuildbotBuildEntry): Added.
1654 (BuildbotBuildEntry.prototype.slaveName): Added.
1655 (BuildbotBuildEntry.prototype.buildRequestId): Added.
1656 (BuildbotBuildEntry.prototype.isInProgress): Added.
1657 (BuildbotSyncer): Added.
1658 (BuildbotSyncer.prototype.testPath): Added.
1659 (BuildbotSyncer.prototype.builderName): Added.
1660 (BuildbotSyncer.prototype.platformName): Added.
1661 (BuildbotSyncer.prototype.fetchPendingRequests): Added.
1662 (BuildbotSyncer.prototype._propertiesForBuildRequest): Added.
1663 (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added.
1664 (BuildbotSyncer._loadConfig): Added.
1665 (BuildbotSyncer._validateAndMergeConfig): Added.
1666 (BuildbotSyncer._validateAndMergeProperties): Added.
1667 * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js.
1668 (beforeEach): Deleted since this only defined inside mocha.
1669 * unit-tests/analysis-task-tests.js:
1670 * unit-tests/buildbot-syncer-tests.js: Added.
1672 (createSampleBuildRequest):
1673 (.smallConfiguration):
1674 * unit-tests/measurement-adaptor-tests.js:
1675 * unit-tests/measurement-set-tests.js:
1676 * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js.
1678 * unit-tests/test-groups-tests.js:
1681 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
1683 Add unit tests for test-group.js
1684 https://bugs.webkit.org/show_bug.cgi?id=155781
1686 Reviewed by Joseph Pecoraro.
1688 Added unit tests for test-group.js that would have caught regressions fixed in r198503.
1690 * public/v3/components/chart-pane-base.js:
1691 (ChartPaneBase.prototype._renderAnnotations): Added a forgotten break statement.
1692 * public/v3/models/build-request.js:
1693 (BuildRequest.prototype.setResult):
1695 * public/v3/models/test-group.js:
1696 * unit-tests/measurement-set-tests.js: Use ./resources/v3-models.js to reduce the code duplication.
1697 * unit-tests/resources/v3-models.js: Import more stuff from v3 models.
1699 * unit-tests/test-groups-tests.js: Added. Added some unit tests for TestGroup.
1701 (.testGroupWithStatusList):
1703 2016-03-22 Ryosuke Niwa <rniwa@webkit.org>
1709 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
1711 Commit log viewer repaints too frequently after r198499
1712 https://bugs.webkit.org/show_bug.cgi?id=155732
1714 Reviewed by Joseph Pecoraro.
1716 The bug was caused by InteractiveTimeSeriesChart invoking onchange callback whenever mouse moved even
1717 if the current point didn't change. Fixed the bug by avoiding the work if the indicator hadn't changed
1718 and avoiding work in the commit log viewer when the requested repository and the revision range were
1719 the same as those of the last request.
1721 * public/v3/components/commit-log-viewer.js:
1723 (CommitLogViewer.prototype.currentRepository): Exit early when repository and the revision range are
1724 identical to the one we already have to avoid repaints and issuing multiple network requests.
1725 * public/v3/components/interactive-time-series-chart.js:
1726 (InteractiveTimeSeriesChart.prototype._mouseMove): Don't invoke _notifyIndicatorChanged if the current
1727 indicator hadn't changed.
1728 * public/v3/pages/chart-pane.js:
1729 (ChartPane.prototype._indicatorDidChange): Fixed the bug that unlocking the indicator wouldn't update
1730 the URL. We need to check whether the lock state had changed. The old condition was also redundant
1731 since _mainChartIndicatorWasLocked is always identically equal to isLocked per the prior assignment.
1733 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
1735 Fix A/B testing after r198503.
1737 * public/include/build-requests-fetcher.php:
1739 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
1741 Analysis task page is broken after r198479
1742 https://bugs.webkit.org/show_bug.cgi?id=155735
1744 Rubber-stamped by Chris Dumez.
1746 * public/api/measurement-set.php:
1747 (AnalysisResultsFetcher::fetch_commits): We need to emit the commit ID as done for regular data.
1748 * public/include/build-requests-fetcher.php:
1749 (BuildRequestsFetcher::fetch_roots_for_set_if_needed): Ditto. Don't use a fake ID after r198479.
1750 * public/v3/models/commit-log.js:
1751 (CommitLog): Assert that all commit log IDs are integers to catch regressions like this in future.
1752 * public/v3/models/root-set.js:
1753 (RootSet): Don't resolve Repository here as doing so would modify the shared "root" entry in the JSON
1754 we fetched, and subsequent construction of RootSet would fail since this line would blow up trying to
1755 find the repository with "[object]" as the ID.
1756 * public/v3/models/test-group.js:
1757 (TestGroup._createModelsFromFetchedTestGroups): Resolve Repository here.
1759 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
1761 v3 UI sometimes don't update the list of revisions on the commit log viewer
1762 https://bugs.webkit.org/show_bug.cgi?id=155729
1764 Rubber-stamped by Chris Dumez.
1766 Fixed multiple bugs that were affecting the list of blame range and commit logs for the range weren't
1767 updated in some cases on v3 UI. Also, the commit log viewer state is now a part of the URL state so
1768 opening and closing the commit log viewer will persist across page loads.
1770 Also fixed a regression from r198479 that Test object can't be created for a top level test.
1772 * public/v3/components/chart-pane-base.js:
1773 (ChartPaneBase.prototype.configure):
1774 (ChartPaneBase.prototype._mainSelectionDidChange): Fixed the bug that the list of blame range nor the
1775 commit log viewer don't get updated when the selected range changes.
1776 (ChartPaneBase.prototype._indicatorDidChange):
1777 (ChartPaneBase.prototype._didFetchData):
1778 (ChartPaneBase.prototype._updateStatus): Extracted from _indicatorDidChange and _didFetchData.
1779 (ChartPaneBase.prototype._requestOpeningCommitViewer): Renamed from _openCommitViewer.
1781 * public/v3/components/chart-status-view.js:
1782 (ChartStatusView.prototype.updateStatusIfNeeded): Fixed the bug that the blame range doesn't get set
1783 on the initial page load when the selection range is set but the chart data hadn't been fetched yet.
1785 * public/v3/components/commit-log-viewer.js:
1786 (CommitLogViewer.prototype.view): Fixed the bug that we don't clear out the old list of commits while
1787 loading the next set of commits to show as it looked as if the list was never updated.
1788 (CommitLogViewer.prototype.render): Fixed the bug that the view always show the last repository name
1789 even if there were nothing being fetched or commits to show.
1791 * public/v3/components/pane-selector.js:
1792 (PaneSelector.prototype.focus): Removed superfluous call to console.log.
1794 * public/v3/models/data-model.js:
1795 (DataModelObject.listForStaticMap): Generalized the code for all to fix the bug in Test.
1796 (DataModelObject.all):
1798 * public/v3/models/test.js:
1799 (Test): Fixed the bug that this code was relying on the static map to be an array.
1800 (Test.topLevelTests): Use newly added listForStaticMap to convert the dictionary to an array.
1802 * public/v3/pages/chart-pane-status-view.js:
1803 (ChartPaneStatusView): Always initialize _usedRevisionRange as a triple to simplify code elsewhere.
1804 (ChartPaneStatusView.prototype.render): Invoke _revisionCallback when user clicks on a repository
1805 expansion mark (>>). Also fixed click handler from the row since this made selecting revision range
1806 on the view cumbersome. Now user has to explicitly click on the expansion mark (>>).
1807 (ChartPaneStatusView.prototype._setRevisionRange): Now takes shouldNotify, from, and to as arguments
1808 as this function must not invoke_revisionCallback inside _updateRevisionListForNewCurrentRepository.
1809 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Use newly added setCurrentRepository
1810 instead of manually invoking setCurrentRepository and updateRevisionListWithNotification.
1811 (ChartPaneStatusView.prototype.setCurrentRepository): Fixed the bug that we weren't updating the
1813 (ChartPaneStatusView.prototype.updateRevisionList): Renamed from updateRevisionListWithNotification
1814 since we no longer call _revisionCallback. In general, callbacks are only meant to communicate user
1815 initiated actions, and not program induced updates like this API so this was a bad pattern anyway.
1816 ChartPane now explicitly updates the commit log viewer instead of relying on this function calling
1817 _requestOpeningCommitViewer implicitly.
1818 (ChartPaneStatusView.prototype._updateRevisionListForNewCurrentRepository): Extracted from
1819 updateRevisionListWithNotification so that setCurrentRepository can also call this function.
1821 * public/v3/pages/chart-pane.js:
1822 (ChartPane.prototype._requestOpeningCommitViewer): Overrides ChartPaneBase's method. Open the same
1823 repository in other panes via ChartsPage.setOpenRepository.
1824 (ChartPane.prototype.setOpenRepository): This method is called when the user selected a repository in
1825 another pane. Open the same repository in this pane if it wasn't already open.
1827 * public/v3/pages/charts-page.js:
1828 (ChartsPage): Added this._currentRepositoryId.
1829 (ChartsPage.prototype.serializeState): Serialize _currentRepositoryId.
1830 (ChartsPage.prototype.updateFromSerializedState): Set the commit log viewer's
1831 (ChartsPage.prototype.setOpenRepository): Added.
1833 * tests/api-measurement-set.js: Fixed a test after r198479.
1835 2016-03-21 Ryosuke Niwa <rniwa@webkit.org>
1837 V3 Perf Dashboard should automatically select initial range when creating a new task
1838 https://bugs.webkit.org/show_bug.cgi?id=155677
1840 Reviewed by Joseph Pecoraro.
1842 Select the entire range of points for which the analysis task is created by default so that creating
1843 a test group to confirm the regression / progression is easy.
1845 * public/v3/pages/analysis-task-page.js:
1846 (AnalysisTaskPage): Added a boolean flag which indicates the user had modified main chart's selection.
1847 * public/v3/pages/analysis-task-page.js:
1848 (AnalysisTaskPage.prototype.render): Set the main chart's selection to the entire range of points in
1849 the analysis task if the user had never modified selection.
1850 (AnalysisTaskPage.prototype._chartSelectionDidChange): This callback is invoked only when the user had
1851 modified the selection so set _selectionWasModifiedByUser true here unconditionally.
1853 2016-03-19 Ryosuke Niwa <rniwa@webkit.org>
1855 Associated commits don't immediately show up on an analysis task page
1856 https://bugs.webkit.org/show_bug.cgi?id=155692
1858 Reviewed by Darin Adler.
1860 The bug was caused by resolveCommits in AnalysisTask._constructAnalysisTasksFromRawData not being
1861 able to find the matching commit log if the commit log had been created by the charts which don't
1862 set the remote identifiers on each CommitLog objects.
1864 Fixed the bug by modifying /api/measurement-set to include the commit ID, and making CommitLog
1865 use the real database ID as its ID instead of a fake ID we create from repository and revision.
1867 Also added a bunch of Mocha unit tests for AnalysisTask.fetchAll.
1869 * public/api/measurement-set.php:
1870 (MeasurementSetFetcher::execute_query): Fetch commit_id.
1871 (MeasurementSetFetcher::format_run): Use pass-by-reference to avoid making a copy of the row.
1872 (MeasurementSetFetcher::parse_revisions_array): Include commit_id as the first item in the result.
1873 * public/v3/instrumentation.js:
1874 * public/v3/models/analysis-task.js:
1875 (AnalysisTask): Fixed a bug that _buildRequestCount and _finishedBuildRequestCount could be kept
1876 as strings and hasPendingRequests() could return a wrong result because it would perform string
1877 inequality instead of numerical inequality.
1878 (AnalysisTask.prototype.updateSingleton): Ditto.
1879 (AnalysisTask.prototype.dissociateCommit):
1880 (AnalysisTask._constructAnalysisTasksFromRawData):
1881 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Use findById now that CommitLog
1882 objects all use the same id as the database id.
1883 * public/v3/models/commit-log.js:
1885 (CommitLog.prototype.remoteId): Deleted since we no longer create a fake id for commit logs for
1887 (CommitLog.findByRemoteId): Deleted.
1888 (CommitLog.ensureSingleton): Deleted.
1889 (CommitLog.fetchBetweenRevisions):
1891 * public/v3/models/data-model.js:
1892 (DataModelObject.clearStaticMap): Added to aid unit testing.
1893 (DataModelObject.ensureNamedStaticMap): Fixed a typo. Each map is a dictionary, not an array.
1894 * public/v3/models/metric.js:
1895 * public/v3/models/platform.js:
1896 * public/v3/models/root-set.js:
1897 (RootSet): Updated per the interface change in CommitLog.ensureSingleton.
1898 (MeasurementRootSet): Updated per /api/measurement-set change. Use the first value as the id.
1899 * public/v3/models/test.js:
1900 * unit-tests/analysis-task-tests.js: Added.
1901 (sampleAnalysisTask):
1902 (measurementCluster):
1903 * unit-tests/checkconfig.js: Added some assertion message to help aid diagnosing the failure.
1904 * unit-tests/measurement-adaptor-tests.js: Updated the sample data per the API change in
1905 /api/measurement-set and also added assertions for commit log ids.
1906 * unit-tests/measurement-set-tests.js:
1908 * unit-tests/resources: Added.
1909 * unit-tests/resources/mock-remote-api.js: Added. Extracted from measurement-set-tests.js to be
1910 used in analysis-task-tests.js.
1911 (assert.notReached.assert.notReached):
1912 (global.RemoteAPI.getJSON):
1913 (global.RemoteAPI.getJSONWithStatus):
1915 * unit-tests/resources/v3-models.js: Added. Extracted from measurement-set-tests.js to be used in
1916 analysis-task-tests.js and added more imports as needed.
1920 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1922 Build fix after r198464.
1924 * public/v3/components/analysis-results-viewer.js:
1925 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups):
1927 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1929 Build fix after r198234.
1931 * public/api/commits.php:
1932 (main): Typo: fetch_latest_reported -> fetch_last_reported.
1933 * public/include/commit-log-fetcher.php:
1934 (CommitLogFetcher::format_single_commit): commits should be an array.
1936 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1938 Perf Dashboard v3 confuses better and worse on A/B task page
1939 https://bugs.webkit.org/show_bug.cgi?id=155675
1940 <rdar://problem/25208723>
1942 Reviewed by Joseph Pecoraro.
1944 The analysis results viewer on v3 UI sometimes treats regressions as progressions and vice versa when
1945 the first set (i.e. set A) of the revisions used in an A/B testing never appears in the original graph,
1946 and its latest commit time matches that of the second set, which appears in the original graph.
1948 Because the analysis results viewer compares results in the increasing row number, this results in
1949 B to be compared to A instead of A to be compared to B. Fixed the bug by preventing the wrong ordering
1950 to occur in _buildRowsForPointsAndTestGroups by always inserting a root set A before B when B appears
1951 and A doesn't appear in the original graph.
1953 * public/v3/components/analysis-results-viewer.js:
1954 (AnalysisResultsViewer.prototype._collectRootSetsInTestGroups): Remember the succeeding root set B
1955 when creating an entry for root set A.
1956 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Fixed the bug. Also un-duplicated
1957 the code to create a new row.
1958 (AnalysisResultsViewer.RootSetInTestGroup): Now takes a succeeding root set. e.g. it's B for A and
1959 undefined for B in A/B testing.
1960 (AnalysisResultsViewer.RootSetInTestGroup.prototype.succeedingRootSet): Added.
1961 * public/v3/components/time-series-chart.js:
1962 (TimeSeriesChart.computeTimeGrid): Fixed the bug that we would end up showing 0 AM instead of dates
1963 when both dates and months change.
1965 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1967 Add unit tests for measurement-set.js and measurement-adapter.js
1968 https://bugs.webkit.org/show_bug.cgi?id=155673
1970 Reviewed by Daniel Bates.
1972 Add tests which were supposed to be added in r198462.
1974 * unit-tests/measurement-adaptor-tests.js: Added.
1975 * unit-tests/measurement-set-tests.js: Added.
1976 (assert.notReached): Added.
1977 (global.RemoteAPI.getJSON): Added.
1978 (global.RemoteAPI.getJSONWithStatus): Added. A mock.
1980 2016-03-18 Ryosuke Niwa <rniwa@webkit.org>
1982 Add unit tests for measurement-set.js and measurement-adapter.js
1983 https://bugs.webkit.org/show_bug.cgi?id=155673
1985 Reviewed by Darin Adler.
1987 Added mocha unit tests for MeasurementSet and MeasurementAdapter classes along with the necessary
1988 refactoring to run these tests in node.
1990 getJSON and getJSONStatus are now under RemoteAPI so that unit tests can mock them.
1992 Removed the dependency on v2 UI's TimeSeries and Measurement class by adding a new implementation
1993 of TimeSeries in v3 and removing the dependency on Measurement in chart-pane-status-view.js with
1994 new helper methods on Build and CommitLog.
1996 Many js files now use 'use strict' (node doesn't support class syntax in non-strict mode) and
1997 module.exports to export symbols in node's require function.
1999 * public/v3/index.html:
2000 * public/v3/main.js:
2001 * public/v3/models/analysis-results.js:
2002 (AnalysisResults.fetch):
2003 * public/v3/models/analysis-task.js:
2004 (AnalysisTask.fetchAll):
2005 * public/v3/models/builder.js:
2007 (Build.prototype.builder): Added. Used by ChartPaneStatusView.
2008 (Build.prototype.buildNumber): Ditto.
2009 (Build.prototype.buildTime): Ditto.
2010 * public/v3/models/commit-log.js:
2011 (CommitLog.prototype.diff): Ditto.
2012 (CommitLog.fetchBetweenRevisions):
2013 * public/v3/models/data-model.js:
2014 (DataModelObject.cachedFetch):
2015 * public/v3/models/measurement-adaptor.js:
2016 (MeasurementAdaptor.prototype.applyToAnalysisResults): Renamed from adoptToAnalysisResults.
2017 (MeasurementAdaptor.prototype.applyTo): Renamed from adoptToSeries. Now shares a lot more
2018 code with applyToAnalysisResults. The code to set 'series' and 'seriesIndex' has been moved
2019 to TimeSeries.append. 'measurement' is no longer needed as this patch removes its only use
2020 in ChartPaneStatusView.
2021 * public/v3/models/measurement-cluster.js:
2022 (MeasurementCluster.prototype.addToSeries): Use TimeSeries.append instead of directly mutating
2024 * public/v3/models/measurement-set.js:
2025 (Array.prototype.includes): Added a polyfill for node.
2026 (MeasurementSet.prototype._fetchSecondaryClusters): Removed a bogus assertion. When fetchBetween
2027 is called with a mixture of clusters that have been fetched and not fetched, this assertion fails.
2028 (MeasurementSet.prototype._fetch):
2029 (TimeSeries.prototype.findById): Moved to time-series.js.
2030 (TimeSeries.prototype.dataBetweenPoints): Ditto.
2031 (TimeSeries.prototype.firstPoint): Ditto.
2032 (TimeSeries.prototype.fetchedTimeSeries): Moved the code to extend the last point to TimeSeries'
2034 * public/v3/models/repository.js:
2035 * public/v3/models/root-set.js:
2036 (MeasurementRootSet): Ignore repositories that had not been defined (e.g. it could be added after
2037 manifest.json had been downloaded but before a given root set is created for an A/B testing).
2038 * public/v3/models/time-series.js:
2039 (TimeSeries): Added.
2040 (TimeSeries.prototype.append): Added.
2041 (TimeSeries.prototype.extendToFuture): Added.
2042 (TimeSeries.prototype.firstPoint): Moved from measurement-set.js.
2043 (TimeSeries.prototype.lastPoint): Added.
2044 (TimeSeries.prototype.previousPoint): Added.
2045 (TimeSeries.prototype.nextPoint): Added.
2046 (TimeSeries.prototype.findPointByIndex): Added.
2047 (TimeSeries.prototype.findById): Moved from measurement-set.js.
2048 (TimeSeries.prototype.findPointAfterTime): Added.
2049 (TimeSeries.prototype.dataBetweenPoints): Moved from measurement-set.js.
2050 * public/v3/pages/chart-pane-status-view.js:
2051 (ChartPaneStatusView.prototype.render): Use newly added helper functions on Build.
2052 (ChartPaneStatusView.prototype._formatTime): Added.
2053 (ChartPaneStatusView.prototype.setCurrentRepository):
2054 (ChartPaneStatusView.prototype.computeChartStatusLabels): Rewrote the code using RootSet object on
2055 currentPoint and previousPoint instead of Measurement class from v2 UI. Also sort the results using
2056 sortByNamePreferringOnesWithURL.
2057 * public/v3/remote.js:
2058 (RemoteAPI.getJSON): Moved under RemoteAPI.
2059 (RemoteAPI.getJSONWithStatus): Ditto.
2061 (PrivilegedAPI.requestCSRFToken):
2063 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
2065 Add unit tests for config.json and statistics.js
2066 https://bugs.webkit.org/show_bug.cgi?id=155626
2068 Reviewed by Darin Adler.
2070 Added mocha unit tests for statistics.js and validating config.json. For segmentations, I've extracted
2071 real data from our internal perf dashboard.
2073 Also fixed some bugs covered by these new tests.
2075 * public/shared/statistics.js:
2076 (Statistics.movingAverage): Fixed a bug that forwardWindowSize was never used.
2077 (Statistics.exponentialMovingAverage): Fixed the bug that the moving average starts at 0. It should
2078 start at the first value instead.
2079 (.splitIntoSegmentsUntilGoodEnough): Fixed the bug that we may try to segment a time series into
2080 more parts than there are data points. Clearly, that doesn't make any sense.
2081 (.findOptimalSegmentation): Renamed local variables so that they're more descriptive, and rewrote
2082 the debugging code was the old code was emitting some useless data. Also fixed the bug that the length
2083 of "segmentation" was off by one (we need segmentCount + 1 elements in the array sine we always
2084 include the start of the first segment = 0 and the end of the last segment = values.length).
2085 (.SampleVarianceUpperTriangularMatrix):
2086 (Statistics): Modernized the export code.
2088 * tools/js/config.js: Added.
2090 (Config.prototype.configFilePath): Added.
2091 (Config.prototype.value): Added.
2092 (Config.prototype.path): Added.
2093 * tools/js/database.js: Added.
2095 (Database.prototype.connect): Added.
2096 (Database.prototype.disconnect): Added.
2097 * unit-tests: Added.
2098 * unit-tests/checkconfig.js: Added. Validates config.json. This is useful while setting up
2099 a local instance of the perf dashboard.
2100 * unit-tests/statistics-tests.js: Added.
2101 (assert.almostEqual): Added. Asserts that two floating values are within a given significant digits.
2106 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
2108 Fix a typo which was supposed to be fixed in r198351.
2110 * public/v3/pages/analysis-task-page.js:
2111 (AnalysisTaskPage.prototype.render):
2113 2016-03-17 Ryosuke Niwa <rniwa@webkit.org>
2115 An analysis task should be closed if a progression cause is identified
2116 https://bugs.webkit.org/show_bug.cgi?id=155549
2118 Reviewed by Chris Dumez.
2120 Since a progression is desirable, we should close an analysis task once its cause is identified.
2122 Also fix some typos.
2124 * init-database.sql: Fixed a typo.
2125 * public/api/analysis-tasks.php:
2126 * public/v3/models/analysis-task.js:
2127 (AnalysisTask.prototype.dissociateBug): Renamed from dissociateBug.
2128 * public/v3/pages/analysis-task-page.js:
2129 (AnalysisTaskPage.prototype.render):
2130 (AnalysisTaskPage.prototype._dissociateBug): Renamed from _dissociateBug.
2131 (AnalysisTaskPage.prototype._dissociateCommit): Fixed the typo in the alert.
2133 2016-03-16 Ryosuke Niwa <rniwa@webkit.org>
2135 Analysis task page should allow specifying commits that caused or fixed a regression or a progression
2136 https://bugs.webkit.org/show_bug.cgi?id=155529
2138 Reviewed by Chris Dumez.
2140 Added the capability to associate revisions that caused or fixed a progression or a regression for which
2141 an analysis task was created. Added task_commits that stores this relationship and added the backend
2142 support to retrieve this table in /api/analysis-tasks and an privileged API to update this table at
2143 /privileged-api/associate-commit.
2145 Also extracted a new component, MutableListView, out of AnalysisTaskPage to render and manipulate a list
2146 of mutable items, and used it to render the list of associated bugs and commits. The view takes a list of
2147 kinds (e.g. repositories or bug trackers), and accepts a pair of a kind and arbitrary text as a new item
2150 * init-database.sql: Added task_commits table.
2152 * public/api/analysis-tasks.php:
2154 (fetch_associated_data_for_tasks): Renamed from fetch_and_push_bugs_to_tasks now that it also fetches
2155 the list of commits associated with each analysis task by calling CommitLogFetcher::fetch_for_tasks.
2156 Also fixe the bug that we were not taking
2157 (format_task): No longer sets 'category' since the computation of category now depends on the list of
2158 commits associated with this analysis task which aren't available until fetch_associated_data_for_tasks.
2159 (determine_category): Added. Categorize any analysis tasks with "fixes" commits as "closed" and "causes"
2160 commits as "identified".
2162 * public/include/commit-log-fetcher.php:
2163 (CommitLogFetcher::__construct): Remove the unused instance variable.
2164 (CommitLogFetcher::fetch_for_tasks): Added. Fetches all commits associated with a list of analysis tasks.
2165 Assumes the caller (fetch_associated_data_for_tasks) had setup "fixes" and "causes" fields on each task.
2167 * public/privileged-api/associate-commit.php: Added. Updates task_commits table to associate or disassociate
2168 a commit with an analysis task. When the specified analysis task and the specified commit are already
2169 associated, we simply update the table instead of adding a duplicating entry or error. For dissociation,
2170 the front-end specifies the commit ID.
2173 * public/v3/index.html:
2174 * public/v3/components/mutable-list-view.js: Added. Used by the list associated bugs and commits.
2175 (MutableListView): Added.
2176 (MutableListView.prototype.setList): Added.
2177 (MutableListView.prototype.setKindList): Added.
2178 (MutableListView.prototype.setAddCallback): Added. This callback is invoked when the user tries to add
2179 a new item to the list.
2180 (MutableListView.prototype.render): Added.
2181 (MutableListView.prototype._submitted): Added.
2182 (MutableListView.cssTemplate):
2183 (MutableListView.htmlTemplate):
2184 (MutableListItem): Added. RemovalLink could be a hyperlink or a callback and gets involved when the user
2185 tries to delete this item.
2186 (MutableListItem.prototype.content):
2188 * public/v3/models/analysis-task.js:
2189 (AnalysisTask): Added the support of the list of commits that fixed and caused changes.
2190 (AnalysisTask.prototype.updateSingleton): Ditto.
2191 (AnalysisTask.prototype.causes): Added.
2192 (AnalysisTask.prototype.fixes): Added.
2193 (AnalysisTask.prototype.associateCommit): Added. Use the API added at /privileged-api/associate-commit
2194 to associate a new commit with this analysis task. Each commit has either caused or fixed the change.
2195 (AnalysisTask.prototype.dissociateCommit): Added. Use the same API to disassociate each commit.
2196 (AnalysisTask._constructAnalysisTasksFromRawData): Find all commits associated with each analysis task.
2197 Because commit log objects use a fake ID fdue to /api/measurement-set not providing commit IDs, we must
2198 use CommitLog.findByRemoteId to find each commit instead of usual CommitLog.findById.
2199 (AnalysisTask._constructAnalysisTasksFromRawData.resolveCommits): Added.
2201 * public/v3/models/build-request.js:
2202 (BuildRequest.prototype.hasFinished): Renamed from hasCompleted since it was confusing for this._status
2203 being "completed" wasn't a necessary condition for this function to return true.
2205 * public/v3/models/commit-log.js:
2206 (CommitLog): Added the static map for actual commit ID instead of a fake ID created in ensureSingleton.
2207 (CommitLog.prototype.remoteId): Added. Returns the real commit ID.
2208 (CommitLog.findByRemoteId): Added. Finds an CommitLog object using the real ID.
2210 * public/v3/models/test-group.js:
2211 (TestGroup.prototype.hasFinished): Renamed from hasCompleted to match the rename in BuildRequest.
2213 * public/v3/pages/analysis-task-page.js:
2214 (AnalysisTaskPage): Added lists for the commits that fixed and caused the change using MutableListView.
2215 Also adopted MutableListView for the list of associated bugs.
2216 (AnalysisTaskPage.prototype.render): Added the code to populate the newly added lists.
2217 (AnalysisTaskPage.prototype._makeCommitListItem): Added.
2218 (AnalysisTaskPage.prototype._associateBug): Now this is a callback from MutableListView.
2219 (AnalysisTaskPage.prototype._associateCommit): Added.
2220 (AnalysisTaskPage.prototype._dissociateCommit): Added.
2221 (AnalysisTaskPage.htmlTemplate):
2222 (AnalysisTaskPage.cssTemplate):
2224 * public/v3/remote.js:
2225 (getJSON): Spit out the entire responseText when JSON failed to parse to make debugging easier.
2227 2016-03-15 Ryosuke Niwa <rniwa@webkit.org>
2229 Extract the code to format commit logs into its own PHP file
2230 https://bugs.webkit.org/show_bug.cgi?id=155514
2232 Rubber-stamped by Chris Dumez.
2234 Extracted CommitLogFetcher out of /api/commits so that it could be used in analysis-tasks.php
2235 in the future to support associating cause/fix for each analysis task.
2237 * public/api/commits.php:
2238 * public/include/commit-log-fetcher.php: Added.
2240 (CommitLogFetcher::__construct): Added.
2241 (CommitLogFetcher::repository_id_from_name): Added.
2242 (CommitLogFetcher::fetch_between): Added.
2243 (CommitLogFetcher::fetch_oldest): Added.
2244 (CommitLogFetcher::fetch_latest): Added.
2245 (CommitLogFetcher::fetch_last_reported): Added.
2246 (CommitLogFetcher::fetch_revision): Added.
2247 (CommitLogFetcher::commit_for_revision): Added.
2248 (CommitLogFetcher::format_single_commit): Added.
2249 (CommitLogFetcher::format_commit): Added.
2251 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
2253 Build fix after r196870.
2255 * public/include/report-processor.php:
2257 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
2259 Add Size metric to perf dashboard
2260 https://bugs.webkit.org/show_bug.cgi?id=155266
2262 Reviewed by Chris Dumez.
2264 Added the "Size" metric and use bytes as its unit.
2266 * public/js/helper-classes.js:
2268 * public/v2/data.js:
2269 (RunsData.unitFromMetricName):
2271 2016-02-20 Ryosuke Niwa <rniwa@webkit.org>
2273 Add the support for universal slave password
2274 https://bugs.webkit.org/show_bug.cgi?id=154476
2276 Reviewed by David Kilzer.
2278 Added the support for universalSlavePassword.
2281 * public/include/report-processor.php:
2282 (ReportProcessor::process):
2283 (ReportProcessor::authenticate_and_construct_build_data): Extracted from process().
2285 2016-02-19 Ryosuke Niwa <rniwa@webkit.org>
2287 Analysis tasks page complains about missing repository but with a wrong name
2288 https://bugs.webkit.org/show_bug.cgi?id=154468
2290 Reviewed by Chris Dumez.
2292 Fixed the bug by using the right variable in the template literal.
2294 * public/v3/components/customizable-test-group-form.js:
2295 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use querySelector here since Chrome doesn't have
2296 getElementsByClassName on ShadowRoot.
2297 * public/v3/pages/analysis-task-page.js:
2298 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Use name which is the name of
2301 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
2303 Revert an unintended change made in the previous commit.
2305 * init-database.sql:
2307 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
2309 Perf dashboard should let user cancel pending A/B testing and hide failed ones
2310 https://bugs.webkit.org/show_bug.cgi?id=154433
2312 Reviewed by Chris Dumez.
2314 Added a button to hide a test group in the details view (the bottom table) in the analysis task page, and
2315 "Show hidden tests" link to show the hidden test groups on demand. When a test group is hidden, all pending
2316 requests in the group will also be canceled since a common scenario of using this feature is that the user
2317 had triggered an useless A/B testing; e.g. all builds will fail, wrong, etc... We can revisit and add the
2318 capability to just cancel the pending requests and leaving the group visible later if necessary.
2320 Run `ALTER TYPE build_request_status_type ADD VALUE 'canceled';` to add the new type.
2322 * init-database.sql: Added testgroup_hidden column to analysis_test_groups table and added 'canceled'
2323 as a value to build_request_status_type table.
2324 * public/api/test-groups.php:
2325 (format_test_group): Added 'hidden' field in the JSON result.
2326 * public/privileged-api/update-test-group.php:
2327 (main): Added the support for updating testgroup_hidden column. When this column is set to true, also
2328 cancel all pending build requests (by setting its request_status to 'canceled' which will be ignore by
2329 the syncing script).
2330 * public/v3/components/test-group-results-table.js:
2331 (TestGroupResultsTable.prototype.setTestGroup): Reset _renderedTestGroup here so that the next call to
2332 render() will update the table; e.g. when build requests' status change from 'Pending' to 'Canceled'.
2333 * public/v3/models/build-request.js:
2334 (BuildRequest.prototype.hasCompleted): A build request is considered complete/finished if it's canceled.
2335 (BuildRequest.prototype.hasPending): Added.
2336 (BuildRequest.prototype.statusLabel): Handle 'canceled' status.
2337 * public/v3/models/test-group.js:
2339 (TestGroup.prototype.updateSingleton): Added to update 'hidden' field.
2340 (TestGroup.prototype.isHidden): Added.
2341 (TestGroup.prototype.hasPending): Added.
2342 (TestGroup.prototype.hasPending): Added.
2343 (TestGroup.prototype.updateHiddenFlag): Added. Uses the privileged API to update testgroup_hidden column.
2344 The JSON API also updates the status of the 'pending' build requests in the group to 'canceled'.
2345 * public/v3/pages/analysis-task-page.js:
2346 (AnalysisTaskPage): Added _showHiddenTestGroups and _filteredTestGroups as instance variables.
2347 (AnalysisTaskPage.prototype._didFetchTestGroups):
2348 (AnalysisTaskPage.prototype._showAllTestGroups): Added.
2349 (AnalysisTaskPage.prototype._didUpdateTestGroupHiddenState): Extracted from _didFetchTestGroups.
2350 (AnalysisTaskPage.prototype._renderTestGroupList): Use the filtered list of test groups to show the list
2351 of test groups. When all test groups are shown, we would first show the hidden ones after the regular ones.
2352 (AnalysisTaskPage.prototype._createTestGroupListItem): Extracted from _renderTestGroupList.
2353 (AnalysisTaskPage.prototype._renderTestGroupDetails): Update the text inside the button to hide the test
2354 group. Also show a warning text that the pending requests will be canceled if there are any.
2355 (AnalysisTaskPage.prototype._hideCurrentTestGroup): Added.
2356 (AnalysisTaskPage.cssTemplate): Updated the style.
2358 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
2360 The rows in the analysis results table should be expandable
2361 https://bugs.webkit.org/show_bug.cgi?id=154427
2363 Reviewed by Chris Dumez.
2365 Added "(Expand)" link between rows that have hidden points. Upon click it inserts the hidden rows.
2367 We insert around five rows at a time when there are hundreds of hidden points but we also avoid leaving
2368 behind expandable rows of less than two rows.
2370 Also fixed a bug in CustomizableTestGroupForm that getElementsById would throw in the shipping Safari
2371 because getElementsById doesn't exist on Element.prototype by using class name instead.
2373 * public/v3/components/analysis-results-viewer.js:
2374 (AnalysisResultsViewer):
2375 (AnalysisResultsViewer.prototype.setCurrentTestGroup): Removed superfluous call to render().
2376 (AnalysisResultsViewer.prototype.setPoints): Always show the start and the end points.
2377 (AnalysisResultsViewer.prototype.buildRowGroups):
2378 (AnalysisResultsViewer.prototype._buildRowsForPointsAndTestGroups): Add an instance of ExpandableRow which
2379 shows a "(Expand)" link to show hidden rows here.
2380 (AnalysisResultsViewer.prototype._expandBetween): Added. Expands rows between two points.
2381 (AnalysisResultsViewer.cssTemplate): Added rules for "(Expand)" links.
2382 (AnalysisResultsViewer.ExpandableRow): Added.
2383 (AnalysisResultsViewer.ExpandableRow.prototype.resultContent): Added. Overrides what's in the results column.
2384 (AnalysisResultsViewer.ExpandableRow.prototype.heading): Added. Generates "(Expand)" link.
2386 * public/v3/components/customizable-test-group-form.js:
2387 (CustomizableTestGroupForm.prototype._computeRootSetMap): Use getElementsByClassName instead of
2389 (CustomizableTestGroupForm.prototype._classForLabelAndRepository): Renamed from _idForLabelAndRepository.
2390 (CustomizableTestGroupForm._constructRevisionRadioButtons): Set class name instead of id.
2392 * public/v3/components/results-table.js:
2393 (ResultsTable.prototype.render): Don't generate radio buttons to select a row when root set is missing;
2394 e.g. for rows that show "(Expand)" links.
2396 2016-02-18 Ryosuke Niwa <rniwa@webkit.org>
2398 Statistically significant A/B testing results should be color coded in details view
2399 https://bugs.webkit.org/show_bug.cgi?id=154414
2401 Reviewed by Chris Dumez.
2403 Color code the statistically significant comparisions in TestGroupResultsTable as done in the analysis
2406 * public/v3/components/customizable-test-group-form.js:
2407 (CustomizableTestGroupForm.cssTemplate): Build fix after r196768.
2408 * public/v3/components/test-group-results-table.js:
2409 (TestGroupResultsTable.prototype.buildRowGroups): Add the status as a class name.
2410 (TestGroupResultsTable.cssTemplate): Added styles to color-code statistically significant results.
2412 2016-02-17 Ryosuke Niwa <rniwa@webkit.org>
2414 v3 UI should allow custom revisions for A/B testing
2415 https://bugs.webkit.org/show_bug.cgi?id=154379
2417 Reviewed by Chris Dumez.
2419 Added the capability to customize revisions selected in the overview chart and the results viewer.
2421 Newly added CustomizableTestGroupForm is responsible for allowing users to modify the set of revisions in
2422 a new A/B testing group. Unlike TestGroupForm which doesn't know anything about which revisions are selected
2423 for each project/repository, CustomizableTestGroupForm is aware of the list of revisions used in each set.
2425 The list of revisions used in each set is represented by RootSet if users had not customized them, and
2426 CustomRootSet otherwise; the latter was added since regular RootSet object requires CommitLog and other
2427 DataModelObjects which are hard to create without corresponding database entries.
2429 * public/v3/components/customizable-test-group-form.js: Added.
2430 (CustomizableTestGroupForm): Added.
2431 (CustomizableTestGroupForm.prototype.setRootSetMap): Added.
2432 (CustomizableTestGroupForm.prototype._submitted): Overrides the superclass' method.
2433 (CustomizableTestGroupForm.prototype._customize): Ditto. Unlike TestGroupForm's callback, this class'
2434 callback passes in a root set map as the third argument.
2435 (CustomizableTestGroupForm.prototype._computeRootSetMap): Added. Returns this._rootSetMap, which is set by
2436 AnalysisTaskPage if user had not customized the root sets. Otherwise return a new map with CustomRootSet's.
2437 (CustomizableTestGroupForm.prototype.render): Added. Creates a table to allow customization of root sets.
2438 (CustomizableTestGroupForm._constructRevisionRadioButtons): Added.
2439 (CustomizableTestGroupForm._createRadioButton): Added.
2440 (CustomizableTestGroupForm.cssTemplate): Added.
2441 (CustomizableTestGroupForm.formContent): Added. This method is called by TestGroupForm.htmlTemplate.
2442 * public/v3/components/test-group-form.js:
2443 (TestGroupForm): Updated the various methods to not directly mutate DOM. Store the state in instance
2444 variables and update DOM in render() as done elsewhere.
2445 (TestGroupForm.prototype.setNeedsName): Deleted. We no longer need this flag since TestGroupForm which is
2446 used for retries never needs a name and CustomizableTestGroupForm which is used to create a new test group
2447 always requires a name.
2448 (TestGroupForm.prototype.setDisabled):
2449 (TestGroupForm.prototype.setLabel):
2450 (TestGroupForm.prototype.setRepetitionCount):
2451 (TestGroupForm.prototype.render): Added.
2452 (TestGroupForm.prototype._submitted): Moved the code to prevent the default action has been moved to the
2453 constructor since this method is overridden by CustomizableTestGroupForm.
2454 (TestGroupForm.cssTemplate): Added.
2455 (TestGroupForm.htmlTemplate):
2456 (TestGroupForm.formContent): Extracted from htmlTemplate.
2457 * public/v3/index.html:
2458 * public/v3/models/repository.js:
2459 (Repository.sortByNamePreferringOnesWithURL): Added.
2460 * public/v3/models/root-set.js:
2461 (RootSet.prototype.revisionForRepository): Added so that _createTestGroupAfterVerifyingRootSetList can retrieve
2462 the revision information from CustomRootSet without going through CommitLog objects since CustomRootSet doesn't
2463 have associated CommitLog objects.
2464 (CustomRootSet): Added. Used by CustomizableTestGroupForm to create a custom root map since regular RootSet
2465 requires CommitLog and other related objects which are hard to create without database entries.
2466 (CustomRootSet.prototype.setRevisionForRepository): Added.
2467 (CustomRootSet.prototype.repositories): Added.
2468 (CustomRootSet.prototype.revisionForRepository): Added.
2469 * public/v3/pages/analysis-task-page.js:
2471 (AnalysisTaskPage.prototype.render): Removed the reference to v2 UI since v3 UI is now strictly more powerful
2472 than v2 UI. Also update the root set maps in each form here.
2473 (AnalysisTaskPage.prototype._retryCurrentTestGroup): No longer takes unused name argument as it got removed
2475 (AnalysisTaskPage.prototype._chartSelectionDidChange): No longer updates the disabled-ness here since it's now
2476 done in render() via setRootSetMap().
2477 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Now takes rootSetMap as an argument.
2478 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): No longer updates the disabled-ness here
2479 since it's now done in render() via setRootSetMap().
2480 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Now takes rootSetMap as an argument.
2481 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Take a dictionary of root set labels
2482 such as A and B, which maps to a RootSet or a newly-added CustomRootSet.
2483 (AnalysisTaskPage.htmlTemplate): Use customizable-test-group-form for creating a new A/B testing group. Retry
2484 form will continue to use TestGroupForm since customizing revisions is non-sensical in retries.
2485 (AnalysisTaskPage.cssTemplate): Updated the style.
2487 2016-02-16 Ryosuke Niwa <rniwa@webkit.org>
2489 v3 UI has the capability to schedule an A/B testing in a specific range
2490 https://bugs.webkit.org/show_bug.cgi?id=154329
2492 Reviewed by Chris Dumez.
2494 Extended AnalysisTaskChartPane and ResultsTable so that users can select a range of points in either
2495 the overview chart pane and the results viewer table. Extracted TestGroupForm out of the analysis task
2496 page and used right below those two components in the analysis task page.
2498 * public/v3/components/results-table.js:
2500 (ResultsTable.prototype.setRangeSelectorLabels): Added.
2501 (ResultsTable.prototype.setRangeSelectorCallback): Added.
2502 (ResultsTable.prototype.selectedRange): Added.
2503 (ResultsTable.prototype._rangeSelectorClicked): Added.
2504 (ResultsTable.prototype.render): Generate radio boxes to select a range.
2506 * public/v3/components/test-group-form.js:
2508 (TestGroupForm.prototype.setStartCallback): Added.
2509 (TestGroupForm.prototype.setNeedsName): Added.
2510 (TestGroupForm.prototype.setDisabled): Added.
2511 (TestGroupForm.prototype.setLabel): Added.
2512 (TestGroupForm.prototype.setRepetitionCount): Added.
2513 (TestGroupForm.prototype._submitted): Added.
2514 (TestGroupForm.htmlTemplate): Extracted from AnalysisTaskPage.htmlTemplate.
2516 * public/v3/index.html:
2518 * public/v3/pages/analysis-task-page.js:
2519 (AnalysisTaskChartPane.prototype._mainSelectionDidChange): Added. Delegates the work to AnalysisTaskPage.
2520 (AnalysisTaskChartPane.prototype.selectedPoints): Added.
2522 (AnalysisTaskPage.prototype.title):
2523 (AnalysisTaskPage.prototype.render):
2524 (AnalysisTaskPage.prototype._renderTestGroupDetails): Use TestGroupForm's methods instead of mutating DOM.
2525 (AnalysisTaskPage.prototype._retryCurrentTestGroup):
2526 (AnalysisTaskPage.prototype._chartSelectionDidChange): Added.
2527 (AnalysisTaskPage.prototype._createNewTestGroupFromChart): Added.
2528 (AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): Added.
2529 (AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Added.
2530 (AnalysisTaskPage.prototype._createRetryNameForTestGroup):
2531 (AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Extracted from _retryCurrentTestGroup
2532 so that we can call it in _createNewTestGroupFromChart and _createNewTestGroupFromViewer.
2533 (AnalysisTaskPage.htmlTemplate):
2535 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
2537 Extract the code specific to v2 UI out of shared statistics.js
2538 https://bugs.webkit.org/show_bug.cgi?id=154277
2540 Reviewed by Chris Dumez.
2542 Extracted statistics-strategies.js out of statistics.js for v2 UI and detect-changes.js. The intent is to
2543 deprecate this file once we implement refined statistics tools in v3 UI and adopt it in detect-changes.js.
2545 * public/shared/statistics.js:
2546 (Statistics.movingAverage): Extracted from the "Simple Moving Average" strategy.
2547 (Statistics.cumultaiveMovingAverage): Extracted from the "Cumulative Moving Average" strategy.
2548 (Statistics.exponentialMovingAverage): Extracted from the "Exponential Moving Average" strategy.
2549 Use a temporary "movingAverage" to keep the last moving average instead of relying on the previous
2550 entry in "averages" array to avoid special casing an array of length 1 and starting the loop at i = 1.
2551 (Statistics.segmentTimeSeriesGreedyWithStudentsTTest): Extracted from "Segmentation: Recursive t-test"
2552 strategy. Don't create the list of averages to match segmentTimeSeriesByMaximizingSchwarzCriterion here.
2553 It's done in newly added averagesFromSegments.
2554 (Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Extracted from
2555 "Segmentation: Schwarz criterion" strategy.
2556 (.recursivelySplitIntoTwoSegmentsAtMaxTIfSignificantlyDifferent): Just store the start index to match
2558 (App.Pane.updateStatisticsTools):
2559 (App.Pane._computeMovingAverageAndOutliers):
2560 * public/v2/data.js:
2561 * public/v2/index.html:
2562 * public/v2/statistics-strategies.js: Added.
2563 (StatisticsStrategies.MovingAverageStrategies): Added.
2564 (averagesFromSegments): Extracted from "Segmentation: Schwarz criterion" strategy. Now used by both
2565 "Segmentation: Recursive t-test" and "Segmentation: Schwarz criterion" strategies.
2566 (StatisticsStrategies.EnvelopingStrategies): Moved from Statistics.EnvelopingStrategies.
2567 (StatisticsStrategies.TestRangeSelectionStrategies): Moved from Statistics.TestRangeSelectionStrategies.
2568 (createWesternElectricRule): Moved from statistics.js.
2569 (countValuesOnSameSide): Ditto.
2570 (StatisticsStrategies.executeStrategy): Moved from Statistics.executeStrategy.
2571 * tools/detect-changes.js:
2572 (computeRangesForTesting):
2574 2016-02-15 Ryosuke Niwa <rniwa@webkit.org>
2576 v1 UI and v2 UI should share statistics.js
2577 https://bugs.webkit.org/show_bug.cgi?id=154262
2579 Reviewed by Chris Dumez.
2581 Share statistics.js between v1 and v2 UI.
2583 * public/index.html:
2584 * public/js/shared.js: Deleted.
2585 * public/js/statistics.js: Removed.
2586 * public/shared: Added.
2587 * public/shared/statistics.js: Moved from Websites/perf.webkit.org/public/v2/js/statistics.js.
2588 * public/v2/index.html:
2589 * public/v2/js/statistics.js: Removed.
2590 * public/v3/index.html:
2591 * tools/detect-changes.js:
2593 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
2595 v3 UI sometimes shows same dates twice on the x-axis of time series charts
2596 https://bugs.webkit.org/show_bug.cgi?id=154210
2598 Reviewed by Chris Dumez.
2600 The bug was caused by the label generation code in TimeSeriesChart.computeTimeGrid never emitting hours.
2602 Use hours instead of dates as labels when the current time's date is same as the previous label's date.
2603 Always include dates before entering this mode to avoid just having hours as labels on the entire x-axis.
2605 * public/v3/components/time-series-chart.js:
2606 (TimeSeriesChart.prototype._renderXAxis): Slightly increase the "average" width of x-axis label.
2607 (TimeSeriesChart.computeTimeGrid): See above. Also assert that the number of labels we generate never
2608 exceeds maxLabels as a sanity check.
2609 (TimeSeriesChart._timeIterators): Added an iterator that increments by two hours for zoomed graphs.
2611 2016-02-13 Ryosuke Niwa <rniwa@webkit.org>
2613 v3 UI should show status and associated bugs on analysis task pages
2614 https://bugs.webkit.org/show_bug.cgi?id=154212
2616 Reviewed by Chris Dumez.
2618 Added the capability to see and modify the status and the list of associated of bugs on analysis task pages.
2620 Also added the list of related tasks, which are analysis tasks associated with the same bug or have
2621 overlapping time ranges with the same test metric but on a potentially different platform.
2623 In addition, categorize analysis tasks with the status of "no change" or "inconclusive" as "closed" as no
2624 further action can be taken (users can bring them back to non-closed state without any restrictions).
2626 * public/api/analysis-tasks.php:
2627 (format_task): Categorize 'unchanged' and 'inconclusive' analysis tasks as closed.
2629 * public/privileged-api/associate-bug.php:
2630 (main): Added shouldDelete as a new mechanism to disassociate a bug since v3 UI shares a single Bug object
2631 between multiple analysis tasks (as it should have been in the first place).
2633 * public/v3/components/chart-pane-base.js:
2635 (ChartPaneBase.prototype._fetchAnalysisTasks): Since each analysis task's change type (status/result) could
2636 change, we need to create annotation objects during each render() call.
2637 (ChartPaneBase.prototype.render):
2638 (ChartPaneBase.prototype._renderAnnotations): Extracted from ChartPaneBase.prototype._fetchAnalysisTasks to
2639 do that. I was afraid of the perf impact of this but it doesn't seem to be an issue in my testing.
2640 (ChartPaneBase.cssTemplate): Removed superfluous margins (moved to ChartPane.cssTemplate) around the charts
2641 since they are only useful in the charts page.
2643 * public/v3/models/analysis-task.js:
2645 (AnalysisTask.prototype.updateSingleton): Added a comment as to why object.result cannot be renamed to
2646 object.changeType in the JSON API.
2647 (AnalysisTask.prototype.updateName): Added.
2648 (AnalysisTask.prototype.updateChangeType): Added.
2649 (AnalysisTask.prototype._updateRemoteState): Added.
2650 (AnalysisTask.prototype.associateBug): Added.
2651 (AnalysisTask.prototype.disassociateBug): Added.
2652 (AnalysisTask.fetchRelatedTasks): Added. See above for the criteria of related-ness.
2654 * public/v3/pages/analysis-task-page.js:
2656 (AnalysisTaskPage.prototype.updateFromSerializedState):
2657 (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): Extracted from updateFromSerializedState.
2658 (AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks): Added.
2659 (AnalysisTaskPage.prototype.render): Render the list of associated bugs, the list of bug trackers (so that
2660 users can use it to associate with a new bug), and the list of related analysis tasks.
2661 (AnalysisTaskPage.prototype._renderTestGroupList): Extracted from render since it was getting too long.
2662 (AnalysisTaskPage.prototype._renderTestGroupDetails): Ditto.
2663 (AnalysisTaskPage.prototype._updateChangeType): Added.
2664 (AnalysisTaskPage.prototype._associateBug): Added.
2665 (AnalysisTaskPage.prototype._disassociateBug): Added.
2666 (AnalysisTaskPage.htmlTemplate): Added various elements to show and modify the status, associate bugs,
2667 and a list of related analysis tasks.
2668 (AnalysisTaskPage.cssTemplate): Added various styles for those form controls.
2670 * public/v3/pages/chart-pane.js:
2671 (ChartPane.cssTemplate): Moved the margins from ChartPaneBase.cssTemplate.
2673 2016-02-12 Ryosuke Niwa <rniwa@webkit.org>
2675 Perf dashboard should allow renaming analysis tasks and test groups
2676 https://bugs.webkit.org/show_bug.cgi?id=154200
2678 Reviewed by Chris Dumez.
2680 Allow editing names of analysis tasks and A/B testing groups in the v3 UI.
2682 Added the support for updating the name to the privileged API at /privileged-api/update-analysis-task
2683 and added a new prevailed API to update A/B testing groups at /privileged-api/update-test-group.
2685 * public/privileged-api/update-analysis-task.php: Added the support for renaming the analysis task.
2688 * public/privileged-api/update-test-group.php: Added. Supports updating the test group's name.
2691 * public/v3/components/editable-text.js: Added.
2692 (EditableText): Added. A new editable text label control. It looks like a text node with "(Edit)" link
2693 at the end which allow users to go into the "editing mode", which reveals an input element.
2694 The user can exit the editing mode by either moving the focus away from the control or clicking on
2695 "(Save)" at the end. It calls _updateCallback in the latter case.
2696 (EditableText.prototype.editedText): Returns the current value of the input element user.
2697 (EditableText.prototype.setText): Sets the label. This does not live-update the input element until
2698 the user exists the current editing mode and re-enters it.
2699 (EditableText.prototype.setStartedEditingCallback): Sets a callback which gets called when the user
2700 requested to enter the editing mode. Since EditableText relies on AnalysisTaskPage to render, this
2701 callback only exits to call EditableText.render() in AnalysisTask._didStartEditingTaskName.
2702 (EditableText.prototype.setUpdateCallback): Sets a callback which gets called when the user exits
2703 the editing mode by activating the "(Save)" link. This callback MUST return a promise upon resolution
2704 of which the control gets out of the editing mode. While the promise is in flight, the input element
2706 (EditableText.prototype.render): Updates various states of the elements. When _updatingPromise is not
2707 falsy, we make the input element readonly and show '(...)' on the link. Don't show the action link
2708 if the label is empty (e.g. analysis task or test group is still being fetched).
2709 (EditableText.prototype._didClick): Called when the user clicked on the action link. Enter the editing
2710 mode or save the edited label via _updateCallback.
2711 (EditableText.prototype._didBlur): Exit the editing mode without saving if the input element is not
2712 focused, there is no inflight promise returned by _updateCallback, and the action link "(Save)" does
2714 (EditableText.prototype._didUpdate): Called when exiting the editing mode.
2715 (EditableText.htmlTemplate):
2716 (EditableText.cssTemplate):
2718 * public/v3/index.html: Include newly added editable-text.js.
2720 * public/v3/models/analysis-task.js:
2721 (AnalysisTask.prototype.updateSingleton): Added.
2722 (AnalysisTask.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
2723 the analysis task from the sever.
2724 (AnalysisTask._constructAnalysisTasksFromRawData): Use ensureSingleton instead of manually calling
2725 findById since we need to update the name of the singleton object we found (via updateSingleton).
2727 * public/v3/models/bug.js:
2728 (Bug.ensureSingleton): Moved the code to compute the synthetic id from AnalysisTask's
2729 _constructAnalysisTasksFromRawData.
2730 (Bug.prototype.updateSingleton): Added. Just assert that nothing changes.
2732 * public/v3/models/build-request.js:
2733 (BuildRequest.prototype.updateSingleton): Added. Assert that the intrinsic values of a build request
2734 doesn't change and update status text, status url, and build id as they could change.
2736 * public/v3/models/commit-log.js:
2737 (CommitLog): Made the constructor argument conform to the convention of id, object pair so that we can
2738 use DataModelObject.ensureSingleton.
2739 (CommitLog.ensureSingleton):
2740 (CommitLog.prototype.updateSingleton): Extracted from CommitLog.ensureSingleton.
2742 * public/v3/models/data-model.js:
2743 (DataModelObject.ensureSingleton): Call newly added updateSingleton.
2744 (DataModelObject.prototype.updateSingleton):
2745 (LabeledObject): Removed the name map since it's never used (findByName is never called anywhere).
2746 (LabeledObject.prototype.updateSingleton): Added. Updates _name.
2747 (LabeledObject.findByName): Deleted.
2749 * public/v3/models/test-group.js:
2750 (TestGroup.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
2751 the test group from the sever.
2752 (TestGroup._createModelsFromFetchedTestGroups): Removed bogus code. A root set doesn't have a test
2753 group associated with it since multiple test groups can share a single root set (this property doesn't
2756 * public/v3/pages/analysis-task-page.js:
2757 (AnalysisTaskPage): Removed useless _taskId and added this._testGroupLabelMap and this._taskNameLabel.
2758 (AnalysisTaskPage.prototype.updateFromSerializedState): Cleanup.
2759 (AnalysisTaskPage.prototype._didFetchTask): Assert that this function is called exactly once.
2760 (AnalysisTaskPage.prototype.render): Use this._task.id() to show the v2 link. Use EditableText to show
2761 the names of the analysis task and the associated test groups. Hide the overview chart and the list of
2762 test groups (along with the retry/confirm button) when the analysis task failed to fetch. We always
2763 update the names of the analysis task and the associated test groups since they could be updated by
2765 (AnalysisTaskPage.prototype._didStartEditingTaskName): Added.
2766 (AnalysisTaskPage.prototype._updateTaskName): Added.
2767 (AnalysisTaskPage.prototype._updateTestGroupName): Added.
2768 (AnalysisTaskPage.htmlTemplate): Updated the style.
2770 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
2772 Land the change that was supposed to be the part of r196463.
2774 * public/v3/pages/analysis-task-page.js:
2775 (AnalysisTaskPage.prototype._didFetchTestGroups): Select the latest test group by default.
2777 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
2779 Refine v3 UI's analysis task page
2780 https://bugs.webkit.org/show_bug.cgi?id=154152
2782 Reviewed by Chris Dumez.
2784 This patch makes the following refinements to the analysis task page:
2785 - Always show the relative different of in-progress A/B testing.
2786 - Make the annotations (colored bars) in the chart open other analysis tasks.
2787 - Order the A/B testing groups in the reverse chronological order.
2788 - Select the time range corresponding to the current test group.
2790 * public/v3/components/analysis-results-viewer.js:
2791 (AnalysisResultsViewer.cssTemplate): Fixed the bug that pending and running testing groups are no longer
2792 colored after r196440. Use a slightly more opaque color for currently running groups compared to pending ones.
2794 * public/v3/components/chart-pane-base.js:
2795 (ChartPaneBase.prototype.setMainSelection): Added.
2796 (ChartPaneBase.prototype._openAnalysisTask): Moved the code from ChartPane._openAnalysisTask so that it can be
2797 reused in both AnalysisTaskChartPane and ChartPane (in charts page).
2798 (ChartPaneBase.prototype.router): Added. Overridden by each subclass.
2800 * public/v3/components/test-group-results-table.js:
2801 (TestGroupResultsTable.prototype.buildRowGroups): Always show the summary (relative difference of A to B) as
2802 long as there are some results in each set.
2804 * public/v3/models/test-group.js:
2805 (TestGroup.prototype.compareTestResults): Always set .label and .fullLabel with the relative change as long as
2806 there are some values. Keep using "pending" and "running" in .status since that would determine the color of
2807 stacking blocks representing those A/B testing groups.
2809 * public/v3/pages/analysis-task-page.js:
2810 (AnalysisTaskChartPane):
2811 (AnalysisTaskChartPane.prototype.setPage): Added.
2812 (AnalysisTaskChartPane.prototype.router): Added.
2814 (AnalysisTaskPage.prototype.render): Show the list of A/B testing groups in the reverse chronological order.
2815 Also set the main chart's selection to the time range of the current test group.
2817 * public/v3/pages/chart-pane.js:
2818 (ChartPane.prototype.router): Added.
2819 (ChartPane.prototype._openAnalysisTask): Moved to ChartPaneBase.prototype._openAnalysisTask.
2821 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
2823 Add a script to process backlogs created while perf dashboard was in the maintenance mode
2824 https://bugs.webkit.org/show_bug.cgi?id=154140
2826 Reviewed by Chris Dumez.
2828 Added a script to process the backlog JSONs created while the perf dashboard was put in the maintenance mode.
2829 It re-submits each JSON file to the perf dashboard using the same server config file used by syncing scripts.
2831 * public/include/report-processor.php:
2832 (TestRunsGenerator::test_value_list_to_values_by_iterations): Fixed a bug in the error message code. It was
2833 referencing an undeclared variable.
2834 * tools/process-maintenance-backlog.py: Added.
2836 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
2838 AnalysisResultsViewer never uses this._smallerIsBetter
2839 https://bugs.webkit.org/show_bug.cgi?id=154134
2841 Reviewed by Chris Dumez.
2843 Removed the unused instance variable _smallerIsBetter from AnalysisResultsViewer and TestGroupStackingBlock.
2845 * public/v3/components/analysis-results-viewer.js:
2846 (AnalysisResultsViewer): Removed the unused _smallerIsBetter.
2847 (AnalysisResultsViewer.prototype.setSmallerIsBetter): Deleted.
2848 (AnalysisResultsViewer.prototype.buildRowGroups):
2849 (AnalysisResultsViewer.TestGroupStackingBlock): Removed the unused _smallerIsBetter.
2850 * public/v3/pages/analysis-task-page.js:
2851 (AnalysisTaskPage.prototype._didFetchTask):
2853 2016-02-11 Ryosuke Niwa <rniwa@webkit.org>
2855 Build fix after r196440.
2857 * public/v3/models/test-group.js:
2858 (TestGroup.prototype.addBuildRequest): Clear the map instead of setting the property to null.
2860 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
2862 Perf dashboard should have UI to retry A/B testing
2863 https://bugs.webkit.org/show_bug.cgi?id=154090
2865 Reviewed by Chris Dumez.
2867 Added a button to re-try an existing A/B testing group with a custom repetition count. The same button functions
2868 as a way of confirming the progression/regression when there have been no A/B testing scheduled in the task.
2870 Also fixed the bug that A/B testing groups that have been waiting for other test groups will be shown as "running".
2872 * public/v3/components/results-table.js:
2873 (ResultsTable.cssTemplate): Don't pad the list of extra repositories when it's empty.
2875 * public/v3/components/test-group-results-table.js:
2876 (TestGroupResultsTable.prototype.buildRowGroups): Use TestGroup.labelForRootSet instead of manually
2877 computing the letter for each configuration set.
2879 * public/v3/models/build-request.js:
2880 (BuildRequest.prototype.hasStarted): Added.
2882 * public/v3/models/data-model.js:
2883 (DataModelObject.ensureSingleton): Added.
2884 (DataModelObject.cachedFetch): Added noCache option. This is used when re-fetching the test groups after
2887 * public/v3/models/measurement-cluster.js:
2888 (MeasurementCluster.prototype.startTime): Added.
2890 * public/v3/models/measurement-set.js:
2891 (MeasurementSet.prototype.hasFetchedRange): Added. Returns true only if there are no "holes" (cluster
2892 yet to be fetched) between the specified time range. This was added to fix a bug in AnalysisTaskPage's
2893 _didFetchMeasurement.
2895 * public/v3/models/test-group.js:
2896 (TestGroup): Added this._rootSetToLabel.
2897 (TestGroup.prototype.addBuildRequest): Reset this._rootSetToLabel along with this._requestedRootSets.
2898 (TestGroup.prototype.repetitionCount): Added. Returns the number of iterations executed per set. We assume that
2899 every root set in the test group shares a single repetition count.
2900 (TestGroup.prototype.requestedRootSets): Now populates this._rootSetToLabel for labelForRootSet.
2901 (TestGroup.prototype.labelForRootSet): Added.
2902 (TestGroup.prototype.hasStarted): Added.
2903 (TestGroup.prototype.compareTestResults): Use 'running' and 'pending' to differentiate test groups that are waiting
2904 for other groups to finish running from the ones that are actually running ('incomplete' before this patch).
2905 (TestGroup.fetchByTask):
2906 (TestGroup.createAndRefetchTestGroups): Added. Creates a new test group using the privileged-api/create-test-group
2907 and fetches the list of test groups for the specified analysis task.
2908 (TestGroup._createModelsFromFetchedTestGroups): Extracted from TestGroup.fetchByTask.
2910 * public/v3/pages/analysis-task-page.js:
2911 (AnalysisTaskPage): Initialize _renderedCurrentTestGroup to undefined so that we'd always can differentiate
2912 the initial call to AnalysisTaskPage.render and subsequent calls in which it's identical to _currentTestGroup.
2913 (AnalysisTaskPage.prototype._didFetchMeasurement): Fixed a bug that we don't exit early even when some
2914 clusters in between startPoint and endPoint are still being fetched via newly added hasFetchedRange.
2915 (AnalysisTaskPage.prototype.render): Update the default repetition count based on the current test group.
2916 Also update the label of the button to "Confirm the change" if there is no A/B testing in this task.
2917 (AnalysisTaskPage.prototype._retryCurrentTestGroup): Added. Re-triggers an existing A/B testing group or creates
2918 the A/B testing for the entire range of the analysis task.
2919 (AnalysisTaskPage.prototype._hasDuplicateTestGroupName): Added.
2920 (AnalysisTaskPage.prototype._createRetryNameForTestGroup): Added.
2921 (AnalysisTaskPage.htmlTemplate): Added form controls to re-trigger A/B testing.
2922 (AnalysisTaskPage.cssTemplate): Updated the style.
2924 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
2926 Removed the duplicated definition of ChartPaneBase.
2928 * public/v3/components/chart-pane-base.js:
2930 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
2932 Analysis task page on v3 UI should show charts
2933 https://bugs.webkit.org/show_bug.cgi?id=154057
2935 Reviewed by Chris Dumez.
2937 Extracted ChartPaneBase out of ChartPane and added an instance of its new subclass, AnalysisTaskChartPane,
2938 to the analysis task page. The main difference is that ChartPaneBase doesn't depend on the presence of
2939 this._chartsPage unlike ChartPane. It also doesn't have the header with toolbar (to show breakdown, etc...).
2941 * public/v3/components/base.js:
2942 (ComponentBase.prototype._constructShadowTree): Call htmlTemplate() and cssTemplate() with the right "this".
2944 * public/v3/components/chart-pane-base.js: Added.
2945 (ChartPaneBase): Extracted from ChartPane.
2946 (ChartPaneBase.prototype.configure): Extracted from the constructor. Separating this function allows the
2947 component to be instantiated inside a HTML template.
2948 (ChartPaneBase.prototype._fetchAnalysisTasks): Moved from ChartPane._fetchAnalysisTasks.
2949 (ChartPaneBase.prototype.platformId): Ditto.
2950 (ChartPaneBase.prototype.metricId): Ditto.
2951 (ChartPaneBase.prototype.setOverviewDomain): Ditto.
2952 (ChartPaneBase.prototype.setMainDomain): Ditto.
2953 (ChartPaneBase.prototype._overviewSelectionDidChange): Extracted from the constructor. This is overridden in
2954 ChartPane and unused in AnalysisTaskChartPane.
2955 (ChartPaneBase.prototype._mainSelectionDidChange): Extracted from ChartPane._mainSelectionDidChange.
2956 (ChartPaneBase.prototype._mainSelectionDidZoom): Extracted from ChartPane._mainSelectionDidZoom.
2957 (ChartPaneBase.prototype._indicatorDidChange): Extracted from ChartPane._indicatorDidChange.
2958 (ChartPaneBase.prototype._didFetchData): Moved from ChartPane._fetchAnalysisTasks.
2959 (ChartPaneBase.prototype._openAnalysisTask): Ditto.
2960 (ChartPaneBase.prototype._openCommitViewer): Ditto. Also fixed a bug that we don't show the spinner while
2961 waiting for the data to be fetched by calling this.render() here.
2962 (ChartPaneBase.prototype._keyup): Moved from ChartPane._keyup. Also fixed the bug that the revisions list
2963 doesn't update by calling this.render() here.
2964 (ChartPaneBase.prototype.render): Extracted from ChartPane.render.
2965 (ChartPaneBase.htmlTemplate): Extracted from ChartPane.htmlTemplate.
2966 (ChartPaneBase.paneHeaderTemplate): Added. This is overridden in ChartPane and unused in AnalysisTaskChartPane.
2967 (ChartPaneBase.cssTemplate): Extracted from ChartPane.htmlTemplate.
2969 * public/v3/components/chart-styles.js: Renamed from public/v3/pages/page-with-charts.js.
2970 (PageWithCharts): Renamed from PageWithCharts since it no longer extends PageWithHeading.
2971 (ChartStyles.createChartSourceList):
2973 * public/v3/components/commit-log-viewer.js:
2974 (CommitLogViewer.prototype.view): Set this._repository right away instead of waiting for the fetched data
2975 so that spinner will be shown while the data is being fetched.
2977 * public/v3/index.html:
2979 * public/v3/pages/analysis-task-page.js:
2980 (AnalysisTaskChartPane): Added extends ChartPaneBase.
2981 (AnalysisTaskPage): Added. this._chartPane.
2982 (AnalysisTaskPage.prototype._didFetchTask): Initialize this._chartPane with a domain.
2983 (AnalysisTaskPage.prototype.render): Render this._chartPane.
2984 (AnalysisTaskPage.htmlTemplate):
2986 * public/v3/pages/chart-pane-status-view.js:
2987 (ChartPaneStatusView): Removed the unused router from the argument list.
2988 (ChartPaneStatusView.prototype.pointsRangeForAnalysis): Renamed from analyzeData() since it was ambiguous.
2989 (ChartPaneStatusView.prototype.moveRepositoryWithNotification): Fixed the bug that we don't update the list
2990 of the revisions here.
2991 (ChartPaneStatusView.prototype.computeChartStatusLabels):
2993 * public/v3/pages/chart-pane.js:
2994 (ChartPane): Now extends ChartPaneBase.
2995 (ChartPane.prototype._overviewSelectionDidChange): Extracted from the constructor.
2996 (ChartPane.prototype._mainSelectionDidChange):
2997 (ChartPane.prototype._mainSelectionDidZoom):
2998 (ChartPane.prototype._indicatorDidChange):
2999 (ChartPane.prototype.render):
3000 (ChartPane.prototype._renderActionToolbar):
3001 (ChartPane.paneHeaderTemplate): Extracted from htmlTemplate.
3002 (ChartPane.cssTemplate):
3003 (ChartPane.overviewOptions.selection.onchange): Deleted.
3004 (ChartPane.prototype._fetchAnalysisTasks): Deleted.
3005 (ChartPane.prototype.platformId): Deleted.
3006 (ChartPane.prototype.metricId): Deleted.
3007 (ChartPane.prototype.setOverviewDomain): Deleted.
3008 (ChartPane.prototype.setMainDomain): Deleted.
3009 (ChartPane.prototype._openCommitViewer): Deleted.
3010 (ChartPane.prototype._didFetchData): Deleted.
3011 (ChartPane.prototype._keyup): Deleted.
3013 * public/v3/pages/charts-page.js:
3015 (ChartsPage.createDomainForAnalysisTask): Extracted by createDomainForAnalysisTask; used to set the domain
3016 of the charts in the analysis task page.
3017 (ChartsPage.createStateForAnalysisTask):
3019 * public/v3/pages/dashboard-page.js:
3021 (DashboardPage.prototype._createChartForCell):
3023 2016-02-10 Ryosuke Niwa <rniwa@webkit.org>
3025 Add the support for maintenance mode
3026 https://bugs.webkit.org/show_bug.cgi?id=154072
3028 Reviewed by Chris Dumez.
3030 Added the crude support for maintenance mode whereby which the reports are stored in the filesystem
3031 instead of the database.
3033 * config.json: Added maintenanceMode and maintenanceDirectory as well as forgotten siteTitle and
3034 remoteServer.httpdMutexDir.
3035 * public/api/report.php:
3036 (main): Don't connect to the database or modify database when maintenanceMode is set.
3037 * public/include/json-header.php:
3038 (ensure_privileged_api_data): Exit with InMaintenanceMode when maintenanceMode is set. This prevents
3039 privileged API such as creating analysis tasks and new A/B testing groups from modifying the database.
3041 2016-02-09 Ryosuke Niwa <rniwa@webkit.org>
3043 Analysis task page on v3 show progression as regressions
3044 https://bugs.webkit.org/show_bug.cgi?id=154045
3046 Reviewed by Chris Dumez.
3048 The bug was caused by TestGroup.compareTestResults referring to undefined _smallerIsBetter.
3049 Retrieve it from the associated metric object via the owner analysis task.
3051 * public/v3/models/test-group.js:
3053 2016-02-05 Ryosuke Niwa <rniwa@webkit.org>
3055 Testing with remote server cache is unusably slow
3056 https://bugs.webkit.org/show_bug.cgi?id=153928
3058 Reviewed by Chris Dumez.
3060 Don't use the single process mode of httpd as it's way too slow even for testing.
3061 Also we'll hit a null pointer crash (http://svn.apache.org/viewvc?view=revision&revision=1711479)
3063 Since httpd exits immediately when launched in multi-process mode, remote-cache-server.py (renamed from
3064 run-with-remote-server.py) now has "start" and "stop" commands to start/stop the Apache. Also added
3065 "reset" command to reset the cache for convenience.
3067 * Install.md: Updated the instruction.
3068 * config.json: Fixed a typo: httpdErro*r*Log.
3069 * tools/remote-cache-server.py: Copied from Websites/perf.webkit.org/tools/run-with-remote-server.py.
3070 Now takes one of the following commands: "start", "stop", and "reset".
3072 (start_httpd): Extracted from main.
3073 (stop_httpd): Added.
3074 * tools/remote-server-relay.conf: Removed redundant (duplicate) LoadModule's.
3075 * tools/run-with-remote-server.py: Removed.
3077 2016-02-04 Ryosuke Niwa <rniwa@webkit.org>
3079 Perf dashboard should have a script to setup database
3080 https://bugs.webkit.org/show_bug.cgi?id=153906
3082 Reviewed by Chris Dumez.
3084 Added tools/setup-database.py to setup the database. It retrieves the database name, username, password
3085 and initializes a database at the specified location.
3087 * Install.md: Updated instruction to setup postgres to use setup-database.py.
3088 * tools/setup-database.py: Added.
3090 (load_database_config):
3091 (determine_psql_dir):
3092 (start_or_stop_database):
3093 (execute_psql_command):
3095 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
3097 buildbot syncing scripts sometimes schedule more than one requests per builder
3098 https://bugs.webkit.org/show_bug.cgi?id=153047
3100 Reviewed by Chris Dumez.
3102 The bug was caused by the check for singularity of scheduledRequests being conducted per configuration
3103 instead of per builder. So if there were multiple test configurations (e.g. Speedometer and Octane) that
3104 both used the same builder, then we may end up scheduling both at once.
3106 Fixed the bug by sharing a single set to keep track of the scheduled requests for all configurations per