[conductor] Remove CiYaml model (#120458)

* [conductor] Remove CiYaml model

* Remove package:yaml

* Update pubspec checksum
This commit is contained in:
Casey Hillers 2023-02-10 12:29:31 -08:00 committed by GitHub
parent 52ab299362
commit 65fd924d84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 46 deletions

View file

@ -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<CiYaml> get ciYaml async {
final CiYaml ciYaml =
CiYaml((await checkoutDirectory).childFile('.ci.yaml'));
return ciYaml;
}
Future<String> get cacheDirectory async {
return fileSystem.path.join(
(await checkoutDirectory).path,
@ -857,11 +850,6 @@ class EngineRepository extends Repository {
final Checkouts checkouts;
Future<CiYaml> 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;
}

View file

@ -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

View file

@ -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';