Commit Graph

115 Commits

Author SHA1 Message Date
Dewei Zhu 89b0ae63bb [perf dashboard] Add sequential mode for perf dashboard A/B testing.
https://bugs.webkit.org/show_bug.cgi?id=223886

Reviewed by Ryosuke Niwa.

Add 'testgroup_repetition_type' to 'analysis_test_groups' table to store repetition type which defaults to 'alternating'.
Add support to schedule 'sequential' A/B testing which schedules all iterations for the first configuration (A)
before the iterations for the second configuration (B).
Before this patch, all A/B testing alternated between two different configurations for each iteration.
Add retry logic for 'sequential' A/B testing.

Update syncing script to not proceed with next configuration the current configuration successfully completed
more iterations than the initially requested or retries exceeded the list.

Fix a potential race in syncing script that 'Promise.all' may cause test group not scheduled in order.

* browser-tests/test-group-form-tests.js: Updated and added unit tests.
* init-database.sql: Added 'testgroup_repetition_type' field to 'analysis_test_groups' table.
* migrate-database.sql: Updated migration script to conditionally add 'testgroup_repetition_type' field.
* public/api/test-groups.php: Added 'repetitionType' field in api return value.
* public/include/build-requests-fetcher.php: Fetching build requests under a triggerable should include test
group with all test groups finished but still need retry. This will allow syncing script to resolve the build
request by ID and block other request to be scheduled on the builder.
* public/include/commit-sets-helpers.php: Added code to create build requests based on test mode.
* public/privileged-api/add-build-requests.php: Added support to only add build requests to one commit set.
* public/privileged-api/create-analysis-task.php: Added 'repetitionType' support.
* public/privileged-api/create-test-group.php: Added 'repetitionType' support.
* public/privileged-api/update-test-group.php:
* public/shared/common-component-base.js:
* public/v3/components/custom-configuration-test-group-form.js: Added 'repetitionType' support.
(CustomConfigurationTestGroupForm.prototype.startTesting):
* public/v3/components/customizable-test-group-form.js:
(CustomizableTestGroupForm.prototype.startTesting):
* public/v3/components/test-group-form.js:
(TestGroupForm.prototype.startTesting):
* public/v3/models/analysis-task.js:
(AnalysisTask.async create):
(AnalysisTask):
* public/v3/models/build-request.js:
(BuildRequest):
(BuildRequest.prototype.updateSingleton): Allow build request order to be updated.
* public/v3/models/test-group.js:
(TestGroup):
(TestGroup.prototype.updateSingleton):
(TestGroup.prototype.repetitionType):
(TestGroup.prototype.repetitionCountForCommitSet): Refactored `repetitionCount` since repetition may be different
between configurations.
(TestGroup.prototype.hasRetries): A helper function to tell if a test group has retry runs.
(TestGroup.prototype.additionalRepetitionNeededToReachInitialRepetitionCount):
(TestGroup.prototype.successfulTestCount):
(TestGroup.prototype.isFirstTestRequest):
(TestGroup.prototype.precedingBuildRequest):
(TestGroup.prototype.retryCountForCommitSet):
(TestGroup.prototype.retryCountsAreSameForAllCommitSets):
(TestGroup.prototype.async _createAlternatingRetriesForTestGroup): Moved from 'retry-failed-build-requests' module.
(TestGroup.async _createSequentialRetriesForTestGroup): Moved from 'retry-failed-build-requests' module.
(TestGroup.prototype.async cancelPendingRequests):
(TestGroup.prototype.async didSendNotification):
(TestGroup.prototype.async addMoreBuildRequests):
(TestGroup.async createWithTask):
(TestGroup.async createWithCustomConfiguration):
(TestGroup.async createAndRefetchTestGroups):
(TestGroup.prototype.async scheduleMoreRequestsOrClearFlag): Moved from 'retry-failed-build-requests' module.
(TestGroup.async fetchById): Added support to fetch test group by ID.
* public/v3/pages/analysis-task-page.js:
(AnalysisTaskChartPane.prototype.didConstructShadowTree):
(AnalysisTaskResultsPane.prototype.didConstructShadowTree):
(AnalysisTaskConfiguratorPane.prototype.setTestGroups):
(AnalysisTaskConfiguratorPane):
(AnalysisTaskTestGroupPane.prototype.didConstructShadowTree):
(AnalysisTaskTestGroupPane.prototype._renderCurrentTestGroup):
(AnalysisTaskTestGroupPane.prototype._retrySummary):
(AnalysisTaskPage.prototype.didConstructShadowTree):
(AnalysisTaskPage.prototype.async _retryCurrentTestGroup):
(AnalysisTaskPage.prototype.async _bisectCurrentTestGroup):
(AnalysisTaskPage.set const):
(AnalysisTaskPage.prototype.async _createTestGroupAfterVerifyingCommitSetList):
(AnalysisTaskPage.prototype.async _createCustomTestGroup):
* public/v3/pages/chart-pane.js:
(ChartPane.prototype.didConstructShadowTree):
(ChartPane.prototype.async _analyzeRange):
* public/v3/pages/create-analysis-task-page.js:
(CreateAnalysisTaskPage.prototype.async _createAnalysisTaskWithGroup):
* server-tests/api-build-requests-tests.js: Added a unit test.
* server-tests/api-upload-root-tests.js: Updated unit tests.
* server-tests/privileged-api-add-build-requests-tests.js: Updated and added unit tests.
* server-tests/privileged-api-create-analysis-task-tests.js: Added unit tests.
* server-tests/privileged-api-create-test-group-tests.js: Updated and added unit tests.
* server-tests/privileged-api-update-test-group-tests.js: Updated and added unit tests.
* server-tests/resources/common-operations.js:
(async assertThrows):
* server-tests/resources/mock-data.js:
(MockData.addMockData):
(MockData.set addMockBuildRequestsWithRoots):
(MockData.set addAnotherMockTestGroup):
(MockData.set mockTestSyncConfigWithSingleBuilder):
(MockData.sampleBuildData):
* server-tests/tools-buildbot-triggerable-tests.js: Updated and added unit tests.
* server-tests/tools-sync-buildbot-integration-tests.js: Updated unit tests.
(async createTestGroupWithPatch):
(createTestGroupWihOwnedCommit):
* tools/js/buildbot-syncer.js:
(BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable):
(BuildbotSyncer.prototype.pullBuildbot):
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable):
(BuildbotTriggerable.prototype.async syncOnce):
(BuildbotTriggerable.prototype.async _scheduleRequest):
(BuildbotTriggerable.prototype._shouldDeferSequentialTestingRequestWithNewCommitSet):
* tools/js/measurement-set-analyzer.js:
(MeasurementSetAnalyzer.prototype.async _analyzeMeasurementSet):
(MeasurementSetAnalyzer):
* tools/js/retry-failed-build-requests.js: Removed.
* tools/run-analysis.js: Use updated API to retry.
(async analysisLoop):
(async processTestGroupMayNeedMoreRequests):
* tools/sync-buildbot.js: Added command line option '--max-retry-factor'.
* unit-tests/analysis-task-tests.js: Updated unit tests.
* unit-tests/buildbot-syncer-tests.js: Updated unit tests.
(createSampleBuildRequest):
* unit-tests/measurement-set-analyzer-tests.js:
* unit-tests/retry-failed-build-requests-tests.js: Moved unit tests to test-group-tests.js.
* unit-tests/test-groups-tests.js: Added unit tests from 'retry-failed-build-requests-tests.js'.

Canonical link: https://commits.webkit.org/238151@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-26 01:23:22 +00:00
Zhifei Fang ab46e31307 Support Commit revision identifier in the Chart
https://bugs.webkit.org/show_bug.cgi?id=224496

Reviewed by Dewei Zhu.

In the measurement-set, we include the commit info but not the commit revision identifier column.
Make the API return the commit revision identifier as part of the commit data.

* browser-tests/customizable-test-group-form-tests.js: Fix flaky tests.
* browser-tests/index.html: Add commit revision identifier info.
* browser-tests/time-series-chart-tests.js: Fix flaky tests.
* public/api/measurement-set.php: Make this API provide commit revision identifier info.
* public/include/build-requests-fetcher.php: Ditto.
* public/v3/models/commit-set.js: Make the commit model can be constructed with the API respose format.
* server-tests/api-measurement-set-tests.js: Adding test for commit revision identifier.
* server-tests/api-build-requests-tests.js: Ditto.
* unit-tests/analysis-task-tests.js: Ditto.
(measurementCluster):
* unit-tests/commit-set-tests.js: Ditto.
* unit-tests/measurement-adaptor-tests.js: Ditto.
* unit-tests/measurement-set-tests.js: Ditto.


Canonical link: https://commits.webkit.org/236545@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275993 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-15 03:06:39 +00:00
Zhifei Fang af6d04af4e Add commit revision label support
https://bugs.webkit.org/show_bug.cgi?id=222897

Reviewed by Ryosuke Niwa.

Add new column revision label.
Make all commit api also can work with revision label.
Change the commit label display with commit revision label.

* browser-tests/commit-log-viewer-tests.js: Fix a failed test case, while requesting the remote api,
we should wait for those promises resolved and then wait for commponent to render.
* init-database.sql: Add new column revision_identifier.
* migrate-database.sql: Add new column revision_identifier.
* public/include/commit-log-fetcher.php: Make api that works with revision should work with revision label.
* public/include/commit-updater.php: Ditto.
* public/include/report-processor.php: Make the processor can also insert revision label.
* public/v3/models/commit-log.js:
(CommitLog.prototype.updateSingleton):
(CommitLog.prototype.revisionIdentifier):
(CommitLog.prototype.label): Make the label include revision label and revision.
(CommitLog.prototype.diff): Make the diff label include revision label and revision.
* server-tests/api-commits-tests.js:
* server-tests/api-report-commits-tests.js:
* server-tests/api-report-tests.js:
(reportWithRevisionIdentifierCommit):
* unit-tests/commit-log-tests.js:


