Skip to content

Commit

Permalink
Remove use of cirrus from backend. (flutter#3064)
Browse files Browse the repository at this point in the history
Remove cirrus code as it is not used anymore.
  • Loading branch information
godofredoc authored Sep 13, 2023
1 parent b1935c3 commit c5b80c6
Show file tree
Hide file tree
Showing 18 changed files with 14 additions and 206 deletions.
4 changes: 0 additions & 4 deletions app_dart/dev/branches.txt

This file was deleted.

7 changes: 3 additions & 4 deletions app_dart/lib/src/model/appengine/stage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<Stage> {
Expand All @@ -25,7 +25,6 @@ class Stage implements Comparable<Stage> {
///
/// Unknown stages will be placed at the end of any ordering.
static const List<String?> _order = <String?>[
'cirrus',
'chromebot',
'devicelab',
'devicelab_win',
Expand All @@ -35,7 +34,7 @@ class Stage implements Comparable<Stage> {
/// 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')
Expand Down Expand Up @@ -71,7 +70,7 @@ class Stage implements Comparable<Stage> {

/// 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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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') ||
Expand Down
89 changes: 0 additions & 89 deletions app_dart/lib/src/request_handlers/refresh_cirrus_status.dart

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions app_dart/lib/src/service/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ class Config {
packagesSlug,
};

/// List of Cirrus supported repos.
static Set<String> cirrusSupportedRepos = <String>{'packages', 'flutter'};

/// GitHub repositories that use CI status to determine if pull requests can be submitted.
static Set<gh.RepositorySlug> reposWithTreeStatus = <gh.RepositorySlug>{
engineSlug,
Expand Down Expand Up @@ -420,17 +417,6 @@ class Config {
);
}

Future<GraphQLClient> createCirrusGraphQLClient() async {
final HttpLink httpLink = HttpLink(
'https://api.cirrus-ci.com/graphql',
);

return GraphQLClient(
cache: GraphQLCache(),
link: httpLink,
);
}

Future<BigqueryService> createBigQueryService() async {
final AccessClientProvider accessClientProvider = AccessClientProvider();
return BigqueryService(accessClientProvider);
Expand Down
4 changes: 1 addition & 3 deletions app_dart/test/model/stage_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ void main() {
final List<Stage> stages = <Stage>[
buildStage(name: 'devicelab'),
buildStage(name: 'unknown'),
buildStage(name: 'cirrus'),
];
stages.sort();
expect(stages.map<String?>((Stage stage) => stage.name), <String>['cirrus', 'devicelab', 'unknown']);
expect(stages.map<String?>((Stage stage) => stage.name), <String>['devicelab', 'unknown']);
});

test('isManagedByDeviceLab', () {
expect(buildStage(name: 'cirrus').isManagedByDeviceLab, isFalse);
expect(buildStage(name: 'devicelab').isManagedByDeviceLab, isTrue);
expect(buildStage(name: 'unknown').isManagedByDeviceLab, isFalse);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -993,7 +993,6 @@ void main() {
when(pullRequestsService.listFiles(slug, issueNumber)).thenAnswer(
(_) => Stream<PullRequestFile>.fromIterable(<PullRequestFile>[
PullRequestFile()..filename = '.ci.yaml',
PullRequestFile()..filename = '.cirrus.yml',
]),
);

Expand Down
42 changes: 0 additions & 42 deletions app_dart/test/request_handlers/refresh_cirrus_status_test.dart

This file was deleted.

5 changes: 0 additions & 5 deletions app_dart/test/src/datastore/fake_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class FakeConfig implements Config {
this.githubService,
this.bigqueryService,
this.githubGraphQLClient,
this.cirrusGraphQLClient,
this.rollerAccountsValue,
this.flutterBuildValue,
this.flutterBuildDescriptionValue,
Expand All @@ -67,7 +66,6 @@ class FakeConfig implements Config {

gh.GitHub? githubClient;
GraphQLClient? githubGraphQLClient;
GraphQLClient? cirrusGraphQLClient;
TabledataResource? tabledataResource;
BigqueryService? bigqueryService;
GithubService? githubService;
Expand Down Expand Up @@ -123,9 +121,6 @@ class FakeConfig implements Config {
@override
Future<GraphQLClient> createGitHubGraphQLClient() async => githubGraphQLClient!;

@override
Future<GraphQLClient> createCirrusGraphQLClient() async => cirrusGraphQLClient!;

@override
Future<TabledataResource> createTabledataResourceApi() async => tabledataResource!;

Expand Down
10 changes: 2 additions & 8 deletions dashboard/lib/logic/qualified_task.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down
10 changes: 4 additions & 6 deletions dashboard/lib/service/appengine_cocoon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
4 changes: 2 additions & 2 deletions dashboard/lib/widgets/task_overlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dashboard/test/goldens/build_dashboard.defaultPropertySheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 0 additions & 10 deletions dashboard/test/logic/qualified_task_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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);
});
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dashboard/test/widgets/task_overlay_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ void main() {
body: TestGrid(
buildState: buildState,
task: Task()
..stageName = 'cirrus'
..stageName = 'luci'
..status = TaskBox.statusSucceeded,
),
),
Expand Down

0 comments on commit c5b80c6

Please sign in to comment.