Commit Graph

582 Commits

Author SHA1 Message Date
Dewei Zhu 41d205c69e Use bigint for 'commit_order' field in 'commits' table to support larger range.
https://bugs.webkit.org/show_bug.cgi?id=228133

Reviewed by Ryosuke Niwa.

'integer' in postgres has range from -2147483648 to +2147483647 which is not big enough.
Use 'bigint' to support wider range (-9223372036854775808 to 9223372036854775807).
SQL query for migration:
    `ALTER TABLE commits ALTER commit_order TYPE bigint;`

* init-database.sql: Update 'integer' to 'bigint' for 'commit_order'.
* migrate-database.sql: Added migration SQL for this change.
* server-tests/api-report-commits-tests.js: Add a unit test.

Canonical link: https://commits.webkit.org/239837@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280127 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-21 11:35:17 +00:00
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
Dewei Zhu 3bfe3232e3 Fix a bug that incorrect timestamp is reported for Git repositories.
https://bugs.webkit.org/show_bug.cgi?id=225987

Reviewed by Ryosuke Niwa.

'datetime.fromtimestamp' will use the current timezone.
However, '/api/report-commits' will interprete it as a timestamp string from UTC.
In order to keep the consistency, we should always use 'datetime.utcfromtimestamp'.

* tools/sync-commits.py: Use 'datetime.utcfromtimestamp' instead of 'datetime.fromtimestamp'.
(GitRepository._revision_from_tokens):

Canonical link: https://commits.webkit.org/238034@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277901 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 00:13:39 +00:00
Zhifei Fang e009fd0eb9 Need to use default git pull to remove the fake svn commit when syncing with SVN
https://bugs.webkit.org/show_bug.cgi?id=226039

Reviewed by Jonathan Bedard.

* tools/sync-commits.py:
(GitRepository._fetch_remote):


Canonical link: https://commits.webkit.org/237972@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-20 21:46:44 +00:00
Zhifei Fang f52dba5f13 Clean up git svn mapping when git pull
https://bugs.webkit.org/show_bug.cgi?id=225934

Reviewed by Ryosuke Niwa.

* tools/sync-commits.py:
(GitRepository._fetch_remote):


Canonical link: https://commits.webkit.org/237880@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-18 21:25:44 +00:00
Zhifei Fang 42eaf14497 Commits updater should ignore null revision identifier
https://bugs.webkit.org/show_bug.cgi?id=225911

Reviewed by Ryosuke Niwa.

* public/include/commit-updater.php:
* server-tests/api-report-commits-tests.js:


Canonical link: https://commits.webkit.org/237872@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277671 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-18 19:56:03 +00:00
Zhifei Fang f0c74d400e Add support for syncing repo with commit revision label.
https://bugs.webkit.org/show_bug.cgi?id=221982

Reviewed by Ryosuke Niwa.

Add new syncing option reportRevisionIdentifier, which will let the script try to sync the commit revision identifier from the commit message.
Add new syncing option reportSVNRevision, which will let the script try to report SVN revision from a git-svn repo.

* tools/sync-commits.py:
(main):
(load_repository):
(GitRepository.__init__):
(GitRepository.fetch_next_commit):
(GitRepository._git_hash_to_svn_revision):
(GitRepository._svn_revision_to_git_hash):
(GitRepository._revision_from_tokens):
(GitRepository._fetch_all_hashes):


Canonical link: https://commits.webkit.org/237491@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-08 01:08:08 +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 b9646b69fe [perf dashboard] Remove v1 and v2 code.
https://bugs.webkit.org/show_bug.cgi?id=223617

Reviewed by Ryosuke Niwa.

Remove v1 and v2 code from perf dashboard.
Remove detect-changes.js script since run-analysis.js is the v3 version equivalent.

