Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
1b9cba4b
Unverified
Commit
1b9cba4b
authored
Oct 30, 2018
by
Greg Spencer
Committed by
GitHub
Oct 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure we refer to 'stable', and not 'release' branch. (#23745)
parent
b8c3e0db
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
15 deletions
+51
-15
prepare_package.dart
dev/bots/prepare_package.dart
+5
-5
prepare_package_test.dart
dev/bots/test/prepare_package_test.dart
+6
-6
version.dart
packages/flutter_tools/lib/src/version.dart
+2
-2
channel_test.dart
packages/flutter_tools/test/channel_test.dart
+38
-2
No files found.
dev/bots/prepare_package.dart
View file @
1b9cba4b
...
@@ -45,7 +45,7 @@ class ProcessRunnerException implements Exception {
...
@@ -45,7 +45,7 @@ class ProcessRunnerException implements Exception {
}
}
}
}
enum
Branch
{
dev
,
beta
,
releas
e
}
enum
Branch
{
dev
,
beta
,
stabl
e
}
String
getBranchName
(
Branch
branch
)
{
String
getBranchName
(
Branch
branch
)
{
switch
(
branch
)
{
switch
(
branch
)
{
...
@@ -53,8 +53,8 @@ String getBranchName(Branch branch) {
...
@@ -53,8 +53,8 @@ String getBranchName(Branch branch) {
return
'beta'
;
return
'beta'
;
case
Branch
.
dev
:
case
Branch
.
dev
:
return
'dev'
;
return
'dev'
;
case
Branch
.
releas
e
:
case
Branch
.
stabl
e
:
return
'
releas
e'
;
return
'
stabl
e'
;
}
}
return
null
;
return
null
;
}
}
...
@@ -65,8 +65,8 @@ Branch fromBranchName(String name) {
...
@@ -65,8 +65,8 @@ Branch fromBranchName(String name) {
return
Branch
.
beta
;
return
Branch
.
beta
;
case
'dev'
:
case
'dev'
:
return
Branch
.
dev
;
return
Branch
.
dev
;
case
'
releas
e'
:
case
'
stabl
e'
:
return
Branch
.
releas
e
;
return
Branch
.
stabl
e
;
default
:
default
:
throw
ArgumentError
(
'Invalid branch name.'
);
throw
ArgumentError
(
'Invalid branch name.'
);
}
}
...
...
dev/bots/test/prepare_package_test.dart
View file @
1b9cba4b
...
@@ -221,7 +221,7 @@ void main() {
...
@@ -221,7 +221,7 @@ void main() {
final
String
archiveName
=
platform
.
isLinux
?
'archive.tar.xz'
:
'archive.zip'
;
final
String
archiveName
=
platform
.
isLinux
?
'archive.tar.xz'
:
'archive.zip'
;
final
String
archiveMime
=
platform
.
isLinux
?
'application/x-gtar'
:
'application/zip'
;
final
String
archiveMime
=
platform
.
isLinux
?
'application/x-gtar'
:
'application/zip'
;
final
String
archivePath
=
path
.
join
(
tempDir
.
absolute
.
path
,
archiveName
);
final
String
archivePath
=
path
.
join
(
tempDir
.
absolute
.
path
,
archiveName
);
final
String
gsArchivePath
=
'gs://flutter_infra/releases/
releas
e/
$platformName
/
$archiveName
'
;
final
String
gsArchivePath
=
'gs://flutter_infra/releases/
stabl
e/
$platformName
/
$archiveName
'
;
final
String
jsonPath
=
path
.
join
(
tempDir
.
absolute
.
path
,
releasesName
);
final
String
jsonPath
=
path
.
join
(
tempDir
.
absolute
.
path
,
releasesName
);
final
String
gsJsonPath
=
'gs://flutter_infra/releases/
$releasesName
'
;
final
String
gsJsonPath
=
'gs://flutter_infra/releases/
$releasesName
'
;
final
String
releasesJson
=
'''{
final
String
releasesJson
=
'''{
...
@@ -247,10 +247,10 @@ void main() {
...
@@ -247,10 +247,10 @@ void main() {
},
},
{
{
"hash": "
$testRef
",
"hash": "
$testRef
",
"channel": "
releas
e",
"channel": "
stabl
e",
"version": "v0.0.0",
"version": "v0.0.0",
"release_date": "2018-03-20T01:47:02.851729Z",
"release_date": "2018-03-20T01:47:02.851729Z",
"archive": "
releas
e/
$platformName
/flutter_
${platformName}
_v0.0.0-dev.zip"
"archive": "
stabl
e/
$platformName
/flutter_
${platformName}
_v0.0.0-dev.zip"
}
}
]
]
}
}
...
@@ -269,7 +269,7 @@ void main() {
...
@@ -269,7 +269,7 @@ void main() {
final
ArchivePublisher
publisher
=
ArchivePublisher
(
final
ArchivePublisher
publisher
=
ArchivePublisher
(
tempDir
,
tempDir
,
testRef
,
testRef
,
Branch
.
releas
e
,
Branch
.
stabl
e
,
'v1.2.3'
,
'v1.2.3'
,
outputFile
,
outputFile
,
processManager:
processManager
,
processManager:
processManager
,
...
@@ -284,8 +284,8 @@ void main() {
...
@@ -284,8 +284,8 @@ void main() {
final
String
contents
=
releaseFile
.
readAsStringSync
();
final
String
contents
=
releaseFile
.
readAsStringSync
();
// Make sure new data is added.
// Make sure new data is added.
expect
(
contents
,
contains
(
'"hash": "
$testRef
"'
));
expect
(
contents
,
contains
(
'"hash": "
$testRef
"'
));
expect
(
contents
,
contains
(
'"channel": "
releas
e"'
));
expect
(
contents
,
contains
(
'"channel": "
stabl
e"'
));
expect
(
contents
,
contains
(
'"archive": "
releas
e/
$platformName
/
$archiveName
"'
));
expect
(
contents
,
contains
(
'"archive": "
stabl
e/
$platformName
/
$archiveName
"'
));
// Make sure existing entries are preserved.
// Make sure existing entries are preserved.
expect
(
contents
,
contains
(
'"hash": "5a58b36e36b8d7aace89d3950e6deb307956a6a0"'
));
expect
(
contents
,
contains
(
'"hash": "5a58b36e36b8d7aace89d3950e6deb307956a6a0"'
));
expect
(
contents
,
contains
(
'"hash": "b9bd51cc36b706215915711e580851901faebb40"'
));
expect
(
contents
,
contains
(
'"hash": "b9bd51cc36b706215915711e580851901faebb40"'
));
...
...
packages/flutter_tools/lib/src/version.dart
View file @
1b9cba4b
...
@@ -47,7 +47,7 @@ class FlutterVersion {
...
@@ -47,7 +47,7 @@ class FlutterVersion {
'master'
,
'master'
,
'dev'
,
'dev'
,
'beta'
,
'beta'
,
'
releas
e'
,
'
stabl
e'
,
]);
]);
/// This maps old branch names to the names of branches that replaced them.
/// This maps old branch names to the names of branches that replaced them.
...
@@ -63,7 +63,7 @@ class FlutterVersion {
...
@@ -63,7 +63,7 @@ class FlutterVersion {
String
_channel
;
String
_channel
;
/// The channel is the upstream branch.
/// The channel is the upstream branch.
/// `master`, `dev`, `beta`, `
releas
e`; or old ones, like `alpha`, `hackathon`, ...
/// `master`, `dev`, `beta`, `
stabl
e`; or old ones, like `alpha`, `hackathon`, ...
String
get
channel
=>
_channel
;
String
get
channel
=>
_channel
;
/// The name of the local branch.
/// The name of the local branch.
...
...
packages/flutter_tools/test/channel_test.dart
View file @
1b9cba4b
...
@@ -56,8 +56,10 @@ void main() {
...
@@ -56,8 +56,10 @@ void main() {
final
Process
process
=
createMockProcess
(
final
Process
process
=
createMockProcess
(
stdout:
'origin/dev
\n
'
stdout:
'origin/dev
\n
'
'origin/beta
\n
'
'origin/beta
\n
'
'origin/stable
\n
'
'upstream/dev
\n
'
'upstream/dev
\n
'
'upstream/beta
\n
'
);
'upstream/beta
\n
'
'upstream/stable
\n
'
);
when
(
mockProcessManager
.
start
(
when
(
mockProcessManager
.
start
(
<
String
>[
'git'
,
'branch'
,
'-r'
],
<
String
>[
'git'
,
'branch'
,
'-r'
],
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
...
@@ -83,7 +85,7 @@ void main() {
...
@@ -83,7 +85,7 @@ void main() {
.
where
((
String
line
)
=>
line
?.
isNotEmpty
==
true
)
.
where
((
String
line
)
=>
line
?.
isNotEmpty
==
true
)
.
skip
(
1
);
// remove `Flutter channels:` line
.
skip
(
1
);
// remove `Flutter channels:` line
expect
(
rows
,
<
String
>[
'dev'
,
'beta'
]);
expect
(
rows
,
<
String
>[
'dev'
,
'beta'
,
'stable'
]);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
ProcessManager:
()
=>
mockProcessManager
,
});
});
...
@@ -127,6 +129,40 @@ void main() {
...
@@ -127,6 +129,40 @@ void main() {
expect
(
testLogger
.
statusText
,
contains
(
"Switching to flutter channel 'beta'..."
));
expect
(
testLogger
.
statusText
,
contains
(
"Switching to flutter channel 'beta'..."
));
expect
(
testLogger
.
errorText
,
hasLength
(
0
));
expect
(
testLogger
.
errorText
,
hasLength
(
0
));
when
(
mockProcessManager
.
start
(
<
String
>[
'git'
,
'fetch'
],
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
)).
thenAnswer
((
_
)
=>
Future
<
Process
>.
value
(
createMockProcess
()));
when
(
mockProcessManager
.
start
(
<
String
>[
'git'
,
'show-ref'
,
'--verify'
,
'--quiet'
,
'refs/heads/stable'
],
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
)).
thenAnswer
((
_
)
=>
Future
<
Process
>.
value
(
createMockProcess
()));
when
(
mockProcessManager
.
start
(
<
String
>[
'git'
,
'checkout'
,
'stable'
,
'--'
],
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
)).
thenAnswer
((
_
)
=>
Future
<
Process
>.
value
(
createMockProcess
()));
await
runner
.
run
(<
String
>[
'channel'
,
'stable'
]);
verify
(
mockProcessManager
.
start
(
<
String
>[
'git'
,
'fetch'
],
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
)).
called
(
1
);
verify
(
mockProcessManager
.
start
(
<
String
>[
'git'
,
'show-ref'
,
'--verify'
,
'--quiet'
,
'refs/heads/stable'
],
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
)).
called
(
1
);
verify
(
mockProcessManager
.
start
(
<
String
>[
'git'
,
'checkout'
,
'stable'
,
'--'
],
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
)).
called
(
1
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
ProcessManager:
()
=>
mockProcessManager
,
FileSystem:
()
=>
MemoryFileSystem
(),
FileSystem:
()
=>
MemoryFileSystem
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment