@@ -7,15 +7,36 @@ import 'dart:convert' show JsonEncoder, jsonDecode;
7
7
import 'package:file/file.dart' show File;
8
8
import 'package:platform/platform.dart' ;
9
9
10
- import './globals.dart' ;
10
+ import './globals.dart' as globals ;
11
11
import './proto/conductor_state.pb.dart' as pb;
12
12
import './proto/conductor_state.pbenum.dart' show ReleasePhase;
13
13
14
14
const String kStateFileName = '.flutter_conductor_state.json' ;
15
15
16
+ const String betaPostReleaseMsg = """
17
+ 'Ensure the following post release steps are complete:',
18
+ '\t 1. Post announcement to discord',
19
+ '\t\t Discord: ${globals .discordReleaseChannel }',
20
+ '\t 2. Post announcement flutter release hotline chat room',
21
+ '\t\t Chatroom: ${globals .flutterReleaseHotline }',
22
+ """ ;
23
+
24
+ const String stablePostReleaseMsg = """
25
+ 'Ensure the following post release steps are complete:',
26
+ '\t 1. Update hotfix to stable wiki following documentation best practices',
27
+ '\t\t Wiki link: ${globals .hotfixToStableWiki }',
28
+ '\t\t Best practices: ${globals .hotfixDocumentationBestPractices }',
29
+ '\t 2. Post announcement to flutter-announce group',
30
+ '\t\t Flutter Announce: ${globals .flutterAnnounceGroup }',
31
+ '\t 3. Post announcement to discord',
32
+ '\t\t Discord: ${globals .discordReleaseChannel }',
33
+ '\t 4. Post announcement flutter release hotline chat room',
34
+ '\t\t Chatroom: ${globals .flutterReleaseHotline }',
35
+ """ ;
36
+
16
37
String luciConsoleLink (String channel, String groupName) {
17
38
assert (
18
- kReleaseChannels.contains (channel),
39
+ globals. kReleaseChannels.contains (channel),
19
40
'channel $channel not recognized' ,
20
41
);
21
42
assert (
@@ -30,7 +51,8 @@ String luciConsoleLink(String channel, String groupName) {
30
51
String defaultStateFilePath (Platform platform) {
31
52
final String ? home = platform.environment['HOME' ];
32
53
if (home == null ) {
33
- throw ConductorException (r'Environment variable $HOME must be set!' );
54
+ throw globals.ConductorException (
55
+ r'Environment variable $HOME must be set!' );
34
56
}
35
57
return < String > [
36
58
home,
@@ -134,7 +156,7 @@ String phaseInstructions(pb.ConductorState state) {
134
156
'at ${state .engine .checkoutPath } in order:' ,
135
157
for (final pb.Cherrypick cherrypick in state.engine.cherrypicks)
136
158
'\t ${cherrypick .trunkRevision }' ,
137
- 'See $kReleaseDocumentationUrl for more information.' ,
159
+ 'See ${ globals . kReleaseDocumentationUrl } for more information.' ,
138
160
].join ('\n ' );
139
161
case ReleasePhase .CODESIGN_ENGINE_BINARIES :
140
162
if (! requiresEnginePR (state)) {
@@ -143,7 +165,7 @@ String phaseInstructions(pb.ConductorState state) {
143
165
}
144
166
// User's working branch was pushed to their mirror, but a PR needs to be
145
167
// opened on GitHub.
146
- final String newPrLink = getNewPrLink (
168
+ final String newPrLink = globals. getNewPrLink (
147
169
userName: githubAccount (state.engine.mirror.url),
148
170
repoName: 'engine' ,
149
171
state: state,
@@ -179,7 +201,7 @@ String phaseInstructions(pb.ConductorState state) {
179
201
'PR is necessary.' ;
180
202
}
181
203
182
- final String newPrLink = getNewPrLink (
204
+ final String newPrLink = globals. getNewPrLink (
183
205
userName: githubAccount (state.framework.mirror.url),
184
206
repoName: 'flutter' ,
185
207
state: state,
@@ -195,44 +217,21 @@ String phaseInstructions(pb.ConductorState state) {
195
217
case ReleasePhase .VERIFY_RELEASE :
196
218
return 'Release archive packages must be verified on cloud storage: ${luciConsoleLink (state .releaseChannel , 'packaging' )}' ;
197
219
case ReleasePhase .RELEASE_COMPLETED :
198
- const String DISCORD_RELEASE_CHANNEL =
199
- 'https://discord.com/channels/608014603317936148/783492179922124850' ;
200
- const String FLUTTER_RELEASE_HOTLINE =
201
- 'https://mail.google.com/chat/u/0/#chat/space/AAAA6RKcK2k' ;
202
- const String HOTFIX_TO_STABLE_WIKI =
203
- 'https://github.com/flutter/flutter/wiki/Hotfixes-to-the-Stable-Channel' ;
204
- const String FLUTTER_ANNOUNCE_GROUP =
205
- 'https://groups.google.com/g/flutter-announce' ;
206
- const String DOCUMENTATION_BEST_PRACTICES =
207
- 'https://github.com/flutter/flutter/wiki/Hotfix-Documentation-Best-Practices' ;
208
220
if (state.releaseChannel == 'beta' ) {
209
221
return < String > [
210
- 'Ensure the following post release steps are complete:' ,
211
- '\t 1. Post announcement to discord' ,
212
- '\t\t Discord: $DISCORD_RELEASE_CHANNEL ' ,
213
- '\t 2. Post announcement flutter release hotline chat room' ,
214
- '\t\t Chatroom: $FLUTTER_RELEASE_HOTLINE ' ,
222
+ betaPostReleaseMsg,
215
223
'-----------------------------------------------------------------------' ,
216
224
'This release has been completed.' ,
217
225
].join ('\n ' );
218
226
}
219
227
return < String > [
220
- 'Ensure the following post release steps are complete:' ,
221
- '\t 1. Update hotfix to stable wiki following documentation best practices' ,
222
- '\t\t Wiki link: $HOTFIX_TO_STABLE_WIKI ' ,
223
- '\t\t Best practices: $DOCUMENTATION_BEST_PRACTICES ' ,
224
- '\t 2. Post announcement to flutter-announce group' ,
225
- '\t\t Flutter Announce: $FLUTTER_ANNOUNCE_GROUP ' ,
226
- '\t 3. Post announcement to discord' ,
227
- '\t\t Discord: $DISCORD_RELEASE_CHANNEL ' ,
228
- '\t 4. Post announcement flutter release hotline chat room' ,
229
- '\t\t Chatroom: $FLUTTER_RELEASE_HOTLINE ' ,
228
+ stablePostReleaseMsg,
230
229
'-----------------------------------------------------------------------' ,
231
230
'This release has been completed.' ,
232
231
].join ('\n ' );
233
232
}
234
233
// For analyzer
235
- throw ConductorException ('Unimplemented phase ${state .currentPhase }' );
234
+ throw globals. ConductorException ('Unimplemented phase ${state .currentPhase }' );
236
235
}
237
236
238
237
/// Regex pattern for git remote host URLs.
@@ -250,13 +249,13 @@ String githubAccount(String remoteUrl) {
250
249
final String engineUrl = remoteUrl;
251
250
final RegExpMatch ? match = githubRemotePattern.firstMatch (engineUrl);
252
251
if (match == null ) {
253
- throw ConductorException (
252
+ throw globals. ConductorException (
254
253
'Cannot determine the GitHub account from $engineUrl ' ,
255
254
);
256
255
}
257
256
final String ? accountName = match.group (2 );
258
257
if (accountName == null || accountName.isEmpty) {
259
- throw ConductorException (
258
+ throw globals. ConductorException (
260
259
'Cannot determine the GitHub account from $match ' ,
261
260
);
262
261
}
@@ -271,7 +270,7 @@ ReleasePhase getNextPhase(ReleasePhase currentPhase) {
271
270
assert (currentPhase != null );
272
271
final ReleasePhase ? nextPhase = ReleasePhase .valueOf (currentPhase.value + 1 );
273
272
if (nextPhase == null ) {
274
- throw ConductorException ('There is no next ReleasePhase!' );
273
+ throw globals. ConductorException ('There is no next ReleasePhase!' );
275
274
}
276
275
return nextPhase;
277
276
}
0 commit comments