* public/index.html: Keep the redirection to v3.
* public/js/helper-classes.js: Removed.
* public/js/jquery.colorhelpers.js: Removed.
* public/js/jquery.flot.categories.js: Removed.
* public/js/jquery.flot.crosshair.js: Removed.
* public/js/jquery.flot.errorbars.js: Removed.
* public/js/jquery.flot.fillbetween.js: Removed.
* public/js/jquery.flot.js: Removed.
* public/js/jquery.flot.navigate.js: Removed.
* public/js/jquery.flot.plugins.js: Removed.
* public/js/jquery.flot.resize.js: Removed.
* public/js/jquery.flot.selection.js: Removed.
* public/js/jquery.flot.stack.js: Removed.
* public/js/jquery.flot.symbol.js: Removed.
* public/js/jquery.flot.threshold.js: Removed.
* public/js/jquery.flot.time.js: Removed.
* public/js/jquery.js: Removed.
* public/v2/analysis.js: Removed.
* public/v2/app.css: Removed.
* public/v2/app.js: Removed.
* public/v2/chart-pane.css: Removed.
* public/v2/commits-viewer.js: Removed.
* public/v2/data.js: Removed.
* public/v2/index.html: Keep the redirection to v3.
* public/v2/interactive-chart.js: Removed.
* public/v2/js/d3/LICENSE: Removed.
* public/v2/js/d3/d3.js: Removed.
* public/v2/js/d3/d3.min.js: Removed.
* public/v2/js/ember-data.js: Removed.
* public/v2/js/ember.js: Removed.
* public/v2/js/handlebars.js: Removed.
* public/v2/js/jquery.min.js: Removed.
* public/v2/manifest.js: Removed.
* public/v2/popup.js: Removed.
* public/v2/statistics-strategies.js: Removed.
* tools/detect-changes.js: Removed.

Canonical link: https://commits.webkit.org/235679@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-23 23:05:32 +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
Dewei Zhu 3b604ed079 [perf dashboard] Perf dashboard should be compatible with newer version of postgres.
https://bugs.webkit.org/show_bug.cgi?id=223567

Reviewed by Ryosuke Niwa.

Newer version of postgres requires explicit ROW expression while updating a single column
using multi-column update syntax. However, 'ROW' is not supported in postgres < 10. In order
to keep compatibility, using a separate query when only updating one row.

* public/include/db.php: Use 'column = value' when there is only one column to update.

Canonical link: https://commits.webkit.org/235600@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274799 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:28 +00:00
Ryosuke Niwa 28234304b9 [perf dashboard] Use async/await in tests for TimeSeriesChart and InteractiveTimeSeriesChart
https://bugs.webkit.org/show_bug.cgi?id=222876

Reviewed by Sam Weinig.

Use async/await instead of chaining promises manually in the browser tests for
TimeSeriesChart and InteractiveTimeSeriesChart for better readability.

* browser-tests/interactive-time-series-chart-tests.js:
* browser-tests/time-series-chart-tests.js:


Canonical link: https://commits.webkit.org/235055@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-09 05:24:29 +00:00
Ryosuke Niwa a47008dcd2 [perf dashboard] Modernize TimeSeries and TimeSeriesView
https://bugs.webkit.org/show_bug.cgi?id=222872

Reviewed by Dewei Zhu.

Declare instance fields in class declarations, use const/let instead of var, and use generators
for forward and backward iterations instead of manually implementing the iterator protocol.

This patch also splits FilteredTimeSeriesView out of TimeSeriesView.

* public/v3/models/time-series.js:
(TimeSeries): Moved the declaration of _data instance field to the class declaration.
(TimeSeries.prototype.constructor): Deleted.
(TimeSeries.prototype.extendToFuture):
(TimeSeries.prototype.valuesBetweenRange):
(TimeSeries.prototype.findById):
(TimeSeries.prototype.findPointAfterTime):
(TimeSeriesView): Declared the instance fields in the class declaration.
(TimeSeriesView.prototype.constructor): Removed filteredData from the argument since it's split
out to FilteredTimeSeriesView now.
(TimeSeriesView.prototype.get _data): Added. An abstraction needed for FilteredTimeSeriesView.
(TimeSeriesView.prototype._findIndexForPoint): Ditto. Moved out of the constructor.
(TimeSeriesView.prototype.filter): Return a FilteredTimeSeriesView.
(TimeSeriesView.prototype.viewTimeRange): Use _subRange to return either TimeSeriesView or
FilteredTimeSeriesView which ever is needed.
(TimeSeriesView.prototype._subRange): An abstraction needed for FilteredTimeSeriesView.
(TimeSeriesView.prototype.Symbol.iterator): Made this a generator instead of implementing
the iterator protocol directly.
(TimeSeriesView.prototype._reverse): Ditto.
(FilteredTimeSeriesView): Added.
(FilteredTimeSeriesView.prototype.constructor): Added. Assert that afterEndingIndex is less than
the length of the filtered data. This assertion was missing in TimeSeries prior to this patch
when filteredData is specified.
(FilteredTimeSeriesView.prototype.get _data): Added.
(FilteredTimeSeriesView.prototype._subRange): Added. Instantiate FilteredTimeSeriesView with
the same filtered data.
(FilteredTimeSeriesView.prototype._findIndexForPoint): Moved from TimeSeriesView's constructor.
(FilteredTimeSeriesView.prototype._buildPointIndexMap): Moved from TimeSeriesView.