git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275329 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Canonical link: https://commits.webkit.org/236004@main
2021-04-01 00:50:11 +00:00
Dewei Zhu b8badda33f [perf dashboard] Remove non-inclusive words from perf dashboard.
https://bugs.webkit.org/show_bug.cgi?id=223505

Reviewed by Ryosuke Niwa.

Removed most of non-inclusive terminology and replaced it with 'worker'.
Make impacted APIs backward compatible during transition.
The non-inclusive terminology will be removed after transition.

* ReadMe.md: Removed non-inclusive words.
* init-database.sql: Rename tables with non-inclusive words.
* migrate-database.sql: Added migration SQL for existing database.
* public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php.
* public/api/build-requests.php:
* public/api/measurement-set.php:
* public/api/report-commits.php:
* public/api/runs.php:
* public/api/update-triggerable.php:
* public/api/upload-root.php:
* public/include/admin-header.php:
* public/include/json-header.php:
* public/include/report-processor.php:
* public/privileged-api/add-build-requests.php:
* public/privileged-api/create-analysis-task.php:
* public/privileged-api/create-test-group.php:
* public/privileged-api/update-test-group.php:
* public/v2/js/ember.js:
* server-tests/api-build-requests-tests.js:
* server-tests/api-commits-tests.js:
* server-tests/api-report-commits-tests.js:
* server-tests/api-report-tests.js:
(emptyReport):
(reportWitMismatchingCommitTime):
(reportWithOneSecondCommitTimeDifference):
(emptyWorkerReport):
(emptySlaveReport): Deleted.
* server-tests/api-test-groups.js:
* server-tests/api-update-triggerable-tests.js:
(updateWithOSXRepositoryGroup):
(updateWithMacWebKitRepositoryGroups):
* server-tests/api-upload-root-tests.js:
(makeReport):
(addWorkerAndCreateRootFile):
* server-tests/privileged-api-add-build-requests-tests.js:
(async createAnalysisTask):
(async addTriggerableAndCreateTask):
* server-tests/privileged-api-create-analysis-task-tests.js:
* server-tests/privileged-api-create-test-group-tests.js:
(createAnalysisTask):
* server-tests/privileged-api-update-test-group-tests.js:
(async createAnalysisTask):
(async addTriggerableAndCreateTask):
* server-tests/resources/common-operations.js:
* server-tests/resources/mock-data.js:
(MockData.addMockConfiguration):
(MockData.set mockTestSyncConfigWithSingleBuilder):
(MockData.sampleBuildData):
* server-tests/resources/test-server.js:
(TestServer.prototype.testConfig):
* server-tests/tools-buildbot-triggerable-tests.js:
* server-tests/tools-os-build-fetcher-tests.js:
* server-tests/tools-sync-buildbot-integration-tests.js:
(createTriggerable):
* tools/detect-changes.js:
(loadServerConfig):
* tools/js/buildbot-syncer.js:
(BuildbotBuildEntry.prototype.buildTag):
(BuildbotSyncer):
(BuildbotSyncer.prototype.scheduleRequest):
(BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable):
(BuildbotSyncer.prototype.pullBuildbot):
(BuildbotSyncer._loadConfig):
(BuildbotSyncer._validateAndMergeConfig):
(BuildbotBuildEntry.prototype.slaveName): Deleted.
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable):
(BuildbotTriggerable.prototype.updateTriggerable):
(BuildbotTriggerable.prototype.async syncOnce):
(BuildbotTriggerable.prototype.async _scheduleRequest):
(BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable):
(BuildbotTriggerable.prototype._scheduleRequestWithLog):
(BuildbotTriggerable._testGroupMapForBuildRequests):
(BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted.
* tools/js/database.js:
* tools/js/os-build-fetcher.js:
(prototype.async _reportCommits):
* tools/js/privileged-api.js:
(NodePrivilegedAPI.prototype.sendRequest):
(NodePrivilegedAPI.configure):
(NodePrivilegedAPI):
* tools/pull-os-versions.py:
(OSBuildFetcher.fetch_and_report_new_builds):
* tools/run-analysis.js:
(async analysisLoop):
* tools/sync-buildbot.js:
(syncLoop.const.makeTriggerable):
(syncLoop):
* tools/sync-commits.py:
(Repository.fetch_commits_and_submit):
* tools/sync-os-versions.js:
(syncLoop):
* tools/util.py:
(submit_commits):
* unit-tests/analysis-task-tests.js:
* unit-tests/buildbot-syncer-tests.js:
(sampleiOSConfig):
(sampleBuildData):
(async const):
* unit-tests/checkconfig.js:
* unit-tests/measurement-set-analyzer-tests.js:
* unit-tests/privileged-api-tests.js:
* unit-tests/retry-failed-build-requests-tests.js:
* unit-tests/test-groups-tests.js:

Canonical link: https://commits.webkit.org/235601@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
Ryosuke Niwa 7af0be0ba6 [perf dashboard] Modernize MeasurementSet
https://bugs.webkit.org/show_bug.cgi?id=222857

Reviewed by Dewei Zhu.

Modernized MeasurementSet by using new instance field syntax, let/const instead of var,
async/await instead of then/catch, and Map instead of an object as a dictionary.

* public/v3/models/measurement-set.js:
(Array.prototype.includes): Deleted this polyfill which was needed for an old node.js.
(MeasurementSet): Moved the initialization of instance variables here. Also use Map
for this._allFetches instead of using a regular object as a dictionary.
(MeasurementSet.findSet): Use Map for MeasurementSet mapping.
(MeasurementSet.prototype.findClusters): Use const and let instead of var.
(MeasurementSet.prototype.async fetchBetween): Use async & await instead of Promise.then.
(MeasurementSet.prototype._ensureClusterPromise): Use let/const instead of var.
(MeasurementSet.prototype._urlForCache): Renamed from _constructUrl and removed the argument
for useCache since this function is now only used for feteching JSON caches.
(MeasurementSet.async _fetchPrimaryCluster): Use async/await and let/const. Consolidated
the API call to re-generate new JSON files and inlined API path here.
(MeasurementSet.async _fetchSecondaryCluster): Use async/await.
(MeasurementSet._addFetchedCluster): Use let/const instead of var.
(MeasurementSet.async fetchSegmentation): Use async/await and let/const.
(MeasurementSet.async _cachedClusterSegmentation): Ditto.
(MeasurementSet.prototype.async _invokeSegmentationAlgorithm): Ditto.
* unit-tests/measurement-set-tests.js:
(beforeEach): Updated the logic to reset measurement sets since the static variable was
renamed in MeasurementSet.findSet above.
* unit-tests/resources/mock-v3-models.js:
(MockModels.inject): Ditto.


Canonical link: https://commits.webkit.org/234979@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274043 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-07 00:25:00 +00:00
Zhifei Fang a0d6c992e5 Make server test run with new node version
https://bugs.webkit.org/show_bug.cgi?id=222463

Change assert.equal to assert.strictEqual since node deprecated this API
Add a new function console.assert to make sure it will throw an error

Reviewed by Ryosuke Niwa.

* public/v3/models/repository.js:
(Repository.sortByNamePreferringOnesWithURL):
(Repository):
* server-tests/admin-platforms-tests.js:
* server-tests/admin-reprocess-report-tests.js:
* server-tests/api-build-requests-tests.js:
(return.TestServer.remoteAPI.getJSON.string_appeared_here.then):
* server-tests/api-commits-tests.js:
(assertCommitIsSameAsOneSubmitted):
(return.TestServer.remoteAPI.getJSON.string_appeared_here.then):
* server-tests/api-manifest-tests.js:
(return.TestServer.remoteAPI.getJSON.string_appeared_here.then):
* server-tests/api-measurement-set-tests.js:
* server-tests/api-report-commits-tests.js:
(emptyReport.then):
(async initialReportCommits):
(async setUpTestsWithExpectedStatus):
(async testWithExpectedFailure):
* server-tests/api-report-tests.js:
(emptyReport.then):
* server-tests/api-test-groups.js:
* server-tests/api-update-triggerable-tests.js:
(update.then):
(then.response.db.selectAll.string_appeared_here.then):
(then.db.selectAll.string_appeared_here.then):
(then.Manifest.fetch.then):
* server-tests/api-upload-root-tests.js:
* server-tests/api-uploaded-file-tests.js:
(return.TestServer.remoteAPI.getJSON.string_appeared_here.then):
* server-tests/privileged-api-add-build-requests-tests.js:
(async createAnalysisTask):
(const.commitSet.of.updatedGroups.0.requestedCommitSets):
* server-tests/privileged-api-create-analysis-task-tests.js:
* server-tests/privileged-api-create-test-group-tests.js:
(createAnalysisTask):
(return.createAnalysisTask.string_appeared_here.then):
(return.addTriggerableAndCreateTask.string_appeared_here.then):
(string_appeared_here.then):
* server-tests/privileged-api-upate-run-status.js:
* server-tests/privileged-api-update-test-group-tests.js:
(async createAnalysisTask):
* server-tests/privileged-api-upload-file-tests.js:
(TestServer.testConfig.uploadFileLimitInMB.1.then):
* server-tests/resources/common-operations.js:
(async assertThrows):
* server-tests/resources/temporary-file.js:
(TemporaryFile.makeTemporaryFileOfSizeInMB):
* server-tests/tools-buildbot-triggerable-tests.js:
(assertRequestAndResolve):
(then.refetchManifest.then):
(getBuilderNameToIDMapPromise.then):
* server-tests/tools-os-build-fetcher-tests.js:
* server-tests/tools-sync-buildbot-integration-tests.js:
(assertAndResolveRequest):
* tools/js/assert-override.js: Added.
(makeConsoleAssertThrow):
* tools/js/buildbot-syncer.js:
(BuildbotBuildEntry.prototype.initialize):
(BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded):
(BuildbotBuildEntry):
(BuildbotSyncer.prototype.scheduleRequest):
(BuildbotSyncer._loadConfig):
(BuildbotSyncer._parseRepositoryGroup):
(BuildbotSyncer._validateAndMergeConfig):
(BuildbotSyncer):
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype._validateRequests):
* tools/js/markup-component.js:
(const.MarkupDocument.new.MarkupDocument.prototype._idForClone):
(const.MarkupDocument.new.MarkupDocument.prototype.markup):
* tools/js/os-build-fetcher.js:
(prototype._addOwnedCommitsForBuild):
* tools/js/remote.js:
(NodeRemoteAPI.prototype.configure):
* tools/js/v3-models.js:
* unit-tests/commit-set-tests.js:


