Make sure we refer to 'stable', and not 'release' branch. (#23745)

This commit is contained in:
Greg Spencer
2018-10-30 16:57:54 -07:00
committed by GitHub
parent b8c3e0dbae
commit 1b9cba4b42
4 changed files with 51 additions and 15 deletions

View File

@@ -45,7 +45,7 @@ class ProcessRunnerException implements Exception {
}
}
enum Branch { dev, beta, release }
enum Branch { dev, beta, stable }
String getBranchName(Branch branch) {
switch (branch) {
@@ -53,8 +53,8 @@ String getBranchName(Branch branch) {
return 'beta';
case Branch.dev:
return 'dev';
case Branch.release:
return 'release';
case Branch.stable:
return 'stable';
}
return null;
}
@@ -65,8 +65,8 @@ Branch fromBranchName(String name) {
return Branch.beta;
case 'dev':
return Branch.dev;
case 'release':
return Branch.release;
case 'stable':
return Branch.stable;
default:
throw ArgumentError('Invalid branch name.');
}

View File

@@ -221,7 +221,7 @@ void main() {
final String archiveName = platform.isLinux ? 'archive.tar.xz' : 'archive.zip';
final String archiveMime = platform.isLinux ? 'application/x-gtar' : 'application/zip';
final String archivePath = path.join(tempDir.absolute.path, archiveName);
final String gsArchivePath = 'gs://flutter_infra/releases/release/$platformName/$archiveName';
final String gsArchivePath = 'gs://flutter_infra/releases/stable/$platformName/$archiveName';
final String jsonPath = path.join(tempDir.absolute.path, releasesName);
final String gsJsonPath = 'gs://flutter_infra/releases/$releasesName';
final String releasesJson = '''{
@@ -247,10 +247,10 @@ void main() {
},
{
"hash": "$testRef",
"channel": "release",
"channel": "stable",
"version": "v0.0.0",
"release_date": "2018-03-20T01:47:02.851729Z",
"archive": "release/$platformName/flutter_${platformName}_v0.0.0-dev.zip"
"archive": "stable/$platformName/flutter_${platformName}_v0.0.0-dev.zip"
}
]
}
@@ -269,7 +269,7 @@ void main() {
final ArchivePublisher publisher = ArchivePublisher(
tempDir,
testRef,
Branch.release,
Branch.stable,
'v1.2.3',
outputFile,
processManager: processManager,
@@ -284,8 +284,8 @@ void main() {
final String contents = releaseFile.readAsStringSync();
// Make sure new data is added.
expect(contents, contains('"hash": "$testRef"'));
expect(contents, contains('"channel": "release"'));
expect(contents, contains('"archive": "release/$platformName/$archiveName"'));
expect(contents, contains('"channel": "stable"'));
expect(contents, contains('"archive": "stable/$platformName/$archiveName"'));
// Make sure existing entries are preserved.
expect(contents, contains('"hash": "5a58b36e36b8d7aace89d3950e6deb307956a6a0"'));
expect(contents, contains('"hash": "b9bd51cc36b706215915711e580851901faebb40"'));