Canonical link: https://commits.webkit.org/234983@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274047 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-07 02:28:29 +00:00
Ryosuke Niwa fb2e8c14bf [perf dashboard] Some browser tests are flaky or failing
https://bugs.webkit.org/show_bug.cgi?id=222874

Reviewed by Dewei Zhu.

There were two tests in TimeSeriesChart tests that were intermittently failing due to the test
not reliably waiting for the iframe's resize to take effect and not waiting for the time series'
fetching logic to run 'til completion before waiting for canvas charts to be re-drawn. Fixing
these by adding code to wait for these conditons.

All browser tests for markup-component.js was broken in r274036 as `require` function is not
available in browsers. Added a workaround in BrowsingContext to add a make assert.ok function
using expect(~).to.be.true().

* browser-tests/index.html:
(BrowsingContext.prototype.constructor):
(waitForElementResize): Added.
* browser-tests/time-series-chart-tests.js: Fixed bugs in the tests.


Canonical link: https://commits.webkit.org/234982@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274046 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-07 02:25:25 +00:00
Ryosuke Niwa 1ed6ec5a31 [perf dashboard] Modernize DataModelObject and LabeledObject
https://bugs.webkit.org/show_bug.cgi?id=222871

Reviewed by Dewei Zhu.

Use const/let instead of var, async/await instead of Promise.then, and Map instead
of a regular object for a dictionary.

Also define instance fields in the class declaration instead of simply adding them
in the class constructors, and set the default parameter values instead of relying
on the unspecified argument being undefined.

* public/v3/models/data-model.js:
(DataModelObject.ensureSingleton):
(DataModelObject.namedStaticMap):
(DataModelObject.ensureNamedStaticMap):
(DataModelObject.findById):
(DataModelObject.listForStaticMap):
(DataModelObject.async cachedFetch):
(DataModelObject):
(LabeledObject.sortByName):
(DataModelObject.cachedFetch): Deleted.


Canonical link: https://commits.webkit.org/234980@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274044 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-07 00:27:54 +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
Dean Johnson 01b0ccad19 [perf.webkit.org] Do not schedule jobs to Buildbot if the last job failed
https://bugs.webkit.org/show_bug.cgi?id=221943

Patch by Dean Johnson <dean_johnson@apple.com> on 2021-02-16
Reviewed by Dewei Zhu.

* server-tests/resources/mock-data.js:
(MockData.sampleBuildData): Allow options.results to be specified.
* server-tests/tools-buildbot-triggerable-tests.js:
(async const): Add tests for new functionality. Existing tests still pass.
* tools/js/buildbot-syncer.js:
(BuildbotBuildEntry.prototype.initialize): Track the 'results' key from a build.
(BuildbotBuildEntry.prototype.result): Make the build result available.
(BuildbotSyncer): Track the last completed build.
(BuildbotSyncer.prototype.lastCompletedBuildSuccessful): Check if the last completed
build was successful.
(BuildbotSyncer.prototype.pullBuildbot):
* tools/js/buildbot-triggerable.js: Do not schedule a job to a builder who failed
its last completedd build.
(BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable):

Canonical link: https://commits.webkit.org/234174@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272971 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-17 02:27:23 +00:00
Dewei Zhu 9e70042c0f 'sync-commits.py' should be able to limit reporting scope to a specific branch on a Git repository.
https://bugs.webkit.org/show_bug.cgi?id=221799

Reviewed by Ryosuke Niwa.

Fetching git commits with 'git log --all ...' may end up fetching commits from branches created for
pull requests. Add 'branch' variable to allow us to limit to a certain branch.

