Unverified Commit 30efcf40 authored by Xilai Zhang's avatar Xilai Zhang Committed by GitHub

[flutter_conductor] Conductor should stop mirroring beta releases to dev (#100716)

parent df1163de
...@@ -41,10 +41,6 @@ final RegExp releaseCandidateBranchRegex = RegExp( ...@@ -41,10 +41,6 @@ final RegExp releaseCandidateBranchRegex = RegExp(
r'flutter-(\d+)\.(\d+)-candidate\.(\d+)', r'flutter-(\d+)\.(\d+)-candidate\.(\d+)',
); );
/// Whether all releases published to the beta channel should be mirrored to
/// dev.
const bool kSynchronizeDevWithBeta = true;
/// Cast a dynamic to String and trim. /// Cast a dynamic to String and trim.
String stdoutToString(dynamic input) { String stdoutToString(dynamic input) {
final String str = input as String; final String str = input as String;
......
...@@ -48,7 +48,7 @@ class NextCommand extends Command<void> { ...@@ -48,7 +48,7 @@ class NextCommand extends Command<void> {
String get description => 'Proceed to the next release phase.'; String get description => 'Proceed to the next release phase.';
@override @override
Future<void> run() { Future<void> run() async {
final File stateFile = checkouts.fileSystem.file(argResults![kStateOption]); final File stateFile = checkouts.fileSystem.file(argResults![kStateOption]);
if (!stateFile.existsSync()) { if (!stateFile.existsSync()) {
throw ConductorException( throw ConductorException(
...@@ -57,7 +57,7 @@ class NextCommand extends Command<void> { ...@@ -57,7 +57,7 @@ class NextCommand extends Command<void> {
} }
final pb.ConductorState state = state_import.readStateFromFile(stateFile); final pb.ConductorState state = state_import.readStateFromFile(stateFile);
return NextContext( await NextContext(
autoAccept: argResults![kYesFlag] as bool, autoAccept: argResults![kYesFlag] as bool,
checkouts: checkouts, checkouts: checkouts,
force: argResults![kForceFlag] as bool, force: argResults![kForceFlag] as bool,
...@@ -302,37 +302,31 @@ class NextContext extends Context { ...@@ -302,37 +302,31 @@ class NextContext extends Context {
previousCheckoutLocation: state.framework.checkoutPath, previousCheckoutLocation: state.framework.checkoutPath,
); );
final String headRevision = await framework.reverseParse('HEAD'); final String headRevision = await framework.reverseParse('HEAD');
final List<String> releaseRefs = <String>[state.releaseChannel]; if (autoAccept == false) {
if (kSynchronizeDevWithBeta && state.releaseChannel == 'beta') { // dryRun: true means print out git command
releaseRefs.add('dev'); await framework.pushRef(
}
for (final String releaseRef in releaseRefs) {
if (autoAccept == false) {
// dryRun: true means print out git command
await framework.pushRef(
fromRef: headRevision, fromRef: headRevision,
toRef: releaseRef, toRef: state.releaseChannel,
remote: state.framework.upstream.url, remote: state.framework.upstream.url,
force: force, force: force,
dryRun: true, dryRun: true,
); );
final bool response = await prompt( final bool response = await prompt(
'Are you ready to publish version ${state.releaseVersion} to $releaseRef?', 'Are you ready to publish version ${state.releaseVersion} to ${state.releaseChannel}?',
); );
if (!response) { if (!response) {
stdio.printError('Aborting command.'); stdio.printError('Aborting command.');
updateState(state, stdio.logs); updateState(state, stdio.logs);
return; return;
}
} }
await framework.pushRef( }
await framework.pushRef(
fromRef: headRevision, fromRef: headRevision,
toRef: releaseRef, toRef: state.releaseChannel,
remote: state.framework.upstream.url, remote: state.framework.upstream.url,
force: force, force: force,
); );
}
break; break;
case pb.ReleasePhase.VERIFY_RELEASE: case pb.ReleasePhase.VERIFY_RELEASE:
stdio.printStatus( stdio.printStatus(
......
...@@ -943,8 +943,6 @@ void main() { ...@@ -943,8 +943,6 @@ void main() {
}); });
test('updates currentPhase if user responds yes', () async { test('updates currentPhase if user responds yes', () async {
stdio.stdin.add('y');
// for kSynchronizeDevWithBeta
stdio.stdin.add('y'); stdio.stdin.add('y');
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand( const FakeCommand(
...@@ -960,10 +958,6 @@ void main() { ...@@ -960,10 +958,6 @@ void main() {
const FakeCommand( const FakeCommand(
command: <String>['git', 'push', FrameworkRepository.defaultUpstream, '$revision1:$releaseChannel'], command: <String>['git', 'push', FrameworkRepository.defaultUpstream, '$revision1:$releaseChannel'],
), ),
// for kSynchronizeDevWithBeta
const FakeCommand(
command: <String>['git', 'push', FrameworkRepository.defaultUpstream, '$revision1:dev'],
),
]); ]);
writeStateToFile( writeStateToFile(
fileSystem.file(stateFile), fileSystem.file(stateFile),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment