diff --git a/dev/conductor/core/lib/src/globals.dart b/dev/conductor/core/lib/src/globals.dart index dd62a511e707..30a6c635d6c7 100644 --- a/dev/conductor/core/lib/src/globals.dart +++ b/dev/conductor/core/lib/src/globals.dart @@ -18,7 +18,7 @@ const List kReleaseChannels = [...kBaseReleaseChannels, Framewor const String kReleaseDocumentationUrl = 'https://github.com/flutter/flutter/wiki/Flutter-Cherrypick-Process'; -const String kLuciPackagingConsoleLink = 'https://ci.chromium.org/p/flutter/g/packaging/console'; +const String kLuciPackagingConsoleLink = 'https://ci.chromium.org/p/dart-internal/g/flutter_packaging/console'; const String kWebsiteReleasesUrl = 'https://docs.flutter.dev/development/tools/sdk/releases'; diff --git a/dev/conductor/core/lib/src/next.dart b/dev/conductor/core/lib/src/next.dart index 0df5615cc4e9..1b5669dcc0f8 100644 --- a/dev/conductor/core/lib/src/next.dart +++ b/dev/conductor/core/lib/src/next.dart @@ -141,15 +141,12 @@ class NextContext extends Context { } await pushWorkingBranch(engine, state.engine); - case pb.ReleasePhase.CODESIGN_ENGINE_BINARIES: - stdio.printStatus([ - 'You must validate pre-submit CI for your engine PR, merge it, and codesign', - 'binaries before proceeding.\n', - ].join('\n')); + case pb.ReleasePhase.VERIFY_ENGINE_CI: + stdio.printStatus('You must validate post-submit CI for your engine PR and merge it'); if (!autoAccept) { - // TODO(fujino): actually test if binaries have been codesigned on macOS final bool response = await prompt( - 'Has CI passed for the engine PR and binaries been codesigned?', + 'Has CI passed for the engine PR?\n\n' + '${state_import.luciConsoleLink(state.releaseChannel, 'engine')}' ); if (!response) { stdio.printError('Aborting command.'); @@ -190,10 +187,10 @@ class NextContext extends Context { addFirst: true, ); // append to list of cherrypicks so we know a PR is required - state.framework.cherrypicks.add(pb.Cherrypick( - appliedRevision: revision, - state: pb.CherrypickState.COMPLETED, - )); + state.framework.cherrypicks.add(pb.Cherrypick.create() + ..appliedRevision = revision + ..state = pb.CherrypickState.COMPLETED + ); } stdio.printStatus('Rolling new engine hash $engineRevision to framework checkout...'); needsCommit = await framework.updateEngineRevision(engineRevision); @@ -203,10 +200,10 @@ class NextContext extends Context { addFirst: true, ); // append to list of cherrypicks so we know a PR is required - state.framework.cherrypicks.add(pb.Cherrypick( - appliedRevision: revision, - state: pb.CherrypickState.COMPLETED, - )); + state.framework.cherrypicks.add(pb.Cherrypick.create() + ..appliedRevision = revision + ..state = pb.CherrypickState.COMPLETED + ); } final List unappliedCherrypicks = []; @@ -250,83 +247,18 @@ class NextContext extends Context { await pushWorkingBranch(framework, state.framework); case pb.ReleasePhase.PUBLISH_VERSION: - stdio.printStatus('Please ensure that you have merged your framework PR and that'); - stdio.printStatus('post-submit CI has finished successfully.\n'); - final Remote frameworkUpstream = Remote( - name: RemoteName.upstream, - url: state.framework.upstream.url, - ); - final FrameworkRepository framework = FrameworkRepository( - checkouts, - // We explicitly want to check out the merged version from upstream - initialRef: '${frameworkUpstream.name}/${state.framework.candidateBranch}', - upstreamRemote: frameworkUpstream, - previousCheckoutLocation: state.framework.checkoutPath, - ); - final String frameworkHead = await framework.reverseParse('HEAD'); - final Remote engineUpstream = Remote( - name: RemoteName.upstream, - url: state.engine.upstream.url, - ); - final EngineRepository engine = EngineRepository( - checkouts, - // We explicitly want to check out the merged version from upstream - initialRef: '${engineUpstream.name}/${state.engine.candidateBranch}', - upstreamRemote: engineUpstream, - previousCheckoutLocation: state.engine.checkoutPath, - ); - final String engineHead = await engine.reverseParse('HEAD'); - if (!autoAccept) { - final bool response = await prompt( - 'Are you ready to tag commit $frameworkHead as ${state.releaseVersion}\n' - 'and push to remote ${state.framework.upstream.url}?', - ); - if (!response) { - stdio.printError('Aborting command.'); - updateState(state, stdio.logs); - return; - } - } - await framework.tag(frameworkHead, state.releaseVersion, frameworkUpstream.name); - await engine.tag(engineHead, state.releaseVersion, engineUpstream.name); - case pb.ReleasePhase.PUBLISH_CHANNEL: - final Remote upstream = Remote( - name: RemoteName.upstream, - url: state.framework.upstream.url, - ); - final FrameworkRepository framework = FrameworkRepository( - checkouts, - // We explicitly want to check out the merged version from upstream - initialRef: '${upstream.name}/${state.framework.candidateBranch}', - upstreamRemote: upstream, - previousCheckoutLocation: state.framework.checkoutPath, - ); - final String headRevision = await framework.reverseParse('HEAD'); - if (!autoAccept) { - // dryRun: true means print out git command - await framework.pushRef( - fromRef: headRevision, - toRef: state.releaseChannel, - remote: state.framework.upstream.url, - force: force, - dryRun: true, - ); - - final bool response = await prompt( - 'Are you ready to publish version ${state.releaseVersion} to ${state.releaseChannel}?', - ); - if (!response) { - stdio.printError('Aborting command.'); - updateState(state, stdio.logs); - return; - } - } - await framework.pushRef( - fromRef: headRevision, - toRef: state.releaseChannel, - remote: state.framework.upstream.url, - force: force, - ); + final String command = ''' + tool-proxy-cli --tool_proxy=/abns/dart-eng-tool-proxy/prod-dart-eng-tool-proxy-tool-proxy.annealed-tool-proxy \\ + --block_on_mpa -I flutter_release \\ + :git_branch ${state.framework.candidateBranch} \\ + :release_channel ${state.releaseChannel} \\ + :tag ${state.releaseVersion} \\ + :force false + '''; + stdio.printStatus('Please ensure that you have merged your framework PR'); + stdio.printStatus('and post-submit CI has finished successfully.\n'); + stdio.printStatus('Run the following command, and ask a Googler'); + stdio.printStatus('to review the request\n\n$command'); case pb.ReleasePhase.VERIFY_RELEASE: stdio.printStatus( 'The current status of packaging builds can be seen at:\n' diff --git a/dev/conductor/core/lib/src/proto/conductor_state.pb.dart b/dev/conductor/core/lib/src/proto/conductor_state.pb.dart index 2cc6554aaf8b..0c3389df32fd 100644 --- a/dev/conductor/core/lib/src/proto/conductor_state.pb.dart +++ b/dev/conductor/core/lib/src/proto/conductor_state.pb.dart @@ -2,12 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/// +// // Generated code. Do not modify. // source: conductor_state.proto // // @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields + +// ignore_for_file: annotate_overrides, camel_case_types +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import import 'dart:core' as $core; @@ -19,33 +23,19 @@ import 'conductor_state.pbenum.dart'; export 'conductor_state.pbenum.dart'; class Remote extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Remote', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'conductor_state'), - createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name') - ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'url') - ..hasRequiredFields = false; - + factory Remote() => create(); Remote._() : super(); - factory Remote({ - $core.String? name, - $core.String? url, - }) { - final _result = create(); - if (name != null) { - _result.name = name; - } - if (url != null) { - _result.url = url; - } - return _result; - } factory Remote.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory Remote.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Remote', + package: const $pb.PackageName(_omitMessageNames ? '' : 'conductor_state'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'name') + ..aOS(2, _omitFieldNames ? '' : 'url') + ..hasRequiredFields = false; + @$core.Deprecated('Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') @@ -53,9 +43,10 @@ class Remote extends $pb.GeneratedMessage { @$core.Deprecated('Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - Remote copyWith(void Function(Remote) updates) => - super.copyWith((message) => updates(message as Remote)) as Remote; // ignore: deprecated_member_use + Remote copyWith(void Function(Remote) updates) => super.copyWith((message) => updates(message as Remote)) as Remote; + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') static Remote create() => Remote._(); Remote createEmptyInstance() => create(); @@ -90,42 +81,21 @@ class Remote extends $pb.GeneratedMessage { } class Cherrypick extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Cherrypick', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'conductor_state'), - createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'trunkRevision', - protoName: 'trunkRevision') - ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'appliedRevision', - protoName: 'appliedRevision') - ..e( - 3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'state', $pb.PbFieldType.OE, - defaultOrMaker: CherrypickState.PENDING, valueOf: CherrypickState.valueOf, enumValues: CherrypickState.values) - ..hasRequiredFields = false; - + factory Cherrypick() => create(); Cherrypick._() : super(); - factory Cherrypick({ - $core.String? trunkRevision, - $core.String? appliedRevision, - CherrypickState? state, - }) { - final _result = create(); - if (trunkRevision != null) { - _result.trunkRevision = trunkRevision; - } - if (appliedRevision != null) { - _result.appliedRevision = appliedRevision; - } - if (state != null) { - _result.state = state; - } - return _result; - } factory Cherrypick.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory Cherrypick.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Cherrypick', + package: const $pb.PackageName(_omitMessageNames ? '' : 'conductor_state'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'trunkRevision', protoName: 'trunkRevision') + ..aOS(2, _omitFieldNames ? '' : 'appliedRevision', protoName: 'appliedRevision') + ..e(3, _omitFieldNames ? '' : 'state', $pb.PbFieldType.OE, + defaultOrMaker: CherrypickState.PENDING, valueOf: CherrypickState.valueOf, enumValues: CherrypickState.values) + ..hasRequiredFields = false; + @$core.Deprecated('Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') @@ -134,8 +104,10 @@ class Cherrypick extends $pb.GeneratedMessage { 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') Cherrypick copyWith(void Function(Cherrypick) updates) => - super.copyWith((message) => updates(message as Cherrypick)) as Cherrypick; // ignore: deprecated_member_use + super.copyWith((message) => updates(message as Cherrypick)) as Cherrypick; + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') static Cherrypick create() => Cherrypick._(); Cherrypick createEmptyInstance() => create(); @@ -182,78 +154,26 @@ class Cherrypick extends $pb.GeneratedMessage { } class Repository extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Repository', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'conductor_state'), - createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'candidateBranch', - protoName: 'candidateBranch') - ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'startingGitHead', - protoName: 'startingGitHead') - ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'currentGitHead', - protoName: 'currentGitHead') - ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'checkoutPath', - protoName: 'checkoutPath') - ..aOM(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'upstream', - subBuilder: Remote.create) - ..aOM(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'mirror', - subBuilder: Remote.create) - ..pc( - 7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'cherrypicks', $pb.PbFieldType.PM, - subBuilder: Cherrypick.create) - ..aOS(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dartRevision', - protoName: 'dartRevision') - ..aOS(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'workingBranch', - protoName: 'workingBranch') - ..hasRequiredFields = false; - + factory Repository() => create(); Repository._() : super(); - factory Repository({ - $core.String? candidateBranch, - $core.String? startingGitHead, - $core.String? currentGitHead, - $core.String? checkoutPath, - Remote? upstream, - Remote? mirror, - $core.Iterable? cherrypicks, - $core.String? dartRevision, - $core.String? workingBranch, - }) { - final _result = create(); - if (candidateBranch != null) { - _result.candidateBranch = candidateBranch; - } - if (startingGitHead != null) { - _result.startingGitHead = startingGitHead; - } - if (currentGitHead != null) { - _result.currentGitHead = currentGitHead; - } - if (checkoutPath != null) { - _result.checkoutPath = checkoutPath; - } - if (upstream != null) { - _result.upstream = upstream; - } - if (mirror != null) { - _result.mirror = mirror; - } - if (cherrypicks != null) { - _result.cherrypicks.addAll(cherrypicks); - } - if (dartRevision != null) { - _result.dartRevision = dartRevision; - } - if (workingBranch != null) { - _result.workingBranch = workingBranch; - } - return _result; - } factory Repository.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory Repository.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Repository', + package: const $pb.PackageName(_omitMessageNames ? '' : 'conductor_state'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'candidateBranch', protoName: 'candidateBranch') + ..aOS(2, _omitFieldNames ? '' : 'startingGitHead', protoName: 'startingGitHead') + ..aOS(3, _omitFieldNames ? '' : 'currentGitHead', protoName: 'currentGitHead') + ..aOS(4, _omitFieldNames ? '' : 'checkoutPath', protoName: 'checkoutPath') + ..aOM(5, _omitFieldNames ? '' : 'upstream', subBuilder: Remote.create) + ..aOM(6, _omitFieldNames ? '' : 'mirror', subBuilder: Remote.create) + ..pc(7, _omitFieldNames ? '' : 'cherrypicks', $pb.PbFieldType.PM, subBuilder: Cherrypick.create) + ..aOS(8, _omitFieldNames ? '' : 'dartRevision', protoName: 'dartRevision') + ..aOS(9, _omitFieldNames ? '' : 'workingBranch', protoName: 'workingBranch') + ..hasRequiredFields = false; + @$core.Deprecated('Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') @@ -262,8 +182,10 @@ class Repository extends $pb.GeneratedMessage { 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') Repository copyWith(void Function(Repository) updates) => - super.copyWith((message) => updates(message as Repository)) as Repository; // ignore: deprecated_member_use + super.copyWith((message) => updates(message as Repository)) as Repository; + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') static Repository create() => Repository._(); Repository createEmptyInstance() => create(); @@ -377,90 +299,35 @@ class Repository extends $pb.GeneratedMessage { } class ConductorState extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ConductorState', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'conductor_state'), - createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'releaseChannel', - protoName: 'releaseChannel') - ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'releaseVersion', - protoName: 'releaseVersion') - ..aOM(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'engine', - subBuilder: Repository.create) - ..aOM(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'framework', - subBuilder: Repository.create) - ..aInt64(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'createdDate', - protoName: 'createdDate') - ..aInt64(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'lastUpdatedDate', - protoName: 'lastUpdatedDate') - ..pPS(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'logs') - ..e( - 9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'currentPhase', $pb.PbFieldType.OE, + factory ConductorState() => create(); + ConductorState._() : super(); + factory ConductorState.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory ConductorState.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ConductorState', + package: const $pb.PackageName(_omitMessageNames ? '' : 'conductor_state'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'releaseChannel', protoName: 'releaseChannel') + ..aOS(2, _omitFieldNames ? '' : 'releaseVersion', protoName: 'releaseVersion') + ..aOM(4, _omitFieldNames ? '' : 'engine', subBuilder: Repository.create) + ..aOM(5, _omitFieldNames ? '' : 'framework', subBuilder: Repository.create) + ..aInt64(6, _omitFieldNames ? '' : 'createdDate', protoName: 'createdDate') + ..aInt64(7, _omitFieldNames ? '' : 'lastUpdatedDate', protoName: 'lastUpdatedDate') + ..pPS(8, _omitFieldNames ? '' : 'logs') + ..e(9, _omitFieldNames ? '' : 'currentPhase', $pb.PbFieldType.OE, protoName: 'currentPhase', defaultOrMaker: ReleasePhase.APPLY_ENGINE_CHERRYPICKS, valueOf: ReleasePhase.valueOf, enumValues: ReleasePhase.values) - ..aOS(10, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'conductorVersion', - protoName: 'conductorVersion') - ..e( - 11, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'releaseType', $pb.PbFieldType.OE, + ..aOS(10, _omitFieldNames ? '' : 'conductorVersion', protoName: 'conductorVersion') + ..e(11, _omitFieldNames ? '' : 'releaseType', $pb.PbFieldType.OE, protoName: 'releaseType', defaultOrMaker: ReleaseType.STABLE_INITIAL, valueOf: ReleaseType.valueOf, enumValues: ReleaseType.values) ..hasRequiredFields = false; - ConductorState._() : super(); - factory ConductorState({ - $core.String? releaseChannel, - $core.String? releaseVersion, - Repository? engine, - Repository? framework, - $fixnum.Int64? createdDate, - $fixnum.Int64? lastUpdatedDate, - $core.Iterable<$core.String>? logs, - ReleasePhase? currentPhase, - $core.String? conductorVersion, - ReleaseType? releaseType, - }) { - final _result = create(); - if (releaseChannel != null) { - _result.releaseChannel = releaseChannel; - } - if (releaseVersion != null) { - _result.releaseVersion = releaseVersion; - } - if (engine != null) { - _result.engine = engine; - } - if (framework != null) { - _result.framework = framework; - } - if (createdDate != null) { - _result.createdDate = createdDate; - } - if (lastUpdatedDate != null) { - _result.lastUpdatedDate = lastUpdatedDate; - } - if (logs != null) { - _result.logs.addAll(logs); - } - if (currentPhase != null) { - _result.currentPhase = currentPhase; - } - if (conductorVersion != null) { - _result.conductorVersion = conductorVersion; - } - if (releaseType != null) { - _result.releaseType = releaseType; - } - return _result; - } - factory ConductorState.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory ConductorState.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); @$core.Deprecated('Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') @@ -469,9 +336,10 @@ class ConductorState extends $pb.GeneratedMessage { 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') ConductorState copyWith(void Function(ConductorState) updates) => - super.copyWith((message) => updates(message as ConductorState)) - as ConductorState; // ignore: deprecated_member_use + super.copyWith((message) => updates(message as ConductorState)) as ConductorState; + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') static ConductorState create() => ConductorState._(); ConductorState createEmptyInstance() => create(); @@ -595,3 +463,6 @@ class ConductorState extends $pb.GeneratedMessage { @$pb.TagNumber(11) void clearReleaseType() => clearField(11); } + +const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); +const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/dev/conductor/core/lib/src/proto/conductor_state.pbenum.dart b/dev/conductor/core/lib/src/proto/conductor_state.pbenum.dart index 7fc843527d67..12ba1530d20a 100644 --- a/dev/conductor/core/lib/src/proto/conductor_state.pbenum.dart +++ b/dev/conductor/core/lib/src/proto/conductor_state.pbenum.dart @@ -2,39 +2,36 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/// +// // Generated code. Do not modify. // source: conductor_state.proto // // @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields -// ignore_for_file: UNDEFINED_SHOWN_NAME +// ignore_for_file: annotate_overrides, camel_case_types +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + import 'dart:core' as $core; + import 'package:protobuf/protobuf.dart' as $pb; class ReleasePhase extends $pb.ProtobufEnum { static const ReleasePhase APPLY_ENGINE_CHERRYPICKS = - ReleasePhase._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'APPLY_ENGINE_CHERRYPICKS'); - static const ReleasePhase CODESIGN_ENGINE_BINARIES = - ReleasePhase._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'CODESIGN_ENGINE_BINARIES'); - static const ReleasePhase APPLY_FRAMEWORK_CHERRYPICKS = ReleasePhase._( - 2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'APPLY_FRAMEWORK_CHERRYPICKS'); - static const ReleasePhase PUBLISH_VERSION = - ReleasePhase._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'PUBLISH_VERSION'); - static const ReleasePhase PUBLISH_CHANNEL = - ReleasePhase._(4, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'PUBLISH_CHANNEL'); - static const ReleasePhase VERIFY_RELEASE = - ReleasePhase._(5, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'VERIFY_RELEASE'); - static const ReleasePhase RELEASE_COMPLETED = - ReleasePhase._(6, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'RELEASE_COMPLETED'); + ReleasePhase._(0, _omitEnumNames ? '' : 'APPLY_ENGINE_CHERRYPICKS'); + static const ReleasePhase VERIFY_ENGINE_CI = ReleasePhase._(1, _omitEnumNames ? '' : 'VERIFY_ENGINE_CI'); + static const ReleasePhase APPLY_FRAMEWORK_CHERRYPICKS = + ReleasePhase._(2, _omitEnumNames ? '' : 'APPLY_FRAMEWORK_CHERRYPICKS'); + static const ReleasePhase PUBLISH_VERSION = ReleasePhase._(3, _omitEnumNames ? '' : 'PUBLISH_VERSION'); + static const ReleasePhase VERIFY_RELEASE = ReleasePhase._(5, _omitEnumNames ? '' : 'VERIFY_RELEASE'); + static const ReleasePhase RELEASE_COMPLETED = ReleasePhase._(6, _omitEnumNames ? '' : 'RELEASE_COMPLETED'); static const $core.List values = [ APPLY_ENGINE_CHERRYPICKS, - CODESIGN_ENGINE_BINARIES, + VERIFY_ENGINE_CI, APPLY_FRAMEWORK_CHERRYPICKS, PUBLISH_VERSION, - PUBLISH_CHANNEL, VERIFY_RELEASE, RELEASE_COMPLETED, ]; @@ -46,14 +43,11 @@ class ReleasePhase extends $pb.ProtobufEnum { } class CherrypickState extends $pb.ProtobufEnum { - static const CherrypickState PENDING = - CherrypickState._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'PENDING'); + static const CherrypickState PENDING = CherrypickState._(0, _omitEnumNames ? '' : 'PENDING'); static const CherrypickState PENDING_WITH_CONFLICT = - CherrypickState._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'PENDING_WITH_CONFLICT'); - static const CherrypickState COMPLETED = - CherrypickState._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'COMPLETED'); - static const CherrypickState ABANDONED = - CherrypickState._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ABANDONED'); + CherrypickState._(1, _omitEnumNames ? '' : 'PENDING_WITH_CONFLICT'); + static const CherrypickState COMPLETED = CherrypickState._(2, _omitEnumNames ? '' : 'COMPLETED'); + static const CherrypickState ABANDONED = CherrypickState._(3, _omitEnumNames ? '' : 'ABANDONED'); static const $core.List values = [ PENDING, @@ -69,14 +63,10 @@ class CherrypickState extends $pb.ProtobufEnum { } class ReleaseType extends $pb.ProtobufEnum { - static const ReleaseType STABLE_INITIAL = - ReleaseType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STABLE_INITIAL'); - static const ReleaseType STABLE_HOTFIX = - ReleaseType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STABLE_HOTFIX'); - static const ReleaseType BETA_INITIAL = - ReleaseType._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'BETA_INITIAL'); - static const ReleaseType BETA_HOTFIX = - ReleaseType._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'BETA_HOTFIX'); + static const ReleaseType STABLE_INITIAL = ReleaseType._(0, _omitEnumNames ? '' : 'STABLE_INITIAL'); + static const ReleaseType STABLE_HOTFIX = ReleaseType._(1, _omitEnumNames ? '' : 'STABLE_HOTFIX'); + static const ReleaseType BETA_INITIAL = ReleaseType._(2, _omitEnumNames ? '' : 'BETA_INITIAL'); + static const ReleaseType BETA_HOTFIX = ReleaseType._(3, _omitEnumNames ? '' : 'BETA_HOTFIX'); static const $core.List values = [ STABLE_INITIAL, @@ -90,3 +80,5 @@ class ReleaseType extends $pb.ProtobufEnum { const ReleaseType._($core.int v, $core.String n) : super(v, n); } + +const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names'); diff --git a/dev/conductor/core/lib/src/proto/conductor_state.pbjson.dart b/dev/conductor/core/lib/src/proto/conductor_state.pbjson.dart index d238e97734b1..6b252ff05360 100644 --- a/dev/conductor/core/lib/src/proto/conductor_state.pbjson.dart +++ b/dev/conductor/core/lib/src/proto/conductor_state.pbjson.dart @@ -2,123 +2,157 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/// +// // Generated code. Do not modify. // source: conductor_state.proto // // @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package -import 'dart:core' as $core; +// ignore_for_file: annotate_overrides, camel_case_types +// ignore_for_file: constant_identifier_names, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import + import 'dart:convert' as $convert; +import 'dart:core' as $core; import 'dart:typed_data' as $typed_data; @$core.Deprecated('Use releasePhaseDescriptor instead') -const ReleasePhase$json = const { +const ReleasePhase$json = { '1': 'ReleasePhase', - '2': const [ - const {'1': 'APPLY_ENGINE_CHERRYPICKS', '2': 0}, - const {'1': 'CODESIGN_ENGINE_BINARIES', '2': 1}, - const {'1': 'APPLY_FRAMEWORK_CHERRYPICKS', '2': 2}, - const {'1': 'PUBLISH_VERSION', '2': 3}, - const {'1': 'PUBLISH_CHANNEL', '2': 4}, - const {'1': 'VERIFY_RELEASE', '2': 5}, - const {'1': 'RELEASE_COMPLETED', '2': 6}, + '2': [ + {'1': 'APPLY_ENGINE_CHERRYPICKS', '2': 0}, + {'1': 'VERIFY_ENGINE_CI', '2': 1}, + {'1': 'APPLY_FRAMEWORK_CHERRYPICKS', '2': 2}, + {'1': 'PUBLISH_VERSION', '2': 3}, + {'1': 'VERIFY_RELEASE', '2': 5}, + {'1': 'RELEASE_COMPLETED', '2': 6}, + ], + '4': [ + {'1': 4, '2': 4}, ], }; /// Descriptor for `ReleasePhase`. Decode as a `google.protobuf.EnumDescriptorProto`. -final $typed_data.Uint8List releasePhaseDescriptor = $convert.base64Decode( - 'CgxSZWxlYXNlUGhhc2USHAoYQVBQTFlfRU5HSU5FX0NIRVJSWVBJQ0tTEAASHAoYQ09ERVNJR05fRU5HSU5FX0JJTkFSSUVTEAESHwobQVBQTFlfRlJBTUVXT1JLX0NIRVJSWVBJQ0tTEAISEwoPUFVCTElTSF9WRVJTSU9OEAMSEwoPUFVCTElTSF9DSEFOTkVMEAQSEgoOVkVSSUZZX1JFTEVBU0UQBRIVChFSRUxFQVNFX0NPTVBMRVRFRBAG'); +final $typed_data.Uint8List releasePhaseDescriptor = + $convert.base64Decode('CgxSZWxlYXNlUGhhc2USHAoYQVBQTFlfRU5HSU5FX0NIRVJSWVBJQ0tTEAASFAoQVkVSSUZZX0' + 'VOR0lORV9DSRABEh8KG0FQUExZX0ZSQU1FV09SS19DSEVSUllQSUNLUxACEhMKD1BVQkxJU0hf' + 'VkVSU0lPThADEhIKDlZFUklGWV9SRUxFQVNFEAUSFQoRUkVMRUFTRV9DT01QTEVURUQQBiIECA' + 'QQBA=='); + @$core.Deprecated('Use cherrypickStateDescriptor instead') -const CherrypickState$json = const { +const CherrypickState$json = { '1': 'CherrypickState', - '2': const [ - const {'1': 'PENDING', '2': 0}, - const {'1': 'PENDING_WITH_CONFLICT', '2': 1}, - const {'1': 'COMPLETED', '2': 2}, - const {'1': 'ABANDONED', '2': 3}, + '2': [ + {'1': 'PENDING', '2': 0}, + {'1': 'PENDING_WITH_CONFLICT', '2': 1}, + {'1': 'COMPLETED', '2': 2}, + {'1': 'ABANDONED', '2': 3}, ], }; /// Descriptor for `CherrypickState`. Decode as a `google.protobuf.EnumDescriptorProto`. -final $typed_data.Uint8List cherrypickStateDescriptor = $convert.base64Decode( - 'Cg9DaGVycnlwaWNrU3RhdGUSCwoHUEVORElORxAAEhkKFVBFTkRJTkdfV0lUSF9DT05GTElDVBABEg0KCUNPTVBMRVRFRBACEg0KCUFCQU5ET05FRBAD'); +final $typed_data.Uint8List cherrypickStateDescriptor = + $convert.base64Decode('Cg9DaGVycnlwaWNrU3RhdGUSCwoHUEVORElORxAAEhkKFVBFTkRJTkdfV0lUSF9DT05GTElDVB' + 'ABEg0KCUNPTVBMRVRFRBACEg0KCUFCQU5ET05FRBAD'); + @$core.Deprecated('Use releaseTypeDescriptor instead') -const ReleaseType$json = const { +const ReleaseType$json = { '1': 'ReleaseType', - '2': const [ - const {'1': 'STABLE_INITIAL', '2': 0}, - const {'1': 'STABLE_HOTFIX', '2': 1}, - const {'1': 'BETA_INITIAL', '2': 2}, - const {'1': 'BETA_HOTFIX', '2': 3}, + '2': [ + {'1': 'STABLE_INITIAL', '2': 0}, + {'1': 'STABLE_HOTFIX', '2': 1}, + {'1': 'BETA_INITIAL', '2': 2}, + {'1': 'BETA_HOTFIX', '2': 3}, ], }; /// Descriptor for `ReleaseType`. Decode as a `google.protobuf.EnumDescriptorProto`. -final $typed_data.Uint8List releaseTypeDescriptor = $convert.base64Decode( - 'CgtSZWxlYXNlVHlwZRISCg5TVEFCTEVfSU5JVElBTBAAEhEKDVNUQUJMRV9IT1RGSVgQARIQCgxCRVRBX0lOSVRJQUwQAhIPCgtCRVRBX0hPVEZJWBAD'); +final $typed_data.Uint8List releaseTypeDescriptor = + $convert.base64Decode('CgtSZWxlYXNlVHlwZRISCg5TVEFCTEVfSU5JVElBTBAAEhEKDVNUQUJMRV9IT1RGSVgQARIQCg' + 'xCRVRBX0lOSVRJQUwQAhIPCgtCRVRBX0hPVEZJWBAD'); + @$core.Deprecated('Use remoteDescriptor instead') -const Remote$json = const { +const Remote$json = { '1': 'Remote', - '2': const [ - const {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, - const {'1': 'url', '3': 2, '4': 1, '5': 9, '10': 'url'}, + '2': [ + {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, + {'1': 'url', '3': 2, '4': 1, '5': 9, '10': 'url'}, ], }; /// Descriptor for `Remote`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List remoteDescriptor = $convert.base64Decode('CgZSZW1vdGUSEgoEbmFtZRgBIAEoCVIEbmFtZRIQCgN1cmwYAiABKAlSA3VybA=='); + @$core.Deprecated('Use cherrypickDescriptor instead') -const Cherrypick$json = const { +const Cherrypick$json = { '1': 'Cherrypick', - '2': const [ - const {'1': 'trunkRevision', '3': 1, '4': 1, '5': 9, '10': 'trunkRevision'}, - const {'1': 'appliedRevision', '3': 2, '4': 1, '5': 9, '10': 'appliedRevision'}, - const {'1': 'state', '3': 3, '4': 1, '5': 14, '6': '.conductor_state.CherrypickState', '10': 'state'}, + '2': [ + {'1': 'trunkRevision', '3': 1, '4': 1, '5': 9, '10': 'trunkRevision'}, + {'1': 'appliedRevision', '3': 2, '4': 1, '5': 9, '10': 'appliedRevision'}, + {'1': 'state', '3': 3, '4': 1, '5': 14, '6': '.conductor_state.CherrypickState', '10': 'state'}, ], }; /// Descriptor for `Cherrypick`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List cherrypickDescriptor = $convert.base64Decode( - 'CgpDaGVycnlwaWNrEiQKDXRydW5rUmV2aXNpb24YASABKAlSDXRydW5rUmV2aXNpb24SKAoPYXBwbGllZFJldmlzaW9uGAIgASgJUg9hcHBsaWVkUmV2aXNpb24SNgoFc3RhdGUYAyABKA4yIC5jb25kdWN0b3Jfc3RhdGUuQ2hlcnJ5cGlja1N0YXRlUgVzdGF0ZQ=='); +final $typed_data.Uint8List cherrypickDescriptor = + $convert.base64Decode('CgpDaGVycnlwaWNrEiQKDXRydW5rUmV2aXNpb24YASABKAlSDXRydW5rUmV2aXNpb24SKAoPYX' + 'BwbGllZFJldmlzaW9uGAIgASgJUg9hcHBsaWVkUmV2aXNpb24SNgoFc3RhdGUYAyABKA4yIC5j' + 'b25kdWN0b3Jfc3RhdGUuQ2hlcnJ5cGlja1N0YXRlUgVzdGF0ZQ=='); + @$core.Deprecated('Use repositoryDescriptor instead') -const Repository$json = const { +const Repository$json = { '1': 'Repository', - '2': const [ - const {'1': 'candidateBranch', '3': 1, '4': 1, '5': 9, '10': 'candidateBranch'}, - const {'1': 'startingGitHead', '3': 2, '4': 1, '5': 9, '10': 'startingGitHead'}, - const {'1': 'currentGitHead', '3': 3, '4': 1, '5': 9, '10': 'currentGitHead'}, - const {'1': 'checkoutPath', '3': 4, '4': 1, '5': 9, '10': 'checkoutPath'}, - const {'1': 'upstream', '3': 5, '4': 1, '5': 11, '6': '.conductor_state.Remote', '10': 'upstream'}, - const {'1': 'mirror', '3': 6, '4': 1, '5': 11, '6': '.conductor_state.Remote', '10': 'mirror'}, - const {'1': 'cherrypicks', '3': 7, '4': 3, '5': 11, '6': '.conductor_state.Cherrypick', '10': 'cherrypicks'}, - const {'1': 'dartRevision', '3': 8, '4': 1, '5': 9, '10': 'dartRevision'}, - const {'1': 'workingBranch', '3': 9, '4': 1, '5': 9, '10': 'workingBranch'}, + '2': [ + {'1': 'candidateBranch', '3': 1, '4': 1, '5': 9, '10': 'candidateBranch'}, + {'1': 'startingGitHead', '3': 2, '4': 1, '5': 9, '10': 'startingGitHead'}, + {'1': 'currentGitHead', '3': 3, '4': 1, '5': 9, '10': 'currentGitHead'}, + {'1': 'checkoutPath', '3': 4, '4': 1, '5': 9, '10': 'checkoutPath'}, + {'1': 'upstream', '3': 5, '4': 1, '5': 11, '6': '.conductor_state.Remote', '10': 'upstream'}, + {'1': 'mirror', '3': 6, '4': 1, '5': 11, '6': '.conductor_state.Remote', '10': 'mirror'}, + {'1': 'cherrypicks', '3': 7, '4': 3, '5': 11, '6': '.conductor_state.Cherrypick', '10': 'cherrypicks'}, + {'1': 'dartRevision', '3': 8, '4': 1, '5': 9, '10': 'dartRevision'}, + {'1': 'workingBranch', '3': 9, '4': 1, '5': 9, '10': 'workingBranch'}, ], }; /// Descriptor for `Repository`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List repositoryDescriptor = $convert.base64Decode( - 'CgpSZXBvc2l0b3J5EigKD2NhbmRpZGF0ZUJyYW5jaBgBIAEoCVIPY2FuZGlkYXRlQnJhbmNoEigKD3N0YXJ0aW5nR2l0SGVhZBgCIAEoCVIPc3RhcnRpbmdHaXRIZWFkEiYKDmN1cnJlbnRHaXRIZWFkGAMgASgJUg5jdXJyZW50R2l0SGVhZBIiCgxjaGVja291dFBhdGgYBCABKAlSDGNoZWNrb3V0UGF0aBIzCgh1cHN0cmVhbRgFIAEoCzIXLmNvbmR1Y3Rvcl9zdGF0ZS5SZW1vdGVSCHVwc3RyZWFtEi8KBm1pcnJvchgGIAEoCzIXLmNvbmR1Y3Rvcl9zdGF0ZS5SZW1vdGVSBm1pcnJvchI9CgtjaGVycnlwaWNrcxgHIAMoCzIbLmNvbmR1Y3Rvcl9zdGF0ZS5DaGVycnlwaWNrUgtjaGVycnlwaWNrcxIiCgxkYXJ0UmV2aXNpb24YCCABKAlSDGRhcnRSZXZpc2lvbhIkCg13b3JraW5nQnJhbmNoGAkgASgJUg13b3JraW5nQnJhbmNo'); +final $typed_data.Uint8List repositoryDescriptor = + $convert.base64Decode('CgpSZXBvc2l0b3J5EigKD2NhbmRpZGF0ZUJyYW5jaBgBIAEoCVIPY2FuZGlkYXRlQnJhbmNoEi' + 'gKD3N0YXJ0aW5nR2l0SGVhZBgCIAEoCVIPc3RhcnRpbmdHaXRIZWFkEiYKDmN1cnJlbnRHaXRI' + 'ZWFkGAMgASgJUg5jdXJyZW50R2l0SGVhZBIiCgxjaGVja291dFBhdGgYBCABKAlSDGNoZWNrb3' + 'V0UGF0aBIzCgh1cHN0cmVhbRgFIAEoCzIXLmNvbmR1Y3Rvcl9zdGF0ZS5SZW1vdGVSCHVwc3Ry' + 'ZWFtEi8KBm1pcnJvchgGIAEoCzIXLmNvbmR1Y3Rvcl9zdGF0ZS5SZW1vdGVSBm1pcnJvchI9Cg' + 'tjaGVycnlwaWNrcxgHIAMoCzIbLmNvbmR1Y3Rvcl9zdGF0ZS5DaGVycnlwaWNrUgtjaGVycnlw' + 'aWNrcxIiCgxkYXJ0UmV2aXNpb24YCCABKAlSDGRhcnRSZXZpc2lvbhIkCg13b3JraW5nQnJhbm' + 'NoGAkgASgJUg13b3JraW5nQnJhbmNo'); + @$core.Deprecated('Use conductorStateDescriptor instead') -const ConductorState$json = const { +const ConductorState$json = { '1': 'ConductorState', - '2': const [ - const {'1': 'releaseChannel', '3': 1, '4': 1, '5': 9, '10': 'releaseChannel'}, - const {'1': 'releaseVersion', '3': 2, '4': 1, '5': 9, '10': 'releaseVersion'}, - const {'1': 'engine', '3': 4, '4': 1, '5': 11, '6': '.conductor_state.Repository', '10': 'engine'}, - const {'1': 'framework', '3': 5, '4': 1, '5': 11, '6': '.conductor_state.Repository', '10': 'framework'}, - const {'1': 'createdDate', '3': 6, '4': 1, '5': 3, '10': 'createdDate'}, - const {'1': 'lastUpdatedDate', '3': 7, '4': 1, '5': 3, '10': 'lastUpdatedDate'}, - const {'1': 'logs', '3': 8, '4': 3, '5': 9, '10': 'logs'}, - const {'1': 'currentPhase', '3': 9, '4': 1, '5': 14, '6': '.conductor_state.ReleasePhase', '10': 'currentPhase'}, - const {'1': 'conductorVersion', '3': 10, '4': 1, '5': 9, '10': 'conductorVersion'}, - const {'1': 'releaseType', '3': 11, '4': 1, '5': 14, '6': '.conductor_state.ReleaseType', '10': 'releaseType'}, + '2': [ + {'1': 'releaseChannel', '3': 1, '4': 1, '5': 9, '10': 'releaseChannel'}, + {'1': 'releaseVersion', '3': 2, '4': 1, '5': 9, '10': 'releaseVersion'}, + {'1': 'engine', '3': 4, '4': 1, '5': 11, '6': '.conductor_state.Repository', '10': 'engine'}, + {'1': 'framework', '3': 5, '4': 1, '5': 11, '6': '.conductor_state.Repository', '10': 'framework'}, + {'1': 'createdDate', '3': 6, '4': 1, '5': 3, '10': 'createdDate'}, + {'1': 'lastUpdatedDate', '3': 7, '4': 1, '5': 3, '10': 'lastUpdatedDate'}, + {'1': 'logs', '3': 8, '4': 3, '5': 9, '10': 'logs'}, + {'1': 'currentPhase', '3': 9, '4': 1, '5': 14, '6': '.conductor_state.ReleasePhase', '10': 'currentPhase'}, + {'1': 'conductorVersion', '3': 10, '4': 1, '5': 9, '10': 'conductorVersion'}, + {'1': 'releaseType', '3': 11, '4': 1, '5': 14, '6': '.conductor_state.ReleaseType', '10': 'releaseType'}, ], }; /// Descriptor for `ConductorState`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List conductorStateDescriptor = $convert.base64Decode( - 'Cg5Db25kdWN0b3JTdGF0ZRImCg5yZWxlYXNlQ2hhbm5lbBgBIAEoCVIOcmVsZWFzZUNoYW5uZWwSJgoOcmVsZWFzZVZlcnNpb24YAiABKAlSDnJlbGVhc2VWZXJzaW9uEjMKBmVuZ2luZRgEIAEoCzIbLmNvbmR1Y3Rvcl9zdGF0ZS5SZXBvc2l0b3J5UgZlbmdpbmUSOQoJZnJhbWV3b3JrGAUgASgLMhsuY29uZHVjdG9yX3N0YXRlLlJlcG9zaXRvcnlSCWZyYW1ld29yaxIgCgtjcmVhdGVkRGF0ZRgGIAEoA1ILY3JlYXRlZERhdGUSKAoPbGFzdFVwZGF0ZWREYXRlGAcgASgDUg9sYXN0VXBkYXRlZERhdGUSEgoEbG9ncxgIIAMoCVIEbG9ncxJBCgxjdXJyZW50UGhhc2UYCSABKA4yHS5jb25kdWN0b3Jfc3RhdGUuUmVsZWFzZVBoYXNlUgxjdXJyZW50UGhhc2USKgoQY29uZHVjdG9yVmVyc2lvbhgKIAEoCVIQY29uZHVjdG9yVmVyc2lvbhI+CgtyZWxlYXNlVHlwZRgLIAEoDjIcLmNvbmR1Y3Rvcl9zdGF0ZS5SZWxlYXNlVHlwZVILcmVsZWFzZVR5cGU='); +final $typed_data.Uint8List conductorStateDescriptor = + $convert.base64Decode('Cg5Db25kdWN0b3JTdGF0ZRImCg5yZWxlYXNlQ2hhbm5lbBgBIAEoCVIOcmVsZWFzZUNoYW5uZW' + 'wSJgoOcmVsZWFzZVZlcnNpb24YAiABKAlSDnJlbGVhc2VWZXJzaW9uEjMKBmVuZ2luZRgEIAEo' + 'CzIbLmNvbmR1Y3Rvcl9zdGF0ZS5SZXBvc2l0b3J5UgZlbmdpbmUSOQoJZnJhbWV3b3JrGAUgAS' + 'gLMhsuY29uZHVjdG9yX3N0YXRlLlJlcG9zaXRvcnlSCWZyYW1ld29yaxIgCgtjcmVhdGVkRGF0' + 'ZRgGIAEoA1ILY3JlYXRlZERhdGUSKAoPbGFzdFVwZGF0ZWREYXRlGAcgASgDUg9sYXN0VXBkYX' + 'RlZERhdGUSEgoEbG9ncxgIIAMoCVIEbG9ncxJBCgxjdXJyZW50UGhhc2UYCSABKA4yHS5jb25k' + 'dWN0b3Jfc3RhdGUuUmVsZWFzZVBoYXNlUgxjdXJyZW50UGhhc2USKgoQY29uZHVjdG9yVmVyc2' + 'lvbhgKIAEoCVIQY29uZHVjdG9yVmVyc2lvbhI+CgtyZWxlYXNlVHlwZRgLIAEoDjIcLmNvbmR1' + 'Y3Rvcl9zdGF0ZS5SZWxlYXNlVHlwZVILcmVsZWFzZVR5cGU='); diff --git a/dev/conductor/core/lib/src/proto/conductor_state.pbserver.dart b/dev/conductor/core/lib/src/proto/conductor_state.pbserver.dart index e1b793df4720..cdb739fa56ab 100644 --- a/dev/conductor/core/lib/src/proto/conductor_state.pbserver.dart +++ b/dev/conductor/core/lib/src/proto/conductor_state.pbserver.dart @@ -2,11 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/// +// // Generated code. Do not modify. // source: conductor_state.proto // // @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package + +// ignore_for_file: annotate_overrides, camel_case_types +// ignore_for_file: constant_identifier_names +// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes +// ignore_for_file: non_constant_identifier_names, prefer_final_fields +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import export 'conductor_state.pb.dart'; diff --git a/dev/conductor/core/lib/src/proto/conductor_state.proto b/dev/conductor/core/lib/src/proto/conductor_state.proto index cc32ca0e3ce6..26fd9c92cc58 100644 --- a/dev/conductor/core/lib/src/proto/conductor_state.proto +++ b/dev/conductor/core/lib/src/proto/conductor_state.proto @@ -11,16 +11,16 @@ message Remote { enum ReleasePhase { // Release was started with `conductor start` and repositories cloned. APPLY_ENGINE_CHERRYPICKS = 0; - CODESIGN_ENGINE_BINARIES = 1; + + // Verify engine CI is green before opening framework PR. + VERIFY_ENGINE_CI = 1; + APPLY_FRAMEWORK_CHERRYPICKS = 2; // Git tag applied to framework RC branch HEAD and pushed upstream. PUBLISH_VERSION = 3; - // RC branch HEAD pushed to upstream release branch. - // - // For example, flutter-1.2-candidate.3 -> upstream/beta - PUBLISH_CHANNEL = 4; + reserved 4; // Formerly PUBLISH_CHANNEL, merged into PUBLISH_VERSION. // Package artifacts verified to exist on cloud storage. VERIFY_RELEASE = 5; diff --git a/dev/conductor/core/lib/src/start.dart b/dev/conductor/core/lib/src/start.dart index a253569485be..f5de61b06d53 100644 --- a/dev/conductor/core/lib/src/start.dart +++ b/dev/conductor/core/lib/src/start.dart @@ -310,16 +310,24 @@ class StartContext extends Context { } final String engineHead = await engine.reverseParse('HEAD'); - state.engine = pb.Repository( - candidateBranch: candidateBranch, - workingBranch: workingBranchName, - startingGitHead: engineHead, - currentGitHead: engineHead, - checkoutPath: (await engine.checkoutDirectory).path, - dartRevision: dartRevision, - upstream: pb.Remote(name: 'upstream', url: engine.upstreamRemote.url), - mirror: pb.Remote(name: 'mirror', url: engine.mirrorRemote!.url), + state.engine = (pb.Repository.create() + ..candidateBranch = candidateBranch + ..workingBranch = workingBranchName + ..startingGitHead = engineHead + ..currentGitHead = engineHead + ..checkoutPath = (await engine.checkoutDirectory).path + ..upstream = (pb.Remote.create() + ..name = 'upstream' + ..url = engine.upstreamRemote.url + ) + ..mirror = (pb.Remote.create() + ..name = 'mirror' + ..url = engine.mirrorRemote!.url + ) ); + if (dartRevision != null && dartRevision!.isNotEmpty) { + state.engine.dartRevision = dartRevision!; + } await framework.newBranch(workingBranchName); @@ -362,14 +370,20 @@ class StartContext extends Context { state.releaseVersion = nextVersion.toString(); - state.framework = pb.Repository( - candidateBranch: candidateBranch, - workingBranch: workingBranchName, - startingGitHead: frameworkHead, - currentGitHead: frameworkHead, - checkoutPath: (await framework.checkoutDirectory).path, - upstream: pb.Remote(name: 'upstream', url: framework.upstreamRemote.url), - mirror: pb.Remote(name: 'mirror', url: framework.mirrorRemote!.url), + state.framework = (pb.Repository.create() + ..candidateBranch = candidateBranch + ..workingBranch = workingBranchName + ..startingGitHead = frameworkHead + ..currentGitHead = frameworkHead + ..checkoutPath = (await framework.checkoutDirectory).path + ..upstream = (pb.Remote.create() + ..name = 'upstream' + ..url = framework.upstreamRemote.url + ) + ..mirror = (pb.Remote.create() + ..name = 'mirror' + ..url = framework.mirrorRemote!.url + ) ); state.currentPhase = ReleasePhase.APPLY_ENGINE_CHERRYPICKS; diff --git a/dev/conductor/core/lib/src/state.dart b/dev/conductor/core/lib/src/state.dart index 4dd4a51ee562..fa0fc303a825 100644 --- a/dev/conductor/core/lib/src/state.dart +++ b/dev/conductor/core/lib/src/state.dart @@ -50,7 +50,7 @@ const String stablePostReleaseMsg = """ String luciConsoleLink(String channel, String groupName) { assert( globals.kReleaseChannels.contains(channel), - 'channel $channel not recognized', + 'channel "$channel" not recognized', ); assert( ['flutter', 'engine', 'packaging'].contains(groupName), @@ -177,10 +177,10 @@ String phaseInstructions(pb.ConductorState state) { '\t${cherrypick.trunkRevision}', 'See ${globals.kReleaseDocumentationUrl} for more information.', ].join('\n'); - case ReleasePhase.CODESIGN_ENGINE_BINARIES: + case ReleasePhase.VERIFY_ENGINE_CI: if (!requiresEnginePR(state)) { - return 'You must now codesign the engine binaries for commit ' - '${state.engine.startingGitHead}.'; + return 'You must verify engine CI has passed: ' + '${luciConsoleLink(state.releaseChannel, 'engine')}'; } // User's working branch was pushed to their mirror, but a PR needs to be // opened on GitHub. @@ -231,8 +231,6 @@ String phaseInstructions(pb.ConductorState state) { 'verify pre-submit CI builds on your pull request are successful, merge your ', 'pull request, validate post-submit CI.', ].join('\n'); - case ReleasePhase.PUBLISH_CHANNEL: - return 'Issue `conductor next` to publish your release to the release branch.'; case ReleasePhase.VERIFY_RELEASE: return 'Release archive packages must be verified on cloud storage: ${luciConsoleLink(state.releaseChannel, 'packaging')}'; case ReleasePhase.RELEASE_COMPLETED: @@ -286,11 +284,20 @@ String githubAccount(String remoteUrl) { /// Will throw a [ConductorException] if [ReleasePhase.RELEASE_COMPLETED] is /// passed as an argument, as there is no next phase. ReleasePhase getNextPhase(ReleasePhase currentPhase) { - final ReleasePhase? nextPhase = ReleasePhase.valueOf(currentPhase.value + 1); - if (nextPhase == null) { - throw globals.ConductorException('There is no next ReleasePhase!'); + switch (currentPhase) { + case ReleasePhase.PUBLISH_VERSION: + return ReleasePhase.VERIFY_RELEASE; + case ReleasePhase.APPLY_ENGINE_CHERRYPICKS: + case ReleasePhase.VERIFY_ENGINE_CI: + case ReleasePhase.APPLY_FRAMEWORK_CHERRYPICKS: + case ReleasePhase.VERIFY_RELEASE: + case ReleasePhase.RELEASE_COMPLETED: + final ReleasePhase? nextPhase = ReleasePhase.valueOf(currentPhase.value + 1); + if (nextPhase != null) { + return nextPhase; + } } - return nextPhase; + throw globals.ConductorException('There is no next ReleasePhase!'); } // Indent two spaces. diff --git a/dev/conductor/core/test/globals_test.dart b/dev/conductor/core/test/globals_test.dart index a5fd147fbe2c..2bbda9e5d4a1 100644 --- a/dev/conductor/core/test/globals_test.dart +++ b/dev/conductor/core/test/globals_test.dart @@ -31,25 +31,27 @@ void main() { late pb.ConductorState state; setUp(() { - state = pb.ConductorState( - engine: pb.Repository( - candidateBranch: candidateBranch, - cherrypicks: [ - pb.Cherrypick(trunkRevision: engineCherrypick1), - pb.Cherrypick(trunkRevision: engineCherrypick2), - ], - dartRevision: dartRevision, - workingBranch: workingBranch, - ), - framework: pb.Repository( - candidateBranch: candidateBranch, - cherrypicks: [ - pb.Cherrypick(trunkRevision: frameworkCherrypick), - ], - workingBranch: workingBranch, - ), - releaseChannel: releaseChannel, - releaseVersion: releaseVersion, + state = (pb.ConductorState.create() + ..engine = (pb.Repository.create() + ..candidateBranch = candidateBranch + ..cherrypicks.addAll([ + pb.Cherrypick.create() + ..trunkRevision = engineCherrypick1, + pb.Cherrypick.create() + ..trunkRevision = engineCherrypick2, + ]) + ..dartRevision = dartRevision + ..workingBranch = workingBranch + ) + ..framework = (pb.Repository.create() + ..candidateBranch = candidateBranch + ..cherrypicks.add(pb.Cherrypick.create() + ..trunkRevision = frameworkCherrypick + ) + ..workingBranch = workingBranch + ) + ..releaseChannel = releaseChannel + ..releaseVersion = releaseVersion ); }); diff --git a/dev/conductor/core/test/next_test.dart b/dev/conductor/core/test/next_test.dart index dee3a2e567b4..192853459fdb 100644 --- a/dev/conductor/core/test/next_test.dart +++ b/dev/conductor/core/test/next_test.dart @@ -80,61 +80,7 @@ void main() { ); }); - group('APPLY_ENGINE_CHERRYPICKS to CODESIGN_ENGINE_BINARIES', () { - test('does not prompt user and updates currentPhase if there are no engine cherrypicks', () async { - final FakeProcessManager processManager = FakeProcessManager.empty(); - final FakePlatform platform = FakePlatform( - environment: { - 'HOME': ['path', 'to', 'home'].join(localPathSeparator), - }, - operatingSystem: localOperatingSystem, - pathSeparator: localPathSeparator, - ); - final File ciYaml = fileSystem.file('$checkoutsParentDirectory/engine/.ci.yaml') - ..createSync(recursive: true); - // this branch already present in ciYaml - _initializeCiYamlFile(ciYaml, enabledBranches: [candidateBranch]); - final pb.ConductorState state = pb.ConductorState( - currentPhase: ReleasePhase.APPLY_ENGINE_CHERRYPICKS, - engine: pb.Repository( - candidateBranch: candidateBranch, - checkoutPath: fileSystem.path.join(checkoutsParentDirectory, 'engine'), - workingBranch: workingBranch, - startingGitHead: revision1, - upstream: pb.Remote(name: 'upstream', url: remoteUrl), - ), - ); - writeStateToFile( - fileSystem.file(stateFile), - state, - [], - ); - final Checkouts checkouts = Checkouts( - fileSystem: fileSystem, - parentDirectory: fileSystem.directory(checkoutsParentDirectory)..createSync(recursive: true), - platform: platform, - processManager: processManager, - stdio: stdio, - ); - final CommandRunner runner = createRunner(checkouts: checkouts); - await runner.run([ - 'next', - '--$kStateOption', - stateFile, - ]); - - final pb.ConductorState finalState = readStateFromFile( - fileSystem.file(stateFile), - ); - - expect(processManager, hasNoRemainingExpectations); - expect(finalState.currentPhase, ReleasePhase.CODESIGN_ENGINE_BINARIES); - expect(stdio.error, isEmpty); - expect( - stdio.stdout, - contains('You must now codesign the engine binaries for commit $revision1')); - }); - + group('APPLY_ENGINE_CHERRYPICKS to VERIFY_ENGINE_CI', () { test('confirms to stdout when all engine cherrypicks were auto-applied', () async { stdio.stdin.add('n'); final File ciYaml = fileSystem.file('$checkoutsParentDirectory/engine/.ci.yaml') @@ -148,21 +94,26 @@ void main() { operatingSystem: localOperatingSystem, pathSeparator: localPathSeparator, ); - final pb.ConductorState state = pb.ConductorState( - engine: pb.Repository( - candidateBranch: candidateBranch, - cherrypicks: [ - pb.Cherrypick( - trunkRevision: 'abc123', - state: pb.CherrypickState.COMPLETED, - ), - ], - checkoutPath: fileSystem.path.join(checkoutsParentDirectory, 'engine'), - workingBranch: workingBranch, - upstream: pb.Remote(name: 'upstream', url: remoteUrl), - mirror: pb.Remote(name: 'mirror', url: remoteUrl), - ), - currentPhase: ReleasePhase.APPLY_ENGINE_CHERRYPICKS, + final pb.ConductorState state = (pb.ConductorState.create() + ..releaseChannel = releaseChannel + ..engine = (pb.Repository.create() + ..candidateBranch = candidateBranch + ..cherrypicks.add(pb.Cherrypick.create() + ..trunkRevision ='abc123' + ..state = pb.CherrypickState.COMPLETED + ) + ..checkoutPath = fileSystem.path.join(checkoutsParentDirectory, 'engine') + ..workingBranch = workingBranch + ..upstream = (pb.Remote.create() + ..name = 'upstream' + ..url = remoteUrl + ) + ..mirror = (pb.Remote.create() + ..name = 'mirror' + ..url = remoteUrl + ) + ) + ..currentPhase = ReleasePhase.APPLY_ENGINE_CHERRYPICKS ); writeStateToFile( fileSystem.file(stateFile), @@ -215,23 +166,28 @@ void main() { operatingSystem: localOperatingSystem, pathSeparator: localPathSeparator, ); - final pb.ConductorState state = pb.ConductorState( - currentPhase: ReleasePhase.APPLY_ENGINE_CHERRYPICKS, - engine: pb.Repository( - candidateBranch: candidateBranch, - checkoutPath: fileSystem.path.join(checkoutsParentDirectory, 'engine'), - cherrypicks: [ - pb.Cherrypick( - trunkRevision: revision2, - state: pb.CherrypickState.PENDING, - ), - ], - workingBranch: workingBranch, - upstream: pb.Remote(name: 'upstream', url: remoteUrl), - mirror: pb.Remote(name: 'mirror', url: remoteUrl), - ), - releaseChannel: releaseChannel, - releaseVersion: releaseVersion, + final pb.ConductorState state = (pb.ConductorState.create() + ..currentPhase = ReleasePhase.APPLY_ENGINE_CHERRYPICKS + ..engine = (pb.Repository.create() + ..candidateBranch = candidateBranch + ..checkoutPath = fileSystem.path.join(checkoutsParentDirectory, 'engine') + ..cherrypicks.add( + pb.Cherrypick.create() + ..trunkRevision = revision2 + ..state = pb.CherrypickState.PENDING + ) + ..workingBranch = workingBranch + ..upstream = (pb.Remote.create() + ..name = 'upstream' + ..url = remoteUrl + ) + ..mirror = (pb.Remote.create() + ..name = 'mirror' + ..url = remoteUrl + ) + ) + ..releaseChannel = releaseChannel + ..releaseVersion = releaseVersion ); writeStateToFile( fileSystem.file(stateFile), @@ -264,27 +220,27 @@ void main() { contains('You must now open a pull request at https://github.com/flutter/engine/compare/flutter-1.2-candidate.3...org:cherrypicks-flutter-1.2-candidate.3?expand=1')); expect(stdio.stdout, contains( 'Are you ready to push your engine branch to the repository $remoteUrl? (y/n) ')); - expect(finalState.currentPhase, ReleasePhase.CODESIGN_ENGINE_BINARIES); + expect(finalState.currentPhase, ReleasePhase.VERIFY_ENGINE_CI); expect(stdio.error, isEmpty); }); }); - group('CODESIGN_ENGINE_BINARIES to APPLY_FRAMEWORK_CHERRYPICKS', () { + group('VERIFY_ENGINE_CI to APPLY_FRAMEWORK_CHERRYPICKS', () { late pb.ConductorState state; late FakeProcessManager processManager; late FakePlatform platform; setUp(() { - state = pb.ConductorState( - engine: pb.Repository( - cherrypicks: [ - pb.Cherrypick( - trunkRevision: 'abc123', - state: pb.CherrypickState.PENDING, - ), - ], - ), - currentPhase: ReleasePhase.CODESIGN_ENGINE_BINARIES, + state = (pb.ConductorState.create() + ..releaseChannel = releaseChannel + ..engine = (pb.Repository.create() + ..cherrypicks.add( + pb.Cherrypick.create() + ..trunkRevision = 'abc123' + ..state = pb.CherrypickState.PENDING + ) + ) + ..currentPhase = ReleasePhase.VERIFY_ENGINE_CI ); processManager = FakeProcessManager.empty(); @@ -324,8 +280,8 @@ void main() { ); expect(processManager, hasNoRemainingExpectations); - expect(stdio.stdout, contains('Has CI passed for the engine PR and binaries been codesigned? (y/n) ')); - expect(finalState.currentPhase, ReleasePhase.CODESIGN_ENGINE_BINARIES); + expect(stdio.stdout, contains('Has CI passed for the engine PR?')); + expect(finalState.currentPhase, ReleasePhase.VERIFY_ENGINE_CI); expect(stdio.error.contains('Aborting command.'), true); }); @@ -362,7 +318,7 @@ void main() { ); expect(processManager, hasNoRemainingExpectations); - expect(stdio.stdout, contains('Has CI passed for the engine PR and binaries been codesigned? (y/n) ')); + expect(stdio.stdout, contains('Has CI passed for the engine PR?')); expect(finalState.currentPhase, ReleasePhase.APPLY_FRAMEWORK_CHERRYPICKS); }); }); @@ -388,30 +344,38 @@ void main() { operatingSystem: localOperatingSystem, pathSeparator: localPathSeparator, ); - state = pb.ConductorState( - releaseChannel: releaseChannel, - releaseVersion: releaseVersion, - framework: pb.Repository( - candidateBranch: candidateBranch, - checkoutPath: frameworkCheckoutPath, - cherrypicks: [ - pb.Cherrypick( - trunkRevision: frameworkCherrypick, - state: pb.CherrypickState.PENDING, - ), - ], - mirror: pb.Remote(name: 'mirror', url: mirrorRemoteUrl), - upstream: pb.Remote(name: 'upstream', url: upstreamRemoteUrl), - workingBranch: workingBranch, - ), - engine: pb.Repository( - candidateBranch: candidateBranch, - checkoutPath: engineCheckoutPath, - dartRevision: 'cdef0123', - workingBranch: workingBranch, - upstream: pb.Remote(name: 'upstream', url: engineUpstreamRemoteUrl), - ), - currentPhase: ReleasePhase.APPLY_FRAMEWORK_CHERRYPICKS, + state = (pb.ConductorState.create() + ..releaseChannel = releaseChannel + ..releaseVersion = releaseVersion + ..framework = (pb.Repository.create() + ..candidateBranch = candidateBranch + ..checkoutPath = frameworkCheckoutPath + ..cherrypicks.add( + pb.Cherrypick.create() + ..trunkRevision = frameworkCherrypick + ..state = pb.CherrypickState.PENDING + ) + ..mirror = (pb.Remote.create() + ..name = 'mirror' + ..url = mirrorRemoteUrl + ) + ..upstream = (pb.Remote.create() + ..name = 'upstream' + ..url = upstreamRemoteUrl + ) + ..workingBranch = workingBranch + ) + ..engine = (pb.Repository.create() + ..candidateBranch = candidateBranch + ..checkoutPath = engineCheckoutPath + ..dartRevision = 'cdef0123' + ..workingBranch = workingBranch + ..upstream = (pb.Remote.create() + ..name = 'upstream' + ..url = engineUpstreamRemoteUrl + ) + ) + ..currentPhase = ReleasePhase.APPLY_FRAMEWORK_CHERRYPICKS ); // create engine repo fileSystem.directory(engineCheckoutPath).createSync(recursive: true); @@ -475,23 +439,32 @@ void main() { stdout: revision4, ), ]); - final pb.ConductorState state = pb.ConductorState( - releaseChannel: releaseChannel, - releaseVersion: releaseVersion, - currentPhase: ReleasePhase.APPLY_FRAMEWORK_CHERRYPICKS, - framework: pb.Repository( - candidateBranch: candidateBranch, - checkoutPath: frameworkCheckoutPath, - mirror: pb.Remote(name: 'mirror', url: mirrorRemoteUrl), - upstream: pb.Remote(name: 'upstream', url: upstreamRemoteUrl), - workingBranch: workingBranch, - ), - engine: pb.Repository( - candidateBranch: candidateBranch, - checkoutPath: engineCheckoutPath, - upstream: pb.Remote(name: 'upstream', url: engineUpstreamRemoteUrl), - currentGitHead: revision1, - ), + final pb.ConductorState state = (pb.ConductorState.create() + ..releaseChannel = releaseChannel + ..releaseVersion = releaseVersion + ..currentPhase = ReleasePhase.APPLY_FRAMEWORK_CHERRYPICKS + ..framework = (pb.Repository.create() + ..candidateBranch = candidateBranch + ..checkoutPath = frameworkCheckoutPath + ..mirror = (pb.Remote.create() + ..name = 'mirror' + ..url = mirrorRemoteUrl + ) + ..upstream = (pb.Remote.create() + ..name = 'upstream' + ..url = upstreamRemoteUrl + ) + ..workingBranch = workingBranch + ) + ..engine = (pb.Repository.create() + ..candidateBranch = candidateBranch + ..checkoutPath = engineCheckoutPath + ..upstream = (pb.Remote.create() + ..name = 'upstream' + ..url = engineUpstreamRemoteUrl + ) + ..currentGitHead = revision1 + ) ); writeStateToFile( fileSystem.file(stateFile), @@ -568,23 +541,32 @@ void main() { stdout: revision4, ), ]); - final pb.ConductorState state = pb.ConductorState( - releaseChannel: releaseChannel, - releaseVersion: releaseVersion, - currentPhase: ReleasePhase.APPLY_FRAMEWORK_CHERRYPICKS, - framework: pb.Repository( - candidateBranch: candidateBranch, - checkoutPath: frameworkCheckoutPath, - mirror: pb.Remote(name: 'mirror', url: mirrorRemoteUrl), - upstream: pb.Remote(name: 'upstream', url: upstreamRemoteUrl), - workingBranch: workingBranch, - ), - engine: pb.Repository( - candidateBranch: candidateBranch, - checkoutPath: engineCheckoutPath, - upstream: pb.Remote(name: 'upstream', url: engineUpstreamRemoteUrl), - dartRevision: 'abc123', - ), + final pb.ConductorState state = (pb.ConductorState.create() + ..releaseChannel = releaseChannel + ..releaseVersion = releaseVersion + ..currentPhase = ReleasePhase.APPLY_FRAMEWORK_CHERRYPICKS + ..framework = (pb.Repository.create() + ..candidateBranch = candidateBranch + ..checkoutPath = frameworkCheckoutPath + ..mirror = (pb.Remote.create() + ..name = 'mirror' + ..url = mirrorRemoteUrl + ) + ..upstream = (pb.Remote.create() + ..name = 'upstream' + ..url = upstreamRemoteUrl + ) + ..workingBranch = workingBranch + ) + ..engine = (pb.Repository.create() + ..candidateBranch = candidateBranch + ..checkoutPath = engineCheckoutPath + ..upstream = (pb.Remote.create() + ..name = 'upstream' + ..url = engineUpstreamRemoteUrl + ) + ..dartRevision = 'abc123' + ) ); writeStateToFile( fileSystem.file(stateFile), @@ -788,132 +770,33 @@ void main() { }); }); - group('PUBLISH_VERSION to PUBLISH_CHANNEL', () { - const String remoteName = 'upstream'; + group('PUBLISH_VERSION to VERIFY_RELEASE', () { const String releaseVersion = '1.2.0-3.0.pre'; late pb.ConductorState state; - late FakePlatform platform; setUp(() { - state = pb.ConductorState( - currentPhase: ReleasePhase.PUBLISH_VERSION, - framework: pb.Repository( - candidateBranch: candidateBranch, - upstream: pb.Remote(url: FrameworkRepository.defaultUpstream), - ), - engine: pb.Repository( - candidateBranch: candidateBranch, - upstream: pb.Remote(url: EngineRepository.defaultUpstream), - ), - releaseVersion: releaseVersion, - ); - platform = FakePlatform( - environment: { - 'HOME': ['path', 'to', 'home'].join(localPathSeparator), - }, - operatingSystem: localOperatingSystem, - pathSeparator: localPathSeparator, - ); - }); - - test('does not update state.currentPhase if user responds no', () async { - stdio.stdin.add('n'); - final FakeProcessManager processManager = FakeProcessManager.list( - [ - // Framework checkout - const FakeCommand( - command: ['git', 'fetch', 'upstream'], - ), - const FakeCommand( - command: ['git', 'checkout', '$remoteName/$candidateBranch'], - ), - const FakeCommand( - command: ['git', 'rev-parse', 'HEAD'], - stdout: revision1, - ), - // Engine checkout - const FakeCommand( - command: ['git', 'fetch', 'upstream'], - ), - const FakeCommand( - command: ['git', 'checkout', '$remoteName/$candidateBranch'], - ), - const FakeCommand( - command: ['git', 'rev-parse', 'HEAD'], - stdout: revision1, - ), - ], - ); - writeStateToFile( - fileSystem.file(stateFile), - state, - [], - ); - final Checkouts checkouts = Checkouts( - fileSystem: fileSystem, - parentDirectory: fileSystem.directory(checkoutsParentDirectory)..createSync(recursive: true), - platform: platform, - processManager: processManager, - stdio: stdio, - ); - final CommandRunner runner = createRunner(checkouts: checkouts); - await runner.run([ - 'next', - '--$kStateOption', - stateFile, - ]); - - final pb.ConductorState finalState = readStateFromFile( - fileSystem.file(stateFile), + state = (pb.ConductorState.create() + ..releaseChannel = releaseChannel + ..currentPhase = ReleasePhase.PUBLISH_VERSION + ..framework = (pb.Repository.create() + ..candidateBranch = candidateBranch + ..upstream = (pb.Remote.create() + ..url = FrameworkRepository.defaultUpstream + ) + ) + ..engine = (pb.Repository.create() + ..candidateBranch = candidateBranch + ..upstream = (pb.Remote.create() + ..url = EngineRepository.defaultUpstream + ) + ) + ..releaseVersion = releaseVersion ); - - expect(processManager, hasNoRemainingExpectations); - expect(stdio.stdout, contains('Are you ready to tag commit $revision1 as $releaseVersion')); - expect(stdio.error, contains('Aborting command.')); - expect(finalState.currentPhase, ReleasePhase.PUBLISH_VERSION); - expect(finalState.logs, stdio.logs); }); - test('updates state.currentPhase if user responds yes', () async { + test('gives push command and updates state.currentPhase', () async { stdio.stdin.add('y'); - final FakeProcessManager processManager = FakeProcessManager.list([ - // Framework checkout - const FakeCommand( - command: ['git', 'fetch', 'upstream'], - ), - const FakeCommand( - command: ['git', 'checkout', '$remoteName/$candidateBranch'], - ), - const FakeCommand( - command: ['git', 'rev-parse', 'HEAD'], - stdout: revision1, - ), - // Engine checkout - const FakeCommand( - command: ['git', 'fetch', 'upstream'], - ), - const FakeCommand( - command: ['git', 'checkout', '$remoteName/$candidateBranch'], - ), - const FakeCommand( - command: ['git', 'rev-parse', 'HEAD'], - stdout: revision2, - ), - // Framework tag - const FakeCommand( - command: ['git', 'tag', releaseVersion, revision1], - ), - const FakeCommand( - command: ['git', 'push', remoteName, releaseVersion], - ), - // Engine tag - const FakeCommand( - command: ['git', 'tag', releaseVersion, revision2], - ), - const FakeCommand( - command: ['git', 'push', remoteName, releaseVersion], - ), - ]); + final FakeProcessManager processManager = FakeProcessManager.empty(); final FakePlatform platform = FakePlatform( environment: { 'HOME': ['path', 'to', 'home'].join(localPathSeparator), @@ -945,134 +828,12 @@ void main() { ); expect(processManager, hasNoRemainingExpectations); - expect(finalState.currentPhase, ReleasePhase.PUBLISH_CHANNEL); - expect(stdio.stdout, contains('Are you ready to tag commit $revision1 as $releaseVersion')); - expect(finalState.logs, stdio.logs); - }); - }); - - group('PUBLISH_CHANNEL to VERIFY_RELEASE', () { - const String remoteName = 'upstream'; - late pb.ConductorState state; - late FakePlatform platform; - - setUp(() { - state = pb.ConductorState( - currentPhase: ReleasePhase.PUBLISH_CHANNEL, - framework: pb.Repository( - candidateBranch: candidateBranch, - upstream: pb.Remote(url: FrameworkRepository.defaultUpstream), - ), - releaseChannel: releaseChannel, - releaseVersion: releaseVersion, - ); - platform = FakePlatform( - environment: { - 'HOME': ['path', 'to', 'home'].join(localPathSeparator), - }, - operatingSystem: localOperatingSystem, - pathSeparator: localPathSeparator, - ); - }); - - test('does not update currentPhase if user responds no', () async { - stdio.stdin.add('n'); - final FakeProcessManager processManager = FakeProcessManager.list([ - const FakeCommand( - command: ['git', 'fetch', 'upstream'], - ), - const FakeCommand( - command: ['git', 'checkout', '$remoteName/$candidateBranch'], - ), - const FakeCommand( - command: ['git', 'rev-parse', 'HEAD'], - stdout: revision1, - ), - ]); - writeStateToFile( - fileSystem.file(stateFile), - state, - [], - ); - final Checkouts checkouts = Checkouts( - fileSystem: fileSystem, - parentDirectory: fileSystem.directory(checkoutsParentDirectory)..createSync(recursive: true), - platform: platform, - processManager: processManager, - stdio: stdio, - ); - final CommandRunner runner = createRunner(checkouts: checkouts); - await runner.run([ - 'next', - '--$kStateOption', - stateFile, - ]); - - final pb.ConductorState finalState = readStateFromFile( - fileSystem.file(stateFile), - ); - - expect(processManager, hasNoRemainingExpectations); - expect(stdio.error, contains('Aborting command.')); - expect( - stdio.stdout, - contains('About to execute command: `git push ${FrameworkRepository.defaultUpstream} $revision1:$releaseChannel`'), - ); - expect(finalState.currentPhase, ReleasePhase.PUBLISH_CHANNEL); - }); - - test('updates currentPhase if user responds yes', () async { - stdio.stdin.add('y'); - final FakeProcessManager processManager = FakeProcessManager.list([ - const FakeCommand( - command: ['git', 'fetch', 'upstream'], - ), - const FakeCommand( - command: ['git', 'checkout', '$remoteName/$candidateBranch'], - ), - const FakeCommand( - command: ['git', 'rev-parse', 'HEAD'], - stdout: revision1, - ), - const FakeCommand( - command: ['git', 'push', FrameworkRepository.defaultUpstream, '$revision1:$releaseChannel'], - ), - ]); - writeStateToFile( - fileSystem.file(stateFile), - state, - [], - ); - final Checkouts checkouts = Checkouts( - fileSystem: fileSystem, - parentDirectory: fileSystem.directory(checkoutsParentDirectory)..createSync(recursive: true), - platform: platform, - processManager: processManager, - stdio: stdio, - ); - final CommandRunner runner = createRunner(checkouts: checkouts); - await runner.run([ - 'next', - '--$kStateOption', - stateFile, - ]); - - final pb.ConductorState finalState = readStateFromFile( - fileSystem.file(stateFile), - ); - - expect(processManager, hasNoRemainingExpectations); - expect(stdio.error, isEmpty); - expect( - stdio.stdout, - contains('About to execute command: `git push ${FrameworkRepository.defaultUpstream} $revision1:$releaseChannel`'), - ); - expect( - stdio.stdout, - contains( - 'Release archive packages must be verified on cloud storage: https://luci-milo.appspot.com/p/dart-internal/g/flutter_packaging/console'), - ); expect(finalState.currentPhase, ReleasePhase.VERIFY_RELEASE); + expect(stdio.stdout, contains('Run the following command, and ask a Googler')); + expect(stdio.stdout, contains(':tag $releaseVersion')); + expect(stdio.stdout, contains(':git_branch ${state.framework.candidateBranch}')); + expect(stdio.stdout, contains(':release_channel ${state.releaseChannel}')); + expect(finalState.logs, stdio.logs); }); }); @@ -1085,9 +846,8 @@ void main() { operatingSystem: localOperatingSystem, pathSeparator: localPathSeparator, ); - final pb.ConductorState state = pb.ConductorState( - currentPhase: ReleasePhase.RELEASE_COMPLETED, - ); + final pb.ConductorState state = pb.ConductorState.create() + ..currentPhase = ReleasePhase.RELEASE_COMPLETED; writeStateToFile( fileSystem.file(stateFile), state, diff --git a/dev/conductor/core/test/state_test.dart b/dev/conductor/core/test/state_test.dart index 89577326c523..7780faf9dad4 100644 --- a/dev/conductor/core/test/state_test.dart +++ b/dev/conductor/core/test/state_test.dart @@ -15,24 +15,23 @@ void main() { final File stateFile = fileSystem.file('/path/to/statefile.json') ..createSync(recursive: true); const String candidateBranch = 'flutter-2.3-candidate.0'; - final pb.ConductorState state = pb.ConductorState( - releaseChannel: 'stable', - releaseVersion: '2.3.4', - engine: pb.Repository( - candidateBranch: candidateBranch, - upstream: pb.Remote( - name: 'upstream', - url: 'git@github.com:flutter/engine.git', - ), - ), - framework: pb.Repository( - candidateBranch: candidateBranch, - upstream: pb.Remote( - name: 'upstream', - url: 'git@github.com:flutter/flutter.git', - ), - ), - ); + final pb.ConductorState state = pb.ConductorState.create() + ..releaseChannel = 'stable' + ..releaseVersion = '2.3.4' + ..engine = (pb.Repository.create() + ..candidateBranch = candidateBranch + ..upstream = (pb.Remote.create() + ..name = 'upstream' + ..url = 'git@github.com:flutter/engine.git' + ) + ) + ..framework = (pb.Repository.create() + ..candidateBranch = candidateBranch + ..upstream = (pb.Remote.create() + ..name = 'upstream' + ..url = 'git@github.com:flutter/flutter.git' + ) + ); writeStateToFile( stateFile, state,