* tools/sync-commits.py: Added 'branch' variable to GitRepository so that we can fetch from a specific branch.
If branch is not specified, it will still use '--all' to list commits.
(load_repository):
(GitRepository.__init__):
(GitRepository._fetch_all_hashes):

Canonical link: https://commits.webkit.org/234050@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272814 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-12 23:03:34 +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 8dd5823bd0 BuildbotTriggerable should not update build requests from another triggerable.
https://bugs.webkit.org/show_bug.cgi?id=220762

Reviewed by Ryosuke Niwa.

BuildbotTriggerable._pullBuildbotOnAllSyncers assumes 'BuildRequest.all()' returns all build requests under current triggerable.
However, this assumption got broken when root reuse change was introduced because build requests under same analysis task are
fetched. Thus, 'BuildRequest.all()' may contain build requests those are not under current triggerable. And those build requests
will be updated to 'failedIfNotCompleted'.
Update 'api/build-requests' so that 'url' and 'status_description' fields are not cleared if update does not specify them.

* public/api/build-requests.php: Added logic to avoid updating 'url' and 'status_description' if they are not specified.
* server-tests/api-build-requests-tests.js: Added an unit test.
* server-tests/resources/mock-data.js:
(MockData.async set addMockBuildRequestsForTwoTriggerablesUnderOneAnalysisTask):
* server-tests/tools-buildbot-triggerable-tests.js: Added an unit test.
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype.async syncOnce): Fixed a typo.
(BuildbotTriggerable._pullBuildbotOnAllSyncers): Instead of iterating over 'BuildRequest.all()', only set 'failedIfNotCompleted'
for build requests those are under current triggerable and satisfy the condition.


Canonical link: https://commits.webkit.org/233165@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-20 08:31:54 +00:00
Dewei Zhu 87bd6a6c1f 'AnalysisTask._commitSetsInSamePlatformGroup' should not fetch an invalid platform and metric config for a MeasurementSet.
https://bugs.webkit.org/show_bug.cgi?id=219721

Reviewed by Ryosuke Niwa.

Selected test group on analysis task page may not highlight when 'AnalysisTask._commitSetsInSamePlatformGroup' fetches
an invalid platform and metric config for a MeasurementSet.

* public/v3/models/analysis-task.js: Added a logic to avoid fetching MeasurementSet with an invalid config.
(AnalysisTask.prototype._commitSetsInSamePlatformGroup):

Canonical link: https://commits.webkit.org/232377@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-11 23:34:24 +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 ec25a93d32 'run-analysis' script should schedule retries for A/B tests even after chart analysis failure.
https://bugs.webkit.org/show_bug.cgi?id=219116

Reviewed by Ryosuke Niwa.

Anlyzing charts and schedule retries for A/B tests on run-analysis script are independent task.
It should not skip scheduling retries even when chart analysis part fails.

* tools/run-analysis.js:
(async analysisLoop): Change the logic so that chart analysis failure will not stop scheduling retries.
Fix a typo for 'notificationRemoteAPI'.

Canonical link: https://commits.webkit.org/231849@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-21 01:27:13 +00:00
Dewei Zhu 9be763abed Fix a bug that platform groups cannot be updated on 'admin/platform'.
https://bugs.webkit.org/show_bug.cgi?id=219118

Reviewed by Ryosuke Niwa.

Admins should be able to update platform group on 'admin/platform'.
Update the assertion on BuildbotTriggerable._pullBuildbotOnAllSyncers so that when there is no
corresponding entry in buildRequestByGroup, the test group for the request should be finished.

* public/admin/platforms.php:
* tools/js/buildbot-triggerable.js: Updated the assert statement.
(BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers):

Canonical link: https://commits.webkit.org/231847@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270138 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-21 00:51:51 +00:00
Dewei Zhu 5b7ba69522 BuildbotTriggerable should not process a completed build request from a completed test group.
https://bugs.webkit.org/show_bug.cgi?id=219016

Reviewed by Ryosuke Niwa.

BuildBotTriggerable._pullBuildbotOnAllSyncers relies on buildReqeustsByGroup to contain all build requests found by
BuildRequest.findById. However, since re-use root change is landed, above assumption is no longer valid. BuildRequest.all()
may includes build requests under same analysis task. Thus, `_pullBuildbotOnAllSyncers` will fail due to 'info' is undefined.