Canonical link: https://commits.webkit.org/234972@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
Dewei Zhu 50982a704b Fix a bug that a syncing script may try to reuse a delete root.
https://bugs.webkit.org/show_bug.cgi?id=222144

Reviewed by Ryosuke Niwa.

UploadedFile.deletedAt is not returned by API which makes UploadedFile instance always claims
the file it not deleted.
Fix a logical bug in CommitSet.areAllRootsAvailable.

* public/include/uploaded-file-helpers.php: Include 'deletedAt' filed in the API response.
* public/v3/models/commit-set.js:
(CommitSet.prototype.areAllRootsAvailable): Fixed an syntax error and a logical bug.
* server-tests/api-build-requests-tests.js: Added check on 'deletedAt' to be set on deleted files.
* unit-tests/commit-set-tests.js: Added unit tests for CommitSet.areAllRootsAvailable.
* unit-tests/resources/mock-v3-models.js: Cleared static map for UploadedFile.

Canonical link: https://commits.webkit.org/234315@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-19 02:10:28 +00:00
Roy Reapor d605526623 perf.webkit.org/tools/js/analysis-results-notifier.js should allow sending of completion emails regardless of test name
https://bugs.webkit.org/show_bug.cgi?id=221712

Patch by Roy Reapor <rreapor@apple.com> on 2021-02-12
Reviewed by Dewei Zhu.

Rule `platforms` and `tests` can be undefined, an empty array, or an array of strings. Undefined will match everything.
Empty array will match nothing. Array of strings will match items in the array.

Rule will not match if either `tests` or `platforms` is an empty array.

* tools/js/analysis-results-notifier.js:
(AnalysisResultsNotifier._validateRules.isUnderfinedOrEmptyArrayOrArrayOfStrings):
- `platforms` and `tests` can now be undefined or an empty array officially
(AnalysisResultsNotifier._validateRules):
- switched to `assert.ok()`. `console.assert()` no longer throws since node v10 (https://github.com/facebook/jest/issues/5634)
- both rule `platforms` and `tests` must pass `isUnderfinedOrEmptyArrayOrArrayOfStrings()`. previously, rules like `{tests: [1, 3], platforms: ['speedometer']}` passes validation.
(AnalysisResultsNotifier._applyUpdate):
- switched to `assert.ok()`. `console.assert()` no longer throws since node v10 (https://github.com/facebook/jest/issues/5634)
(AnalysisResultsNotifier._validateRules.isNonemptyArrayOfStrings): Deleted.
* unit-tests/analysis-results-notifier-tests.js:
- added a bunch of unittests
- specify the exact regex match for `assert.throws()` and `assert.doesNotThrow()` argument.

Canonical link: https://commits.webkit.org/234049@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-12 22:29:04 +00:00
Dewei Zhu 1df4437b73 Add max age for a root to be reused.
https://bugs.webkit.org/show_bug.cgi?id=219628

Reviewed by Ryosuke Niwa.

In order to prevent reusing a stale root, we should set a limit on the age of a root to be reused.
* public/include/manifest-generator.php: Added 'maxRootReuseAgeInDays' to manifest.
* public/v3/models/build-request.js: Added root age check.
(BuildRequest.prototype.async findBuildRequestWithSameRoots):
* public/v3/models/commit-set.js: Extended 'areAllRootsAvailable' with root age check.
(CommitSet.prototype.areAllRootsAvailable):
* public/v3/models/manifest.js:
(Manifest.fetch): Made it async.
(Manifest.async fetchRawResponse): Extract fetching raw manifest out so that 'maxRootReuseAgeInDays'
can be read without resetting other data models. Also added code to only fetch from API if requesting
/data/manifest.json returns 404.
(Manifest._didFetchManifest):
* server-tests/api-manifest-tests.js: Updated unit tests.
* unit-tests/build-request-tests.js: Updated unit tests and add new tests.
* unit-tests/manifest-test.js: Added unit tests.

Canonical link: https://commits.webkit.org/232274@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-09 23:13:28 +00:00
Dewei Zhu b60df63300 Performance dashboard should avoid building same configuration under one analysis task.
https://bugs.webkit.org/show_bug.cgi?id=218413

Reviewed by Ryosuke Niwa.

Add logic in syncing script to reuse already built roots from same build request under current analysis task.
If there is another same build request scheduled/running, will defer scheduling current build request.

* public/admin/platforms.php: Fixed newer version of PHP warns on accessing invalid key in an array.
* public/admin/tests.php: Added a null check against $selected_parent.
* public/api/build-requests.php: Extended this API to allow reusing roots from existing build request.
* public/v3/models/build-request.js:
(BuildRequest.prototype.async findBuildRequestWithSameRoots): Find build type build request with same commit set
which can/will be reused under current analysis task.
* public/v3/models/commit-set.js:
(CommitSet.prototype.equalsIgnoringRoot): Added a helper function which checks commit set equality ignoring the root.
(CommitSet.prototype.equals): Use '_equalsOptionallyIgnoringRoot' as underlying implementation.
(CommitSet.prototype._equalsOptionallyIgnoringRoot): Implementation for both equals and equalsIngnoringRoot.
* server-tests/api-build-requests-tests.js: Added unit tests.
* server-tests/resources/mock-data.js: Added new mock data for new unit tests.
(MockData.addMockConfiguration):
(MockData.addMockData):
(MockData.set addMockBuildRequestsWithRoots):
(MockData.set addTwoMockTestGroupWithOwnedCommits):
(MockData.mockTestSyncConfigWithPatchAcceptingBuilder):
* server-tests/tools-buildbot-triggerable-tests.js: Added unit tests.
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype.async syncOnce):
(BuildbotTriggerable.prototype.async _scheduleRequest): A helper function to reuse the roots if there are built
roots available for same build type build request. If there is another build scheduled for same build request,
will defer scheduling the build request.
* unit-tests/build-request-tests.js: Add unit tests.

Canonical link: https://commits.webkit.org/231628@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269871 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-16 20:32:08 +00:00
Dewei Zhu 6dba7ea899 Fix and update performance dashboard tests
https://bugs.webkit.org/show_bug.cgi?id=218222

Reviewed by Ryosuke Niwa.

* public/api/upload-root.php: Add a null check against empty array
when accessing invalid key which will show warning since php 7.4.
Per https://wiki.php.net/rfc/notice-for-non-valid-array-container.
* server-tests/tools-sync-buildbot-integration-tests.js:
Fixed a unit test that assumes build request IDs under one test group is
one after another. This assumption is wrong when 'StartServers' under
'mpm_prefork_module' is set more than one in apache config.
Fixed antoher incorrect unit test.
* unit-tests/analysis-results-notifier-tests.js:
Fixed unit tests which incorrectly used 'assert.throws' per
https://nodejs.org/docs/latest-v7.x/api/assert.html#assert_assert_throws_block_error_message.

Canonical link: https://commits.webkit.org/230917@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269026 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-27 08:21:48 +00:00
Dewei Zhu 32af431d81 Add SSL support for peformance dashboard database connection.
https://bugs.webkit.org/show_bug.cgi?id=203426

Reviewed by Ryosuke Niwa.

Performance dashboard should allow connecting Postgres database with SSL.

* public/include/db.php: Add SSL configuration to connection string if specified.
* tools/js/database.js: Add SSL configuration to connection string if specified.
(Database.prototype._prepareSSLConfig):
(Database.prototype.connect):
* unit-tests/checkconfig.js: Added unit tests for optional ssl fields.

Canonical link: https://commits.webkit.org/216834@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-25 22:41:27 +00:00
Dewei Zhu 977e2c2e6e Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases.
https://bugs.webkit.org/show_bug.cgi?id=203270

Reviewed by Ryosuke Niwa.

Rename "build_number" to "build_tag" to fit more generic use cases.
Add support to be backward compatible to accept reports contain either
"buildNumber" or "buildTag".

* browser-tests/index.html:
* init-database.sql:
* migrate-database.sql: Updated migration sql for this change.
* public/admin/test-configurations.php:
* public/api/measurement-set.php:
* public/api/runs.php:
* public/api/upload-root.php: Added support for both "buildNumber" and "buildTag".
* public/include/report-processor.php: Added support for both "buildNumber" and "buildTag".
* public/v3/models/builder.js:
(Builder.prototype.urlForBuild):
(Builder):
(Build):
(Build.prototype.buildTag):
(Build.prototype.label):
(Build.prototype.url):
(Build.prototype.buildNumber): Deleted.
* public/v3/models/measurement-adaptor.js:
(MeasurementAdaptor):
(MeasurementAdaptor.prototype.applyTo.return.build):
* public/v3/pages/chart-pane-status-view.js:
* public/v3/pages/test-freshness-page.js:
(TestFreshnessPage.prototype._renderTooltip):
* server-tests/admin-platforms-tests.js:
(reportsForDifferentPlatforms):
* server-tests/admin-reprocess-report-tests.js:
* server-tests/api-commits-tests.js:
* server-tests/api-manifest-tests.js:
* server-tests/api-measurement-set-tests.js:
* server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag".
(emptyReport):
(reportWitMismatchingCommitTime):
(reportWithOneSecondCommitTimeDifference):
(emptySlaveReport):
(makeReport):
(reportWithSameSubtestName):
* server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag".
* server-tests/privileged-api-add-build-requests-tests.js:
* server-tests/privileged-api-create-analysis-task-tests.js:
* server-tests/privileged-api-create-test-group-tests.js:
(createAnalysisTask):
* server-tests/privileged-api-upate-run-status.js:
* server-tests/privileged-api-update-test-group-tests.js:
(async.createAnalysisTask):
* server-tests/resources/mock-data.js:
(MockData.addMockConfiguration):
(MockData.sampleBuildData):
(MockData.finishedBuildData):
* server-tests/tools-sync-buildbot-integration-tests.js:
* tools/js/buildbot-syncer.js:
(BuildbotBuildEntry.prototype.initialize):
(BuildbotBuildEntry.prototype.buildTag):
(BuildbotBuildEntry.prototype.url):
(BuildbotSyncer.prototype.urlForBuildTag):
(BuildbotBuildEntry.prototype.buildNumber): Deleted.
(BuildbotSyncer.prototype.urlForBuildNumber): Deleted.
* unit-tests/analysis-task-tests.js:
(measurementCluster):
* unit-tests/buildbot-syncer-tests.js:
* unit-tests/measurement-adaptor-tests.js:
* unit-tests/measurement-set-analyzer-tests.js:
* unit-tests/measurement-set-tests.js:
* unit-tests/resources/mock-v3-models.js:

Canonical link: https://commits.webkit.org/216795@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
Dewei Zhu 6d111173e8 Provide build request status description information on dashboard.
https://bugs.webkit.org/show_bug.cgi?id=199810

Reviewed by Ryosuke Niwa.

Add build request status description to show detailed information for a build and show it in dashboard.
Update SQL for existing instance:
    ALTER TABLE build_requests ADD COLUMN IF NOT EXISTS request_status_description varchar(1024) DEFAULT NULL;

* ReadMe.md: Updated instructions for initializing a database to include running 'migrate-database.sql'.
* init-database.sql: Added request_status_description column.
* migrate-database.sql: A file stores migration SQL for existing instance.
* public/api/build-requests.php: Added support for updating request_status_description.
* public/include/build-requests-fetcher.php: Exposed `statusDescription` to API.
* public/v3/components/test-group-revision-table.js: Added UI for showing build request status detail.
(TestGroupRevisionTable.prototype._renderTable):
(TestGroupRevisionTable.prototype._buildDescriptionCell):
(TestGroupRevisionTable.cssTemplate):
* public/v3/components/warning-icon.js: Extended warning icon to be able to customize information on hover.
(WarningIcon):
(WarningIcon.prototype.render):
* public/v3/components/button-base.js: Added a instance method to set button title.
(ButtonBase.prototype.setButtonTitle):
* public/v3/models/build-request.js: Added 'statusDescription' field.
(BuildRequest):
(BuildRequest.prototype.updateSingleton):
(BuildRequest.prototype.statusDescription):
* server-tests/api-build-requests-tests.js: Fixed unit tests.
* server-tests/resources/mock-data.js:
(MockData.set mockTestSyncConfigWithSingleBuilder): Added 'status_description' in buildbot mock data.
(MockData.sampleBuildData):
* server-tests/resources/test-server.js:
(TestServer.prototype.initDatabase): Added code to execute 'migrate-database.sql' on initialization.
* server-tests/tools-sync-buildbot-integration-tests.js: Added unit tests.
* tools/js/buildbot-syncer.js: Added 'statusDescription' field to 'BuildbotBuildEntry'.
(BuildbotBuildEntry.prototype.initialize):
(BuildbotBuildEntry.prototype.statusDescription):
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers):
* unit-tests/buildbot-syncer-tests.js: Added test code for BuildbotBuildEntry.statusDescription.

