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