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
481dfec0
Unverified
Commit
481dfec0
authored
Dec 07, 2021
by
Christopher Fujino
Committed by
GitHub
Dec 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_conductor] Support publishing to multiple channels (#94770)
parent
3b1e3ba7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
21 deletions
+39
-21
globals.dart
dev/conductor/core/lib/src/globals.dart
+5
-1
next.dart
dev/conductor/core/lib/src/next.dart
+24
-16
start.dart
dev/conductor/core/lib/src/start.dart
+1
-1
version.dart
dev/conductor/core/lib/src/version.dart
+2
-2
common.dart
dev/conductor/core/test/common.dart
+1
-1
next_test.dart
dev/conductor/core/test/next_test.dart
+6
-0
No files found.
dev/conductor/core/lib/src/globals.dart
View file @
481dfec0
...
...
@@ -16,7 +16,7 @@ const List<String> kBaseReleaseChannels = <String>['stable', 'beta', 'dev'];
const
List
<
String
>
kReleaseChannels
=
<
String
>[...
kBaseReleaseChannels
,
FrameworkRepository
.
defaultBranch
];
const
List
<
String
>
K
ReleaseIncrements
=
<
String
>[
'y'
,
'z'
,
'm'
,
'n'
];
const
List
<
String
>
k
ReleaseIncrements
=
<
String
>[
'y'
,
'z'
,
'm'
,
'n'
];
const
String
kReleaseDocumentationUrl
=
'https://github.com/flutter/flutter/wiki/Flutter-Cherrypick-Process'
;
...
...
@@ -28,6 +28,10 @@ final RegExp releaseCandidateBranchRegex = RegExp(
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.
String
stdoutToString
(
dynamic
input
)
{
final
String
str
=
input
as
String
;
...
...
dev/conductor/core/lib/src/next.dart
View file @
481dfec0
...
...
@@ -48,7 +48,7 @@ class NextCommand extends Command<void> {
String
get
description
=>
'Proceed to the next release phase.'
;
@override
Future
<
void
>
run
()
async
{
Future
<
void
>
run
()
{
final
File
stateFile
=
checkouts
.
fileSystem
.
file
(
argResults
![
kStateOption
]);
if
(!
stateFile
.
existsSync
())
{
throw
ConductorException
(
...
...
@@ -57,7 +57,7 @@ class NextCommand extends Command<void> {
}
final
pb
.
ConductorState
state
=
state_import
.
readStateFromFile
(
stateFile
);
await
NextContext
(
return
NextContext
(
autoAccept:
argResults
![
kYesFlag
]
as
bool
,
checkouts:
checkouts
,
force:
argResults
![
kForceFlag
]
as
bool
,
...
...
@@ -324,29 +324,37 @@ class NextContext extends Context {
previousCheckoutLocation:
state
.
framework
.
checkoutPath
,
);
final
String
headRevision
=
await
framework
.
reverseParse
(
'HEAD'
);
if
(
autoAccept
==
false
)
{
// dryRun: true means print out git command
await
framework
.
pushRef
(
final
List
<
String
>
releaseRefs
=
<
String
>[
state
.
releaseChannel
];
if
(
kSynchronizeDevWithBeta
&&
state
.
releaseChannel
==
'beta'
)
{
releaseRefs
.
add
(
'dev'
);
}
for
(
final
String
releaseRef
in
releaseRefs
)
{
if
(
autoAccept
==
false
)
{
// dryRun: true means print out git command
await
framework
.
pushRef
(
fromRef:
headRevision
,
toRef:
state
.
releaseChannel
,
toRef:
releaseRef
,
remote:
state
.
framework
.
upstream
.
url
,
force:
force
,
dryRun:
true
,
);
);
final
bool
response
=
await
prompt
(
'Are you ready to publish this release?'
);
if
(!
response
)
{
stdio
.
printError
(
'Aborting command.'
);
updateState
(
state
,
stdio
.
logs
);
return
;
final
bool
response
=
await
prompt
(
'Are you ready to publish version
${state.releaseVersion}
to
$releaseRef
?'
,
);
if
(!
response
)
{
stdio
.
printError
(
'Aborting command.'
);
updateState
(
state
,
stdio
.
logs
);
return
;
}
}
}
await
framework
.
pushRef
(
await
framework
.
pushRef
(
fromRef:
headRevision
,
toRef:
state
.
releaseChannel
,
toRef:
releaseRef
,
remote:
state
.
framework
.
upstream
.
url
,
force:
force
,
);
);
}
break
;
case
pb
.
ReleasePhase
.
VERIFY_RELEASE
:
stdio
.
printStatus
(
...
...
dev/conductor/core/lib/src/start.dart
View file @
481dfec0
...
...
@@ -93,7 +93,7 @@ class StartCommand extends Command<void> {
kIncrementOption
,
help:
'Specifies which part of the x.y.z version number to increment. Required.'
,
valueHelp:
'level'
,
allowed:
K
ReleaseIncrements
,
allowed:
k
ReleaseIncrements
,
allowedHelp:
<
String
,
String
>{
'y'
:
'Indicates the first dev release after a beta release.'
,
'z'
:
'Indicates a hotfix to a stable release.'
,
...
...
dev/conductor/core/lib/src/version.dart
View file @
481dfec0
...
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'./globals.dart'
show
ConductorException
,
K
ReleaseIncrements
,
releaseCandidateBranchRegex
;
import
'./globals.dart'
show
ConductorException
,
k
ReleaseIncrements
,
releaseCandidateBranchRegex
;
/// Possible string formats that `flutter --version` can return.
enum
VersionType
{
...
...
@@ -262,7 +262,7 @@ class Version {
/// Will throw a [ConductorException] if the version is not possible given the
/// [candidateBranch] and [incrementLetter].
void
ensureValid
(
String
candidateBranch
,
String
incrementLetter
)
{
if
(!
K
ReleaseIncrements
.
contains
(
incrementLetter
))
{
if
(!
k
ReleaseIncrements
.
contains
(
incrementLetter
))
{
throw
ConductorException
(
'Invalid incrementLetter:
$incrementLetter
'
);
}
final
RegExpMatch
?
branchMatch
=
releaseCandidateBranchRegex
.
firstMatch
(
candidateBranch
);
...
...
dev/conductor/core/test/common.dart
View file @
481dfec0
...
...
@@ -48,7 +48,7 @@ class TestStdio extends Stdio {
@override
String
readLineSync
()
{
if
(
stdin
.
isEmpty
)
{
throw
Exception
(
'Unexpected call to readLineSync!'
);
throw
Exception
(
'Unexpected call to readLineSync!
Last stdout was
${logs.last}
'
);
}
return
stdin
.
removeAt
(
0
);
}
...
...
dev/conductor/core/test/next_test.dart
View file @
481dfec0
...
...
@@ -966,6 +966,8 @@ void main() {
});
test
(
'updates currentPhase if user responds yes'
,
()
async
{
stdio
.
stdin
.
add
(
'y'
);
// for kSynchronizeDevWithBeta
stdio
.
stdin
.
add
(
'y'
);
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
...
...
@@ -981,6 +983,10 @@ void main() {
const
FakeCommand
(
command:
<
String
>[
'git'
,
'push'
,
FrameworkRepository
.
defaultUpstream
,
'
$revision1
:
$releaseChannel
'
],
),
// for kSynchronizeDevWithBeta
const
FakeCommand
(
command:
<
String
>[
'git'
,
'push'
,
FrameworkRepository
.
defaultUpstream
,
'
$revision1
:dev'
],
),
]);
writeStateToFile
(
fileSystem
.
file
(
stateFile
),
...
...
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