* server-tests/tools-buildbot-triggerable-tests.js: Added a unit test.
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added logic to stop processing the build request if it's not
from incomplete build requests under a triggerable.

Canonical link: https://commits.webkit.org/231645@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-17 04:33:06 +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 0cb6a559be Refactor 'platforms' table to contain group information.
https://bugs.webkit.org/show_bug.cgi?id=193132

Reviewed by Ryosuke Niwa.

Group 'platforms' so that bisecting can use commit sets from other platforms which are in the same platform group.
This will help to enhance the bisecting capability to higher granularity.
Added admin page to manage platform groups.
Updated platform admin page to allow update platform group.
SQL query to update existing database:
'''
BEGIN;
CREATE TABLE platform_groups (
    platformgroup_id serial PRIMARY KEY,
    platformgroup_name varchar(64) NOT NULL,
    CONSTRAINT platform_group_name_must_be_unique UNIQUE (platformgroup_name));

ALTER TABLE platforms ADD COLUMN platform_group integer REFERENCES platform_groups DEFAULT NULL;
END;
'''

* init-database.sql: Added 'platform_group' column to 'platforms' table.
Added 'platform_groups' table.
* migrate-database.sql: Updated migration script accordingly.
* public/admin/platform-groups.php: Added a page to manage platform groups.
* public/admin/platforms.php: Added support to update platform group in admin page.
* public/include/admin-header.php: Added link to page that maneges platform groups.
* public/include/manifest-generator.php: Added 'platformGroup' in manifest.
* public/v3/index.html: Included 'platform-groups.js'.
* public/v3/models/analysis-task.js:
(AnalysisTask.prototype.async.commitSetsFromTestGroupsAndMeasurementSet):
Included measurement commit sets from other platforms in the same platform group.
(AnalysisTask.prototype._commitSetForOtherPlatformsInSameGroup):
Helper function to find measurment commit set for other platforms in same platform group.
* public/v3/models/manifest.js: Added step to build 'PlatformGroup' instances.
* public/v3/models/platform-group.js: Added 'PlatformGroup' to represent entries in 'platform_groups' table.
(PlatformGroup):
(PlatformGroup.prototype.addPlatform):
(PlatformGroup.prototype.platforms):
* public/v3/models/platform.js: Added itself to 'PlatformGroup' in constructor if it belongs
to a group.
(Platform.prototype.group): Return the platform group of current platform.
* public/v3/models/time-series.js: Added helper function to show view between a given time range.
(TimeSeries.prototype.viewBetweenTime):
* server-tests/api-manifest-tests.js: Updated unit test to also test platform group initialization.
* tools/js/database.js: Added prefix for 'platform_groups'.
* tools/js/v3-models.js: Added import for platform group.

Canonical link: https://commits.webkit.org/230971@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269083 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-28 01:00:35 +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
Zhifei Fang 7b347d7d2e Test-freshness page table heaer misplaced
Some platform name is too long
https://bugs.webkit.org/show_bug.cgi?id=208617

Reviewed by Ryosuke Niwa.

* public/v3/pages/test-freshness-page.js:
(TestFreshnessPage.cssTemplate):


Canonical link: https://commits.webkit.org/221527@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257895 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-05 03:14:47 +00:00
Zhifei Fang e3096f8a46 Add power metric to perf dashboard
https://bugs.webkit.org/show_bug.cgi?id=205227

Reviewed by Ryosuke Niwa.

* public/v3/models/metric.js:
(Metric):


Canonical link: https://commits.webkit.org/218458@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253542 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-12-15 22:12:34 +00:00
Dewei Zhu 6d578dff43 Custom analysis task page should allow schedule any triggerable accepted tests.
https://bugs.webkit.org/show_bug.cgi?id=204925

Reviewed by Ryosuke Niwa.

Fix a bug that subtest will not show on custom analysis task page if both itself and parent test are
accepted by triggerable.
Order test list in alphabetical order.

* public/v3/components/custom-analysis-task-configurator.js:
(CustomAnalysisTaskConfigurator.prototype._renderTriggerableTests):

Canonical link: https://commits.webkit.org/218169@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-12-06 22:49:02 +00:00
Dewei Zhu 6da537599e Fix a bug that cannot unhide a platform.
https://bugs.webkit.org/show_bug.cgi?id=203521

