Unverified Commit 21d3c3f2 authored by Kevin Chisholm's avatar Kevin Chisholm Committed by GitHub

replace engine and framework mirror args with github username arg (#109239)

parent f04a5464
...@@ -39,8 +39,7 @@ Releases are initialized with the `start` sub-command, like: ...@@ -39,8 +39,7 @@ Releases are initialized with the `start` sub-command, like:
conductor start \ conductor start \
--candidate-branch=flutter-2.2-candidate.10 \ --candidate-branch=flutter-2.2-candidate.10 \
--release-channel=beta \ --release-channel=beta \
--framework-mirror=git@github.com:username/flutter.git \ --github-username=kingOfDevelopers \
--engine-mirror=git@github.com:username/engine.git \
--engine-cherrypicks=72114dafe28c8700f1d5d629c6ae9d34172ba395 \ --engine-cherrypicks=72114dafe28c8700f1d5d629c6ae9d34172ba395 \
--framework-cherrypicks=a3e66b396746f6581b2b7efd1b0d0f0074215128,d8d853436206e86f416236b930e97779b143a100 \ --framework-cherrypicks=a3e66b396746f6581b2b7efd1b0d0f0074215128,d8d853436206e86f416236b930e97779b143a100 \
--dart-revision=4511eb2a779a612d9d6b2012123575013e0aef12 \ --dart-revision=4511eb2a779a612d9d6b2012123575013e0aef12 \
......
...@@ -31,6 +31,7 @@ const String kEngineMirrorOption = 'engine-mirror'; ...@@ -31,6 +31,7 @@ const String kEngineMirrorOption = 'engine-mirror';
const String kReleaseOption = 'release-channel'; const String kReleaseOption = 'release-channel';
const String kStateOption = 'state-file'; const String kStateOption = 'state-file';
const String kVersionOverrideOption = 'version-override'; const String kVersionOverrideOption = 'version-override';
const String kGithubUsernameOption = 'github-username';
/// Command to print the status of the current Flutter release. /// Command to print the status of the current Flutter release.
class StartCommand extends Command<void> { class StartCommand extends Command<void> {
...@@ -54,7 +55,8 @@ class StartCommand extends Command<void> { ...@@ -54,7 +55,8 @@ class StartCommand extends Command<void> {
argParser.addOption( argParser.addOption(
kFrameworkUpstreamOption, kFrameworkUpstreamOption,
defaultsTo: FrameworkRepository.defaultUpstream, defaultsTo: FrameworkRepository.defaultUpstream,
help: 'Configurable Framework repo upstream remote. Primarily for testing.', help:
'Configurable Framework repo upstream remote. Primarily for testing.',
hide: true, hide: true,
); );
argParser.addOption( argParser.addOption(
...@@ -63,14 +65,6 @@ class StartCommand extends Command<void> { ...@@ -63,14 +65,6 @@ class StartCommand extends Command<void> {
help: 'Configurable Engine repo upstream remote. Primarily for testing.', help: 'Configurable Engine repo upstream remote. Primarily for testing.',
hide: true, hide: true,
); );
argParser.addOption(
kFrameworkMirrorOption,
help: 'Framework repo mirror remote.',
);
argParser.addOption(
kEngineMirrorOption,
help: 'Engine repo mirror remote.',
);
argParser.addOption( argParser.addOption(
kStateOption, kStateOption,
defaultsTo: defaultPath, defaultsTo: defaultPath,
...@@ -98,7 +92,11 @@ class StartCommand extends Command<void> { ...@@ -98,7 +92,11 @@ class StartCommand extends Command<void> {
argParser.addOption( argParser.addOption(
kVersionOverrideOption, kVersionOverrideOption,
help: 'Explicitly set the desired version. This should only be used if ' help: 'Explicitly set the desired version. This should only be used if '
'the version computed by the tool is not correct.', 'the version computed by the tool is not correct.',
);
argParser.addOption(
kGithubUsernameOption,
help: 'Github username',
); );
} }
...@@ -130,21 +128,19 @@ class StartCommand extends Command<void> { ...@@ -130,21 +128,19 @@ class StartCommand extends Command<void> {
argumentResults, argumentResults,
platform.environment, platform.environment,
)!; )!;
final String frameworkMirror = getValueFromEnvOrArgs( final String githubUsername = getValueFromEnvOrArgs(
kFrameworkMirrorOption, kGithubUsernameOption,
argumentResults, argumentResults,
platform.environment, platform.environment,
)!; )!;
final String frameworkMirror =
'https://github.com/$githubUsername/flutter.git';
final String engineUpstream = getValueFromEnvOrArgs( final String engineUpstream = getValueFromEnvOrArgs(
kEngineUpstreamOption, kEngineUpstreamOption,
argumentResults, argumentResults,
platform.environment, platform.environment,
)!; )!;
final String engineMirror = getValueFromEnvOrArgs( final String engineMirror = 'https://github.com/$githubUsername/engine.git';
kEngineMirrorOption,
argumentResults,
platform.environment,
)!;
final String candidateBranch = getValueFromEnvOrArgs( final String candidateBranch = getValueFromEnvOrArgs(
kCandidateOption, kCandidateOption,
argumentResults, argumentResults,
...@@ -177,7 +173,8 @@ class StartCommand extends Command<void> { ...@@ -177,7 +173,8 @@ class StartCommand extends Command<void> {
platform.environment, platform.environment,
); );
final File stateFile = checkouts.fileSystem.file( final File stateFile = checkouts.fileSystem.file(
getValueFromEnvOrArgs(kStateOption, argumentResults, platform.environment), getValueFromEnvOrArgs(
kStateOption, argumentResults, platform.environment),
); );
final String? versionOverrideString = getValueFromEnvOrArgs( final String? versionOverrideString = getValueFromEnvOrArgs(
kVersionOverrideOption, kVersionOverrideOption,
...@@ -206,6 +203,7 @@ class StartCommand extends Command<void> { ...@@ -206,6 +203,7 @@ class StartCommand extends Command<void> {
stateFile: stateFile, stateFile: stateFile,
force: force, force: force,
versionOverride: versionOverride, versionOverride: versionOverride,
githubUsername: githubUsername,
); );
return context.run(); return context.run();
} }
...@@ -227,34 +225,36 @@ class StartContext extends Context { ...@@ -227,34 +225,36 @@ class StartContext extends Context {
required this.conductorVersion, required this.conductorVersion,
required this.processManager, required this.processManager,
required this.releaseChannel, required this.releaseChannel,
required this.githubUsername,
required super.checkouts, required super.checkouts,
required super.stateFile, required super.stateFile,
this.force = false, this.force = false,
this.versionOverride, this.versionOverride,
}) : git = Git(processManager), }) : git = Git(processManager),
engine = EngineRepository( engine = EngineRepository(
checkouts, checkouts,
initialRef: 'upstream/$candidateBranch', initialRef: 'upstream/$candidateBranch',
upstreamRemote: Remote( upstreamRemote: Remote(
name: RemoteName.upstream, name: RemoteName.upstream,
url: engineUpstream, url: engineUpstream,
), ),
mirrorRemote: Remote( mirrorRemote: Remote(
name: RemoteName.mirror, name: RemoteName.mirror,
url: engineMirror, url: engineMirror,
), ),
), framework = FrameworkRepository( ),
checkouts, framework = FrameworkRepository(
initialRef: 'upstream/$candidateBranch', checkouts,
upstreamRemote: Remote( initialRef: 'upstream/$candidateBranch',
name: RemoteName.upstream, upstreamRemote: Remote(
url: frameworkUpstream, name: RemoteName.upstream,
), url: frameworkUpstream,
mirrorRemote: Remote( ),
name: RemoteName.mirror, mirrorRemote: Remote(
url: frameworkMirror, name: RemoteName.mirror,
), url: frameworkMirror,
); ),
);
final String candidateBranch; final String candidateBranch;
final String? dartRevision; final String? dartRevision;
...@@ -269,6 +269,7 @@ class StartContext extends Context { ...@@ -269,6 +269,7 @@ class StartContext extends Context {
final ProcessManager processManager; final ProcessManager processManager;
final String releaseChannel; final String releaseChannel;
final Version? versionOverride; final Version? versionOverride;
final String githubUsername;
/// If validations should be overridden. /// If validations should be overridden.
final bool force; final bool force;
...@@ -298,7 +299,8 @@ class StartContext extends Context { ...@@ -298,7 +299,8 @@ class StartContext extends Context {
Future<void> run() async { Future<void> run() async {
if (stateFile.existsSync()) { if (stateFile.existsSync()) {
throw ConductorException('Error! A persistent state file already found at ${stateFile.path}.\n\n' throw ConductorException(
'Error! A persistent state file already found at ${stateFile.path}.\n\n'
'Run `conductor clean` to cancel a previous release.'); 'Run `conductor clean` to cancel a previous release.');
} }
if (!releaseCandidateBranchRegex.hasMatch(candidateBranch)) { if (!releaseCandidateBranchRegex.hasMatch(candidateBranch)) {
...@@ -329,10 +331,12 @@ class StartContext extends Context { ...@@ -329,10 +331,12 @@ class StartContext extends Context {
cherrypicks: engineCherrypickRevisions, cherrypicks: engineCherrypickRevisions,
upstreamRef: EngineRepository.defaultBranch, upstreamRef: EngineRepository.defaultBranch,
releaseRef: candidateBranch, releaseRef: candidateBranch,
)).map((String revision) => pb.Cherrypick( ))
trunkRevision: revision, .map((String revision) => pb.Cherrypick(
state: pb.CherrypickState.PENDING, trunkRevision: revision,
)).toList(); state: pb.CherrypickState.PENDING,
))
.toList();
for (final pb.Cherrypick cherrypick in engineCherrypicks) { for (final pb.Cherrypick cherrypick in engineCherrypicks) {
final String revision = cherrypick.trunkRevision; final String revision = cherrypick.trunkRevision;
...@@ -366,10 +370,12 @@ class StartContext extends Context { ...@@ -366,10 +370,12 @@ class StartContext extends Context {
cherrypicks: frameworkCherrypickRevisions, cherrypicks: frameworkCherrypickRevisions,
upstreamRef: FrameworkRepository.defaultBranch, upstreamRef: FrameworkRepository.defaultBranch,
releaseRef: candidateBranch, releaseRef: candidateBranch,
)).map((String revision) => pb.Cherrypick( ))
trunkRevision: revision, .map((String revision) => pb.Cherrypick(
state: pb.CherrypickState.PENDING, trunkRevision: revision,
)).toList(); state: pb.CherrypickState.PENDING,
))
.toList();
for (final pb.Cherrypick cherrypick in frameworkCherrypicks) { for (final pb.Cherrypick cherrypick in frameworkCherrypicks) {
final String revision = cherrypick.trunkRevision; final String revision = cherrypick.trunkRevision;
...@@ -399,7 +405,8 @@ class StartContext extends Context { ...@@ -399,7 +405,8 @@ class StartContext extends Context {
); );
final bool atBranchPoint = branchPoint == frameworkHead; final bool atBranchPoint = branchPoint == frameworkHead;
final ReleaseType releaseType = computeReleaseType(lastVersion, atBranchPoint); final ReleaseType releaseType =
computeReleaseType(lastVersion, atBranchPoint);
state.releaseType = releaseType; state.releaseType = releaseType;
try { try {
...@@ -451,10 +458,10 @@ class StartContext extends Context { ...@@ -451,10 +458,10 @@ class StartContext extends Context {
switch (releaseType) { switch (releaseType) {
case ReleaseType.STABLE_INITIAL: case ReleaseType.STABLE_INITIAL:
nextVersion = Version( nextVersion = Version(
x: lastVersion.x, x: lastVersion.x,
y: lastVersion.y, y: lastVersion.y,
z: 0, z: 0,
type: VersionType.stable, type: VersionType.stable,
); );
break; break;
case ReleaseType.STABLE_HOTFIX: case ReleaseType.STABLE_HOTFIX:
...@@ -501,7 +508,8 @@ class StartContext extends Context { ...@@ -501,7 +508,8 @@ class StartContext extends Context {
throw ConductorException('Aborting command.'); throw ConductorException('Aborting command.');
} }
stdio.printStatus('Applying the tag $requestedVersion at the branch point $branchPoint'); stdio.printStatus(
'Applying the tag $requestedVersion at the branch point $branchPoint');
await framework.tag( await framework.tag(
branchPoint, branchPoint,
...@@ -549,10 +557,13 @@ class StartContext extends Context { ...@@ -549,10 +557,13 @@ class StartContext extends Context {
final List<String> upstreamRevlist = (await repository.revList(<String>[ final List<String> upstreamRevlist = (await repository.revList(<String>[
'--ancestry-path', '--ancestry-path',
'$branchPoint..$upstreamRef', '$branchPoint..$upstreamRef',
])).reversed.toList(); ]))
.reversed
.toList();
stdio.printStatus('upstreamRevList:\n${upstreamRevlist.join('\n')}\n'); stdio.printStatus('upstreamRevList:\n${upstreamRevlist.join('\n')}\n');
stdio.printStatus('validatedCherrypicks:\n${validatedCherrypicks.join('\n')}\n'); stdio.printStatus(
'validatedCherrypicks:\n${validatedCherrypicks.join('\n')}\n');
for (final String upstreamRevision in upstreamRevlist) { for (final String upstreamRevision in upstreamRevlist) {
if (validatedCherrypicks.contains(upstreamRevision)) { if (validatedCherrypicks.contains(upstreamRevision)) {
validatedCherrypicks.remove(upstreamRevision); validatedCherrypicks.remove(upstreamRevision);
...@@ -569,7 +580,10 @@ class StartContext extends Context { ...@@ -569,7 +580,10 @@ class StartContext extends Context {
'The following ${repository.name} cherrypicks were not found in the ' 'The following ${repository.name} cherrypicks were not found in the '
'upstream $upstreamRef branch:', 'upstream $upstreamRef branch:',
); );
for (final String cp in <String>[...validatedCherrypicks, ...unknownCherrypicks]) { for (final String cp in <String>[
...validatedCherrypicks,
...unknownCherrypicks
]) {
stdio.printError('\t$cp'); stdio.printError('\t$cp');
} }
throw ConductorException( throw ConductorException(
......
This diff is collapsed.
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