Canonical link: https://commits.webkit.org/215881@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-27 22:45:12 +00:00
Dewei Zhu 9acf5e469c Use 12 digits to show a git commit.
https://bugs.webkit.org/show_bug.cgi?id=200067

Reviewed by Ryosuke Niwa.

Use 12 digits to show a git commit to reasonably descrease commit prefix collision probability
for repository with large amount of commits.

* public/v3/models/commit-log.js: Increase digits from 8 to 12 for git SHA.
(CommitLog.prototype.label):
(CommitLog.prototype.diff):
* unit-tests/commit-log-tests.js: Updated unit tests.
* unit-tests/commit-set-tests.js: Updated unit tests.

Canonical link: https://commits.webkit.org/213907@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247770 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-07-24 17:10:28 +00:00
Dewei Zhu 41ef63c488 Customizable test group form should allow user to supply a revision prefix of a commit and revision starts with 'r'.
https://bugs.webkit.org/show_bug.cgi?id=198940

Reviewed by Ryosuke Niwa.

Customizable test group form should adapt prefix matching when fetching for a commit.

* browser-tests/customizable-test-group-form-tests.js: Updated and added unit tests.
* public/v3/components/customizable-test-group-form.js: Removed loggings those a unintentionally committed.
* public/v3/models/commit-set.js: Adapted prefix matching API when fetching a commit.
(IntermediateCommitSet.prototype._fetchCommitLogAndOwnedCommits):
* unit-tests/commit-set-tests.js: Updated unit tests accordingly.

Canonical link: https://commits.webkit.org/212973@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246581 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-06-19 05:12:35 +00:00
Dewei Zhu cd7f6e0966 Custom analysis task configurator should allow supplying commit prefix and revision starts 'r'.
https://bugs.webkit.org/show_bug.cgi?id=198847

Reviewed by Ryosuke Niwa.

Custom analysis task configurator should not require full SHA to start an A/B test.
Custom analysis task configurator should accept svn revision starts with 'r'.

* browser-tests/custom-analysis-task-configurator-tests.js: Added a unit test for this change.
* public/api/commits.php: Extend this API to allow prefix matching when fethcing a single commit.
* public/include/commit-log-fetcher.php: Added a function to fetch a commit with prefix.
* public/v3/components/custom-analysis-task-configurator.js: Add UI support for accepting partial revision.
(CustomAnalysisTaskConfigurator.prototype._computeCommitSet):
(CustomAnalysisTaskConfigurator.prototype.async._resolveRevision):
(CustomAnalysisTaskConfigurator.prototype._buildTestabilityList):
* public/v3/models/commit-log.js:
(CommitLog.async.fetchForSingleRevision): Added third argument to specify prefix matching which defaults to false.
* server-tests/api-commits-tests.js: Added unit tests.
* unit-tests/commit-log-tests.js: Added a unit test.

Canonical link: https://commits.webkit.org/212914@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246522 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-06-17 23:11:59 +00:00
Dewei Zhu 1acdf86d5a Perf dashboard erroneously rejects a build request to build owned components when there are no patches.
https://bugs.webkit.org/show_bug.cgi?id=197928

Reviewed by Ryosuke Niwa.

Fix a bug that build type build request that only builds owned components failed to pass sanity check when there
is no repository accepts patch in triggerable repository group.
Add a sanity check to throw an error when build request type is build but there is no repository group template.

* tools/js/buildbot-syncer.js:
(BuildbotSyncer.prototype._propertiesForBuildRequest): Changed sanity check the always requires repository accepts patch when there is a build to make it also works for build request only builds owned components.
(BuildbotSyncer._parseRepositoryGroup): Added check for repository group templates not null  when build requiest type is build.
* unit-tests/buildbot-syncer-tests.js: Added unit tests for this change.
* unit-tests/resources/mock-v3-models.js: Added mock date for unit tests.

Canonical link: https://commits.webkit.org/212186@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245616 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-05-22 06:15:58 +00:00
Dewei Zhu dcccae82a1 Analyzing a chart that does not exist should not halt whole run-analysis script.
https://bugs.webkit.org/show_bug.cgi?id=193563

Reviewed by Ryosuke Niwa.

Halting whole run-analysis script while there is any invalid chart specified in Manifest makes the script fragile.
Run-analysis is also responsible for adding retry and sending notification which should not be block by this error.
Skipping analyzing the corresponding configuration seems reasonable.

* public/v3/models/measurement-set.js:
(MeasurementSet.prototype._ensureClusterPromise): Only add callback when callback is specified.
This will help to fix 'UnhandledPromiseRejectionWarning' while running the test.
* tools/js/measurement-set-analyzer.js:
(MeasurementSetAnalyzer.prototype.async._analyzeMeasurementSet): Catch the exception while failing to fetch a measurement set and skip the analysis for this config.
* unit-tests/measurement-set-analyzer-tests.js: Added unit tests for this.

Canonical link: https://commits.webkit.org/208219@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-01-23 04:28:57 +00:00
Dewei Zhu 55866b7cb7 Extend commits table to contain testability information.
https://bugs.webkit.org/show_bug.cgi?id=191557

Reviewed by Ryosuke Niwa.

Added the ability to store testability message in commits table.
Refactored '/api/report-commits' to support update commit only.
Updated os version syncing script to be able to update testability information.