Reviewed by Ryosuke Niwa.

Before this change, the there is no value in POST when 'hidden' checkbox is unchecked.
Then the update will fail because platform_hidden cannot be NULL.

* public/admin/platforms.php: Adapted 'update_boolean_field'.
* public/admin/triggerables.php: Adapted 'update_boolean_field'.
* public/include/admin-header.php: Added 'update_boolean_field' helper function to set explict
boolean value for update.

Canonical link: https://commits.webkit.org/216901@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-28 21:46:29 +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 be57e94171 Improve test freshness page interaction experience.
https://bugs.webkit.org/show_bug.cgi?id=202684

Reviewed by Ryosuke Niwa.

Change test freshness page show tooltip on click instead of popuping on mouse hover.
And clicking anywhere in 'page-with-heading' section except the tooltip can dismiss tooltip.
Add keyboard support to move focus around including 'Tab' key support.
Add support to use 'Enter' key to show or dismiss tooltip.
Add support to use 'Escape' key to dismiss tooltip.

* public/shared/common-component-base.js: Added support for link to specify 'tabindex'.
(CommonComponentBase.prototype.createLink):
(CommonComponentBase.createLink):
(CommonComponentBase):
* public/v3/components/base.js: Added support for customizing whether or not prevent default and stop propagation
while creating event handler.
(ComponentBase.prototype.createEventHandler):
(ComponentBase.createEventHandler):
(ComponentBase):
* public/v3/components/freshness-indicator.js:
(FreshnessIndicator): Removed 'url' property and removed customization for mouse event.
(FreshnessIndicator.prototype.update):
(FreshnessIndicator.prototype.didConstructShadowTree): Deleted.
* public/v3/pages/test-freshness-page.js:
(TestFreshnessPage): Changed to show tooltip on click and added key board event.
(TestFreshnessPage.prototype.didConstructShadowTree): Added key event support.
(TestFreshnessPage.prototype._findClosestIndicatorAnchorForCoordinate):
(TestFreshnessPage.prototype.render):
(TestFreshnessPage.prototype._renderTooltip):
(TestFreshnessPage.prototype._constructTableCell): Added tabIndex for each cell that contains freshness indicator.
(TestFreshnessPage.prototype._configureAnchorForIndicator):
(TestFreshnessPage.prototype._clearIndicatorState): Changed the color of links in tooltip to a more readable color.
Added styles when anchor for status cell and links on tooltip are focused.
(TestFreshnessPage.cssTemplate):

Canonical link: https://commits.webkit.org/216318@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251028 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-11 23:17:52 +00:00
Zhifei Fang 7841b6e3c4 [perf dashboard] Test fressness popover sometimes point to wrong place
https://bugs.webkit.org/show_bug.cgi?id=202606

Reviewed by Ryosuke Niwa.

* public/v3/pages/test-freshness-page.js: Use a invisable tooltip anchor to cacluate tooltip position. It also helps to get rid of caculation for determine the tooltip table position.
(TestFreshnessPage.prototype._renderTooltip):
(TestFreshnessPage.cssTemplate):


Canonical link: https://commits.webkit.org/216089@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-05 01:16:58 +00:00
Zhifei Fang 2fc3d725fd [perf dashboard] Make test fressness head and indicator perfect centered
https://bugs.webkit.org/show_bug.cgi?id=202602

Reviewed by Ryosuke Niwa.

* public/v3/components/freshness-indicator.js: make indicator margin auto, it will then horizontally centered in the container
(FreshnessIndicator.cssTemplate):
(FreshnessIndicator):
* public/v3/pages/test-freshness-page.js: make the table head transform based on the center left
(TestFreshnessPage.cssTemplate):


Canonical link: https://commits.webkit.org/216082@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250749 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-04 22:07:15 +00:00
Dewei Zhu e12f1e4434 Fix a bug that warning icon causes infinite rendering when it has warning message.
https://bugs.webkit.org/show_bug.cgi?id=202502

Reviewed by Ryosuke Niwa.

Fix the problem that a warning icon with a warning message will result in infinite rendering.

* public/v3/components/button-base.js:
(ButtonBase):
(ButtonBase.prototype.setButtonTitle): Fixed a typo in function name and moved the title update to
render function.
(ButtonBase.prototype.render): Added the logic to render title.
* public/v3/components/test-group-revision-table.js: Set warning message by invoking setButtonTitle.
* public/v3/components/warning-icon.js: Removed the warning messge related code and leave the responsibility
to ButtonBase.
(WarningIcon):
(WarningIcon.prototype.render):

