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
38dbbb17
Unverified
Commit
38dbbb17
authored
Mar 01, 2022
by
Christopher Fujino
Committed by
GitHub
Mar 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_conductor] deprecate increment (#99189)
parent
31316991
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
274 additions
and
204 deletions
+274
-204
README.md
dev/conductor/README.md
+5
-1
globals.dart
dev/conductor/core/lib/src/globals.dart
+0
-2
compile_proto.sh
dev/conductor/core/lib/src/proto/compile_proto.sh
+1
-2
conductor_state.pb.dart
dev/conductor/core/lib/src/proto/conductor_state.pb.dart
+14
-10
conductor_state.pbenum.dart
dev/conductor/core/lib/src/proto/conductor_state.pbenum.dart
+23
-0
conductor_state.pbjson.dart
dev/conductor/core/lib/src/proto/conductor_state.pbjson.dart
+16
-2
conductor_state.proto
dev/conductor/core/lib/src/proto/conductor_state.proto
+19
-2
start.dart
dev/conductor/core/lib/src/start.dart
+85
-52
version.dart
dev/conductor/core/lib/src/version.dart
+6
-7
start_test.dart
dev/conductor/core/test/start_test.dart
+97
-107
state_test.dart
dev/conductor/core/test/state_test.dart
+1
-3
version_test.dart
dev/conductor/core/test/version_test.dart
+7
-16
No files found.
dev/conductor/README.md
View file @
38dbbb17
...
@@ -44,9 +44,13 @@ conductor start \
...
@@ -44,9 +44,13 @@ conductor start \
--engine-cherrypicks=72114dafe28c8700f1d5d629c6ae9d34172ba395 \
--engine-cherrypicks=72114dafe28c8700f1d5d629c6ae9d34172ba395 \
--framework-cherrypicks=a3e66b396746f6581b2b7efd1b0d0f0074215128,d8d853436206e86f416236b930e97779b143a100 \
--framework-cherrypicks=a3e66b396746f6581b2b7efd1b0d0f0074215128,d8d853436206e86f416236b930e97779b143a100 \
--dart-revision=4511eb2a779a612d9d6b2012123575013e0aef12 \
--dart-revision=4511eb2a779a612d9d6b2012123575013e0aef12 \
--increment=m
```
```
The conductor will, based on the release channel and the presence/lack of
previous tags, determine which part of the release version should be
incremented. In the cases where this is not correct, the version can be
overridden with
`--version-override=3.0.0`
.
For more details on these command line arguments, see
`conductor help start`
.
For more details on these command line arguments, see
`conductor help start`
.
This command will write to disk a state file that will persist until the release
This command will write to disk a state file that will persist until the release
is completed. If you already have a persistent state file, this command will
is completed. If you already have a persistent state file, this command will
...
...
dev/conductor/core/lib/src/globals.dart
View file @
38dbbb17
...
@@ -16,8 +16,6 @@ const List<String> kBaseReleaseChannels = <String>['stable', 'beta'];
...
@@ -16,8 +16,6 @@ const List<String> kBaseReleaseChannels = <String>['stable', 'beta'];
const
List
<
String
>
kReleaseChannels
=
<
String
>[...
kBaseReleaseChannels
,
FrameworkRepository
.
defaultBranch
];
const
List
<
String
>
kReleaseChannels
=
<
String
>[...
kBaseReleaseChannels
,
FrameworkRepository
.
defaultBranch
];
const
List
<
String
>
kReleaseIncrements
=
<
String
>[
'y'
,
'z'
,
'm'
,
'n'
];
const
String
kReleaseDocumentationUrl
=
'https://github.com/flutter/flutter/wiki/Flutter-Cherrypick-Process'
;
const
String
kReleaseDocumentationUrl
=
'https://github.com/flutter/flutter/wiki/Flutter-Cherrypick-Process'
;
const
String
kLuciPackagingConsoleLink
=
'https://ci.chromium.org/p/flutter/g/packaging/console'
;
const
String
kLuciPackagingConsoleLink
=
'https://ci.chromium.org/p/flutter/g/packaging/console'
;
...
...
dev/conductor/core/lib/src/proto/compile_proto.sh
View file @
38dbbb17
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
# //flutter/dev/tools/lib/proto
# //flutter/dev/tools/lib/proto
DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
>
/dev/null 2>&1
&&
pwd
)
"
DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
>
/dev/null 2>&1
&&
pwd
)
"
DARTFMT
=
"
$DIR
/../../../../bin/cache/dart-sdk/bin/dartfmt"
# Ensure dart-sdk is cached
# Ensure dart-sdk is cached
"
$DIR
/../../../../bin/dart"
--version
"
$DIR
/../../../../bin/dart"
--version
...
@@ -29,7 +28,7 @@ protoc --dart_out="$DIR" --proto_path="$DIR" "$DIR/conductor_state.proto"
...
@@ -29,7 +28,7 @@ protoc --dart_out="$DIR" --proto_path="$DIR" "$DIR/conductor_state.proto"
for
SOURCE_FILE
in
$(
ls
"
$DIR
"
/
*
.pb
*
.dart
)
;
do
for
SOURCE_FILE
in
$(
ls
"
$DIR
"
/
*
.pb
*
.dart
)
;
do
# Format in place file
# Format in place file
"
$DARTFMT
"
--over
write
--line-length
120
"
$SOURCE_FILE
"
dart format
--output
=
write
--line-length
120
"
$SOURCE_FILE
"
# Create temp copy with the license header prepended
# Create temp copy with the license header prepended
cp
"
$DIR
/license_header.txt"
"
${
SOURCE_FILE
}
.tmp"
cp
"
$DIR
/license_header.txt"
"
${
SOURCE_FILE
}
.tmp"
...
...
dev/conductor/core/lib/src/proto/conductor_state.pb.dart
View file @
38dbbb17
...
@@ -403,8 +403,12 @@ class ConductorState extends $pb.GeneratedMessage {
...
@@ -403,8 +403,12 @@ class ConductorState extends $pb.GeneratedMessage {
enumValues:
ReleasePhase
.
values
)
enumValues:
ReleasePhase
.
values
)
..
aOS
(
10
,
const
$core
.
bool
.
fromEnvironment
(
'protobuf.omit_field_names'
)
?
''
:
'conductorVersion'
,
..
aOS
(
10
,
const
$core
.
bool
.
fromEnvironment
(
'protobuf.omit_field_names'
)
?
''
:
'conductorVersion'
,
protoName:
'conductorVersion'
)
protoName:
'conductorVersion'
)
..
aOS
(
11
,
const
$core
.
bool
.
fromEnvironment
(
'protobuf.omit_field_names'
)
?
''
:
'incrementLevel'
,
..
e
<
ReleaseType
>(
protoName:
'incrementLevel'
)
11
,
const
$core
.
bool
.
fromEnvironment
(
'protobuf.omit_field_names'
)
?
''
:
'releaseType'
,
$pb
.
PbFieldType
.
OE
,
protoName:
'releaseType'
,
defaultOrMaker:
ReleaseType
.
STABLE_INITIAL
,
valueOf:
ReleaseType
.
valueOf
,
enumValues:
ReleaseType
.
values
)
..
hasRequiredFields
=
false
;
..
hasRequiredFields
=
false
;
ConductorState
.
_
()
:
super
();
ConductorState
.
_
()
:
super
();
...
@@ -418,7 +422,7 @@ class ConductorState extends $pb.GeneratedMessage {
...
@@ -418,7 +422,7 @@ class ConductorState extends $pb.GeneratedMessage {
$core
.
Iterable
<
$core
.
String
>?
logs
,
$core
.
Iterable
<
$core
.
String
>?
logs
,
ReleasePhase
?
currentPhase
,
ReleasePhase
?
currentPhase
,
$core
.
String
?
conductorVersion
,
$core
.
String
?
conductorVersion
,
$core
.
String
?
incrementLevel
,
ReleaseType
?
releaseType
,
})
{
})
{
final
_result
=
create
();
final
_result
=
create
();
if
(
releaseChannel
!=
null
)
{
if
(
releaseChannel
!=
null
)
{
...
@@ -448,8 +452,8 @@ class ConductorState extends $pb.GeneratedMessage {
...
@@ -448,8 +452,8 @@ class ConductorState extends $pb.GeneratedMessage {
if
(
conductorVersion
!=
null
)
{
if
(
conductorVersion
!=
null
)
{
_result
.
conductorVersion
=
conductorVersion
;
_result
.
conductorVersion
=
conductorVersion
;
}
}
if
(
incrementLevel
!=
null
)
{
if
(
releaseType
!=
null
)
{
_result
.
incrementLevel
=
incrementLevel
;
_result
.
releaseType
=
releaseType
;
}
}
return
_result
;
return
_result
;
}
}
...
@@ -580,14 +584,14 @@ class ConductorState extends $pb.GeneratedMessage {
...
@@ -580,14 +584,14 @@ class ConductorState extends $pb.GeneratedMessage {
void
clearConductorVersion
()
=>
clearField
(
10
);
void
clearConductorVersion
()
=>
clearField
(
10
);
@
$pb
.
TagNumber
(
11
)
@
$pb
.
TagNumber
(
11
)
$core
.
String
get
incrementLevel
=>
$_getSZ
(
9
);
ReleaseType
get
releaseType
=>
$_getN
(
9
);
@
$pb
.
TagNumber
(
11
)
@
$pb
.
TagNumber
(
11
)
set
incrementLevel
(
$core
.
String
v
)
{
set
releaseType
(
ReleaseType
v
)
{
$_setString
(
9
,
v
);
setField
(
11
,
v
);
}
}
@
$pb
.
TagNumber
(
11
)
@
$pb
.
TagNumber
(
11
)
$core
.
bool
has
IncrementLevel
()
=>
$_has
(
9
);
$core
.
bool
has
ReleaseType
()
=>
$_has
(
9
);
@
$pb
.
TagNumber
(
11
)
@
$pb
.
TagNumber
(
11
)
void
clear
IncrementLevel
()
=>
clearField
(
11
);
void
clear
ReleaseType
()
=>
clearField
(
11
);
}
}
dev/conductor/core/lib/src/proto/conductor_state.pbenum.dart
View file @
38dbbb17
...
@@ -67,3 +67,26 @@ class CherrypickState extends $pb.ProtobufEnum {
...
@@ -67,3 +67,26 @@ class CherrypickState extends $pb.ProtobufEnum {
const
CherrypickState
.
_
(
$core
.
int
v
,
$core
.
String
n
)
:
super
(
v
,
n
);
const
CherrypickState
.
_
(
$core
.
int
v
,
$core
.
String
n
)
:
super
(
v
,
n
);
}
}
class
ReleaseType
extends
$pb
.
ProtobufEnum
{
static
const
ReleaseType
STABLE_INITIAL
=
ReleaseType
.
_
(
0
,
const
$core
.
bool
.
fromEnvironment
(
'protobuf.omit_enum_names'
)
?
''
:
'STABLE_INITIAL'
);
static
const
ReleaseType
STABLE_HOTFIX
=
ReleaseType
.
_
(
1
,
const
$core
.
bool
.
fromEnvironment
(
'protobuf.omit_enum_names'
)
?
''
:
'STABLE_HOTFIX'
);
static
const
ReleaseType
BETA_INITIAL
=
ReleaseType
.
_
(
2
,
const
$core
.
bool
.
fromEnvironment
(
'protobuf.omit_enum_names'
)
?
''
:
'BETA_INITIAL'
);
static
const
ReleaseType
BETA_HOTFIX
=
ReleaseType
.
_
(
3
,
const
$core
.
bool
.
fromEnvironment
(
'protobuf.omit_enum_names'
)
?
''
:
'BETA_HOTFIX'
);
static
const
$core
.
List
<
ReleaseType
>
values
=
<
ReleaseType
>[
STABLE_INITIAL
,
STABLE_HOTFIX
,
BETA_INITIAL
,
BETA_HOTFIX
,
];
static
final
$core
.
Map
<
$core
.
int
,
ReleaseType
>
_byValue
=
$pb
.
ProtobufEnum
.
initByValue
(
values
);
static
ReleaseType
?
valueOf
(
$core
.
int
value
)
=>
_byValue
[
value
];
const
ReleaseType
.
_
(
$core
.
int
v
,
$core
.
String
n
)
:
super
(
v
,
n
);
}
dev/conductor/core/lib/src/proto/conductor_state.pbjson.dart
View file @
38dbbb17
...
@@ -44,6 +44,20 @@ const CherrypickState$json = const {
...
@@ -44,6 +44,20 @@ const CherrypickState$json = const {
/// Descriptor for `CherrypickState`. Decode as a `google.protobuf.EnumDescriptorProto`.
/// Descriptor for `CherrypickState`. Decode as a `google.protobuf.EnumDescriptorProto`.
final
$typed_data
.
Uint8List
cherrypickStateDescriptor
=
$convert
.
base64Decode
(
final
$typed_data
.
Uint8List
cherrypickStateDescriptor
=
$convert
.
base64Decode
(
'Cg9DaGVycnlwaWNrU3RhdGUSCwoHUEVORElORxAAEhkKFVBFTkRJTkdfV0lUSF9DT05GTElDVBABEg0KCUNPTVBMRVRFRBACEg0KCUFCQU5ET05FRBAD'
);
'Cg9DaGVycnlwaWNrU3RhdGUSCwoHUEVORElORxAAEhkKFVBFTkRJTkdfV0lUSF9DT05GTElDVBABEg0KCUNPTVBMRVRFRBACEg0KCUFCQU5ET05FRBAD'
);
@
$core
.
Deprecated
(
'Use releaseTypeDescriptor instead'
)
const
ReleaseType$json
=
const
{
'1'
:
'ReleaseType'
,
'2'
:
const
[
const
{
'1'
:
'STABLE_INITIAL'
,
'2'
:
0
},
const
{
'1'
:
'STABLE_HOTFIX'
,
'2'
:
1
},
const
{
'1'
:
'BETA_INITIAL'
,
'2'
:
2
},
const
{
'1'
:
'BETA_HOTFIX'
,
'2'
:
3
},
],
};
/// Descriptor for `ReleaseType`. Decode as a `google.protobuf.EnumDescriptorProto`.
final
$typed_data
.
Uint8List
releaseTypeDescriptor
=
$convert
.
base64Decode
(
'CgtSZWxlYXNlVHlwZRISCg5TVEFCTEVfSU5JVElBTBAAEhEKDVNUQUJMRV9IT1RGSVgQARIQCgxCRVRBX0lOSVRJQUwQAhIPCgtCRVRBX0hPVEZJWBAD'
);
@
$core
.
Deprecated
(
'Use remoteDescriptor instead'
)
@
$core
.
Deprecated
(
'Use remoteDescriptor instead'
)
const
Remote$json
=
const
{
const
Remote$json
=
const
{
'1'
:
'Remote'
,
'1'
:
'Remote'
,
...
@@ -101,10 +115,10 @@ const ConductorState$json = const {
...
@@ -101,10 +115,10 @@ const ConductorState$json = const {
const
{
'1'
:
'logs'
,
'3'
:
8
,
'4'
:
3
,
'5'
:
9
,
'10'
:
'logs'
},
const
{
'1'
:
'logs'
,
'3'
:
8
,
'4'
:
3
,
'5'
:
9
,
'10'
:
'logs'
},
const
{
'1'
:
'currentPhase'
,
'3'
:
9
,
'4'
:
1
,
'5'
:
14
,
'6'
:
'.conductor_state.ReleasePhase'
,
'10'
:
'currentPhase'
},
const
{
'1'
:
'currentPhase'
,
'3'
:
9
,
'4'
:
1
,
'5'
:
14
,
'6'
:
'.conductor_state.ReleasePhase'
,
'10'
:
'currentPhase'
},
const
{
'1'
:
'conductorVersion'
,
'3'
:
10
,
'4'
:
1
,
'5'
:
9
,
'10'
:
'conductorVersion'
},
const
{
'1'
:
'conductorVersion'
,
'3'
:
10
,
'4'
:
1
,
'5'
:
9
,
'10'
:
'conductorVersion'
},
const
{
'1'
:
'
incrementLevel'
,
'3'
:
11
,
'4'
:
1
,
'5'
:
9
,
'10'
:
'incrementLevel
'
},
const
{
'1'
:
'
releaseType'
,
'3'
:
11
,
'4'
:
1
,
'5'
:
14
,
'6'
:
'.conductor_state.ReleaseType'
,
'10'
:
'releaseType
'
},
],
],
};
};
/// Descriptor for `ConductorState`. Decode as a `google.protobuf.DescriptorProto`.
/// Descriptor for `ConductorState`. Decode as a `google.protobuf.DescriptorProto`.
final
$typed_data
.
Uint8List
conductorStateDescriptor
=
$convert
.
base64Decode
(
final
$typed_data
.
Uint8List
conductorStateDescriptor
=
$convert
.
base64Decode
(
'Cg5Db25kdWN0b3JTdGF0ZRImCg5yZWxlYXNlQ2hhbm5lbBgBIAEoCVIOcmVsZWFzZUNoYW5uZWwSJgoOcmVsZWFzZVZlcnNpb24YAiABKAlSDnJlbGVhc2VWZXJzaW9uEjMKBmVuZ2luZRgEIAEoCzIbLmNvbmR1Y3Rvcl9zdGF0ZS5SZXBvc2l0b3J5UgZlbmdpbmUSOQoJZnJhbWV3b3JrGAUgASgLMhsuY29uZHVjdG9yX3N0YXRlLlJlcG9zaXRvcnlSCWZyYW1ld29yaxIgCgtjcmVhdGVkRGF0ZRgGIAEoA1ILY3JlYXRlZERhdGUSKAoPbGFzdFVwZGF0ZWREYXRlGAcgASgDUg9sYXN0VXBkYXRlZERhdGUSEgoEbG9ncxgIIAMoCVIEbG9ncxJBCgxjdXJyZW50UGhhc2UYCSABKA4yHS5jb25kdWN0b3Jfc3RhdGUuUmVsZWFzZVBoYXNlUgxjdXJyZW50UGhhc2USKgoQY29uZHVjdG9yVmVyc2lvbhgKIAEoCVIQY29uZHVjdG9yVmVyc2lvbhI
mCg5pbmNyZW1lbnRMZXZlbBgLIAEoCVIOaW5jcmVtZW50TGV2ZWw
='
);
'Cg5Db25kdWN0b3JTdGF0ZRImCg5yZWxlYXNlQ2hhbm5lbBgBIAEoCVIOcmVsZWFzZUNoYW5uZWwSJgoOcmVsZWFzZVZlcnNpb24YAiABKAlSDnJlbGVhc2VWZXJzaW9uEjMKBmVuZ2luZRgEIAEoCzIbLmNvbmR1Y3Rvcl9zdGF0ZS5SZXBvc2l0b3J5UgZlbmdpbmUSOQoJZnJhbWV3b3JrGAUgASgLMhsuY29uZHVjdG9yX3N0YXRlLlJlcG9zaXRvcnlSCWZyYW1ld29yaxIgCgtjcmVhdGVkRGF0ZRgGIAEoA1ILY3JlYXRlZERhdGUSKAoPbGFzdFVwZGF0ZWREYXRlGAcgASgDUg9sYXN0VXBkYXRlZERhdGUSEgoEbG9ncxgIIAMoCVIEbG9ncxJBCgxjdXJyZW50UGhhc2UYCSABKA4yHS5jb25kdWN0b3Jfc3RhdGUuUmVsZWFzZVBoYXNlUgxjdXJyZW50UGhhc2USKgoQY29uZHVjdG9yVmVyc2lvbhgKIAEoCVIQY29uZHVjdG9yVmVyc2lvbhI
+CgtyZWxlYXNlVHlwZRgLIAEoDjIcLmNvbmR1Y3Rvcl9zdGF0ZS5SZWxlYXNlVHlwZVILcmVsZWFzZVR5cGU
='
);
dev/conductor/core/lib/src/proto/conductor_state.proto
View file @
38dbbb17
...
@@ -45,6 +45,24 @@ enum CherrypickState {
...
@@ -45,6 +45,24 @@ enum CherrypickState {
ABANDONED
=
3
;
ABANDONED
=
3
;
}
}
// The type of release that is being created.
//
// This determines how the version will be calculated.
enum
ReleaseType
{
// All pre-release metadata from previous beta releases will be discarded. The
// z must be 0.
STABLE_INITIAL
=
0
;
// Increment z.
STABLE_HOTFIX
=
1
;
// Compute x, y, and m from the candidate branch name. z and n should be 0.
BETA_INITIAL
=
2
;
// Increment n.
BETA_HOTFIX
=
3
;
}
message
Cherrypick
{
message
Cherrypick
{
// The revision on trunk to cherrypick.
// The revision on trunk to cherrypick.
string
trunkRevision
=
1
;
string
trunkRevision
=
1
;
...
@@ -113,6 +131,5 @@ message ConductorState {
...
@@ -113,6 +131,5 @@ message ConductorState {
// that created the [ConductorState] object.
// that created the [ConductorState] object.
string
conductorVersion
=
10
;
string
conductorVersion
=
10
;
// One of x, y, z, m, or n.
ReleaseType
releaseType
=
11
;
string
incrementLevel
=
11
;
}
}
dev/conductor/core/lib/src/start.dart
View file @
38dbbb17
...
@@ -6,6 +6,7 @@ import 'package:args/args.dart';
...
@@ -6,6 +6,7 @@ import 'package:args/args.dart';
import
'package:args/command_runner.dart'
;
import
'package:args/command_runner.dart'
;
import
'package:file/file.dart'
;
import
'package:file/file.dart'
;
import
'package:fixnum/fixnum.dart'
;
import
'package:fixnum/fixnum.dart'
;
import
'package:meta/meta.dart'
;
import
'package:platform/platform.dart'
;
import
'package:platform/platform.dart'
;
import
'package:process/process.dart'
;
import
'package:process/process.dart'
;
...
@@ -13,7 +14,7 @@ import 'context.dart';
...
@@ -13,7 +14,7 @@ import 'context.dart';
import
'git.dart'
;
import
'git.dart'
;
import
'globals.dart'
;
import
'globals.dart'
;
import
'proto/conductor_state.pb.dart'
as
pb
;
import
'proto/conductor_state.pb.dart'
as
pb
;
import
'proto/conductor_state.pbenum.dart'
show
ReleasePhase
;
import
'proto/conductor_state.pbenum.dart'
;
import
'repository.dart'
;
import
'repository.dart'
;
import
'state.dart'
as
state_import
;
import
'state.dart'
as
state_import
;
import
'stdio.dart'
;
import
'stdio.dart'
;
...
@@ -26,10 +27,10 @@ const String kEngineUpstreamOption = 'engine-upstream';
...
@@ -26,10 +27,10 @@ const String kEngineUpstreamOption = 'engine-upstream';
const
String
kFrameworkCherrypicksOption
=
'framework-cherrypicks'
;
const
String
kFrameworkCherrypicksOption
=
'framework-cherrypicks'
;
const
String
kFrameworkMirrorOption
=
'framework-mirror'
;
const
String
kFrameworkMirrorOption
=
'framework-mirror'
;
const
String
kFrameworkUpstreamOption
=
'framework-upstream'
;
const
String
kFrameworkUpstreamOption
=
'framework-upstream'
;
const
String
kIncrementOption
=
'increment'
;
const
String
kEngineMirrorOption
=
'engine-mirror'
;
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'
;
/// 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
>
{
...
@@ -89,23 +90,16 @@ class StartCommand extends Command<void> {
...
@@ -89,23 +90,16 @@ class StartCommand extends Command<void> {
kDartRevisionOption
,
kDartRevisionOption
,
help:
'New Dart revision to cherrypick.'
,
help:
'New Dart revision to cherrypick.'
,
);
);
argParser
.
addOption
(
kIncrementOption
,
help:
'Specifies which part of the x.y.z version number to increment. Required.'
,
valueHelp:
'level'
,
allowed:
kReleaseIncrements
,
allowedHelp:
<
String
,
String
>{
'y'
:
'Indicates the first dev release after a beta release.'
,
'z'
:
'Indicates a hotfix to a stable release.'
,
'm'
:
'Indicates a standard dev release.'
,
'n'
:
'Indicates a hotfix to a dev or beta release.'
,
},
);
argParser
.
addFlag
(
argParser
.
addFlag
(
kForceFlag
,
kForceFlag
,
abbr:
'f'
,
abbr:
'f'
,
help:
'Override all validations of the command line inputs.'
,
help:
'Override all validations of the command line inputs.'
,
);
);
argParser
.
addOption
(
kVersionOverrideOption
,
help:
'Explicitly set the desired version. This should only be used if '
'the version computed by the tool is not correct.'
,
);
}
}
final
Checkouts
checkouts
;
final
Checkouts
checkouts
;
...
@@ -177,11 +171,6 @@ class StartCommand extends Command<void> {
...
@@ -177,11 +171,6 @@ class StartCommand extends Command<void> {
platform
.
environment
,
platform
.
environment
,
allowNull:
true
,
allowNull:
true
,
);
);
final
String
incrementLetter
=
getValueFromEnvOrArgs
(
kIncrementOption
,
argumentResults
,
platform
.
environment
,
)!;
final
bool
force
=
getBoolFromEnvOrArgs
(
final
bool
force
=
getBoolFromEnvOrArgs
(
kForceFlag
,
kForceFlag
,
argumentResults
,
argumentResults
,
...
@@ -190,6 +179,16 @@ class StartCommand extends Command<void> {
...
@@ -190,6 +179,16 @@ class StartCommand extends Command<void> {
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
(
kVersionOverrideOption
,
argumentResults
,
platform
.
environment
,
allowNull:
true
,
);
Version
?
versionOverride
;
if
(
versionOverrideString
!=
null
)
{
versionOverride
=
Version
.
fromString
(
versionOverrideString
);
}
final
StartContext
context
=
StartContext
(
final
StartContext
context
=
StartContext
(
candidateBranch:
candidateBranch
,
candidateBranch:
candidateBranch
,
...
@@ -202,11 +201,11 @@ class StartCommand extends Command<void> {
...
@@ -202,11 +201,11 @@ class StartCommand extends Command<void> {
frameworkCherrypickRevisions:
frameworkCherrypickRevisions
,
frameworkCherrypickRevisions:
frameworkCherrypickRevisions
,
frameworkMirror:
frameworkMirror
,
frameworkMirror:
frameworkMirror
,
frameworkUpstream:
frameworkUpstream
,
frameworkUpstream:
frameworkUpstream
,
incrementLetter:
incrementLetter
,
processManager:
processManager
,
processManager:
processManager
,
releaseChannel:
releaseChannel
,
releaseChannel:
releaseChannel
,
stateFile:
stateFile
,
stateFile:
stateFile
,
force:
force
,
force:
force
,
versionOverride:
versionOverride
,
);
);
return
context
.
run
();
return
context
.
run
();
}
}
...
@@ -226,12 +225,12 @@ class StartContext extends Context {
...
@@ -226,12 +225,12 @@ class StartContext extends Context {
required
this
.
frameworkMirror
,
required
this
.
frameworkMirror
,
required
this
.
frameworkUpstream
,
required
this
.
frameworkUpstream
,
required
this
.
conductorVersion
,
required
this
.
conductorVersion
,
required
this
.
incrementLetter
,
required
this
.
processManager
,
required
this
.
processManager
,
required
this
.
releaseChannel
,
required
this
.
releaseChannel
,
required
Checkouts
checkouts
,
required
Checkouts
checkouts
,
required
File
stateFile
,
required
File
stateFile
,
this
.
force
=
false
,
this
.
force
=
false
,
this
.
versionOverride
,
})
:
git
=
Git
(
processManager
),
})
:
git
=
Git
(
processManager
),
engine
=
EngineRepository
(
engine
=
EngineRepository
(
checkouts
,
checkouts
,
...
@@ -270,10 +269,10 @@ class StartContext extends Context {
...
@@ -270,10 +269,10 @@ class StartContext extends Context {
final
String
frameworkMirror
;
final
String
frameworkMirror
;
final
String
frameworkUpstream
;
final
String
frameworkUpstream
;
final
String
conductorVersion
;
final
String
conductorVersion
;
final
String
incrementLetter
;
final
Git
git
;
final
Git
git
;
final
ProcessManager
processManager
;
final
ProcessManager
processManager
;
final
String
releaseChannel
;
final
String
releaseChannel
;
final
Version
?
versionOverride
;
/// If validations should be overridden.
/// If validations should be overridden.
final
bool
force
;
final
bool
force
;
...
@@ -281,6 +280,26 @@ class StartContext extends Context {
...
@@ -281,6 +280,26 @@ class StartContext extends Context {
final
EngineRepository
engine
;
final
EngineRepository
engine
;
final
FrameworkRepository
framework
;
final
FrameworkRepository
framework
;
/// Determine which part of the version to increment in the next release.
///
/// If [atBranchPoint] is true, then this is a [ReleaseType.BETA_INITIAL].
@visibleForTesting
ReleaseType
computeReleaseType
(
Version
lastVersion
,
bool
atBranchPoint
)
{
if
(
atBranchPoint
)
{
return
ReleaseType
.
BETA_INITIAL
;
}
if
(
releaseChannel
==
'stable'
)
{
if
(
lastVersion
.
type
==
VersionType
.
stable
)
{
return
ReleaseType
.
STABLE_HOTFIX
;
}
else
{
return
ReleaseType
.
STABLE_INITIAL
;
}
}
return
ReleaseType
.
BETA_HOTFIX
;
}
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
'
...
@@ -299,7 +318,6 @@ class StartContext extends Context {
...
@@ -299,7 +318,6 @@ class StartContext extends Context {
state
.
releaseChannel
=
releaseChannel
;
state
.
releaseChannel
=
releaseChannel
;
state
.
createdDate
=
unixDate
;
state
.
createdDate
=
unixDate
;
state
.
lastUpdatedDate
=
unixDate
;
state
.
lastUpdatedDate
=
unixDate
;
state
.
incrementLevel
=
incrementLetter
;
// Create a new branch so that we don't accidentally push to upstream
// Create a new branch so that we don't accidentally push to upstream
// candidateBranch.
// candidateBranch.
...
@@ -378,21 +396,34 @@ class StartContext extends Context {
...
@@ -378,21 +396,34 @@ class StartContext extends Context {
exact:
false
,
exact:
false
,
));
));
final
String
frameworkHead
=
await
framework
.
reverseParse
(
'HEAD'
);
final
String
branchPoint
=
await
framework
.
branchPoint
(
candidateBranch
,
FrameworkRepository
.
defaultBranch
);
final
bool
atBranchPoint
=
branchPoint
==
frameworkHead
;
final
ReleaseType
releaseType
=
computeReleaseType
(
lastVersion
,
atBranchPoint
);
state
.
releaseType
=
releaseType
;
try
{
try
{
lastVersion
.
ensureValid
(
candidateBranch
,
incrementLetter
);
lastVersion
.
ensureValid
(
candidateBranch
,
releaseType
);
}
on
ConductorException
catch
(
e
)
{
}
on
ConductorException
catch
(
e
)
{
// Let the user know, but resume execution
// Let the user know, but resume execution
stdio
.
printError
(
e
.
message
);
stdio
.
printError
(
e
.
message
);
}
}
Version
nextVersion
=
calculateNextVersion
(
lastVersion
);
Version
nextVersion
;
if
(!
force
)
{
if
(
versionOverride
!=
null
)
{
nextVersion
=
await
ensureBranchPointTagged
(
nextVersion
,
framework
);
nextVersion
=
versionOverride
!;
}
else
{
nextVersion
=
calculateNextVersion
(
lastVersion
,
releaseType
);
nextVersion
=
await
ensureBranchPointTagged
(
branchPoint:
branchPoint
,
requestedVersion:
nextVersion
,
framework:
framework
,
);
}
}
state
.
releaseVersion
=
nextVersion
.
toString
();
state
.
releaseVersion
=
nextVersion
.
toString
();
final
String
frameworkHead
=
await
framework
.
reverseParse
(
'HEAD'
);
state
.
framework
=
pb
.
Repository
(
state
.
framework
=
pb
.
Repository
(
candidateBranch:
candidateBranch
,
candidateBranch:
candidateBranch
,
workingBranch:
workingBranchName
,
workingBranch:
workingBranchName
,
...
@@ -416,37 +447,39 @@ class StartContext extends Context {
...
@@ -416,37 +447,39 @@ class StartContext extends Context {
}
}
/// Determine this release's version number from the [lastVersion] and the [incrementLetter].
/// Determine this release's version number from the [lastVersion] and the [incrementLetter].
Version
calculateNextVersion
(
Version
lastVersion
)
{
Version
calculateNextVersion
(
Version
lastVersion
,
ReleaseType
releaseType
)
{
if
(
incrementLetter
==
'm'
)
{
late
final
Version
nextVersion
;
return
Version
.
fromCandidateBranch
(
candidateBranch
);
switch
(
releaseType
)
{
}
case
ReleaseType
.
STABLE_INITIAL
:
if
(
incrementLetter
==
'z'
)
{
nextVersion
=
Version
(
if
(
lastVersion
.
type
==
VersionType
.
stable
)
{
return
Version
.
increment
(
lastVersion
,
incrementLetter
);
}
// This is the first stable release, so hardcode the z as 0
return
Version
(
x:
lastVersion
.
x
,
x:
lastVersion
.
x
,
y:
lastVersion
.
y
,
y:
lastVersion
.
y
,
z:
0
,
z:
0
,
type:
VersionType
.
stable
,
type:
VersionType
.
stable
,
);
);
break
;
case
ReleaseType
.
STABLE_HOTFIX
:
nextVersion
=
Version
.
increment
(
lastVersion
,
'z'
);
break
;
case
ReleaseType
.
BETA_INITIAL
:
nextVersion
=
Version
.
fromCandidateBranch
(
candidateBranch
);
break
;
case
ReleaseType
.
BETA_HOTFIX
:
nextVersion
=
Version
.
increment
(
lastVersion
,
'n'
);
break
;
}
}
return
Version
.
increment
(
lastVersion
,
incrementLetter
)
;
return
nextVersion
;
}
}
/// Ensures the branch point [candidateBranch] and `master` has a version tag.
/// Ensures the branch point [candidateBranch] and `master` has a version tag.
///
///
/// This is necessary for version reporting for users on the `master` channel
/// This is necessary for version reporting for users on the `master` channel
/// to be correct.
/// to be correct.
Future
<
Version
>
ensureBranchPointTagged
(
Future
<
Version
>
ensureBranchPointTagged
({
Version
requestedVersion
,
required
Version
requestedVersion
,
FrameworkRepository
framework
,
required
String
branchPoint
,
)
async
{
required
FrameworkRepository
framework
,
final
String
branchPoint
=
await
framework
.
branchPoint
(
})
async
{
candidateBranch
,
FrameworkRepository
.
defaultBranch
,
);
if
(
await
framework
.
isCommitTagged
(
branchPoint
))
{
if
(
await
framework
.
isCommitTagged
(
branchPoint
))
{
// The branch point is tagged, no work to be done
// The branch point is tagged, no work to be done
return
requestedVersion
;
return
requestedVersion
;
...
...
dev/conductor/core/lib/src/version.dart
View file @
38dbbb17
...
@@ -2,7 +2,9 @@
...
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'./globals.dart'
show
ConductorException
,
kReleaseIncrements
,
releaseCandidateBranchRegex
;
import
'globals.dart'
show
ConductorException
,
releaseCandidateBranchRegex
;
import
'proto/conductor_state.pbenum.dart'
;
/// Possible string formats that `flutter --version` can return.
/// Possible string formats that `flutter --version` can return.
enum
VersionType
{
enum
VersionType
{
...
@@ -262,10 +264,7 @@ class Version {
...
@@ -262,10 +264,7 @@ class Version {
///
///
/// Will throw a [ConductorException] if the version is not possible given the
/// Will throw a [ConductorException] if the version is not possible given the
/// [candidateBranch] and [incrementLetter].
/// [candidateBranch] and [incrementLetter].
void
ensureValid
(
String
candidateBranch
,
String
incrementLetter
)
{
void
ensureValid
(
String
candidateBranch
,
ReleaseType
releaseType
)
{
if
(!
kReleaseIncrements
.
contains
(
incrementLetter
))
{
throw
ConductorException
(
'Invalid incrementLetter:
$incrementLetter
'
);
}
final
RegExpMatch
?
branchMatch
=
releaseCandidateBranchRegex
.
firstMatch
(
candidateBranch
);
final
RegExpMatch
?
branchMatch
=
releaseCandidateBranchRegex
.
firstMatch
(
candidateBranch
);
if
(
branchMatch
==
null
)
{
if
(
branchMatch
==
null
)
{
throw
ConductorException
(
throw
ConductorException
(
...
@@ -292,12 +291,12 @@ class Version {
...
@@ -292,12 +291,12 @@ class Version {
}
}
// stable type versions don't have an m field set
// stable type versions don't have an m field set
if
(
type
!=
VersionType
.
stable
&&
incrementLetter
!=
'm'
)
{
if
(
type
!=
VersionType
.
stable
&&
releaseType
!=
ReleaseType
.
STABLE_HOTFIX
&&
releaseType
!=
ReleaseType
.
STABLE_INITIAL
)
{
final
String
branchM
=
branchMatch
.
group
(
3
)!;
final
String
branchM
=
branchMatch
.
group
(
3
)!;
if
(
m
!=
int
.
tryParse
(
branchM
))
{
if
(
m
!=
int
.
tryParse
(
branchM
))
{
throw
ConductorException
(
throw
ConductorException
(
'Parsed version
${toString()}
has a different m value than candidate '
'Parsed version
${toString()}
has a different m value than candidate '
'branch
$candidateBranch
'
,
'branch
$candidateBranch
with type
$type
'
,
);
);
}
}
}
}
...
...
dev/conductor/core/test/start_test.dart
View file @
38dbbb17
...
@@ -5,9 +5,8 @@
...
@@ -5,9 +5,8 @@
import
'dart:convert'
show
jsonDecode
;
import
'dart:convert'
show
jsonDecode
;
import
'package:args/command_runner.dart'
;
import
'package:args/command_runner.dart'
;
import
'package:conductor_core/src/globals.dart'
;
import
'package:conductor_core/src/proto/conductor_state.pb.dart'
as
pb
;
import
'package:conductor_core/src/proto/conductor_state.pb.dart'
as
pb
;
import
'package:conductor_core/src/proto/conductor_state.pbenum.dart'
show
ReleasePhase
;
import
'package:conductor_core/src/proto/conductor_state.pbenum.dart'
;
import
'package:conductor_core/src/repository.dart'
;
import
'package:conductor_core/src/repository.dart'
;
import
'package:conductor_core/src/start.dart'
;
import
'package:conductor_core/src/start.dart'
;
import
'package:conductor_core/src/state.dart'
;
import
'package:conductor_core/src/state.dart'
;
...
@@ -25,7 +24,7 @@ void main() {
...
@@ -25,7 +24,7 @@ void main() {
const
String
frameworkMirror
=
'https://github.com/user/flutter.git'
;
const
String
frameworkMirror
=
'https://github.com/user/flutter.git'
;
const
String
engineMirror
=
'https://github.com/user/engine.git'
;
const
String
engineMirror
=
'https://github.com/user/engine.git'
;
const
String
candidateBranch
=
'flutter-1.2-candidate.3'
;
const
String
candidateBranch
=
'flutter-1.2-candidate.3'
;
const
String
releaseChannel
=
'
stable
'
;
const
String
releaseChannel
=
'
beta
'
;
const
String
revision
=
'abcd1234'
;
const
String
revision
=
'abcd1234'
;
const
String
conductorVersion
=
'deadbeef'
;
const
String
conductorVersion
=
'deadbeef'
;
late
Checkouts
checkouts
;
late
Checkouts
checkouts
;
...
@@ -97,8 +96,6 @@ void main() {
...
@@ -97,8 +96,6 @@ void main() {
'beta'
,
'beta'
,
'--
$kStateOption
'
,
'--
$kStateOption
'
,
'/path/to/statefile.json'
,
'/path/to/statefile.json'
,
'--
$kIncrementOption
'
,
'y'
,
]),
]),
throwsExceptionWith
(
throwsExceptionWith
(
'Error! This tool is only supported on macOS and Linux'
,
'Error! This tool is only supported on macOS and Linux'
,
...
@@ -124,7 +121,36 @@ void main() {
...
@@ -124,7 +121,36 @@ void main() {
);
);
});
});
test
(
'does not fail if version wrong but --force provided'
,
()
async
{
test
(
'throws if provided an invalid --
$kVersionOverrideOption
'
,
()
async
{
final
CommandRunner
<
void
>
runner
=
createRunner
();
final
String
stateFilePath
=
fileSystem
.
path
.
join
(
platform
.
environment
[
'HOME'
]!,
kStateFileName
,
);
await
expectLater
(
()
async
=>
runner
.
run
(<
String
>[
'start'
,
'--
$kFrameworkMirrorOption
'
,
frameworkMirror
,
'--
$kEngineMirrorOption
'
,
engineMirror
,
'--
$kCandidateOption
'
,
candidateBranch
,
'--
$kReleaseOption
'
,
releaseChannel
,
'--
$kStateOption
'
,
stateFilePath
,
'--
$kVersionOverrideOption
'
,
'an invalid version string'
,
]),
throwsExceptionWith
(
'an invalid version string cannot be parsed'
),
);
});
test
(
'creates state file if provided correct inputs'
,
()
async
{
stdio
.
stdin
.
add
(
'y'
);
// accept prompt from ensureBranchPointTagged()
const
String
revision2
=
'def789'
;
const
String
revision2
=
'def789'
;
const
String
revision3
=
'123abc'
;
const
String
revision3
=
'123abc'
;
const
String
previousDartRevision
=
'171876a4e6cf56ee6da1f97d203926bd7afda7ef'
;
const
String
previousDartRevision
=
'171876a4e6cf56ee6da1f97d203926bd7afda7ef'
;
...
@@ -132,7 +158,7 @@ void main() {
...
@@ -132,7 +158,7 @@ void main() {
const
String
previousVersion
=
'1.2.0-1.0.pre'
;
const
String
previousVersion
=
'1.2.0-1.0.pre'
;
// This is what this release will be
// This is what this release will be
const
String
nextVersion
=
'1.2.0-1.1.pre'
;
const
String
nextVersion
=
'1.2.0-1.1.pre'
;
const
String
incrementLevel
=
'n
'
;
const
String
candidateBranch
=
'flutter-1.2-candidate.1
'
;
final
Directory
engine
=
fileSystem
final
Directory
engine
=
fileSystem
.
directory
(
checkoutsParentDirectory
)
.
directory
(
checkoutsParentDirectory
)
...
@@ -250,6 +276,14 @@ void main() {
...
@@ -250,6 +276,14 @@ void main() {
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision3
,
stdout:
revision3
,
),
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'merge-base'
,
candidateBranch
,
'master'
],
stdout:
branchPointRevision
,
),
// check if commit is tagged, zero exit code means it is tagged
const
FakeCommand
(
command:
<
String
>[
'git'
,
'describe'
,
'--exact-match'
,
'--tags'
,
branchPointRevision
],
),
];
];
final
CommandRunner
<
void
>
runner
=
createRunner
(
final
CommandRunner
<
void
>
runner
=
createRunner
(
...
@@ -278,9 +312,6 @@ void main() {
...
@@ -278,9 +312,6 @@ void main() {
stateFilePath
,
stateFilePath
,
'--
$kDartRevisionOption
'
,
'--
$kDartRevisionOption
'
,
nextDartRevision
,
nextDartRevision
,
'--
$kIncrementOption
'
,
incrementLevel
,
'--
$kForceFlag
'
,
]);
]);
final
File
stateFile
=
fileSystem
.
file
(
stateFilePath
);
final
File
stateFile
=
fileSystem
.
file
(
stateFilePath
);
...
@@ -290,7 +321,9 @@ void main() {
...
@@ -290,7 +321,9 @@ void main() {
jsonDecode
(
stateFile
.
readAsStringSync
()),
jsonDecode
(
stateFile
.
readAsStringSync
()),
);
);
expect
(
processManager
.
hasRemainingExpectations
,
false
);
expect
(
state
.
releaseType
,
ReleaseType
.
BETA_HOTFIX
);
expect
(
stdio
.
error
,
isNot
(
contains
(
'Tried to tag the branch point, however the target version'
)));
expect
(
processManager
,
hasNoRemainingExpectations
);
expect
(
state
.
isInitialized
(),
true
);
expect
(
state
.
isInitialized
(),
true
);
expect
(
state
.
releaseChannel
,
releaseChannel
);
expect
(
state
.
releaseChannel
,
releaseChannel
);
expect
(
state
.
releaseVersion
,
nextVersion
);
expect
(
state
.
releaseVersion
,
nextVersion
);
...
@@ -303,21 +336,17 @@ void main() {
...
@@ -303,21 +336,17 @@ void main() {
expect
(
state
.
framework
.
upstream
.
url
,
'git@github.com:flutter/flutter.git'
);
expect
(
state
.
framework
.
upstream
.
url
,
'git@github.com:flutter/flutter.git'
);
expect
(
state
.
currentPhase
,
ReleasePhase
.
APPLY_ENGINE_CHERRYPICKS
);
expect
(
state
.
currentPhase
,
ReleasePhase
.
APPLY_ENGINE_CHERRYPICKS
);
expect
(
state
.
conductorVersion
,
conductorVersion
);
expect
(
state
.
conductorVersion
,
conductorVersion
);
expect
(
state
.
incrementLevel
,
incrementLevel
);
});
});
test
(
'
creates state file if provided correct inputs
'
,
()
async
{
test
(
'
uses --
$kVersionOverrideOption
'
,
()
async
{
stdio
.
stdin
.
add
(
'y'
);
// accept prompt from ensureBranchPointTagged()
stdio
.
stdin
.
add
(
'y'
);
// accept prompt from ensureBranchPointTagged()
const
String
revision2
=
'def789'
;
const
String
revision2
=
'def789'
;
const
String
revision3
=
'123abc'
;
const
String
revision3
=
'123abc'
;
const
String
previousDartRevision
=
'171876a4e6cf56ee6da1f97d203926bd7afda7ef'
;
const
String
previousDartRevision
=
'171876a4e6cf56ee6da1f97d203926bd7afda7ef'
;
const
String
nextDartRevision
=
'f6c91128be6b77aef8351e1e3a9d07c85bc2e46e'
;
const
String
nextDartRevision
=
'f6c91128be6b77aef8351e1e3a9d07c85bc2e46e'
;
const
String
previousVersion
=
'1.2.0-1.0.pre'
;
const
String
previousVersion
=
'1.2.0-1.0.pre'
;
// This is a git tag applied to the branch point, not an actual release
const
String
candidateBranch
=
'flutter-1.2-candidate.1'
;
const
String
branchPointTag
=
'1.2.0-3.0.pre'
;
const
String
versionOverride
=
'42.0.0-42.0.pre'
;
// This is what this release will be
const
String
nextVersion
=
'1.2.0-3.1.pre'
;
const
String
incrementLevel
=
'm'
;
final
Directory
engine
=
fileSystem
final
Directory
engine
=
fileSystem
.
directory
(
checkoutsParentDirectory
)
.
directory
(
checkoutsParentDirectory
)
...
@@ -431,26 +460,14 @@ void main() {
...
@@ -431,26 +460,14 @@ void main() {
],
],
stdout:
'
$previousVersion
-42-gabc123'
,
stdout:
'
$previousVersion
-42-gabc123'
,
),
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'merge-base'
,
candidateBranch
,
'master'
],
stdout:
branchPointRevision
,
),
// check if commit is tagged
const
FakeCommand
(
command:
<
String
>[
'git'
,
'describe'
,
'--exact-match'
,
'--tags'
,
branchPointRevision
],
// non-zero exit means commit is not tagged
exitCode:
128
,
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'tag'
,
branchPointTag
,
branchPointRevision
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'push'
,
FrameworkRepository
.
defaultUpstream
,
branchPointTag
],
),
const
FakeCommand
(
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision3
,
stdout:
revision3
,
),
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'merge-base'
,
candidateBranch
,
'master'
],
stdout:
branchPointRevision
,
),
];
];
final
CommandRunner
<
void
>
runner
=
createRunner
(
final
CommandRunner
<
void
>
runner
=
createRunner
(
...
@@ -479,8 +496,8 @@ void main() {
...
@@ -479,8 +496,8 @@ void main() {
stateFilePath
,
stateFilePath
,
'--
$kDartRevisionOption
'
,
'--
$kDartRevisionOption
'
,
nextDartRevision
,
nextDartRevision
,
'--
$k
Increment
Option
'
,
'--
$k
VersionOverride
Option
'
,
incrementLevel
,
versionOverride
,
]);
]);
final
File
stateFile
=
fileSystem
.
file
(
stateFilePath
);
final
File
stateFile
=
fileSystem
.
file
(
stateFilePath
);
...
@@ -490,23 +507,8 @@ void main() {
...
@@ -490,23 +507,8 @@ void main() {
jsonDecode
(
stateFile
.
readAsStringSync
()),
jsonDecode
(
stateFile
.
readAsStringSync
()),
);
);
expect
(
processManager
.
hasRemainingExpectations
,
false
);
expect
(
processManager
,
hasNoRemainingExpectations
);
expect
(
state
.
isInitialized
(),
true
);
expect
(
state
.
releaseVersion
,
versionOverride
);
expect
(
state
.
releaseChannel
,
releaseChannel
);
expect
(
state
.
releaseVersion
,
nextVersion
);
expect
(
state
.
engine
.
candidateBranch
,
candidateBranch
);
expect
(
state
.
engine
.
startingGitHead
,
revision2
);
expect
(
state
.
engine
.
dartRevision
,
nextDartRevision
);
expect
(
state
.
engine
.
upstream
.
url
,
'git@github.com:flutter/engine.git'
);
expect
(
state
.
framework
.
candidateBranch
,
candidateBranch
);
expect
(
state
.
framework
.
startingGitHead
,
revision3
);
expect
(
state
.
framework
.
upstream
.
url
,
'git@github.com:flutter/flutter.git'
);
expect
(
state
.
currentPhase
,
ReleasePhase
.
APPLY_ENGINE_CHERRYPICKS
);
expect
(
state
.
conductorVersion
,
conductorVersion
);
expect
(
state
.
incrementLevel
,
incrementLevel
);
expect
(
stdio
.
stdout
,
contains
(
'Applying the tag
$branchPointTag
at the branch point
$branchPointRevision
'
));
expect
(
stdio
.
stdout
,
contains
(
'The actual release will be version
$nextVersion
'
));
expect
(
branchPointTag
!=
nextVersion
,
true
);
});
});
test
(
'logs to STDERR but does not fail on an unexpected candidate branch'
,
()
async
{
test
(
'logs to STDERR but does not fail on an unexpected candidate branch'
,
()
async
{
...
@@ -517,11 +519,8 @@ void main() {
...
@@ -517,11 +519,8 @@ void main() {
const
String
nextDartRevision
=
'f6c91128be6b77aef8351e1e3a9d07c85bc2e46e'
;
const
String
nextDartRevision
=
'f6c91128be6b77aef8351e1e3a9d07c85bc2e46e'
;
// note that this significantly behind the candidate branch name
// note that this significantly behind the candidate branch name
const
String
previousVersion
=
'0.9.0-1.0.pre'
;
const
String
previousVersion
=
'0.9.0-1.0.pre'
;
// This is a git tag applied to the branch point, not an actual release
const
String
branchPointTag
=
'1.2.0-3.0.pre'
;
// This is what this release will be
// This is what this release will be
const
String
nextVersion
=
'1.2.0-3.1.pre'
;
const
String
nextVersion
=
'0.9.0-1.1.pre'
;
const
String
incrementLevel
=
'm'
;
final
Directory
engine
=
fileSystem
final
Directory
engine
=
fileSystem
.
directory
(
checkoutsParentDirectory
)
.
directory
(
checkoutsParentDirectory
)
...
@@ -635,25 +634,17 @@ void main() {
...
@@ -635,25 +634,17 @@ void main() {
],
],
stdout:
'
$previousVersion
-42-gabc123'
,
stdout:
'
$previousVersion
-42-gabc123'
,
),
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision3
,
),
const
FakeCommand
(
const
FakeCommand
(
command:
<
String
>[
'git'
,
'merge-base'
,
candidateBranch
,
'master'
],
command:
<
String
>[
'git'
,
'merge-base'
,
candidateBranch
,
'master'
],
stdout:
branchPointRevision
,
stdout:
branchPointRevision
,
),
),
// check if commit is tagged
// check if commit is tagged
, 0 exit code means it is tagged
const
FakeCommand
(
const
FakeCommand
(
command:
<
String
>[
'git'
,
'describe'
,
'--exact-match'
,
'--tags'
,
branchPointRevision
],
command:
<
String
>[
'git'
,
'describe'
,
'--exact-match'
,
'--tags'
,
branchPointRevision
],
// non-zero exit means commit is not tagged
exitCode:
128
,
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'tag'
,
branchPointTag
,
branchPointRevision
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'push'
,
FrameworkRepository
.
defaultUpstream
,
branchPointTag
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision3
,
),
),
];
];
...
@@ -683,8 +674,6 @@ void main() {
...
@@ -683,8 +674,6 @@ void main() {
stateFilePath
,
stateFilePath
,
'--
$kDartRevisionOption
'
,
'--
$kDartRevisionOption
'
,
nextDartRevision
,
nextDartRevision
,
'--
$kIncrementOption
'
,
incrementLevel
,
]);
]);
final
File
stateFile
=
fileSystem
.
file
(
stateFilePath
);
final
File
stateFile
=
fileSystem
.
file
(
stateFilePath
);
...
@@ -694,7 +683,8 @@ void main() {
...
@@ -694,7 +683,8 @@ void main() {
jsonDecode
(
stateFile
.
readAsStringSync
()),
jsonDecode
(
stateFile
.
readAsStringSync
()),
);
);
expect
(
processManager
.
hasRemainingExpectations
,
false
);
expect
(
stdio
.
error
,
isNot
(
contains
(
'Tried to tag the branch point, however'
)));
expect
(
processManager
,
hasNoRemainingExpectations
);
expect
(
state
.
isInitialized
(),
true
);
expect
(
state
.
isInitialized
(),
true
);
expect
(
state
.
releaseChannel
,
releaseChannel
);
expect
(
state
.
releaseChannel
,
releaseChannel
);
expect
(
state
.
releaseVersion
,
nextVersion
);
expect
(
state
.
releaseVersion
,
nextVersion
);
...
@@ -707,10 +697,7 @@ void main() {
...
@@ -707,10 +697,7 @@ void main() {
expect
(
state
.
framework
.
upstream
.
url
,
'git@github.com:flutter/flutter.git'
);
expect
(
state
.
framework
.
upstream
.
url
,
'git@github.com:flutter/flutter.git'
);
expect
(
state
.
currentPhase
,
ReleasePhase
.
APPLY_ENGINE_CHERRYPICKS
);
expect
(
state
.
currentPhase
,
ReleasePhase
.
APPLY_ENGINE_CHERRYPICKS
);
expect
(
state
.
conductorVersion
,
conductorVersion
);
expect
(
state
.
conductorVersion
,
conductorVersion
);
expect
(
state
.
incrementLevel
,
incrementLevel
);
expect
(
state
.
releaseType
,
ReleaseType
.
BETA_HOTFIX
);
expect
(
stdio
.
stdout
,
contains
(
'Applying the tag
$branchPointTag
at the branch point
$branchPointRevision
'
));
expect
(
stdio
.
stdout
,
contains
(
'The actual release will be version
$nextVersion
'
));
expect
(
branchPointTag
!=
nextVersion
,
true
);
expect
(
stdio
.
error
,
contains
(
'Parsed version
$previousVersion
.42 has a different x value than candidate branch
$candidateBranch
'
));
expect
(
stdio
.
error
,
contains
(
'Parsed version
$previousVersion
.42 has a different x value than candidate branch
$candidateBranch
'
));
});
});
...
@@ -721,7 +708,6 @@ void main() {
...
@@ -721,7 +708,6 @@ void main() {
const
String
nextDartRevision
=
'f6c91128be6b77aef8351e1e3a9d07c85bc2e46e'
;
const
String
nextDartRevision
=
'f6c91128be6b77aef8351e1e3a9d07c85bc2e46e'
;
const
String
previousVersion
=
'1.2.0-3.0.pre'
;
const
String
previousVersion
=
'1.2.0-3.0.pre'
;
const
String
nextVersion
=
'1.2.0'
;
const
String
nextVersion
=
'1.2.0'
;
const
String
incrementLevel
=
'z'
;
final
Directory
engine
=
fileSystem
final
Directory
engine
=
fileSystem
.
directory
(
checkoutsParentDirectory
)
.
directory
(
checkoutsParentDirectory
)
...
@@ -835,6 +821,10 @@ void main() {
...
@@ -835,6 +821,10 @@ void main() {
],
],
stdout:
'
$previousVersion
-42-gabc123'
,
stdout:
'
$previousVersion
-42-gabc123'
,
),
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision3
,
),
const
FakeCommand
(
const
FakeCommand
(
command:
<
String
>[
'git'
,
'merge-base'
,
candidateBranch
,
'master'
],
command:
<
String
>[
'git'
,
'merge-base'
,
candidateBranch
,
'master'
],
stdout:
branchPointRevision
,
stdout:
branchPointRevision
,
...
@@ -843,10 +833,6 @@ void main() {
...
@@ -843,10 +833,6 @@ void main() {
const
FakeCommand
(
const
FakeCommand
(
command:
<
String
>[
'git'
,
'describe'
,
'--exact-match'
,
'--tags'
,
branchPointRevision
],
command:
<
String
>[
'git'
,
'describe'
,
'--exact-match'
,
'--tags'
,
branchPointRevision
],
),
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision3
,
),
];
];
final
CommandRunner
<
void
>
runner
=
createRunner
(
final
CommandRunner
<
void
>
runner
=
createRunner
(
...
@@ -870,13 +856,11 @@ void main() {
...
@@ -870,13 +856,11 @@ void main() {
'--
$kCandidateOption
'
,
'--
$kCandidateOption
'
,
candidateBranch
,
candidateBranch
,
'--
$kReleaseOption
'
,
'--
$kReleaseOption
'
,
releaseChannel
,
'stable'
,
'--
$kStateOption
'
,
'--
$kStateOption
'
,
stateFilePath
,
stateFilePath
,
'--
$kDartRevisionOption
'
,
'--
$kDartRevisionOption
'
,
nextDartRevision
,
nextDartRevision
,
'--
$kIncrementOption
'
,
incrementLevel
,
]);
]);
final
File
stateFile
=
fileSystem
.
file
(
stateFilePath
);
final
File
stateFile
=
fileSystem
.
file
(
stateFilePath
);
...
@@ -888,7 +872,7 @@ void main() {
...
@@ -888,7 +872,7 @@ void main() {
expect
(
processManager
.
hasRemainingExpectations
,
false
);
expect
(
processManager
.
hasRemainingExpectations
,
false
);
expect
(
state
.
isInitialized
(),
true
);
expect
(
state
.
isInitialized
(),
true
);
expect
(
state
.
releaseChannel
,
releaseChannel
);
expect
(
state
.
releaseChannel
,
'stable'
);
expect
(
state
.
releaseVersion
,
nextVersion
);
expect
(
state
.
releaseVersion
,
nextVersion
);
expect
(
state
.
engine
.
candidateBranch
,
candidateBranch
);
expect
(
state
.
engine
.
candidateBranch
,
candidateBranch
);
expect
(
state
.
engine
.
startingGitHead
,
revision2
);
expect
(
state
.
engine
.
startingGitHead
,
revision2
);
...
@@ -897,7 +881,7 @@ void main() {
...
@@ -897,7 +881,7 @@ void main() {
expect
(
state
.
framework
.
startingGitHead
,
revision3
);
expect
(
state
.
framework
.
startingGitHead
,
revision3
);
expect
(
state
.
currentPhase
,
ReleasePhase
.
APPLY_ENGINE_CHERRYPICKS
);
expect
(
state
.
currentPhase
,
ReleasePhase
.
APPLY_ENGINE_CHERRYPICKS
);
expect
(
state
.
conductorVersion
,
conductorVersion
);
expect
(
state
.
conductorVersion
,
conductorVersion
);
expect
(
state
.
incrementLevel
,
incrementLevel
);
expect
(
state
.
releaseType
,
ReleaseType
.
STABLE_INITIAL
);
});
});
test
(
'StartContext gets engine and framework checkout directories after run'
,
()
async
{
test
(
'StartContext gets engine and framework checkout directories after run'
,
()
async
{
...
@@ -910,8 +894,6 @@ void main() {
...
@@ -910,8 +894,6 @@ void main() {
const
String
previousVersion
=
'1.2.0-1.0.pre'
;
const
String
previousVersion
=
'1.2.0-1.0.pre'
;
// This is a git tag applied to the branch point, not an actual release
// This is a git tag applied to the branch point, not an actual release
const
String
branchPointTag
=
'1.2.0-3.0.pre'
;
const
String
branchPointTag
=
'1.2.0-3.0.pre'
;
// This is what this release will be
const
String
incrementLevel
=
'm'
;
final
Directory
engine
=
fileSystem
final
Directory
engine
=
fileSystem
.
directory
(
checkoutsParentDirectory
)
.
directory
(
checkoutsParentDirectory
)
...
@@ -1026,6 +1008,11 @@ void main() {
...
@@ -1026,6 +1008,11 @@ void main() {
],
],
stdout:
'
$previousVersion
-42-gabc123'
,
stdout:
'
$previousVersion
-42-gabc123'
,
),
),
// HEAD and branch point are same
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
branchPointRevision
,
),
const
FakeCommand
(
const
FakeCommand
(
command:
<
String
>[
'git'
,
'merge-base'
,
candidateBranch
,
'master'
],
command:
<
String
>[
'git'
,
'merge-base'
,
candidateBranch
,
'master'
],
stdout:
branchPointRevision
,
stdout:
branchPointRevision
,
...
@@ -1042,10 +1029,6 @@ void main() {
...
@@ -1042,10 +1029,6 @@ void main() {
const
FakeCommand
(
const
FakeCommand
(
command:
<
String
>[
'git'
,
'push'
,
FrameworkRepository
.
defaultUpstream
,
branchPointTag
],
command:
<
String
>[
'git'
,
'push'
,
FrameworkRepository
.
defaultUpstream
,
branchPointTag
],
),
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision3
,
),
];
];
final
String
operatingSystem
=
const
LocalPlatform
().
operatingSystem
;
final
String
operatingSystem
=
const
LocalPlatform
().
operatingSystem
;
...
@@ -1091,15 +1074,22 @@ void main() {
...
@@ -1091,15 +1074,22 @@ void main() {
frameworkMirror:
frameworkMirror
,
frameworkMirror:
frameworkMirror
,
frameworkUpstream:
FrameworkRepository
.
defaultUpstream
,
frameworkUpstream:
FrameworkRepository
.
defaultUpstream
,
releaseChannel:
releaseChannel
,
releaseChannel:
releaseChannel
,
incrementLetter:
incrementLevel
,
processManager:
processManager
,
processManager:
processManager
,
conductorVersion:
conductorVersion
,
conductorVersion:
conductorVersion
,
stateFile:
stateFile
);
stateFile:
stateFile
,
);
await
startContext
.
run
();
await
startContext
.
run
();
final
pb
.
ConductorState
state
=
pb
.
ConductorState
();
state
.
mergeFromProto3Json
(
jsonDecode
(
stateFile
.
readAsStringSync
()),
);
expect
((
await
startContext
.
engine
.
checkoutDirectory
).
path
,
equals
(
engine
.
path
));
expect
((
await
startContext
.
engine
.
checkoutDirectory
).
path
,
equals
(
engine
.
path
));
expect
((
await
startContext
.
framework
.
checkoutDirectory
).
path
,
equals
(
framework
.
path
));
expect
((
await
startContext
.
framework
.
checkoutDirectory
).
path
,
equals
(
framework
.
path
));
expect
(
state
.
releaseType
,
ReleaseType
.
BETA_INITIAL
);
expect
(
processManager
,
hasNoRemainingExpectations
);
});
});
},
onPlatform:
<
String
,
dynamic
>{
},
onPlatform:
<
String
,
dynamic
>{
'windows'
:
const
Skip
(
'Flutter Conductor only supported on macos/linux'
),
'windows'
:
const
Skip
(
'Flutter Conductor only supported on macos/linux'
),
...
...
dev/conductor/core/test/state_test.dart
View file @
38dbbb17
...
@@ -18,7 +18,6 @@ void main() {
...
@@ -18,7 +18,6 @@ void main() {
final
pb
.
ConductorState
state
=
pb
.
ConductorState
(
final
pb
.
ConductorState
state
=
pb
.
ConductorState
(
releaseChannel:
'stable'
,
releaseChannel:
'stable'
,
releaseVersion:
'2.3.4'
,
releaseVersion:
'2.3.4'
,
incrementLevel:
'z'
,
engine:
pb
.
Repository
(
engine:
pb
.
Repository
(
candidateBranch:
candidateBranch
,
candidateBranch:
candidateBranch
,
upstream:
pb
.
Remote
(
upstream:
pb
.
Remote
(
...
@@ -60,8 +59,7 @@ void main() {
...
@@ -60,8 +59,7 @@ void main() {
},
},
"logs": [
"logs": [
"[status] hello world"
"[status] hello world"
],
]
"incrementLevel": "z"
}'''
;
}'''
;
expect
(
serializedState
,
expectedString
);
expect
(
serializedState
,
expectedString
);
});
});
...
...
dev/conductor/core/test/version_test.dart
View file @
38dbbb17
...
@@ -2,9 +2,10 @@
...
@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'package:conductor_core/src/proto/conductor_state.pbenum.dart'
;
import
'package:conductor_core/src/version.dart'
;
import
'package:conductor_core/src/version.dart'
;
import
'
./
common.dart'
;
import
'common.dart'
;
void
main
(
)
{
void
main
(
)
{
group
(
'Version.fromString()'
,
()
{
group
(
'Version.fromString()'
,
()
{
...
@@ -106,7 +107,7 @@ void main() {
...
@@ -106,7 +107,7 @@ void main() {
const
String
candidateBranch
=
'flutter-3.2-candidate.4'
;
const
String
candidateBranch
=
'flutter-3.2-candidate.4'
;
final
Version
version
=
Version
.
fromString
(
versionString
);
final
Version
version
=
Version
.
fromString
(
versionString
);
expect
(
expect
(
()
=>
version
.
ensureValid
(
candidateBranch
,
'n'
),
()
=>
version
.
ensureValid
(
candidateBranch
,
ReleaseType
.
BETA_HOTFIX
),
throwsExceptionWith
(
throwsExceptionWith
(
'Parsed version
$versionString
has a different x value than '
'Parsed version
$versionString
has a different x value than '
'candidate branch
$candidateBranch
'
,
'candidate branch
$candidateBranch
'
,
...
@@ -119,7 +120,7 @@ void main() {
...
@@ -119,7 +120,7 @@ void main() {
const
String
candidateBranch
=
'flutter-1.15-candidate.4'
;
const
String
candidateBranch
=
'flutter-1.15-candidate.4'
;
final
Version
version
=
Version
.
fromString
(
versionString
);
final
Version
version
=
Version
.
fromString
(
versionString
);
expect
(
expect
(
()
=>
version
.
ensureValid
(
candidateBranch
,
'm'
),
()
=>
version
.
ensureValid
(
candidateBranch
,
ReleaseType
.
BETA_INITIAL
),
throwsExceptionWith
(
throwsExceptionWith
(
'Parsed version
$versionString
has a different y value than '
'Parsed version
$versionString
has a different y value than '
'candidate branch
$candidateBranch
'
,
'candidate branch
$candidateBranch
'
,
...
@@ -132,7 +133,7 @@ void main() {
...
@@ -132,7 +133,7 @@ void main() {
const
String
candidateBranch
=
'flutter-1.2-candidate.0'
;
const
String
candidateBranch
=
'flutter-1.2-candidate.0'
;
final
Version
version
=
Version
.
fromString
(
versionString
);
final
Version
version
=
Version
.
fromString
(
versionString
);
expect
(
expect
(
()
=>
version
.
ensureValid
(
candidateBranch
,
'n'
),
()
=>
version
.
ensureValid
(
candidateBranch
,
ReleaseType
.
BETA_HOTFIX
),
throwsExceptionWith
(
throwsExceptionWith
(
'Parsed version
$versionString
has a different m value than '
'Parsed version
$versionString
has a different m value than '
'candidate branch
$candidateBranch
'
,
'candidate branch
$candidateBranch
'
,
...
@@ -145,7 +146,7 @@ void main() {
...
@@ -145,7 +146,7 @@ void main() {
const
String
candidateBranch
=
'flutter-1.2-candidate.98'
;
const
String
candidateBranch
=
'flutter-1.2-candidate.98'
;
final
Version
version
=
Version
.
fromString
(
versionString
);
final
Version
version
=
Version
.
fromString
(
versionString
);
expect
(
expect
(
()
=>
version
.
ensureValid
(
candidateBranch
,
'n'
),
()
=>
version
.
ensureValid
(
candidateBranch
,
ReleaseType
.
STABLE_HOTFIX
),
isNot
(
throwsException
),
isNot
(
throwsException
),
);
);
});
});
...
@@ -155,21 +156,11 @@ void main() {
...
@@ -155,21 +156,11 @@ void main() {
const
String
candidateBranch
=
'stable'
;
const
String
candidateBranch
=
'stable'
;
final
Version
version
=
Version
.
fromString
(
versionString
);
final
Version
version
=
Version
.
fromString
(
versionString
);
expect
(
expect
(
()
=>
version
.
ensureValid
(
candidateBranch
,
'z'
),
()
=>
version
.
ensureValid
(
candidateBranch
,
ReleaseType
.
STABLE_HOTFIX
),
throwsExceptionWith
(
throwsExceptionWith
(
'Candidate branch
$candidateBranch
does not match the pattern'
,
'Candidate branch
$candidateBranch
does not match the pattern'
,
),
),
);
);
});
});
test
(
'does not validate m if incrementLetter is m'
,
()
{
const
String
versionString
=
'1.2.0-0.0.pre'
;
const
String
candidateBranch
=
'flutter-1.2-candidate.42'
;
final
Version
version
=
Version
.
fromString
(
versionString
);
expect
(
()
=>
version
.
ensureValid
(
candidateBranch
,
'm'
),
isNot
(
throwsException
),
);
});
});
});
}
}
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