From 65fd924d848f611c36de6a1e1bf1059c334ac86f Mon Sep 17 00:00:00 2001 From: Casey Hillers Date: Fri, 10 Feb 2023 12:29:31 -0800 Subject: [PATCH] [conductor] Remove CiYaml model (#120458) * [conductor] Remove CiYaml model * Remove package:yaml * Update pubspec checksum --- dev/conductor/core/lib/src/repository.dart | 35 -------------------- dev/conductor/core/pubspec.yaml | 3 +- dev/conductor/core/test/repository_test.dart | 9 ----- 3 files changed, 1 insertion(+), 46 deletions(-) diff --git a/dev/conductor/core/lib/src/repository.dart b/dev/conductor/core/lib/src/repository.dart index 0f52e4ee9d..0dc55560e5 100644 --- a/dev/conductor/core/lib/src/repository.dart +++ b/dev/conductor/core/lib/src/repository.dart @@ -10,7 +10,6 @@ import 'package:file/file.dart'; import 'package:meta/meta.dart'; import 'package:platform/platform.dart'; import 'package:process/process.dart'; -import 'package:yaml/yaml.dart'; import './git.dart'; import './globals.dart'; @@ -599,12 +598,6 @@ class FrameworkRepository extends Repository { static const String defaultUpstream = 'git@github.com:flutter/flutter.git'; static const String defaultBranch = 'master'; - Future get ciYaml async { - final CiYaml ciYaml = - CiYaml((await checkoutDirectory).childFile('.ci.yaml')); - return ciYaml; - } - Future get cacheDirectory async { return fileSystem.path.join( (await checkoutDirectory).path, @@ -857,11 +850,6 @@ class EngineRepository extends Repository { final Checkouts checkouts; - Future get ciYaml async { - final CiYaml ciYaml = CiYaml((await checkoutDirectory).childFile('.ci.yaml')); - return ciYaml; - } - static const String defaultUpstream = 'git@github.com:flutter/engine.git'; static const String defaultBranch = 'main'; @@ -930,26 +918,3 @@ class Checkouts { final ProcessManager processManager; final Stdio stdio; } - -class CiYaml { - CiYaml(this.file) { - if (!file.existsSync()) { - throw ConductorException('Could not find the .ci.yaml file at ${file.path}'); - } - } - - /// Underlying [File] that this object wraps. - final File file; - - /// Returns the raw string contents of this file. - /// - /// This is not cached as the contents can be written to while the conductor - /// is running. - String get stringContents => file.readAsStringSync(); - - /// Returns the parsed contents of the file as a [YamlMap]. - /// - /// This is not cached as the contents can be written to while the conductor - /// is running. - YamlMap get contents => loadYaml(stringContents) as YamlMap; -} diff --git a/dev/conductor/core/pubspec.yaml b/dev/conductor/core/pubspec.yaml index 391dcff739..d07db3e90b 100644 --- a/dev/conductor/core/pubspec.yaml +++ b/dev/conductor/core/pubspec.yaml @@ -15,7 +15,6 @@ dependencies: path: 1.8.3 process: 4.2.4 protobuf: 2.1.0 - yaml: 3.1.1 async: 2.10.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" clock: 1.1.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" @@ -65,4 +64,4 @@ dev_dependencies: web_socket_channel: 2.3.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" webkit_inspection_protocol: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" -# PUBSPEC CHECKSUM: f01f +# PUBSPEC CHECKSUM: 721e diff --git a/dev/conductor/core/test/repository_test.dart b/dev/conductor/core/test/repository_test.dart index 35196b8acc..c7b508483c 100644 --- a/dev/conductor/core/test/repository_test.dart +++ b/dev/conductor/core/test/repository_test.dart @@ -393,15 +393,6 @@ vars = { expect(didUpdate, false); }); - test('CiYaml(file) will throw if file does not exist', () { - final File file = fileSystem.file('/non/existent/file.txt'); - - expect( - () => CiYaml(file), - throwsExceptionWith('Could not find the .ci.yaml file at /non/existent/file.txt'), - ); - }); - test('framework repo set as localUpstream ensures requiredLocalBranches exist locally', () async { const String commit = 'deadbeef'; const String candidateBranch = 'flutter-1.2-candidate.3';