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:
conductor start \
--candidate-branch=flutter-2.2-candidate.10 \
--release-channel=beta \
--framework-mirror=git@github.com:username/flutter.git \
--engine-mirror=git@github.com:username/engine.git \
--github-username=kingOfDevelopers \
--engine-cherrypicks=72114dafe28c8700f1d5d629c6ae9d34172ba395 \
--framework-cherrypicks=a3e66b396746f6581b2b7efd1b0d0f0074215128,d8d853436206e86f416236b930e97779b143a100 \
--dart-revision=4511eb2a779a612d9d6b2012123575013e0aef12 \
......
......@@ -31,6 +31,7 @@ const String kEngineMirrorOption = 'engine-mirror';
const String kReleaseOption = 'release-channel';
const String kStateOption = 'state-file';
const String kVersionOverrideOption = 'version-override';
const String kGithubUsernameOption = 'github-username';
/// Command to print the status of the current Flutter release.
class StartCommand extends Command<void> {
......@@ -54,7 +55,8 @@ class StartCommand extends Command<void> {
argParser.addOption(
kFrameworkUpstreamOption,
defaultsTo: FrameworkRepository.defaultUpstream,
help: 'Configurable Framework repo upstream remote. Primarily for testing.',
help:
'Configurable Framework repo upstream remote. Primarily for testing.',
hide: true,
);
argParser.addOption(
......@@ -63,14 +65,6 @@ class StartCommand extends Command<void> {
help: 'Configurable Engine repo upstream remote. Primarily for testing.',
hide: true,
);
argParser.addOption(
kFrameworkMirrorOption,
help: 'Framework repo mirror remote.',
);
argParser.addOption(
kEngineMirrorOption,
help: 'Engine repo mirror remote.',
);
argParser.addOption(
kStateOption,
defaultsTo: defaultPath,
......@@ -100,6 +94,10 @@ class StartCommand extends Command<void> {
help: 'Explicitly set the desired version. This should only be used if '
'the version computed by the tool is not correct.',
);
argParser.addOption(
kGithubUsernameOption,
help: 'Github username',
);
}
final Checkouts checkouts;
......@@ -130,21 +128,19 @@ class StartCommand extends Command<void> {
argumentResults,
platform.environment,
)!;
final String frameworkMirror = getValueFromEnvOrArgs(
kFrameworkMirrorOption,
final String githubUsername = getValueFromEnvOrArgs(
kGithubUsernameOption,
argumentResults,
platform.environment,
)!;
final String frameworkMirror =
'https://github.com/$githubUsername/flutter.git';
final String engineUpstream = getValueFromEnvOrArgs(
kEngineUpstreamOption,
argumentResults,
platform.environment,
)!;
final String engineMirror = getValueFromEnvOrArgs(
kEngineMirrorOption,
argumentResults,
platform.environment,
)!;
final String engineMirror = 'https://github.com/$githubUsername/engine.git';
final String candidateBranch = getValueFromEnvOrArgs(
kCandidateOption,
argumentResults,
......@@ -177,7 +173,8 @@ class StartCommand extends Command<void> {
platform.environment,
);
final File stateFile = checkouts.fileSystem.file(
getValueFromEnvOrArgs(kStateOption, argumentResults, platform.environment),
getValueFromEnvOrArgs(
kStateOption, argumentResults, platform.environment),
);
final String? versionOverrideString = getValueFromEnvOrArgs(
kVersionOverrideOption,
......@@ -206,6 +203,7 @@ class StartCommand extends Command<void> {
stateFile: stateFile,
force: force,
versionOverride: versionOverride,
githubUsername: githubUsername,
);
return context.run();
}
......@@ -227,6 +225,7 @@ class StartContext extends Context {
required this.conductorVersion,
required this.processManager,
required this.releaseChannel,
required this.githubUsername,
required super.checkouts,
required super.stateFile,
this.force = false,
......@@ -243,7 +242,8 @@ class StartContext extends Context {
name: RemoteName.mirror,
url: engineMirror,
),
), framework = FrameworkRepository(
),
framework = FrameworkRepository(
checkouts,
initialRef: 'upstream/$candidateBranch',
upstreamRemote: Remote(
......@@ -269,6 +269,7 @@ class StartContext extends Context {
final ProcessManager processManager;
final String releaseChannel;
final Version? versionOverride;
final String githubUsername;
/// If validations should be overridden.
final bool force;
......@@ -298,7 +299,8 @@ class StartContext extends Context {
Future<void> run() async {
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.');
}
if (!releaseCandidateBranchRegex.hasMatch(candidateBranch)) {
......@@ -329,10 +331,12 @@ class StartContext extends Context {
cherrypicks: engineCherrypickRevisions,
upstreamRef: EngineRepository.defaultBranch,
releaseRef: candidateBranch,
)).map((String revision) => pb.Cherrypick(
))
.map((String revision) => pb.Cherrypick(
trunkRevision: revision,
state: pb.CherrypickState.PENDING,
)).toList();
))
.toList();
for (final pb.Cherrypick cherrypick in engineCherrypicks) {
final String revision = cherrypick.trunkRevision;
......@@ -366,10 +370,12 @@ class StartContext extends Context {
cherrypicks: frameworkCherrypickRevisions,
upstreamRef: FrameworkRepository.defaultBranch,
releaseRef: candidateBranch,
)).map((String revision) => pb.Cherrypick(
))
.map((String revision) => pb.Cherrypick(
trunkRevision: revision,
state: pb.CherrypickState.PENDING,
)).toList();
))
.toList();
for (final pb.Cherrypick cherrypick in frameworkCherrypicks) {
final String revision = cherrypick.trunkRevision;
......@@ -399,7 +405,8 @@ class StartContext extends Context {
);
final bool atBranchPoint = branchPoint == frameworkHead;
final ReleaseType releaseType = computeReleaseType(lastVersion, atBranchPoint);
final ReleaseType releaseType =
computeReleaseType(lastVersion, atBranchPoint);
state.releaseType = releaseType;
try {
......@@ -501,7 +508,8 @@ class StartContext extends Context {
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(
branchPoint,
......@@ -549,10 +557,13 @@ class StartContext extends Context {
final List<String> upstreamRevlist = (await repository.revList(<String>[
'--ancestry-path',
'$branchPoint..$upstreamRef',
])).reversed.toList();
]))
.reversed
.toList();
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) {
if (validatedCherrypicks.contains(upstreamRevision)) {
validatedCherrypicks.remove(upstreamRevision);
......@@ -569,7 +580,10 @@ class StartContext extends Context {
'The following ${repository.name} cherrypicks were not found in the '
'upstream $upstreamRef branch:',
);
for (final String cp in <String>[...validatedCherrypicks, ...unknownCherrypicks]) {
for (final String cp in <String>[
...validatedCherrypicks,
...unknownCherrypicks
]) {
stdio.printError('\t$cp');
}
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