diff --git a/app_dart/dev/branches.txt b/app_dart/dev/branches.txt deleted file mode 100644 index 592c177c3..000000000 --- a/app_dart/dev/branches.txt +++ /dev/null @@ -1,4 +0,0 @@ -master -main -flutter-2.13-candidate.0 -fuchsia_r48 diff --git a/app_dart/lib/src/model/appengine/stage.dart b/app_dart/lib/src/model/appengine/stage.dart index b6ddb040b..c09b2ef53 100644 --- a/app_dart/lib/src/model/appengine/stage.dart +++ b/app_dart/lib/src/model/appengine/stage.dart @@ -13,7 +13,7 @@ part 'stage.g.dart'; /// A group of related [Task]s run against a particular [Commit]. /// /// Stages are grouped by the infrastructure family that runs them, such as -/// Cirrus, LUCI, DeviceLab on Linux, DeviceLab on Windows, etc. +/// LUCI, DeviceLab on Linux, DeviceLab on Windows, etc. @immutable @JsonSerializable(createFactory: false, ignoreUnannotated: true) class Stage implements Comparable { @@ -25,7 +25,6 @@ class Stage implements Comparable { /// /// Unknown stages will be placed at the end of any ordering. static const List _order = [ - 'cirrus', 'chromebot', 'devicelab', 'devicelab_win', @@ -35,7 +34,7 @@ class Stage implements Comparable { /// Arbitrarily large index to represent the "end of the ordering". static const int _endOfList = 1000000; - /// The name of the stage (e.g. 'cirrus', 'devicelab', 'devicelab_win'). + /// The name of the stage (e.g. 'devicelab', 'devicelab_win'). /// /// This is guaranteed to be non-null. @JsonKey(name: 'Name') @@ -71,7 +70,7 @@ class Stage implements Comparable { /// Whether this stage is managed by the Flutter device lab. /// - /// Stages such as 'cirrus' and 'chromebot' are not managed by the Flutter + /// Stages such as 'chromebot' are not managed by the Flutter /// device lab. bool get isManagedByDeviceLab => name!.startsWith('devicelab'); diff --git a/app_dart/lib/src/request_handlers/github/webhook_subscription.dart b/app_dart/lib/src/request_handlers/github/webhook_subscription.dart index 91512c288..e0a0144e0 100644 --- a/app_dart/lib/src/request_handlers/github/webhook_subscription.dart +++ b/app_dart/lib/src/request_handlers/github/webhook_subscription.dart @@ -367,7 +367,6 @@ class GithubWebhookSubscription extends SubscriptionHandler { /// requirement, across repositories. bool _isTestExempt(String filename) { return filename.contains('.ci.yaml') || - filename.contains('.cirrus.yml') || filename.contains('analysis_options.yaml') || filename.contains('AUTHORS') || filename.contains('CODEOWNERS') || diff --git a/app_dart/lib/src/request_handlers/refresh_cirrus_status.dart b/app_dart/lib/src/request_handlers/refresh_cirrus_status.dart deleted file mode 100644 index e8002af35..000000000 --- a/app_dart/lib/src/request_handlers/refresh_cirrus_status.dart +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2019 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:graphql/client.dart'; - -import '../request_handling/exceptions.dart'; -import '../service/logging.dart'; -import 'refresh_cirrus_status_queries.dart'; - -/// Refer all cirrus build statuses at: https://github.com/cirruslabs/cirrus-ci-web/blob/master/schema.graphql#L120 -const List kCirrusFailedStates = [ - 'ABORTED', - 'FAILED', -]; -const List kCirrusInProgressStates = ['CREATED', 'TRIGGERED', 'SCHEDULED', 'EXECUTING', 'PAUSED']; - -/// Return the latest Cirrus build for a given [sha] by querying the cirrus graphQL. -/// -/// API explorer: https://cirrus-ci.com/explorer -Future queryCirrusGraphQL( - String sha, - GraphQLClient client, - String name, -) async { - const String owner = 'flutter'; - log.info('Cirrus query owner:$owner, name:$name, sha:$sha '); - final QueryResult result = await client.query( - QueryOptions( - document: cirusStatusQuery, - fetchPolicy: FetchPolicy.noCache, - variables: { - 'owner': owner, - 'name': name, - 'SHA': sha, - }, - ), - ); - if (result.hasException) { - log.severe(result.exception.toString()); - throw const BadRequestException('GraphQL query failed'); - } - - final List> tasks = >[]; - late CirrusResult cirrusResult; - - if (result.data == null) { - cirrusResult = CirrusResult(null, null, tasks); - return cirrusResult; - } - try { - cirrusResult = getFirstBuildResult(result.data, tasks, name: name, sha: sha); - } catch (_) { - log.fine('Did not receive expected result from Cirrus, sha $sha may not be executing Cirrus tasks.'); - } - return cirrusResult; -} - -/// There may be multiple build results for a single commit. -/// -/// This returns the first build which represents the latest test statuses. -CirrusResult getFirstBuildResult( - Map? data, - List> tasks, { - String? name, - String? sha, -}) { - log.info('Cirrus data: $data'); - final List searchBuilds = data!['searchBuilds'] as List; - if (searchBuilds.isEmpty) { - return const CirrusResult(null, null, >[]); - } - final Map searchBuild = searchBuilds.first as Map; - tasks.addAll((searchBuild['latestGroupTasks'] as List).cast>()); - final String? id = searchBuild['id'] as String?; - log.info('Cirrus searchBuild id for flutter/$name, commit: $sha: $id'); - final String? branch = searchBuild['branch'] as String?; - return CirrusResult(id, branch, tasks); -} - -class CirrusResult { - const CirrusResult(this.id, this.branch, this.tasks); - - final String? id; - final String? branch; - final List> tasks; -} diff --git a/app_dart/lib/src/request_handlers/refresh_cirrus_status_queries.dart b/app_dart/lib/src/request_handlers/refresh_cirrus_status_queries.dart deleted file mode 100644 index 774280fbc..000000000 --- a/app_dart/lib/src/request_handlers/refresh_cirrus_status_queries.dart +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2019 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:gql/ast.dart'; -import 'package:gql/language.dart' as lang; - -final DocumentNode cirusStatusQuery = lang.parseString(r''' - query BuildBySHAQuery($owner: String!, $name: String!, $SHA: String) { - searchBuilds(repositoryOwner: $owner, repositoryName: $name, SHA: $SHA) { - id branch latestGroupTasks { - id name status - } - } - }'''); diff --git a/app_dart/lib/src/service/config.dart b/app_dart/lib/src/service/config.dart index ec1c9882b..9ec6937bb 100644 --- a/app_dart/lib/src/service/config.dart +++ b/app_dart/lib/src/service/config.dart @@ -61,9 +61,6 @@ class Config { packagesSlug, }; - /// List of Cirrus supported repos. - static Set cirrusSupportedRepos = {'packages', 'flutter'}; - /// GitHub repositories that use CI status to determine if pull requests can be submitted. static Set reposWithTreeStatus = { engineSlug, @@ -420,17 +417,6 @@ class Config { ); } - Future createCirrusGraphQLClient() async { - final HttpLink httpLink = HttpLink( - 'https://api.cirrus-ci.com/graphql', - ); - - return GraphQLClient( - cache: GraphQLCache(), - link: httpLink, - ); - } - Future createBigQueryService() async { final AccessClientProvider accessClientProvider = AccessClientProvider(); return BigqueryService(accessClientProvider); diff --git a/app_dart/test/model/stage_test.dart b/app_dart/test/model/stage_test.dart index 207db5a21..edd592d06 100644 --- a/app_dart/test/model/stage_test.dart +++ b/app_dart/test/model/stage_test.dart @@ -26,14 +26,12 @@ void main() { final List stages = [ buildStage(name: 'devicelab'), buildStage(name: 'unknown'), - buildStage(name: 'cirrus'), ]; stages.sort(); - expect(stages.map((Stage stage) => stage.name), ['cirrus', 'devicelab', 'unknown']); + expect(stages.map((Stage stage) => stage.name), ['devicelab', 'unknown']); }); test('isManagedByDeviceLab', () { - expect(buildStage(name: 'cirrus').isManagedByDeviceLab, isFalse); expect(buildStage(name: 'devicelab').isManagedByDeviceLab, isTrue); expect(buildStage(name: 'unknown').isManagedByDeviceLab, isFalse); }); diff --git a/app_dart/test/request_handlers/github/webhook_subscription_test.dart b/app_dart/test/request_handlers/github/webhook_subscription_test.dart index f0ab0c7a7..9b921ea0e 100644 --- a/app_dart/test/request_handlers/github/webhook_subscription_test.dart +++ b/app_dart/test/request_handlers/github/webhook_subscription_test.dart @@ -981,7 +981,7 @@ void main() { ); }); - test('Framework no comment if only ci.yaml and cirrus.yml changed', () async { + test('Framework no comment if only ci.yamlchanged', () async { const int issueNumber = 123; tester.message = generateGithubWebhookMessage( @@ -993,7 +993,6 @@ void main() { when(pullRequestsService.listFiles(slug, issueNumber)).thenAnswer( (_) => Stream.fromIterable([ PullRequestFile()..filename = '.ci.yaml', - PullRequestFile()..filename = '.cirrus.yml', ]), ); diff --git a/app_dart/test/request_handlers/refresh_cirrus_status_test.dart b/app_dart/test/request_handlers/refresh_cirrus_status_test.dart deleted file mode 100644 index 63c063b47..000000000 --- a/app_dart/test/request_handlers/refresh_cirrus_status_test.dart +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2020 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:cocoon_service/src/request_handlers/refresh_cirrus_status.dart'; -import 'package:test/test.dart'; - -void main() { - group('RefreshCirrusStatus', () { - Map? data; - final List> tasks = >[]; - setUp(() { - data = dataWithMultipleBuilds; - }); - test('returns first build result', () async { - final CirrusResult cirrusResult = getFirstBuildResult(data, tasks); - expect(cirrusResult.id, "4532390054854656"); - expect(cirrusResult.tasks[0]['id'] as String, "4566569471705088"); - }); - }); -} - -Map dataWithMultipleBuilds = { - "searchBuilds": [ - { - "id": "4532390054854656", - "branch": "dependabot/github_actions/ossf/scorecard-action-1.0.4", - "latestGroupTasks": [ - {"id": "4566569471705088", "name": "format+analyze", "status": "COMPLETED"}, - {"id": "5692469378547712", "name": "publishable", "status": "COMPLETED"}, - ], - }, - { - "id": "6393714829426688", - "branch": "dependabot/github_actions/ossf/scorecard-action-1.0.4", - "latestGroupTasks": [ - {"id": "4930474559668224", "name": "format+analyze", "status": "COMPLETED"}, - {"id": "4971160919080960", "name": "publishable", "status": "COMPLETED"}, - ], - } - ], -}; diff --git a/app_dart/test/src/datastore/fake_config.dart b/app_dart/test/src/datastore/fake_config.dart index 424edcc79..617bcbae6 100644 --- a/app_dart/test/src/datastore/fake_config.dart +++ b/app_dart/test/src/datastore/fake_config.dart @@ -41,7 +41,6 @@ class FakeConfig implements Config { this.githubService, this.bigqueryService, this.githubGraphQLClient, - this.cirrusGraphQLClient, this.rollerAccountsValue, this.flutterBuildValue, this.flutterBuildDescriptionValue, @@ -67,7 +66,6 @@ class FakeConfig implements Config { gh.GitHub? githubClient; GraphQLClient? githubGraphQLClient; - GraphQLClient? cirrusGraphQLClient; TabledataResource? tabledataResource; BigqueryService? bigqueryService; GithubService? githubService; @@ -123,9 +121,6 @@ class FakeConfig implements Config { @override Future createGitHubGraphQLClient() async => githubGraphQLClient!; - @override - Future createCirrusGraphQLClient() async => cirrusGraphQLClient!; - @override Future createTabledataResourceApi() async => tabledataResource!; diff --git a/dashboard/lib/logic/qualified_task.dart b/dashboard/lib/logic/qualified_task.dart index d6c30c198..ca6e027b1 100644 --- a/dashboard/lib/logic/qualified_task.dart +++ b/dashboard/lib/logic/qualified_task.dart @@ -39,12 +39,9 @@ class QualifiedTask { /// Get the URL for the configuration of this task. /// /// Luci tasks are stored on Luci. - /// Cirrus tasks are stored on Cirrus. String get sourceConfigurationUrl { - assert(isLuci || isCirrus || isGoogleTest || isDartInternal); - if (isCirrus) { - return '$_cirrusUrl/master'; - } else if (isLuci) { + assert(isLuci || isGoogleTest || isDartInternal); + if (isLuci) { return '$_luciUrl/builders/$pool/$task'; } else if (isGoogleTest) { return _googleTestUrl; @@ -57,9 +54,6 @@ class QualifiedTask { /// Whether this task was run on google test. bool get isGoogleTest => stage == StageName.googleTest; - /// Whether this task was run on Cirrus CI. - bool get isCirrus => stage == StageName.cirrus; - /// Whether the task was run on the LUCI infrastructure. bool get isLuci => stage == StageName.cocoon || stage == StageName.legacyLuci || stage == StageName.luci; diff --git a/dashboard/lib/service/appengine_cocoon.dart b/dashboard/lib/service/appengine_cocoon.dart index 1cddc65c9..cb7f53303 100644 --- a/dashboard/lib/service/appengine_cocoon.dart +++ b/dashboard/lib/service/appengine_cocoon.dart @@ -290,12 +290,10 @@ class AppEngineCocoonService implements CocoonService { ..status = taskData['Status'] as String ..isTestFlaky = taskData['TestFlaky'] as bool? ?? false; - if (taskData['StageName'] != StageName.cirrus) { - task - ..buildNumberList = taskData['BuildNumberList'] as String? ?? '' - ..builderName = taskData['BuilderName'] as String? ?? '' - ..luciBucket = taskData['LuciBucket'] as String? ?? ''; - } + task + ..buildNumberList = taskData['BuildNumberList'] as String? ?? '' + ..builderName = taskData['BuilderName'] as String? ?? '' + ..luciBucket = taskData['LuciBucket'] as String? ?? ''; return task; } } diff --git a/dashboard/lib/widgets/task_overlay.dart b/dashboard/lib/widgets/task_overlay.dart index dd977ab0c..9d185ffda 100644 --- a/dashboard/lib/widgets/task_overlay.dart +++ b/dashboard/lib/widgets/task_overlay.dart @@ -105,7 +105,7 @@ class TaskOverlayEntry extends StatelessWidget { /// A reference to the [BuildState] for performing operations on this [Task]. final BuildState buildState; - /// [Commit] for cirrus tasks to show log. + /// [Commit] for tasks to show log. final Commit commit; @override @@ -177,7 +177,7 @@ class TaskOverlayContents extends StatelessWidget { /// The [Task] to display in the overlay final Task task; - /// [Commit] for cirrus tasks to show log. + /// [Commit] for tasks to show log. final Commit? commit; /// This callback removes the parent overlay from the widget tree. diff --git a/dashboard/test/goldens/build_dashboard.defaultPropertySheet.dark.png b/dashboard/test/goldens/build_dashboard.defaultPropertySheet.dark.png index 3f507e8c8..3ee510439 100644 Binary files a/dashboard/test/goldens/build_dashboard.defaultPropertySheet.dark.png and b/dashboard/test/goldens/build_dashboard.defaultPropertySheet.dark.png differ diff --git a/dashboard/test/goldens/build_dashboard.defaultPropertySheet.png b/dashboard/test/goldens/build_dashboard.defaultPropertySheet.png index 1c05c4482..756c94a6a 100644 Binary files a/dashboard/test/goldens/build_dashboard.defaultPropertySheet.png and b/dashboard/test/goldens/build_dashboard.defaultPropertySheet.png differ diff --git a/dashboard/test/logic/qualified_task_test.dart b/dashboard/test/logic/qualified_task_test.dart index 362044e74..2e7d19ac1 100644 --- a/dashboard/test/logic/qualified_task_test.dart +++ b/dashboard/test/logic/qualified_task_test.dart @@ -20,15 +20,6 @@ void main() { ); }); - test('QualifiedTask.sourceConfigurationUrl for cirrus', () { - final Task cirrusTask = Task()..stageName = 'cirrus'; - - expect( - QualifiedTask.fromTask(cirrusTask).sourceConfigurationUrl, - 'https://cirrus-ci.com/github/flutter/flutter/master', - ); - }); - test('QualifiedTask.sourceConfigurationUrl for google test', () { final Task googleTestTask = Task()..stageName = 'google_internal'; @@ -48,7 +39,6 @@ void main() { expect(const QualifiedTask(stage: 'luci', task: 'abc').isLuci, true); expect(const QualifiedTask(stage: 'chromebot', task: 'abc').isLuci, true); expect(const QualifiedTask(stage: 'cocoon', task: 'abc').isLuci, true); - expect(const QualifiedTask(stage: 'cirrus', task: 'abc').isLuci, false); expect(const QualifiedTask(stage: 'google_internal', task: 'abc').isLuci, false); }); } diff --git a/dashboard/test/widgets/goldens/task_overlay_test.nondevicelab_open.png b/dashboard/test/widgets/goldens/task_overlay_test.nondevicelab_open.png index af7dd7766..216685786 100644 Binary files a/dashboard/test/widgets/goldens/task_overlay_test.nondevicelab_open.png and b/dashboard/test/widgets/goldens/task_overlay_test.nondevicelab_open.png differ diff --git a/dashboard/test/widgets/task_overlay_test.dart b/dashboard/test/widgets/task_overlay_test.dart index c265ebcf3..e908b39fd 100644 --- a/dashboard/test/widgets/task_overlay_test.dart +++ b/dashboard/test/widgets/task_overlay_test.dart @@ -306,7 +306,7 @@ void main() { body: TestGrid( buildState: buildState, task: Task() - ..stageName = 'cirrus' + ..stageName = 'luci' ..status = TaskBox.statusSucceeded, ), ),