Skip to content

Commit 38dbbb1

Browse files
[flutter_conductor] deprecate increment (#99189)
1 parent 3131699 commit 38dbbb1

12 files changed

Lines changed: 274 additions & 204 deletions

dev/conductor/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,13 @@ conductor start \
4444
--engine-cherrypicks=72114dafe28c8700f1d5d629c6ae9d34172ba395 \
4545
--framework-cherrypicks=a3e66b396746f6581b2b7efd1b0d0f0074215128,d8d853436206e86f416236b930e97779b143a100 \
4646
--dart-revision=4511eb2a779a612d9d6b2012123575013e0aef12 \
47-
--increment=m
4847
```
4948

49+
The conductor will, based on the release channel and the presence/lack of
50+
previous tags, determine which part of the release version should be
51+
incremented. In the cases where this is not correct, the version can be
52+
overridden with `--version-override=3.0.0`.
53+
5054
For more details on these command line arguments, see `conductor help start`.
5155
This command will write to disk a state file that will persist until the release
5256
is completed. If you already have a persistent state file, this command will

dev/conductor/core/lib/src/globals.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ const List<String> kBaseReleaseChannels = <String>['stable', 'beta'];
1616

1717
const List<String> kReleaseChannels = <String>[...kBaseReleaseChannels, FrameworkRepository.defaultBranch];
1818

19-
const List<String> kReleaseIncrements = <String>['y', 'z', 'm', 'n'];
20-
2119
const String kReleaseDocumentationUrl = 'https://github.com/flutter/flutter/wiki/Flutter-Cherrypick-Process';
2220

2321
const String kLuciPackagingConsoleLink = 'https://ci.chromium.org/p/flutter/g/packaging/console';

dev/conductor/core/lib/src/proto/compile_proto.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
# //flutter/dev/tools/lib/proto
77
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
8-
DARTFMT="$DIR/../../../../bin/cache/dart-sdk/bin/dartfmt"
98

109
# Ensure dart-sdk is cached
1110
"$DIR/../../../../bin/dart" --version
@@ -29,7 +28,7 @@ protoc --dart_out="$DIR" --proto_path="$DIR" "$DIR/conductor_state.proto"
2928

3029
for SOURCE_FILE in $(ls "$DIR"/*.pb*.dart); do
3130
# Format in place file
32-
"$DARTFMT" --overwrite --line-length 120 "$SOURCE_FILE"
31+
dart format --output=write --line-length 120 "$SOURCE_FILE"
3332

3433
# Create temp copy with the license header prepended
3534
cp "$DIR/license_header.txt" "${SOURCE_FILE}.tmp"

dev/conductor/core/lib/src/proto/conductor_state.pb.dart

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,12 @@ class ConductorState extends $pb.GeneratedMessage {
403403
enumValues: ReleasePhase.values)
404404
..aOS(10, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'conductorVersion',
405405
protoName: 'conductorVersion')
406-
..aOS(11, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'incrementLevel',
407-
protoName: 'incrementLevel')
406+
..e<ReleaseType>(
407+
11, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'releaseType', $pb.PbFieldType.OE,
408+
protoName: 'releaseType',
409+
defaultOrMaker: ReleaseType.STABLE_INITIAL,
410+
valueOf: ReleaseType.valueOf,
411+
enumValues: ReleaseType.values)
408412
..hasRequiredFields = false;
409413

410414
ConductorState._() : super();
@@ -418,7 +422,7 @@ class ConductorState extends $pb.GeneratedMessage {
418422
$core.Iterable<$core.String>? logs,
419423
ReleasePhase? currentPhase,
420424
$core.String? conductorVersion,
421-
$core.String? incrementLevel,
425+
ReleaseType? releaseType,
422426
}) {
423427
final _result = create();
424428
if (releaseChannel != null) {
@@ -448,8 +452,8 @@ class ConductorState extends $pb.GeneratedMessage {
448452
if (conductorVersion != null) {
449453
_result.conductorVersion = conductorVersion;
450454
}
451-
if (incrementLevel != null) {
452-
_result.incrementLevel = incrementLevel;
455+
if (releaseType != null) {
456+
_result.releaseType = releaseType;
453457
}
454458
return _result;
455459
}
@@ -580,14 +584,14 @@ class ConductorState extends $pb.GeneratedMessage {
580584
void clearConductorVersion() => clearField(10);
581585

582586
@$pb.TagNumber(11)
583-
$core.String get incrementLevel => $_getSZ(9);
587+
ReleaseType get releaseType => $_getN(9);
584588
@$pb.TagNumber(11)
585-
set incrementLevel($core.String v) {
586-
$_setString(9, v);
589+
set releaseType(ReleaseType v) {
590+
setField(11, v);
587591
}
588592

589593
@$pb.TagNumber(11)
590-
$core.bool hasIncrementLevel() => $_has(9);
594+
$core.bool hasReleaseType() => $_has(9);
591595
@$pb.TagNumber(11)
592-
void clearIncrementLevel() => clearField(11);
596+
void clearReleaseType() => clearField(11);
593597
}

dev/conductor/core/lib/src/proto/conductor_state.pbenum.dart

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,26 @@ class CherrypickState extends $pb.ProtobufEnum {
6767

6868
const CherrypickState._($core.int v, $core.String n) : super(v, n);
6969
}
70+
71+
class ReleaseType extends $pb.ProtobufEnum {
72+
static const ReleaseType STABLE_INITIAL =
73+
ReleaseType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STABLE_INITIAL');
74+
static const ReleaseType STABLE_HOTFIX =
75+
ReleaseType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STABLE_HOTFIX');
76+
static const ReleaseType BETA_INITIAL =
77+
ReleaseType._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'BETA_INITIAL');
78+
static const ReleaseType BETA_HOTFIX =
79+
ReleaseType._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'BETA_HOTFIX');
80+
81+
static const $core.List<ReleaseType> values = <ReleaseType>[
82+
STABLE_INITIAL,
83+
STABLE_HOTFIX,
84+
BETA_INITIAL,
85+
BETA_HOTFIX,
86+
];
87+
88+
static final $core.Map<$core.int, ReleaseType> _byValue = $pb.ProtobufEnum.initByValue(values);
89+
static ReleaseType? valueOf($core.int value) => _byValue[value];
90+
91+
const ReleaseType._($core.int v, $core.String n) : super(v, n);
92+
}

dev/conductor/core/lib/src/proto/conductor_state.pbjson.dart

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,20 @@ const CherrypickState$json = const {
4444
/// Descriptor for `CherrypickState`. Decode as a `google.protobuf.EnumDescriptorProto`.
4545
final $typed_data.Uint8List cherrypickStateDescriptor = $convert.base64Decode(
4646
'Cg9DaGVycnlwaWNrU3RhdGUSCwoHUEVORElORxAAEhkKFVBFTkRJTkdfV0lUSF9DT05GTElDVBABEg0KCUNPTVBMRVRFRBACEg0KCUFCQU5ET05FRBAD');
47+
@$core.Deprecated('Use releaseTypeDescriptor instead')
48+
const ReleaseType$json = const {
49+
'1': 'ReleaseType',
50+
'2': const [
51+
const {'1': 'STABLE_INITIAL', '2': 0},
52+
const {'1': 'STABLE_HOTFIX', '2': 1},
53+
const {'1': 'BETA_INITIAL', '2': 2},
54+
const {'1': 'BETA_HOTFIX', '2': 3},
55+
],
56+
};
57+
58+
/// Descriptor for `ReleaseType`. Decode as a `google.protobuf.EnumDescriptorProto`.
59+
final $typed_data.Uint8List releaseTypeDescriptor = $convert.base64Decode(
60+
'CgtSZWxlYXNlVHlwZRISCg5TVEFCTEVfSU5JVElBTBAAEhEKDVNUQUJMRV9IT1RGSVgQARIQCgxCRVRBX0lOSVRJQUwQAhIPCgtCRVRBX0hPVEZJWBAD');
4761
@$core.Deprecated('Use remoteDescriptor instead')
4862
const Remote$json = const {
4963
'1': 'Remote',
@@ -101,10 +115,10 @@ const ConductorState$json = const {
101115
const {'1': 'logs', '3': 8, '4': 3, '5': 9, '10': 'logs'},
102116
const {'1': 'currentPhase', '3': 9, '4': 1, '5': 14, '6': '.conductor_state.ReleasePhase', '10': 'currentPhase'},
103117
const {'1': 'conductorVersion', '3': 10, '4': 1, '5': 9, '10': 'conductorVersion'},
104-
const {'1': 'incrementLevel', '3': 11, '4': 1, '5': 9, '10': 'incrementLevel'},
118+
const {'1': 'releaseType', '3': 11, '4': 1, '5': 14, '6': '.conductor_state.ReleaseType', '10': 'releaseType'},
105119
],
106120
};
107121

108122
/// Descriptor for `ConductorState`. Decode as a `google.protobuf.DescriptorProto`.
109123
final $typed_data.Uint8List conductorStateDescriptor = $convert.base64Decode(
110-
'Cg5Db25kdWN0b3JTdGF0ZRImCg5yZWxlYXNlQ2hhbm5lbBgBIAEoCVIOcmVsZWFzZUNoYW5uZWwSJgoOcmVsZWFzZVZlcnNpb24YAiABKAlSDnJlbGVhc2VWZXJzaW9uEjMKBmVuZ2luZRgEIAEoCzIbLmNvbmR1Y3Rvcl9zdGF0ZS5SZXBvc2l0b3J5UgZlbmdpbmUSOQoJZnJhbWV3b3JrGAUgASgLMhsuY29uZHVjdG9yX3N0YXRlLlJlcG9zaXRvcnlSCWZyYW1ld29yaxIgCgtjcmVhdGVkRGF0ZRgGIAEoA1ILY3JlYXRlZERhdGUSKAoPbGFzdFVwZGF0ZWREYXRlGAcgASgDUg9sYXN0VXBkYXRlZERhdGUSEgoEbG9ncxgIIAMoCVIEbG9ncxJBCgxjdXJyZW50UGhhc2UYCSABKA4yHS5jb25kdWN0b3Jfc3RhdGUuUmVsZWFzZVBoYXNlUgxjdXJyZW50UGhhc2USKgoQY29uZHVjdG9yVmVyc2lvbhgKIAEoCVIQY29uZHVjdG9yVmVyc2lvbhImCg5pbmNyZW1lbnRMZXZlbBgLIAEoCVIOaW5jcmVtZW50TGV2ZWw=');
124+
'Cg5Db25kdWN0b3JTdGF0ZRImCg5yZWxlYXNlQ2hhbm5lbBgBIAEoCVIOcmVsZWFzZUNoYW5uZWwSJgoOcmVsZWFzZVZlcnNpb24YAiABKAlSDnJlbGVhc2VWZXJzaW9uEjMKBmVuZ2luZRgEIAEoCzIbLmNvbmR1Y3Rvcl9zdGF0ZS5SZXBvc2l0b3J5UgZlbmdpbmUSOQoJZnJhbWV3b3JrGAUgASgLMhsuY29uZHVjdG9yX3N0YXRlLlJlcG9zaXRvcnlSCWZyYW1ld29yaxIgCgtjcmVhdGVkRGF0ZRgGIAEoA1ILY3JlYXRlZERhdGUSKAoPbGFzdFVwZGF0ZWREYXRlGAcgASgDUg9sYXN0VXBkYXRlZERhdGUSEgoEbG9ncxgIIAMoCVIEbG9ncxJBCgxjdXJyZW50UGhhc2UYCSABKA4yHS5jb25kdWN0b3Jfc3RhdGUuUmVsZWFzZVBoYXNlUgxjdXJyZW50UGhhc2USKgoQY29uZHVjdG9yVmVyc2lvbhgKIAEoCVIQY29uZHVjdG9yVmVyc2lvbhI+CgtyZWxlYXNlVHlwZRgLIAEoDjIcLmNvbmR1Y3Rvcl9zdGF0ZS5SZWxlYXNlVHlwZVILcmVsZWFzZVR5cGU=');

dev/conductor/core/lib/src/proto/conductor_state.proto

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,24 @@ enum CherrypickState {
4545
ABANDONED = 3;
4646
}
4747

48+
// The type of release that is being created.
49+
//
50+
// This determines how the version will be calculated.
51+
enum ReleaseType {
52+
// All pre-release metadata from previous beta releases will be discarded. The
53+
// z must be 0.
54+
STABLE_INITIAL = 0;
55+
56+
// Increment z.
57+
STABLE_HOTFIX = 1;
58+
59+
// Compute x, y, and m from the candidate branch name. z and n should be 0.
60+
BETA_INITIAL = 2;
61+
62+
// Increment n.
63+
BETA_HOTFIX = 3;
64+
}
65+
4866
message Cherrypick {
4967
// The revision on trunk to cherrypick.
5068
string trunkRevision = 1;
@@ -113,6 +131,5 @@ message ConductorState {
113131
// that created the [ConductorState] object.
114132
string conductorVersion = 10;
115133

116-
// One of x, y, z, m, or n.
117-
string incrementLevel = 11;
134+
ReleaseType releaseType = 11;
118135
}

0 commit comments

Comments
 (0)