* init-database.sql: Added 'commit_testability' field to 'commits' table.
* public/api/report-commits.php: Refactor this api to allow only update existing commits.
* public/include/commit-log-fetcher.php: Expose testability warning information in this API.
* public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update.
* public/v3/models/commit-log.js: CommitLog object should expose testability warning information.
(CommitLog.prototype.updateSingleton):
(CommitLog.prototype.testability):
* public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and
IntermediateCommitSet instances.
(CommitSet.prototype.commitsWithTestability):
(CommitSet.prototype.commits):
(IntermediateCommitSet.prototype.commitsWithTestability):
(IntermediateCommitSet.prototype.commits):
* server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`.
* server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests.
* tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings.
(async.fetchReportAndUpdateCommits):
(prototype.async.fetchReportAndUpdateBuilds):
(prototype.async._fetchAvailableBuilds):
(prototype.async._commitsForAvailableBuilds):
(prototype._commitsWithinRange):
(prototype.async._reportCommits):
(fetchAndReportAllInOrder): Deleted.
(prototype.fetchAndReportNewBuilds): Deleted.
(prototype._fetchAvailableBuilds): Deleted.
(prototype._commitsForAvailableBuilds): Deleted.
(prototype._submitCommits): Deleted.
* tools/sync-os-versions.js:
* unit-tests/commit-log-tests.js: Added a unit test for 'testability'.
* unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'.

Canonical link: https://commits.webkit.org/207523@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
Dewei Zhu 5b1b4d8c3b Add cache for CommitLog objects to avoid refetching same commit.
https://bugs.webkit.org/show_bug.cgi?id=191621

Reviewed by Ryosuke Niwa.

Added a cache for fully fetched commit log objects to avoid refetching.

* public/v3/models/commit-log.js:
(CommitLog): Added assertion for id.
Removed unused 'remoteId' as it has been removed since r198479.
(CommitLog.async.fetchBetweenRevisions): Turned it into async function.
(CommitLog.async.fetchForSingleRevision): Added the logic to check cache before fetching.
(CommitLog._constructFromRawData): Added logic to add entries to cache.
* public/v3/models/commit-set.js: Fixed measurement set not passing commit id while constructing a
commit log object.
* public/v3/models/repository.js: Added the ability to track fetched commit for certain repository.
(Repository.commitForRevision): Returns a commit for given revision.
(Repository.setCommitForRevision): Sets commit for a given revision.
* unit-tests/commit-log-tests.js: Added unit tests for this change.
Fixed existing tests.
* unit-tests/commit-set-range-bisector-tests.js: Fixed unit tests.
* unit-tests/commit-set-tests.js: Fixed unit tests.

Canonical link: https://commits.webkit.org/206371@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-14 07:36:34 +00:00
Dewei Zhu 45b1c1666a Add retry for test groups with failed build requests.
https://bugs.webkit.org/show_bug.cgi?id=190188

Reviewed by Ryosuke Niwa.

Added retry logic in run-analysis script.
Current retry logic will only be triggered when there is at least one successful build request for each commit set
in a test group.

* init-database.sql: Added 'testgroup_initial_repetition_count' and 'testgroup_may_need_more_requests'.
SQL to update existing database:
'''
BEGIN;
    ALTER TABLE analysis_test_groups
        ADD COLUMN testgroup_initial_repetition_count integer DEFAULT NULL,
        ADD COLUMN testgroup_may_need_more_requests boolean DEFAULT FALSE;
    UPDATE analysis_test_groups SET testgroup_initial_repetition_count = (
        SELECT DISTINCT(COUNT(*)) FROM build_requests WHERE request_group = testgroup_id AND request_order >= 0 GROUP BY request_commit_set
    );
    ALTER TABLE analysis_test_groups ALTER COLUMN testgroup_initial_repetition_count DROP DEFAULT, ALTER COLUMN testgroup_may_need_more_requests SET NOT NULL;
END;
'''
'testgroup_initial_repetition_count' represents the number of successful build request for each commit set when
test group is created.
'testgroup_may_need_more_requests' will be set when any build request in test group is set to 'failed'.
* public/api/build-requests.php: Added the logic to set 'testgroup_may_need_more_requests'.
* public/api/test-groups.php: Updated 'ready-for-notification' to 'ready-for-further-processing' so that it returns finished test
groups those either have 'needs_notification' or  'may_need_more_requests' set.
* public/include/commit-sets-helpers.php: Set 'initial_repetition_count' to repetition count.
* public/privileged-api/update-test-group.php: Added APIs to add build request for a test group and
update 'may_need_more_requests' flag.
* public/v3/models/test-group.js:
(TestGroup): Added '_mayNeedMoreRequests' and '_initialRepetitionCount' field.
Refactored code that interacts with '/api/update-test-group'.
(TestGroup.prototype.updateSingleton):
(TestGroup.prototype.mayNeedMoreRequests):
(TestGroup.prototype.initialRepetitionCount):
(TestGroup.prototype.async._updateBuildRequest):
(TestGroup.prototype.updateName):
(TestGroup.prototype.updateHiddenFlag):
(TestGroup.prototype.async.didSendNotification):
(TestGroup.prototype.async.addMoreBuildRequests):
(TestGroup.prototype.async.clearMayNeedMoreBuildRequests): Added API to clear 'may_need_more_requests' flag.
(TestGroup.fetchAllReadyForFurtherProcessing): Refactored 'TestGroup.fetchAllWithNotificationReady' to return test groups either
have 'needs_notification' or  'may_need_more_requests' set.
(TestGroup.fetchAllThatMayNeedMoreRequests): Fetches test groups those may need more build requests.
* server-tests/api-test-groups.js: Added unit tests.
* server-tests/privileged-api-add-build-requests-tests.js: Added unit tests for 'add-build-requests' API.
* server-tests/privileged-api-update-test-group-tests.js: Added unit tests.
* server-tests/resources/mock-data.js:
(MockData.addMockData):
* server-tests/resources/test-server.js:
(TestServer.prototype._determinePgsqlDirectory): Fixed a bug that 'childProcess.execFileSync' may return a buffer.
* tools/run-analysis.js: Added logic to add extra build request before sennding notification.
* tools/js/retry-failed-build-requests.js:
(async.createAdditionalBuildRequestsForTestGroupsWithFailedRequests): Module that add extra build requests.
* unit-tests/retry-failed-build-requests-tests.js: Added.
* unit-tests/test-groups-tests.js: Added unit tests.

Canonical link: https://commits.webkit.org/205257@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236861 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-05 00:17:49 +00:00
Dewei Zhu dbb245f061 Show t-test results based on individual measurements to analysis task page.
https://bugs.webkit.org/show_bug.cgi?id=188425

Reviewed by Ryosuke Niwa.

Added comparison for individual iterations in analysis task page.
Added comparison for individual iterations for notification on A/B tests completion.
Refactored t-distribution inverse lookup to any degree of freedom with 5 significant figures.

* public/shared/statistics.js: Refactored t-distribution inverse lookup function and adapted this
change to all invocations.
(Statistics.new.this.supportedConfidenceIntervalProbabilities):
(Statistics.new.this.supportedOneSideTTestProbabilities):
(Statistics.new.this.confidenceIntervalDelta):
(Statistics.new.sampleMeanAndVarianceForMultipleSamples):
(Statistics.new.this.probabilityRangeForWelchsT):
(Statistics.new.this.probabilityRangeForWelchsTFromTwoSampleSets):
(Statistics.new.this._determinetwoSidedProbabilityBoundaryForWelchsT):
(Statistics.new.this.computeWelchsT):
(Statistics.new.this._computeWelchsTFromStatistics):
(Statistics.new.this.minimumTForOneSidedProbability): Function that does t-distribution inverse lookup.
* public/v3/components/analysis-results-viewer.js: Adapted TestGroup.compareTestResults change.
(AnalysisResultsViewer.TestGroupStackingBlock.prototype._measurementsForCommitSet):
(AnalysisResultsViewer.TestGroupStackingBlock.prototype._computeTestGroupStatus):
(AnalysisResultsViewer.TestGroupStackingBlock.prototype._valuesForCommitSet): Deleted.
* public/v3/components/test-group-results-viewer.js: Show both comparisions for both individual and mean.
(TestGroupResultsViewer.prototype._renderResultsTable):
(TestGroupResultsViewer.prototype._buildRowForMetric.):
(TestGroupResultsViewer.prototype._buildValueMap):
* public/v3/models/test-group.js:
(TestGroup.compareTestResults): Added comparison for individual iterations.
* tools/js/test-group-result-page.js:
(TestGroupResultPage.prototype._constructTableForMetric):
(TestGroupResultPage.prototype.get styleTemplate):
(TestGroupResultPage):
(TestGroupResultPage.prototype._URLForAnalysisTask): Renamed to '_resultsForTestGroup'
* unit-tests/statistics-tests.js: Updated and added unit tests.

Canonical link: https://commits.webkit.org/203958@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235255 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-08-23 23:11:10 +00:00
Dewei Zhu 18cdc22184 MeasurementSet should merge last four segments into two if values are identical.
https://bugs.webkit.org/show_bug.cgi?id=187311

Reviewed by Ryosuke Niwa.

If last four segments has the same value, MeasurmentSet should merge them.

* public/v3/models/measurement-set.js: Added the logic to conditionally merge last segments.
(MeasurementSet.prototype.fetchSegmentation):
* unit-tests/measurement-set-tests.js: Added a unit test for this change.

Canonical link: https://commits.webkit.org/202641@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-07-06 05:57:48 +00:00
Dewei Zhu d712acb3f9 Fix a bug in range bisector that start commit may be counted twice.
https://bugs.webkit.org/show_bug.cgi?id=187205

Reviewed by Darin Adler.

Range bisector counted start commit twice if start commit is the same as end commit.

* public/v3/commit-set-range-bisector.js:
(CommitSetRangeBisector.async.commitSetClosestToMiddleOfAllCommits):
* unit-tests/commit-set-range-bisector-tests.js: Added a unit test for this change.

Canonical link: https://commits.webkit.org/202540@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-07-03 03:55:21 +00:00
Dewei Zhu 7e775c0d76 MeasurementSetAnalyzer should check triggerable availability before creating confirming A/B tests.
https://bugs.webkit.org/show_bug.cgi?id=187028

Reviewed by Ryosuke Niwa.

If the triggerable is not available, MeasurmentSetAnalyzer should only create analysis task without
confirming A/B tests.

* tools/js/measurement-set-analyzer.js: Added logic to check triggerable availability.
(MeasurementSetAnalyzer.prototype.async._analyzeMeasurementSet):
(MeasurementSetAnalyzer):
* unit-tests/measurement-set-analyzer-tests.js: Updated unit tests and added a new unit test for this change.

Canonical link: https://commits.webkit.org/202413@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233326 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-06-28 21:15:48 +00:00
Dewei Zhu 3f51803776 Extend test group rule to support 'userInitiated' field.
https://bugs.webkit.org/show_bug.cgi?id=186544

Reviewed by Ryosuke Niwa.

Added support for rule specifying whether or not test group is user initiated.

* tools/js/analysis-results-notifier.js: Rule now support 'userInitiated' field.
(AnalysisResultsNotifier.prototype.async.sendNotificationsForTestGroups):
(AnalysisResultsNotifier.prototype._applyRules):
(AnalysisResultsNotifier._matchesRule):
* unit-tests/analysis-results-notifier-tests.js: Added unit tests for this change.

Canonical link: https://commits.webkit.org/201872@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232740 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-06-12 03:27:45 +00:00
Dewei Zhu cc3dcb9f9f CommitSet range bisector should use commits occur in commit sets which specify the range as valid commits for commits without ordering.
https://bugs.webkit.org/show_bug.cgi?id=186062

Reviewed by Ryosuke Niwa.

For commits without ordering, we should use the commits occurs in the commit sets which specify the range as valid commits.
Commit sets in range should only contain those valid commits for corresponding repositories.

* public/v3/commit-set-range-bisector.js: Updated logic to add check on commits without ordering.
(CommitSetRangeBisector.async.commitSetClosestToMiddleOfAllCommits):
* unit-tests/commit-set-range-bisector-tests.js: Added a unit test for this case.

Canonical link: https://commits.webkit.org/201795@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232629 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-06-08 18:23:17 +00:00
Dewei Zhu 853907d100 Added sending notification feature when test group finishes.
https://bugs.webkit.org/show_bug.cgi?id=184340

Reviewed by Ryosuke Niwa.

Added 'testgroup_needs_notification' filed to 'analysis_test_group' table to indicate whether a test group
has a pending notification.
Added 'testgroup_notification_sent_at' to record the last notification sent time.
SQL queries to update existing database are:
    'ALTER TABLE analysis_test_groups ADD COLUMN testgroup_needs_notification boolean NOT NULL DEFAULT FALSE;'
    'ALTER TABLE analysis_test_groups ADD COLUMN testgroup_notification_sent_at timestamp DEFAULT NULL;'
Updated 'run-analysis' script to be able to send notification when test group finishes.
Added 'Notify on completion' checkbox while creating/retrying/bisecting a test group.

* browser-tests/test-group-form-tests.js: Updated existing tests and added a new test.
* browser-tests/test-group-result-page-tests.js: Added unit tests for TestGroupResultPage.
* init-database.sql: Added 'testgroup_needs_notification' filed to 'analysis_test_group' table.
* public/api/test-groups.php: Added '/api/test-groups/ready-for-notification' API to 'test-group' to show all
test groups that need to send notification. Only the ones with 'completed', 'failed' or 'cancelled' status and its
'testgroup_needs_notification' is true will be returned by this API.
* public/include/build-requests-fetcher.php: Added 'fetch_requests_for_groups' to return test groups with given ids.
* public/include/commit-sets-helpers.php: Updated the logic to support setting 'testgroup_needs_notification'
while create an analysis_test_groups.
* public/privileged-api/create-analysis-task.php: Updated the logic to support setting 'testgroup_needs_notification'.
* public/privileged-api/create-test-group.php: Updated the logic to support setting 'testgroup_needs_notification'.
* public/privileged-api/update-test-group.php: Updated the logic to support updating 'testgroup_needs_notification'.
Extended this API to allow authentication both from CSRF token and slave.
* public/v3/components/custom-configuration-test-group-form.js:
(CustomConfigurationTestGroupForm.prototype.startTesting): Pass 'notifyOnCompletion' information which represents
'testgroup_needs_notification' from API perspective.
* public/v3/components/customizable-test-group-form.js:
(CustomizableTestGroupForm.prototype.startTesting): Pass 'notifyOnCompletion' information which represents
'testgroup_needs_notification' from API perspective.
(CustomizableTestGroupForm.cssTemplate): Added space between 'Notify on completion' checkbox and test group iteration selection list.
* public/v3/components/test-group-form.js:
(TestGroupForm): Added '_notifyOnCompletion' instance variable.
(TestGroupForm.prototype.didConstructShadowTree): Added 'onchange' event for notify on completion checkbox.
(TestGroupForm.prototype.startTesting): Pass 'notifyOnCompletion' information which represents
'testgroup_needs_notification' from API perspective.
(TestGroupForm.cssTemplate): Added space between 'Notify on completion' checkbox and test group iteration selection list.
* public/v3/models/analysis-results.js: Export 'AnalysisResults'.
(AnalysisResults.fetch): Update API path to use absolute url.
(AnalysisResults):
* public/v3/models/analysis-task.js:
(AnalysisTask.async.create): Extend this function to take notifyOnCompletion as argument which will be used as
'needsNotification' to send to server.
(AnalysisTask):
* public/v3/models/test-group.js:
(TestGroup): Added '_needsNotification' field.
(TestGroup.prototype.updateSingleton): Added logic to update '_needsNotification' field.
(TestGroup.prototype.needsNotification): Returns '_needsNotification' field.
(TestGroup.prototype.author): Returns author information.
(TestGroup.prototype.async.didSendNotification): API that updates 'testgroup_needs_notification' to true.
(TestGroup.prototype.async.fetchTask): API to fetch the task when it has not been fetched.
(TestGroup.createWithTask): Updated this function to accept 'notifyOnCompletion' which will be used as
'needsNotification' to send to server.
(TestGroup.createWithCustomConfiguration): Updated this function to accept 'notifyOnCompletion' which will be used as
'needsNotification' to send to server.
(TestGroup.createAndRefetchTestGroups): Updated this function to accept 'notifyOnCompletion' which will be used as
'needsNotification' to send to server.
(TestGroup.fetchAllWithNotificationReady): New function that invokes '/api/test-groups/ready-for-notification'.
* public/v3/pages/analysis-task-page.js: Update logic to 'notifyOnCompletion' around
(AnalysisTaskChartPane.prototype.didConstructShadowTree):
(AnalysisTaskResultsPane.prototype.didConstructShadowTree):
(AnalysisTaskTestGroupPane.prototype.didConstructShadowTree):
(AnalysisTaskPage.prototype.didConstructShadowTree):
(AnalysisTaskPage.prototype._retryCurrentTestGroup):
(AnalysisTaskPage.prototype.async._bisectCurrentTestGroup):
(AnalysisTaskPage.prototype._createTestGroupAfterVerifyingCommitSetList.set const):
(AnalysisTaskPage.prototype._createTestGroupAfterVerifyingCommitSetList):
(AnalysisTaskPage.prototype._createCustomTestGroup):
* public/v3/pages/chart-pane.js: Added 'Notify on completion' checkbox.
(ChartPane.prototype.didConstructShadowTree):
(ChartPane.prototype.async._analyzeRange):
* public/v3/pages/create-analysis-task-page.js: Adapted API change.
(CreateAnalysisTaskPage.prototype._createAnalysisTaskWithGroup):
* server-tests/api-test-groups.js: Added tests for '/api/test-groups/ready-for-notification'.
* server-tests/privileged-api-create-analysis-task-tests.js: Updated tests to adapt this change.
Added new tests.
* server-tests/privileged-api-create-test-group-tests.js: Added new tests.
* server-tests/privileged-api-update-test-group-tests.js: Added unit test for 'update-test-group' API.
* server-tests/resources/mock-data.js: addMockData should set 'testgroup_needs_notification' to be true.
* server-tests/tools-sync-buildbot-integration-tests.js: Updated tests to adapt this change.
(async.createTestGroupWihPatch):
(createTestGroupWihOwnedCommit):
* tools/js/analysis-results-notifier.js: Added notifier to send notification for completed test groups.
(AnalysisResultsNotifier):
(AnalysisResultsNotifier.prototype.async.sendNotificationsForTestGroups):
(AnalysisResultsNotifier.prototype._sendNotification): Invoke remote API to send notification.
(AnalysisResultsNotifier.prototype._constructMessageByRules):
(AnalysisResultsNotifier._matchesRule):
(AnalysisResultsNotifier._applyUpdate):
(AnalysisResultsNotifier.async._messageForTestGroup): Build html as message body for a test group.
(AnalysisResultsNotifier._URLForAnalysisTask): Returns URL for an analysis task.
(AnalysisResultsNotifier._instantiateNotificationTemplate):
* tools/js/test-group-result-page.js: Added 'TestGroupResultPage' and 'BarGraph' to show test group result.
(TestGroupResultPage):
(TestGroupResultPage.prototype.async.setTestGroup):
(TestGroupResultPage._urlForAnalysisTask):
(TestGroupResultPage.prototype._URLForAnalysisTask):
(TestGroupResultPage.prototype.constructTables):
(TestGroupResultPage.prototype._constructTableForMetric):
(TestGroupResultPage.):
(TestGroupResultPage.prototype.get pageContent):
(TestGroupResultPage.prototype.get styleTemplate):
(BarGraph):
(BarGraph.prototype.setWidth):
(BarGraph.prototype._constructBarGraph):
(BarGraph.prototype.get pageContent):
(BarGraph.prototype.get styleTemplate):
* tools/js/measurement-set-analyzer.js: Adapted 'AnalysisTask.create' change.
(MeasurementSetAnalyzer.prototype.async._analyzeMeasurementSet):
(MeasurementSetAnalyzer):
* tools/js/v3-models.js:
* tools/run-analysis.js: Added the logic that sends notification for completed test groups.
(main):
(async.analysisLoop):
* unit-tests/analysis-task-tests.js:
* unit-tests/analysis-results-notifier-tests.js: Added a unit test for 'AnalysisResultsNotifier' and 'NotificationService'.
* unit-tests/measurement-set-analyzer-tests.js: Updated unit tests per this change.
* unit-tests/test-groups-tests.js: Added unit tests for 'TestGroup.needsNotification'.
* unit-tests/resources/mock-remote-api.js: Only set 'privilegedAPI' when it exits.

Canonical link: https://commits.webkit.org/201783@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232612 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-06-08 03:44:28 +00:00
Ryosuke Niwa 0f49408247 Add the basic support for writing components in node.js
https://bugs.webkit.org/show_bug.cgi?id=186299

Reviewed by Antti Koivisto.

Add the basic support for writing components in node.js for generating rich email notifications.

To do this, this patch introduces MarkupComponentBase and MarkupPage which implement similar API
to ComponentBase and Page classes of v3 UI code. This enables us to share code between frontend
and the backend in the future. Because there is no support for declarative custom elements or
shadow root in HTML, MarkupComponentBase uses a similar but distinct concept of "content" tree
to represent the "DOM" tree for a component. When generating the HTML, MarkupComponentBase and
MarkupPage collectively transforms stylesheets and flattens the tree into a single HTML. In order
to keep this flatteneing logic simple, MarkupComponentBase only supports a very small subset of
CSS selectors to select elements by their local names and class names.

Specifically, each class name and element name based selectors are replaced by a globally unique
class name based selector, and each element which matches the selector is applied of the same
globally unique class name. The transformation is applied when constructing the "content" tree
as well as calls to renderReplace.

Because much of v3 frontend code relies on DOM API, this patch also implements the simplest form
of a fake DOM API as MarkupNode, MarkupParentNode, MarkupElement, and MarkupText. In order to avoid
reimplementing HTML & CSS parsers, this patch introduces the concept of content and style templates
to ComponentBase which are JSON alternatives to HTML & CSS template strings which can be used in
both frontend & backend.

* browser-tests/close-button-tests.js: Include CommonComponentBase.
* browser-tests/commit-log-viewer-tests.js: Ditto.
* browser-tests/component-base-tests.js: Ditto. Added a test cases for content & style templates.
(async.importComponentBase): Added.
* browser-tests/editable-text-tests.js: Include CommonComponentBase.
* browser-tests/index.html:
* browser-tests/markup-page-tests.js: Added.
* browser-tests/page-router-tests.js: Include CommonComponentBase.
* browser-tests/page-tests.js: Ditto.
* browser-tests/test-group-form-tests.js: Ditto.
* public/shared/common-component-base.js: Added.
(CommonComponentBase): Extracted out of ComponentBase.
(CommonComponentBase.prototype.renderReplace): Added.
(CommonComponentBase.renderReplace): Moved from ComponentBase.
(CommonComponentBase.prototype._recursivelyUpgradeUnknownElements): Moved and renamed from
ComponentBase's _recursivelyReplaceUnknownElementsByComponents.
(CommonComponentBase.prototype._upgradeUnknownElement): Extracted out of the same function.
(CommonComponentBase._constructStylesheetFromTemplate): Added.
(CommonComponentBase._constructNodeTreeFromTemplate): Added.
(CommonComponentBase.prototype.createElement): Added.
(CommonComponentBase.createElement): Moved from ComponentBase.
(CommonComponentBase._addContentToElement): Moved from ComponentBase.
(CommonComponentBase.prototype.createLink): Added.
(CommonComponentBase.createLink): Moved from ComponentBase.
(CommonComponentBase._context): Added. Set to document in a browser and MarkupDocument in node.js.
(CommonComponentBase._isNode): Added. Set to a function which does instanceof Node/MarkupNode check.
(CommonComponentBase._baseClass): Added. Set to ComponentBase or MarkupComponentBase.
* public/v3/components/base.js:
(ComponentBase):
(ComponentBase.prototype._ensureShadowTree): Added the support for the content and style templates.
Also avoid parsing the html template each time a component is instantiated by caching the result.
* public/v3/index.html:
* tools/js/markup-component.js: Added.
(MarkupDocument): Added. A fake Document.
(MarkupDocument.prototype.createContentRoot): A substitude for attachShadow.
(MarkupDocument.prototype.createElement):
(MarkupDocument.prototype.createTextNode):
(MarkupDocument.prototype._idForClone):
(MarkupDocument.prototype.reset):
(MarkupDocument.prototype.markup):
(MarkupDocument.prototype.escapeAttributeValue):
(MarkupDocument.prototype.escapeNodeData):
(MarkupNode): Added. A fake Node. Each node gets an unique ID.
(MarkupNode.prototype._markup):
(MarkupNode.prototype.clone): Implemented by the leave class.
(MarkupNode.prototype._cloneNodeData):
(MarkupNode.prototype.remove):
(MarkupParentNode): Added. An equivalent of ContainerNode in WebCore.
(MarkupParentNode.prototype.get childNodes):
(MarkupParentNode.prototype._cloneNodeData):
(MarkupParentNode.prototype.appendChild):
(MarkupParentNode.prototype.removeChild):
(MarkupParentNode.prototype.removeAllChildren):
(MarkupParentNode.prototype.replaceChild):
(MarkupContentRoot): Added. Used like a shadow tree.
(MarkupContentRoot.prototype._markup): Added.
(MarkupElement): Added. A fake Element. It also implements a subset of IDL attributes implemented by
subclasses such as HTMLInputElement for simplicity.
(MarkupElement.prototype.get id): Added.
(MarkupElement.prototype.get localName): Added.
(MarkupElement.prototype.clone): Added.
(MarkupElement.prototype.appendChild): Added.
(MarkupElement.prototype.addEventListener): Added.
(MarkupElement.prototype.setAttribute): Added.
(MarkupElement.prototype.getAttribute): Added.
(MarkupElement.prototype.get attributes): Added.
(MarkupElement.prototype.get textContent): Added.
(MarkupElement.prototype.set textContent): Added.
(MarkupElement.prototype._serializeStyle): Added.
(MarkupElement.prototype._markup): Added. Flattens the tree with content tree like copy & paste so
this can't be used to implement innerHTML.
(MarkupElement.prototype.get value): Added.
(MarkupElement.prototype.set value): Added.
(MarkupElement.prototype.get style): Added. Returns a fake writeonly CSSStyleDeclaration.
(MarkupElement.prototype.set style): Added.
(MarkupElement.get selfClosingNames): Added. A small list of self-closing tags for the HTML generation.
(MarkupText): Added.
(MarkupText.prototype.clone): Added.
(MarkupText.prototype._markup): Added.
(MarkupText.prototype.get data): Added.
(MarkupText.prototype.set data): Added.
(MarkupComponentBase): Added.
(MarkupComponentBase.prototype.element): Added. Like ComponentBase's element.
(MarkupComponentBase.prototype.content): Added. Like ComponentBase's content.
(MarkupComponentBase.prototype._findElementRecursivelyById): Added. A fake getElementById.
(MarkupComponentBase.prototype.render): Added. Like ComponentBase's render.
(MarkupComponentBase.prototype.runRenderLoop): Added. In ComponentBase, we use requestAnimationFrame.
In MarkupComponentBase, we keep rendering until the queue drains empty.
(MarkupComponentBase.prototype.renderReplace): Added. Like ComponentBase's renderReplace but applies
the transformation of classes to workaround the lack of shadow tree support in scriptless HTML.
(MarkupComponentBase.prototype._applyStyleOverrides): Added. Recursively applies the transformation.
(MarkupComponentBase.prototype._ensureContentTree): Added. Like ComponentBase's _ensureShadowTree.
(MarkupComponentBase.reset): Added.
(MarkupComponentBase._parseTemplates): Added. Parses the content & style templates, and generates the
transformed fake DOM tree and stylesheet text whereby selectors in each component is modified to be
unique across all components. The function to apply the necessary changes to an element is saved in
the global map of components, and later used in renderReplace via _applyStyleOverrides.
(MarkupComponentBase.defineElement): Added. Like ComponentBase's defineElement.
(MarkupComponentBase.prototype.createEventHandler): Added.
(MarkupComponentBase.createEventHandler): Added.
(MarkupPage): Added. The top-level component responsible for generating a DOCTYPE, head, and body.
(MarkupPage.prototype.pageTitle): Added.
(MarkupPage.prototype.content): Added. Overrides the one in MarkupComponentBase to return what would
be the content of the body element as opposed to the html element for the connivance of subclasses,
and to match the behavior of the frontend Page class.
(MarkupPage.prototype.render): Added.
(MarkupPage.prototype._updateComponentsStylesheet): Added. Concatenates the transformed stylesheet of
all components used.
(MarkupPage.get contentTemplate): Added.
(MarkupPage.prototype.generateMarkup): Added. Enqueues the page to render, spin the render loop, and
generates the HTML. We enqueue the page twice in order to invoke _updateComponentsStylesheet after
all subcomponent had finished rendering.
* unit-tests/markup-component-base-tests.js: Added.
* unit-tests/markup-element-tests.js: Added.
(.createElement): Added.
* unit-tests/markup-page-tests.js: Added.


Canonical link: https://commits.webkit.org/201761@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232588 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-06-07 18:25:35 +00:00
Dewei Zhu ae36184bf1 Range bisector should check the commits for repositories without change in specified range.
https://bugs.webkit.org/show_bug.cgi?id=185269

Reviewed by Ryosuke Niwa.

For repositories without a change in the specified range, we still need to use them to filter commit
sets. Before this change, code does not apply filtering by those repositories against commit set. As
a result, commit sets with different commits for those repositories may be chosen as bisecting commit set.

* public/v3/commit-set-range-bisector.js: Updated the logic to verify range for repositories without
change in range.
(CommitSetRangeBisector.async.commitSetClosestToMiddleOfAllCommits):
* unit-tests/commit-set-range-bisector-tests.js: Added a unit test to guard against this change.

Canonical link: https://commits.webkit.org/200966@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231593 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-05-09 20:58:27 +00:00
Dewei Zhu 93a571ae9d Create analysis task should sync analysis task status after creation.
https://bugs.webkit.org/show_bug.cgi?id=185222

Reviewed by Ryosuke Niwa.

* public/v3/models/analysis-task.js:
(AnalysisTask.async.create): Fetch newly-created analysis task right about its creation.
(AnalysisTask):
* tools/js/measurement-set-analyzer.js:
(MeasurementSetAnalyzer.prototype.async._analyzeMeasurementSet): Adjust as 'AnalysisTask.create' now
returns an anlysis task instance.
(MeasurementSetAnalyzer):
* unit-tests/analysis-task-tests.js: Added a unit test for this change.
(async):
* unit-tests/measurement-set-analyzer-tests.js: Update unit tests accordingly.
Fix a typo in one previous unit test.
(async):

Canonical link: https://commits.webkit.org/200731@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-05-03 07:06:16 +00:00
Dewei Zhu 780bf260fb Write a script that detects chart changes by using v3 API.
https://bugs.webkit.org/show_bug.cgi?id=184419

Reviewed by Ryosuke Niwa.

Added a script that detects chart changes and schedule confirming analysis task.

* browser-tests/async-task-tests.js: Added a unit test for 'AsyncTask'.
* browser-tests/index.html: Added import for 'AsyncTask' for testing.
* public/shared/statistics.js: Make 'findRangesForChangeDetectionsWithWelchsTTest' defaults to 0.99 one sided possibility.
(Statistics.new.this.findRangesForChangeDetectionsWithWelchsTTest):
* public/v3/async-task.js:
(AsyncTask.isAvailable): Helper function to determine whether AsyncTask is available or not as 'Worker' is
not available in nodejs.
(AsyncTask):
* public/v3/models/bug.js: Export as a module.
* public/v3/models/measurement-set.js:
(MeasurementSet.prototype._invokeSegmentationAlgorithm): Added a check to avoid using AsyncTask when running in NodeJs.
(MeasurementSet):
* server-tests/resources/common-operations.js: Added a helper function to assert certain exception is thrown.
(async.assertThrows):
* tools/js/measurement-set-analyzer.js: Added 'MeasurementSetAnalyzer' module for analyzing measurement set.
(MeasurementSetAnalyzer):
(MeasurementSetAnalyzer.prototype.async.analyzeOnce):
(MeasurementSetAnalyzer.measurementSetListForAnalysis):
(MeasurementSetAnalyzer.prototype.async._analyzeMeasurementSet):
* tools/js/v3-models.js: Added import for 'Bug' object.
* tools/run-analysis.js: Added this script to detect measurement set changes.
(main):
(async.analysisLoop):
* unit-tests/measurement-set-analyzer-tests.js: Added unit tests for 'MeasurementSetAnalyzer'.
* unit-tests/resources/mock-v3-models.js: Reset 'MeasurementSet._set' every time.
Update mock platform to include lastModifiedByMetric information.
(MockModels.inject):

Canonical link: https://commits.webkit.org/200671@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231225 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-05-02 06:16:16 +00:00
Ryosuke Niwa 3460bf37ba Creating a custom analysis task after fetching all analysis tasks fail
https://bugs.webkit.org/show_bug.cgi?id=184641

Reviewed by Saam Barati.

The bug was caused by AnalysisTask._fetchSubset not fetching the analysis task when all analysis tasks
had previously been fetched (AnlaysisTask._fetchAllPromise is set) even when noCache is set to true.
Fixed it by ignornig _fetchAllPromise when noCache is set to true.

This patch also adds noCache argument to AnalysisTask.fetchById and reverts the inadvertent change in
r226836 to always set noCache to true in this function.

* public/v3/models/analysis-task.js:
(AnalysisTask.fetchById): Added noCache argument instead of always specifying true, and modernized the code.
(AnalysisTask._fetchSubset): Fixed the bug. See above description.
* public/v3/models/test-group.js:
(TestGroup.createWithTask): Set noCache to true when calling AnalysisTask.fetchById here.
* unit-tests/analysis-task-tests.js: Added test cases for AnalysisTask.fetchById, including a test
to make sure it doesn't fetch the specified analysis task when noCache is set to false and all analysis
tasks had previously been fetched for the aforementioned revert of the inadvertent change in r226836.
(sampleAnalysisTasks): Renamed from sampleAnalysisTasks as the result contains multiple analysis tasks.
* unit-tests/test-groups-tests.js: Added a test case for TestGroup.createWithTask


Canonical link: https://commits.webkit.org/200638@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231183 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 23:56:21 +00:00
Ryosuke Niwa 744b1a67ef REGRESSION(r230960): Browser tests under TimeSeriesChart fetchMeasurementSets all fail
https://bugs.webkit.org/show_bug.cgi?id=185125

Reviewed by Saam Barati.

The bug was caused by mock-remote-api.js always loading PrivilegedAPI using require, which doesn't work in a browser.
Fixed the bug by explicitly requiring the right kind of PrivilegedAPI in each unit test instead.

* unit-tests/analysis-task-tests.js:
* unit-tests/buildbot-syncer-tests.js:
* unit-tests/commit-log-tests.js:
* unit-tests/commit-set-range-bisector-tests.js:
* unit-tests/commit-set-tests.js:
* unit-tests/measurement-set-tests.js:
* unit-tests/privileged-api-tests.js:
* unit-tests/resources/mock-remote-api.js:
(MockRemoteAPI.inject): Take PrivilegedAPI instead of the type string. Also fixed a bug that _token wasn't unset
after each unit test, and superfluous initializations of originalRemoteAPI and originalPrivilegedAPI.
* unit-tests/test-groups-tests.js:


Canonical link: https://commits.webkit.org/200637@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231180 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 23:43:45 +00:00
Dewei Zhu 680343a2a0 MeasurementSet._constructUrl should construct absolute url.
https://bugs.webkit.org/show_bug.cgi?id=185137

Reviewed by Ryosuke Niwa.

MeasurementSet._constructUrl should not construct an url with relative path.

* public/v3/models/measurement-set.js: Should use '/api/measurement-set...' and '/data/measurement-set-...'
for uncached and cached fetching.
* unit-tests/measurement-set-tests.js: Updated unit tests.
(const.set MeasurementSet):

Canonical link: https://commits.webkit.org/200629@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231169 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-30 21:06:05 +00:00
Dewei Zhu a76679c8d7 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):

Canonical link: https://commits.webkit.org/200553@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-27 06:22:00 +00:00
Dewei Zhu 6092fcc1e7 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):

Canonical link: https://commits.webkit.org/200433@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230960 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-24 17:17:42 +00:00
Dewei Zhu f13d7e6f6c 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'.

Canonical link: https://commits.webkit.org/200299@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-19 22:16:23 +00:00
Dewei Zhu 0bc5c6ce6f 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.

Canonical link: https://commits.webkit.org/200208@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-17 17:23:18 +00:00
Dewei Zhu 8a7176b2a4 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'.

Canonical link: https://commits.webkit.org/199971@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-09 16:27:52 +00:00
Dewei Zhu d3f7a2d02c 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.

* 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'.

Canonical link: https://commits.webkit.org/199881@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-05 04:49:21 +00:00
Aakash Jain 047ed30901 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.


Canonical link: https://commits.webkit.org/199774@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-02 09:09:08 +00:00
Aakash Jain c7ae3c1d60 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.



Canonical link: https://commits.webkit.org/199388@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-20 00:20:46 +00:00
Aakash Jain ed912b891c 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.



Canonical link: https://commits.webkit.org/199354@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-16 23:48:37 +00:00
Aakash Jain 736265431a 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.


Canonical link: https://commits.webkit.org/199298@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229618 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-15 03:17:37 +00:00
Aakash Jain 0a387a975c 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.



Canonical link: https://commits.webkit.org/199191@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229489 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-09 23:45:11 +00:00
Aakash Jain 56886825e8 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.


Canonical link: https://commits.webkit.org/198904@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229101 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-28 21:54:56 +00:00
Aakash Jain 37934a172d 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.



Canonical link: https://commits.webkit.org/198280@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-05 17:14:13 +00:00
Aakash Jain 82a8c41859 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.



Canonical link: https://commits.webkit.org/198279@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228098 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-05 16:53:22 +00:00