blob: b399bcb18c52f1bd37319eabc85e853c23806c78 [file] [log] [blame]
2018-04-26 Dewei Zhu <dewei_zhu@apple.com>
Extend create-analysis-test API to be able to create with confirming test group.
https://bugs.webkit.org/show_bug.cgi?id=184958
Reviewed by Ryosuke Niwa.
Extend create-analysis-test API to be able to create an analysis task with confirming test group.
Update create analysis task UI in chart pane to adapt this new API.
Refactored '/privileged-api/create-test-group' API to share some creating test group logic with '/privileged-api/create-analysis-task' API.
Moved the shared logic to commit-sets-helpers.php.
* public/api/analysis-tasks.php: Use 'require_once' instead of 'require'.
* public/include/commit-sets-helpers.php: Added.
(create_test_group_and_build_requests): A helper function that creates test group and build requests for a analysis
task. In long term, this should be a class to avoid passing long argument list around.
(insert_commit_sets_and_construct_configuration_list): Based on commit sets returns build and test configurations.
(insert_build_request_for_configuration): Insert build requests based on configuration.
(commit_sets_from_revision_sets): Returns commit sets from given revision set list.
* public/privileged-api/create-analysis-task.php: Added the ability to create analysis task with confirming test
groups when repetition count is specified.
* public/privileged-api/create-test-group.php: Moved shared function to commit-sets-helpers.php.
* public/v3/models/analysis-task.js:
(AnalysisTask.create): Instead of accepting run ids, it now accepts points and test group name and confirming iterations.
It will conditionally add test group information into parameter when confirming iterations is a positive number.
(AnalysisTask):
* public/v3/models/commit-set.js:
(CommitSet.revisionSetsFromCommitSets): Move 'TestGroup._revisionSetsFromCommitSets' since CommitSet class is more
appropriate place and it will be shared by both TestGroup and AnalysisTask
(CommitSet):
* public/v3/models/test-group.js:
(TestGroup.createWithTask): Adapt 'CommitSet.revisionSetsFromCommitSets'.
(TestGroup.createWithCustomConfiguration): Adapt 'CommitSet.revisionSetsFromCommitSets'.
(TestGroup.createAndRefetchTestGroups): Adapt 'CommitSet.revisionSetsFromCommitSets'.
(TestGroup._revisionSetsFromCommitSets): Deleted and moved to 'CommitSet.revisionSetsFromCommitSets'.
* public/v3/pages/chart-pane.js:
(ChartPane.prototype.didConstructShadowTree): Added the logic to disable options when checkbox for creating confirming
test group is unchecked.
(ChartPane.prototype._analyzeRange): Conditionally create confirming test group from UI.
(ChartPane.cssTemplate):
* server-tests/privileged-api-create-analysis-task-tests.js: Added unit tests. Added a unit test for 'NodePrivilegedAPI'.
* unit-tests/analysis-task-tests.js: Added unit tests.
* unit-tests/commit-set-tests.js: Added unit test for 'CommitSet.revisionSetsFromCommitSets'.
* unit-tests/resources/mock-remote-api.js: Reset csrf token when BrowserPrivilegedAPI is used.
(MockRemoteAPI.inject):
2018-04-23 Dewei Zhu <dewei_zhu@apple.com>
Tool scripts should not use PrivilegedAPI from 'public/v3/privileged-api.js'.
https://bugs.webkit.org/show_bug.cgi?id=184766
Reviewed by Ryosuke Niwa.
For tools, we should not use PrivilegedAPI for tools as current PrivilegedAPI
is used by UI and it is unnecessary to generate CSRF token for tools.
Will post a followup patch that creates a PrivilegedAPI used by tools.
Make a change on TestServer.inject and MockRemoteAPI.inject to allow specifying
BrowserPrivilegedAPI or NodePrivilegedAPI in the test. Currently defaults to
BrowserPrivilegedAPI as this is the test behavior before this change.
* server-tests/resources/common-operations.js: Allow passing type of privileged api
information to TestServer.inject.
* server-tests/resources/test-server.js: Conditionally inject PrivilegedAPI based on
type of privileged api.
(TestServer.prototype.inject):
(TestServer):
* server-tests/tools-buildbot-triggerable-tests.js: Updated 'prepareServerTest' invocation.
* server-tests/tools-os-build-fetcher-tests.js: Updated 'prepareServerTest' invocation.
* server-tests/tools-sync-buildbot-integration-tests.js: Temporarily injecting
BrowserPrivilegedAPI for mocking UploadedFile. The actual script does not rely on
BrowserPrivilegedAPI at all.
(async.createTestGroupWihPatch):
(beforeEach):
* tools/js/privileged-api.js: Added NodePrivilegedAPI
(NodePrivilegedAPI.prototype.sendRequest):
(NodePrivilegedAPI.configure): Configure the slave name and password.
(NodePrivilegedAPI):
* tools/js/v3-models.js: Removed the import of PrivilegedAPI.
* unit-tests/privileged-api-tests.js:. Added unit tests for NodePrivilegedAPI.
* unit-tests/resources/mock-remote-api.js: Conditionally inject PrivilegedAPI based on
the type of privileged api.
(MockRemoteAPI.inject):
2018-04-23 Dewei Zhu <dewei_zhu@apple.com>
Revision information returned by querying measurement set api with analysis task id should contain commit order.
https://bugs.webkit.org/show_bug.cgi?id=184902
Reviewed by Ryosuke Niwa.
This is a bug fix for r230719 which does not cover the case while querying `measurement-set.php?analysisTask=$task_id`
* public/api/measurement-set.php: AnalysisResultsFetcher.fetch_commits results should contains commit order.
* server-tests/api-measurement-set-tests.js: Added unit test for this change.
2018-04-19 Dewei Zhu <dewei_zhu@apple.com>
Add a bisect button to automatically schedule bisecting A/B tasks.
https://bugs.webkit.org/show_bug.cgi?id=183888
Reviewed by Ryosuke Niwa.
Extended AnalysisTask's ability to figure out bisecting A/B tasks based on existing data points and test groups.
Updated analysis page UI to show bisect button which will only appear when the middle commit set of the range in
test group can be found.
Finding middle commit set algorithm is described as follows:
1. Find all commits from multiple repositories among the ranges specified by two commit sets in test group. In
the meanwhile, merge all commits that have commit time into a single list. For commits only have commit order,
put those commits into separate lists.
2. Filter all the available commit sets in current analysis task by keeping the ones have exact repositories
as the two commit sets in specified test group, and every commit of a commit set is in side the commit range.
After filtering the commit sets, sort the remaining ones and only keep one commit set if multiple commit sets
are equal to each other.
3. Among commits processed by step 2, find the commit sets that have the commit which is closest to the middle of
all commits that have commit time created from step 1.
4. Among commits processed by step 3, find the commit sets that have the commit which is closest to the middle of
commits that only have commit order and categorized by repository. We have to iterate through repository as commit
order is not granted to be comparable between different repositories.
5. If more than one commit sets are found, choose the middle commit set.
* public/v3/commit-set-range-bisector.js: Added.
(CommitSetRangeBisector.async.commitSetClosestToMiddleOfAllCommits): Instead of naively returning the middle of
existing commit set array, this function selects a bisect bisection points that is closest to actually middle of
the revision range based on all revisions reported to performance dashboard.
(CommitSetRangeBisector._findCommitSetsWithinRange): Helper function to find commit sets those are in specified range.
(CommitSetRangeBisector._orderCommitSetsByTimeAndOrderThenDeduplicate): Helper function to sort and deduplicate commit sets.
(CommitSetRangeBisector._closestCommitSetsToBisectingCommitByTime): Helper function to find the commit sets those
are closest to the middle of among all the commits in the range that have commit time.
(CommitSetRangeBisector._findCommitSetsClosestToMiddleOfCommitsWithOrder): Helper function which goes through all
repositories the commit of which has commit order, and find the commit sets those are closest to the middle of
commits for each repository.
(CommitSetRangeBisector._buildCommitToCommitSetMap): Helper function to builder mapping from a commit to commit
sets those contain this commit.
(CommitSetRangeBisector._findCommitClosestToMiddleIndex): Helper function to find closest commit to the middle of index.
(CommitSetRangeBisector):
* public/v3/index.html: Imports 'public/v3/commit-set-range-bisector.js'.
* public/v3/models/analysis-task.js:
(AnalysisTask.prototype.async.commitSetsFromTestGroupsAndMeasurementSet): Aggregates all existing commit sets in
test groups of current analysis tasks.
* public/v3/models/commit-log.js:
(CommitLog.prototype.hasCommitTime): A helper function determine whether a commit has a commit time. For commit
that does not have time, server will return commit time as zero. As it is unrealistic for a commit has commit time
0, it would be safe to assume a valid commit time is greater than 0.
(CommitLog.prototype.hasCommitOrder): Returns whether a commit has a commit oder.
(CommitLog.hasOrdering): Determine whether we can order two commits by commit time or commit order.
(CommitLog.orderTwoCommits): Order two commits incrementally.
* public/v3/models/commit-set.js:
(CommitSet.prototype.hasSameRepositories): A helper function to determine whether a commit set has same repositories
as current repository.
(CommitSet.containsRootOrPatchOrOwnedCommit): A helper function to determine whether current commit set has root,
patch or owned commit.
(CommitSet.commitForRepository): This function defined twice identically, remove one of them.
* public/v3/models/test-group.js: Make '_computeRequestedCommitSets' a static function as it does not use any
instance variables.
* public/v3/pages/analysis-task-page.js: Added bisect button.
(AnalysisTaskTestGroupPane):
(AnalysisTaskTestGroupPane.prototype.didConstructShadowTree):
(AnalysisTaskTestGroupPane.prototype.setTestGroups): Update 'setTestGroups' to update _bisectingCommitSetByTestGroup
when the test groups changes.
(AnalysisTaskTestGroupPane.prototype._renderCurrentTestGroup): Added code to conditionally show bisect button.
Bisect button will only show when there is a middle commit set for that test group.
(AnalysisTaskTestGroupPane.htmlTemplate):
(AnalysisTaskTestGroupPane.cssTemplate):
(AnalysisTaskPage.prototype.didConstructShadowTree):
(AnalysisTaskPage.prototype._retryCurrentTestGroup):
(AnalysisTaskPage.prototype.async._bisectCurrentTestGroup): A callback when bisect button is clicked.
* tools/js/v3-models.js:
* unit-tests/commit-log-tests.js: Added unit tests for 'CommitLog.hasCommitTime', 'CommitLog.hasCommitOrder',
'CommitLog.orderTwoCommits', 'CommitLog.hasOrdering'.
* unit-tests/commit-set-range-bisector-tests.js: Unit tests for 'CommitSetRangeBisector.commitSetClosestToMiddleOfAllCommits'.
* unit-tests/commit-set-tests.js: Added unit tests for 'CommitSet.hasSameRepositories' and 'CommitSet.containsRootOrPatchOrOwnedCommit'.
2018-04-16 Dewei Zhu <dewei_zhu@apple.com>
Commit order should always be returned by api.
https://bugs.webkit.org/show_bug.cgi?id=184674
Reviewed by Ryosuke Niwa.
Commit order sometimes missing in CommitLog object before this change.
This makes ordering commits logic become unnecessarily complicate.
This change will ensure commit order is always fetched for a CommitLog object.
Change measurement-set API to contain commit order information.
Change commits API to contain commit order information.
* public/api/measurement-set.php: Includes commit order information.
* public/include/commit-log-fetcher.php:
* public/v3/models/commit-log.js: Added a function to return order information.
(CommitLog.prototype.updateSingleton): This function should update commit order.
(CommitLog.prototype.order): Returns the order of commit.
* public/v3/models/commit-set.js:
(MeasurementCommitSet): Update MeasurementCommitSet to contain commit order information when creating CommitLog object.
* server-tests/api-measurement-set-tests.js: Updated unit tests.
* unit-tests/analysis-task-tests.js: Update unit tests to contain commit order information in mock data.
(measurementCluster):
* unit-tests/commit-log-tests.js: Added unit tests for CommitLog.order.
* unit-tests/commit-set-tests.js: Added commit order in MeasurementCommitSet.
* unit-tests/measurement-adaptor-tests.js: Updated unit tests to contain commit order information in mock data.
* unit-tests/measurement-set-tests.js: Updated unit tests to contain commit order information in mock data.
2018-04-15 Ryosuke Niwa <rniwa@webkit.org>
Make it possible to hide some repository groups
https://bugs.webkit.org/show_bug.cgi?id=184632
Reviewed by Saam Barati.
Added the ability to hide repository groups in the custom analysis task configurator from the admin page.
Hidden repositroy groups will continue to function for existing test groups. This is purely an UI change.
* init-database.sql: Added repositorygroup_hidden as a new column to triggerable_repository_groups.
* public/admin/triggerables.php: Added a form field to hide a repository group.
* public/include/manifest-generator.php: Include hidden state in the manifest file.
* public/v3/components/custom-analysis-task-configurator.js:
(CustomAnalysisTaskConfigurator.prototype._renderRepositoryPanes): Filter out hidden repository groups.
* public/v3/models/triggerable.js:
(prototype.isHidden): Added.
* server-tests/api-manifest-tests.js: Updated an existing test case to test a hidden repository group.
2018-04-06 Dewei Zhu <dewei_zhu@apple.com>
Added 'CommitSet.diff' which will be shared between multiple independent incoming changes.
https://bugs.webkit.org/show_bug.cgi?id=184368
Reviewed by Ryosuke Niwa.
'CommitSet.diff' will be used in multiple independent incoming changes.
It would be easier to make this a separate change to parallelize the changes depends on this API.
* public/v3/models/commit-set.js:
(CommitSet.prototype.createNameWithoutCollision): Moved from 'AnalysisTaskPage' and make it more generic.
(CommitSet.prototype.diff): Describe differences between 2 commit sets including commit, root and patch differences.
* public/v3/pages/analysis-task-page.js: Move 'AnalysisTaskPage._createRetryNameForTestGroup' to CommitSet in a more generic form.
(AnalysisTaskPage.prototype._retryCurrentTestGroup): Use 'CommitSet.withoutRootPatchOrOwnedCommit' instead.
(AnalysisTaskPage.prototype._createRetryNameForTestGroup): Moved to CommitSet in a more generic form.
* unit-tests/commit-set-tests.js: Added unit tests for 'CommitSet.diff'.
2018-04-05 Dewei Zhu <dewei_zhu@apple.com>
Fix a bug introduced in r230295 that A/B test result is not shown.
https://bugs.webkit.org/show_bug.cgi?id=184350
Reviewed by Ryosuke Niwa.
result.label should be assigned in `TestGroup._computeRequestedCommitSets`.
* public/v3/models/test-group.js:
(TestGroup.prototype._computeRequestedCommitSets):
2018-03-29 Dewei Zhu <dewei_zhu@apple.com>
Added UI to show potential regressions in chart with t-testing against segmentations.
https://bugs.webkit.org/show_bug.cgi?id=184131
Reviewed by Ryosuke Niwa.
Added UI in the chart-pane so that user can use new option in trendline which not only
shows the segmentation, but also t-test against potential changes indicated by segmentation.
Fix a bug in AnalysisTaskPage that chart is not updated when change type of task changes.
* browser-tests/interactive-time-series-chart-tests.js: Fix a unit tests.
* browser-tests/time-series-chart-tests.js: Fix a unit tests.
* public/shared/statistics.js: Added a function to t-test certain range based on segmentation results.
(Statistics.supportedOneSideTTestProbabilities):
(Statistics.findRangesForChangeDetectionsWithWelchsTTest): The argument `segmentations`, every 2 items in the list defines
segmentation, that is why the index incremental is 2 in this funcion.
* public/v3/components/chart-pane-base.js: Will select the range if user clicks on a suggested annotation.
(ChartPaneBase.prototype.configure):
(ChartPaneBase.prototype._didClickAnnotation):
* public/v3/components/chart-styles.js:
(ChartStyles.annotationFillStyleForTask): Added 'annotationFillStyleForTask' to determine the fillStyle for annotation based on change type of a analysis task.
* public/v3/components/interactive-time-series-chart.js:
(InteractiveTimeSeriesChart.prototype._findAnnotation): Also need to search among suggested annotaions.
* public/v3/components/time-series-chart.js: Introduced 'suggested annotaion' which does not have an existing task and is suggested by t-test based on segmentation.
(TimeSeriesChart):
(TimeSeriesChart.prototype.setSuggestedAnnotations):
(TimeSeriesChart.prototype.allAnnotations): Returns both annotations with and without analysis task.
(TimeSeriesChart.prototype._layoutAnnotationBars): Should take all annotations in the calculation.
* public/v3/models/measurement-set.js:
(MeasurementSet.prototype.metricId): Returns metric id.
* public/v3/models/metric.js:
(Metric.prototype.summarizeForValues): Added helper function to summarize a given value
* public/v3/models/test-group.js:
(TestGroup.prototype.compareTestResults): Adapted to use 'Metric.summarizeForValues'.
* public/v3/pages/chart-pane.js: Added 'Segmentation with t-test analysis' to 'ChartTrendLineTypes'.
(ChartPane.prototype._renderTrendLinePopover):
(ChartPane.prototype.async._updateTrendLine): make it an async function.
* unit-tests/statistics-tests.js: Added unit tests for 'findRangesForChangeDetectionsWithWelchsTTest'.
2018-04-02 Aakash Jain <aakash_jain@apple.com>
Remove deprecated Buildbot 0.8 code from Perf syncing scripts
https://bugs.webkit.org/show_bug.cgi?id=183915
Reviewed by Ryosuke Niwa.
* server-tests/resources/mock-data.js:
(MockData.buildbotBuildersURLDeprecated): Deleted.
(MockData.mockBuildbotBuildersDeprecated): Deleted.
(MockData.pendingBuildDeprecated): Deleted.
(MockData.runningBuildDeprecated): Deleted.
(MockData.finishedBuildDeprecated): Deleted.
* tools/js/buildbot-syncer.js:
(BuildbotBuildEntryDeprecated): Deleted.
(BuildbotBuildEntryDeprecated.prototype.initialize): Deleted.
(BuildbotBuildEntryDeprecated.prototype.url): Deleted.
(BuildbotSyncer.prototype.scheduleBuildOnBuildbotDeprecated): Deleted.
(BuildbotSyncer.prototype._pullRecentBuildsDeprecated): Deleted.
(BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Deleted.
(BuildbotSyncer.prototype.pathForBuildJSONDeprecated): Deleted.
(BuildbotSyncer.prototype.pathForForceBuildDeprecated): Deleted.
(BuildbotSyncer.prototype.url): Deleted.
(BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deleted.
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Deleted.
* unit-tests/buildbot-syncer-tests.js:
(smallPendingBuildDeprecated): Deleted.
(smallInProgressBuildDeprecated): Deleted.
(smallFinishedBuildDeprecated): Deleted.
(samplePendingBuildRequestDeprecated): Deleted.
(sampleInProgressBuildDeprecated): Deleted.
(sampleFinishedBuildDeprecated): Deleted.
2018-03-19 Aakash Jain <aakash_jain@apple.com>
Update Perf buildbot syncing scripts for Buildbot 0.9
https://bugs.webkit.org/show_bug.cgi?id=175969
Reviewed by Ryosuke Niwa.
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype.initSyncers): Switch from Deprecated version to new version of getBuilderNameToIDMap.
* tools/js/buildbot-syncer.js:
(BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Switch from Deprecated version to new version of scheduleRequest.
(BuildbotSyncer.prototype.pullBuildbot): Switch from Deprecated version to new version of pathForPendingBuilds, _pullRecentBuilds
and BuildbotBuildEntry. Parse the pending build-requests data in Buildbot 0.9 format.
* unit-tests/buildbot-syncer-tests.js: Updated as per Buildbot 0.9 code.
* server-tests/tools-sync-buildbot-integration-tests.js: Ditto.
* server-tests/tools-buildbot-triggerable-tests.js: Ditto.
* server-tests/resources/mock-data.js: Ditto.
(MockData.pendingBuildsUrl): Method to construct pendingBuildsUrl in Buildbot 0.9 format.
(MockData.recentBuildsUrl): Ditto for recent builds url.
(MockData.statusUrl): Ditto for status url.
(MockData.builderIDForName): Method to get builder ID from builder name.
2018-03-15 Aakash Jain <aakash_jain@apple.com>
BuildbotBuildEntry creates an incorrect url for pending builds
https://bugs.webkit.org/show_bug.cgi?id=183670
Reviewed by Ryosuke Niwa.
* tools/js/buildbot-syncer.js:
(BuildbotBuildEntry.prototype.initialize): Fetch buildrequestid from Buildbot.
(BuildbotBuildEntry.prototype.url): Construct url for pending build using buildrequestid from Buildbot.
* unit-tests/buildbot-syncer-tests.js: Updated unit-test.
2018-03-14 Aakash Jain <aakash_jain@apple.com>
Add support for boolean properties in BuildbotSyncer while submitting build request to Buildbot 0.9 server
https://bugs.webkit.org/show_bug.cgi?id=183638
Reviewed by Ryosuke Niwa.
* tools/js/buildbot-syncer.js:
(BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Allow boolean properties.
* server-tests/tools-sync-buildbot-integration-tests.js: Tests for boolean properties.
* unit-tests/buildbot-syncer-tests.js: Ditto.
2018-03-04 Dewei Zhu <dewei_zhu@apple.com>
Create analysis task should use build time as fallback when commit time is not available.
https://bugs.webkit.org/show_bug.cgi?id=183309
Reviewed by Ryosuke Niwa.
Added the ability to schedule analysis task for the range without commit time.
* public/privileged-api/create-analysis-task.php: Use build time as fallback.
* server-tests/privileged-api-create-analysis-task-tests.js: Added a unit test for this change.
2018-03-04 Aakash Jain <aakash_jain@apple.com>
BuildbotBuildEntry for buildbot 0.9 uses incorrect buildrequestid
https://bugs.webkit.org/show_bug.cgi?id=183194
Reviewed by Ryosuke Niwa.
* tools/js/buildbot-syncer.js:
(BuildbotBuildEntry.prototype.initialize): Updated _buildRequestId to use correct build-request-id, as set in syncer._buildRequestPropertyName.
(BuildbotSyncer.prototype.pathForPendingBuilds): Updated url to fetch properties for build-requests.
* unit-tests/buildbot-syncer-tests.js:
(sampleBuildData): Updated sampleBuildData with correct build-request-id in properties. Added
properties to samplePendingBuildRequestData.
2018-02-28 Aakash Jain <aakash_jain@apple.com>
Rename samplePendingBuild to samplePendingBuildRequest
https://bugs.webkit.org/show_bug.cgi?id=183171
Reviewed by Ryosuke Niwa.
* unit-tests/buildbot-syncer-tests.js:
(samplePendingBuildRequests): Renamed from samplePendingBuild.
(samplePendingBuildRequestDeprecated): Renamed from samplePendingBuildDeprecated.
(samplePendingBuild): Deleted.
(samplePendingBuildDeprecated): Deleted.
2018-02-02 Aakash Jain <aakash_jain@apple.com>
Add support for submitting build request to Buildbot 0.9 server in BuildbotSyncer
https://bugs.webkit.org/show_bug.cgi?id=182218
Reviewed by Ryosuke Niwa.
* tools/js/buildbot-syncer.js:
(BuildbotSyncer.prototype.scheduleRequest): Added assert to ensure forcescheduler property is always defined. Builds can not
be scheduled on Buildbot without this property. Updated unit-tests and server-tests accordingly.
(BuildbotSyncer.prototype.scheduleBuildOnBuildbotDeprecated): Method to schedule build request on Buildbot 0.8 server.
(BuildbotSyncer.prototype.scheduleBuildOnBuildbot): Method to schedule build request on Buildbot 0.9 server.
(BuildbotSyncer.prototype.pathForForceBuildDeprecated): Path for scheudling build on Buildbot 0.8 server.
(BuildbotSyncer.prototype.pathForForceBuild): Path for scheudling build on Buildbot 0.9 server.
* unit-tests/buildbot-syncer-tests.js:
(smallConfiguration): Added test-case for scheduleBuildOnBuildbot. Also added forcescheduler property in sample data.
* server-tests/resources/mock-data.js: Added forcescheduler property in sample data.
* server-tests/tools-buildbot-triggerable-tests.js: Updated server-tests to take care of added forcescheduler property.
2018-02-02 Aakash Jain <aakash_jain@apple.com>
Add support for fetching recent builds in Buildbot 0.9 format in BuildbotSyncer
https://bugs.webkit.org/show_bug.cgi?id=179743
Reviewed by Ryosuke Niwa.
* tools/js/buildbot-syncer.js:
(BuildbotSyncer.prototype._pullRecentBuildsDeprecated): Renamed from _pullRecentBuilds. This method fetch
from Buildbot 0.8 server.
(BuildbotSyncer.prototype._pullRecentBuilds): Method to fetch recent builds from Buildbot 0.9 server.
(BuildbotSyncer.prototype.pathForRecentBuilds): URL for fetching recent builds from Buildbot 0.9 server.
(BuildbotSyncer.prototype.pathForBuildJSONDeprecated): Renamed from pathForBuildJSON.
* unit-tests/buildbot-syncer-tests.js:
(_pullRecentBuilds.it): unit-test - should not fetch recent builds when count is zero.
(_pullRecentBuilds.it): unit-test - should pull the right number of recent builds.
(_pullRecentBuilds.it): unit-test - should handle unexpected error while fetching recent builds.
(_pullRecentBuilds.it): unit-test - should create BuildbotBuildEntry after fetching recent builds.
2018-02-01 Aakash Jain <aakash_jain@apple.com>
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format
https://bugs.webkit.org/show_bug.cgi?id=182036
Reviewed by Ryosuke Niwa.
* tools/js/buildbot-syncer.js:
(BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format.
(BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format.
(BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format.
(BuildbotSyncer.prototype.builderID): Added.
(BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON.
(BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format.
(BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber.
(BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format.
(BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page.
* unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated.
(sampleBuildData): Sample build data. Common method for in-progress and finished build data.
(samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds.
(sampleInProgressBuildData): Ditto for in-progress build.
(sampleFinishedBuildData): Ditto for finished build.
(samplePendingBuild): Sample data for single pending build.
(sampleInProgressBuild): Ditto for in-progress build.
(sampleFinishedBuild): Ditto for finished build.
(samplePendingBuildDeprecated): Renamed from samplePendingBuild.
(sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild.
(sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild.
(BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build.
(BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build.
(BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build.
(BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build.
2018-01-31 Dewei Zhu <dewei_zhu@apple.com>
Should chose the best match during 'route' if there are multiple matches.
https://bugs.webkit.org/show_bug.cgi?id=182326
Reviewed by Ryosuke Niwa.
r227749 made a change that 'analysisCategoryPage' will be added before 'analysisTaskPage'.
As route names for both pages starts with 'analysis', whichever added first will be chosen.
For a route like 'analysis/task/1'. As a result, 'analysisCategoryPage' will be chosen and
this is not expected behavior. Adding the logic on the cases when route name does not extact
match the route name, always choose the longest mathcing route name.
Also modernized the code of 'page-router.js' to use const & let instead of var.
Added a browser test to guard against this bug.
* browser-tests/index.html: Import 'page-router-tests.js'.
* browser-tests/page-router-tests.js: Added unit test to guard against this bug.
* public/v3/pages/page-router.js:
(PageRouter.prototype.route): Added logic to find best matching in the case of inexact match.
(PageRouter.prototype.pageDidOpen):
(PageRouter.prototype._updateURLState):
(PageRouter.prototype._serializeToHash):
(PageRouter.prototype._deserializeFromHash):
(PageRouter.prototype._serializeHashQueryValue):
(PageRouter.prototype._deserializeHashQueryValue):
(PageRouter.prototype._countOccurrences):
(PageRouter):
2018-01-29 Dewei Zhu <dewei_zhu@apple.com>
Should fetch owner commits in build-requests-fetcher.
https://bugs.webkit.org/show_bug.cgi?id=182266
Reviewed by Ryosuke Niwa.
In a build request, owner commit of a commit is not always one of a commit in the commit set.
Build request api should contain owner commits in the 'commits' field of the return value.
* public/include/build-requests-fetcher.php: Added logic to fetch owner commits and added them into 'commits'.
* server-tests/api-build-requests-tests.js: Added a unit test.
* server-tests/resources/mock-data.js:
(MockData.set addTestGroupWithOwnerCommitNotInCommitSet): Added a test group with a build request, the commit set of which does
not contain owner commit of one commit.
2018-01-29 Ryosuke Niwa <rniwa@webkit.org>
Add the support for reporting Speedometer 2.0 results to perf dashboard
https://bugs.webkit.org/show_bug.cgi?id=182089
<rdar://problem/36172346>
Rubber-stamped by Chris Dumez.
Apparently, this has always worked since the very first version of the perf dashboard added in r163688.
The relevant code is at the line 313 of report-processor.php now.
Added regression tests for this feature since we didn't have any tests four years ago.
* server-tests/api-report-tests.js:
2018-01-29 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r225898): The perf dashboard fails to open when there are no summary pages
https://bugs.webkit.org/show_bug.cgi?id=182210
Rubber-stamped by Chris Dumez.
The bug was caused by TestFreshnessPage unconditionally assuming that summaryPageConfiguration is set.
Fixed it by not creating TestFreshnessPage when there are no summary pages specified.
Also modernized the code to use const & let instead of var.
* public/v3/main.js:
(main):
2018-01-29 Ryosuke Niwa <rniwa@webkit.org>
Perf dashboard's page title can be set to a previously visited page
https://bugs.webkit.org/show_bug.cgi?id=182209
Rubber-stamped by Chris Dumez.
Before this patch, opening a page and navigating away from it could result in the page title
getting set to that of the previously visited page after the new page had been opened.
This bug was caused by Page.render keep setting document.title even though the page is no longer
the currently open page of the router. Fixed it by exiting early in Page.enqueueToRender when
this page is not the currently open page of the router.
Also added basic tests for Page.
* browser-tests/index.html:
* browser-tests/page-tests.js: Added.
* public/v3/pages/page.js:
(Page): Removed the unused second constructor argument.
(Page.prototype.enqueueToRender): Fixed the bug.
(Page.prototype.render): Use const instead of var.
2018-01-29 Ryosuke Niwa <rniwa@webkit.org>
CommitLogViewer should not fetch commits in serial
https://bugs.webkit.org/show_bug.cgi?id=182207
Rubber-stamped by Chris Dumez.
Fetch both the commits in the range as well as the preceding commit at once instead of
fetching the preceding commit only after the commits in the range had been fetched.
* browser-tests/commit-log-viewer-tests.js: Fixed the tcoest case after r224227.
* public/v3/components/commit-log-viewer.js:
(CommitLogViewer.prototype._fetchCommitLogs): Fetch commits in parallel.
2018-01-24 Dewei Zhu <dewei_zhu@apple.com>
Check existence of 'node_modules_dir' before creating it.
https://bugs.webkit.org/show_bug.cgi?id=182040
Reviewed by Aakash Jain.
Fix the bug introduced in r227395.
* tools/run-tests.py: Added directory existence check.
2018-01-22 Dewei Zhu <dewei_zhu@apple.com>
Fix the bug that 'TestGroupResultsViewer' creates unnecessary rows.
https://bugs.webkit.org/show_bug.cgi?id=181967
Reviewed by Ryosuke Niwa.
Fixed a bug caused by a typo in CommitSet.equals, which makes it returns incorrect results for most
comparison between a CommitSet and a MeasurementCommitSet.
MeasurementCommitSet does not have full information for the commits, thus, it cannot build mappings
between root/patch/owner commit/requires build to repository. When querying whether a given repository
needs to be built, MeasurementCommitSet will return undefined. Due to 'undefined != false', this
equality check will fail. Making 'CommitSet.requiresBuildForRepository' defaults to 'false' would fix
this bug.
* public/v3/models/commit-set.js:
(CommitSet.prototype.requiresBuildForRepository): Make it return false when key does not exist
instead of 'undefined'.
(CommitSet.prototype.equals): Fixed the typo that causes the bug.
Use wrapped functions instead of querying the mapping directly.
* unit-tests/commit-set-tests.js: Added unit tests.
2018-01-18 Dewei Zhu <dewei_zhu@apple.com>
'run-test.py' script should make sure 'node_modules' directory exists before installing node packages.
https://bugs.webkit.org/show_bug.cgi?id=181808
Reviewed by Ryosuke Niwa.
'run-test.py' will fail if 'node_modules' does not exist before running this script.
Instead of calling 'os.chdir' to change directory, use 'cwd' in subprocess instead.
* tools/run-tests.py: Added the logic to ensure 'node_modules' exists.
Also use 'cwd' in subprocess.call instead of calling 'os.chdir' ahead.
2018-01-20 Dewei Zhu <dewei_zhu@apple.com>
Extend 'ifBuilt' config key to set property based on whether certain repositories are built or not.
https://bugs.webkit.org/show_bug.cgi?id=181906
Reviewed by Ryosuke Niwa.
Before this change, 'ifBuilt' will always set specified property for test properties as long as there
is a build type build in the same build request group. However, this is no longer valid as we don't
want to set specified property for testing when only owned commit is built in previous build.
'ifBuilt' needs to conditionally set property based on whether certain required repositories are built.
Empty required repository list means no requirement on repository to set property.
* tools/js/buildbot-syncer.js:
(BuildbotSyncer.prototype._propertiesForBuildRequest):In the case of 'built', only set property when
repository requirment is meet and there is a 'build' root request in the same build request group.
(BuildbotSyncer._parseRepositoryGroup): Extend 'ifBuild' to pass information based on contition.
* unit-tests/buildbot-syncer-tests.js: Added unit tests.
2018-01-19 Dewei Zhu <dewei_zhu@apple.com>
Should reject updating a build request which has an associated build.
https://bugs.webkit.org/show_bug.cgi?id=181893
Reviewed by Ryosuke Niwa.
Current code does not prevent submitting to same build request multiple times.
This could lead to a build losing its associated build request.
As a result, this build will be visible in charts which is not right.
Added a check when a build request is reported.
Addressed a 'FIXME' for the race condition inside ReportProcessor->resolve_build_id by surrounding
it with a database transaction.
* public/include/report-processor.php:
Wrap adding platform and resolve_build_id with a database transaction.
Add a check to make sure only a build request has no associated build can be updated.
* server-tests/api-report-tests.js: Added unit tests accordingly.
2018-01-18 Dewei Zhu <dewei_zhu@apple.com>
Should allow updating a build-request to 'canceled'.
https://bugs.webkit.org/show_bug.cgi?id=181819
Reviewed by Ryosuke Niwa.
It's possible syncing script update a build-request to 'canceled' state.
* public/api/build-requests.php: Added 'canceled' as an acceptable update state.
* server-tests/api-build-requests-tests.js: Added a unit test to update a build-request to 'canceled'.
2018-01-18 Aakash Jain <aakash_jain@apple.com>
Add support for builderNameToIDMap in BuildbotSyncer
https://bugs.webkit.org/show_bug.cgi?id=176526
Reviewed by Ryosuke Niwa.
* tools/js/buildbot-syncer.js:
(BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on.
(BuildbotSyncer._resolveBuildersWithPlatforms): Ditto.
(BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter.
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9.
(BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8.
(BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap.
* unit-tests/buildbot-syncer-tests.js: Updated unit-tests.
* server-tests/resources/mock-data.js:
(MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list.
(MockData.buildbotBuildersURL): Ditto for Buildbot 0.9
(MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8
(MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9
* server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle
newly added promise for fetching builders list from Buildbot.
* server-tests/tools-sync-buildbot-integration-tests.js: Ditto.
2018-01-18 Ryosuke Niwa <rniwa@webkit.org>
Charts can be empty when values are all identical
https://bugs.webkit.org/show_bug.cgi?id=181828
Reviewed by Alexey Proskuryakov.
Fixed the bug that when SampleVarianceUpperTriangularMatrix can store -Infinity as the initial cost
of some entries when the sample standard deviation between two points turns out to be 0,
and cause splitIntoSegmentsUntilGoodEnough to return undefiend because no segmentation has a finite cost.
Also fixed the bug that the time series chart fails to show any data points when all data points have
identical values as the entire y-coordinate gets collapsed to an empty value range by adjusting the max value
when min & max values are identical.
* public/v3/components/time-series-chart.js:
(TimeSeriesChart.prototype._ensureValueRangeCache): Raise the max slightly when min & max are identical
to avoid the chart becoming empty. Otherwise valueDiff in _computeVerticalRenderingMetrics becomes 0
and value-to-y-coordinate conversion always results in NaN.
* public/shared/statistics.js:
(Statistics..SampleVarianceUpperTriangularMatrix):
* unit-tests/statistics-tests.js: Added a test case.
2018-01-18 Ryosuke Niwa <rniwa@webkit.org>
Don't fetch more than two builds to check duplicity of builds in ReportProcessor
https://bugs.webkit.org/show_bug.cgi?id=181786
Reviewed by Wenson Hsieh.
Limit the number of builds to check to avoid using a lot of memory with a long delay.
* public/include/report-processor.php:
(ReportProcessor::resolve_build_id):
2018-01-17 Ryosuke Niwa <rniwa@webkit.org>
Rename config.json to config.json.sample
https://bugs.webkit.org/show_bug.cgi?id=181785
Reviewed by Wenson Hsieh.
* .gitignore: Added config.json.
* ReadMe.md: Updated the instruction.
* config.json.sample: Renamed from config.json.
2018-01-17 Ryosuke Niwa <rniwa@webkit.org>
Unreviewed build fixes in TestGroupResultsViewer.
* public/v3/components/test-group-results-viewer.js:
(TestGroupResultsViewer.prototype.render): _renderCurrentMetricsLazily was never called.
(TestGroupResultsViewer.prototype._buildRowForMetric): Don't try to render null or NaN.
2018-01-17 Ryosuke Niwa <rniwa@webkit.org>
Fix perf dashboard tests for node v8
https://bugs.webkit.org/show_bug.cgi?id=181782
Reviewed by Wenson Hsieh.
Fixed the various tests for node.js v8, which is the latest LTS version.
* server-tests/api-manifest-tests.js: Replaced the missing Triggerable.acceptsTest by Triggerable.acceptedTests
after r226836.
* server-tests/api-measurement-set-tests.js: Added "Z" to the end timestamps to force UTF timezone now that Date
in node.js parses using the local timezone by default.
* server-tests/resources/test-server.js:
(TestServer.prototype._restoreDataDirectory): Fixed the bug that this function was erroneously using the async
function to rename a directory per new warnings. This code was racy, and it used to cause a test error occasionally.
* server-tests/tools-os-build-fetcher-tests.js: Fixed the assertions to make it work in the latest node.js.
* unit-tests/measurement-set-tests.js:
(waitForMeasurementSet): Wait for setTimeout to cycle through all microtasks instead of just two microtask cycles.
2018-01-11 Ryosuke Niwa <rniwa@webkit.org>
Cannot trigger Dromaeo tests on internal perf try bots
https://bugs.webkit.org/show_bug.cgi?id=179712
Reviewed by Chris Dumez.
The bug was caused by CustomAnalysisTaskConfigurator only showing the top-level tests that are triggerable
instead of the list of highest level tests that are triggerable.
* public/v3/components/custom-analysis-task-configurator.js:
(CustomAnalysisTaskConfigurator.prototype.selectTests): Update the test group name when a new test is picked.
(CustomAnalysisTaskConfigurator.prototype.selectPlatform):
(CustomAnalysisTaskConfigurator.prototype._didUpdateSelectedPlatforms): Extracted from selectPlatform.
(CustomAnalysisTaskConfigurator.prototype._renderTriggerableTests): Include the list of all highest-level tests
which are triggerable.
(CustomAnalysisTaskConfigurator.prototype._renderRadioButtonList): Added labelForObject which returns the label
to be used in the list items. For tests, we want to use the full name, not just its label.
* public/v3/models/analysis-task.js:
(AnalysisTask.fetchById):
* public/v3/models/triggerable.js:
(Triggerable.prototype.acceptedTests): Added.
(Triggerable.prototype.acceptsTest): Deleted.
== Rolled over to ChangeLog-2018-01-01 ==