Canonical link: https://commits.webkit.org/216007@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-03 08:39:53 +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 c17de2bb3d Dashboard should defaults to first dashboard page when summary page is not available.
https://bugs.webkit.org/show_bug.cgi?id=200180

Reviewed by Ryosuke Niwa.

Fix a bug that charts page will become the default when there is no summary page but there
is at least one dashboard page.

* public/v3/main.js: Charts page and analysis category page should not be considered as summay pages.
(main):

Canonical link: https://commits.webkit.org/214127@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248110 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-01 18:02:45 +00:00
Dewei Zhu 63c23c2c41 Analysis task page should show build request author and creation time.
https://bugs.webkit.org/show_bug.cgi?id=200274

Reviewed by Ryosuke Niwa.

Author and creation time of a build request should be visible in analysis task page.

* public/v3/pages/analysis-task-page.js: Added UI to show build request creation time and author.
(AnalysisTaskTestGroupPane.prototype._renderCurrentTestGroup):

Canonical link: https://commits.webkit.org/214092@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248045 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-07-31 16:28:02 +00:00
Dewei Zhu 9ad3dafa07 Should not render latest build information if there is no data points for a config.
https://bugs.webkit.org/show_bug.cgi?id=200250

Reviewed by Ryosuke Niwa.

Fix a bug test freshness page that tooltip cannot be rendered when a cell does not have
a data point.

* public/v3/pages/test-freshness-page.js: Added a null check on commit set before rendering
latest build informaiton.
(TestFreshnessPage.prototype._renderTooltip):

Canonical link: https://commits.webkit.org/214055@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248007 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-07-30 16:04:23 +00:00
Dewei Zhu e41b618186 Fix a bug that cannot update builder password on builders administrative page.
https://bugs.webkit.org/show_bug.cgi?id=200154

Reviewed by Ryosuke Niwa.

'builders' administrative page should be able to update password for a builder.

* public/admin/builders.php: Should be able to update builder password.

Canonical link: https://commits.webkit.org/213982@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-07-26 17:58:21 +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 89197f0056 Test freshness page should expose revision information for latest build on tooltip.
https://bugs.webkit.org/show_bug.cgi?id=199483

Reviewed by Ryosuke Niwa.

Added latest build revision information on test freshness page tooltip.

* public/v3/pages/test-freshness-page.js: Add build revision information on tooltip.
(TestFreshnessPage.prototype.didConstructShadowTree):
(TestFreshnessPage.prototype._fetchTestResults):
(TestFreshnessPage.prototype.render):
(TestFreshnessPage.prototype._renderTooltip):
(TestFreshnessPage.cssTemplate):

Canonical link: https://commits.webkit.org/213431@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247168 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-07-05 19:19:28 +00:00
Dewei Zhu 61eeb80b1e commit api should not return 'AmbiguousRevisionPrefix' if there is an exact revision match
https://bugs.webkit.org/show_bug.cgi?id=199227

Reviewed by Ryosuke Niwa.

When prefix match is specified, api should check whether there is an exact match when multiple commits
match the prefix.

* public/include/commit-log-fetcher.php: Added the logic to check if there is an exact match when multiple matches are found.
* server-tests/api-commits-tests.js: Added an unit test.

Canonical link: https://commits.webkit.org/213193@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246847 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-06-26 21:59:41 +00:00
Dean Johnson 5cfe1171fd [perf.webkit.org] Update summary page calculations to use mean instead of median
https://bugs.webkit.org/show_bug.cgi?id=199050

Reviewed by Dewei Zhu.

* public/v3/pages/summary-page.js:
(SummaryPageConfigurationGroup): Updated 'median' references to 'mean'.
(SummaryPageConfigurationGroup.set _startAndEndPointForTimeRange): Factored out logic for finding data
points in a timeSeries, within a specified timeRange.
(SummaryPageConfigurationGroup.set _meanForTimeRange): New. Returns the mean of a timeSeries across a
given timeRange.


Canonical link: https://commits.webkit.org/213128@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246743 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-06-24 18:20:43 +00:00