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
a7ddb9b6
Unverified
Commit
a7ddb9b6
authored
Jun 15, 2022
by
Kevin Chisholm
Committed by
GitHub
Jun 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
readability refactor (#106026)
parent
873d343e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
35 deletions
+49
-35
globals.dart
dev/conductor/core/lib/src/globals.dart
+15
-0
state.dart
dev/conductor/core/lib/src/state.dart
+34
-35
No files found.
dev/conductor/core/lib/src/globals.dart
View file @
a7ddb9b6
...
@@ -22,6 +22,21 @@ const String kLuciPackagingConsoleLink = 'https://ci.chromium.org/p/flutter/g/pa
...
@@ -22,6 +22,21 @@ const String kLuciPackagingConsoleLink = 'https://ci.chromium.org/p/flutter/g/pa
const
String
kWebsiteReleasesUrl
=
'https://docs.flutter.dev/development/tools/sdk/releases'
;
const
String
kWebsiteReleasesUrl
=
'https://docs.flutter.dev/development/tools/sdk/releases'
;
const
String
discordReleaseChannel
=
'https://discord.com/channels/608014603317936148/783492179922124850'
;
const
String
flutterReleaseHotline
=
'https://mail.google.com/chat/u/0/#chat/space/AAAA6RKcK2k'
;
const
String
hotfixToStableWiki
=
'https://github.com/flutter/flutter/wiki/Hotfixes-to-the-Stable-Channel'
;
const
String
flutterAnnounceGroup
=
'https://groups.google.com/g/flutter-announce'
;
const
String
hotfixDocumentationBestPractices
=
'https://github.com/flutter/flutter/wiki/Hotfix-Documentation-Best-Practices'
;
final
RegExp
releaseCandidateBranchRegex
=
RegExp
(
final
RegExp
releaseCandidateBranchRegex
=
RegExp
(
r'flutter-(\d+)\.(\d+)-candidate\.(\d+)'
,
r'flutter-(\d+)\.(\d+)-candidate\.(\d+)'
,
);
);
...
...
dev/conductor/core/lib/src/state.dart
View file @
a7ddb9b6
...
@@ -7,15 +7,36 @@ import 'dart:convert' show JsonEncoder, jsonDecode;
...
@@ -7,15 +7,36 @@ import 'dart:convert' show JsonEncoder, jsonDecode;
import
'package:file/file.dart'
show
File
;
import
'package:file/file.dart'
show
File
;
import
'package:platform/platform.dart'
;
import
'package:platform/platform.dart'
;
import
'./globals.dart'
;
import
'./globals.dart'
as
globals
;
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'
show
ReleasePhase
;
const
String
kStateFileName
=
'.flutter_conductor_state.json'
;
const
String
kStateFileName
=
'.flutter_conductor_state.json'
;
const
String
betaPostReleaseMsg
=
"""
'Ensure the following post release steps are complete:',
'
\t
1. Post announcement to discord',
'
\t\t
Discord:
${globals.discordReleaseChannel}
',
'
\t
2. Post announcement flutter release hotline chat room',
'
\t\t
Chatroom:
${globals.flutterReleaseHotline}
',
"""
;
const
String
stablePostReleaseMsg
=
"""
'Ensure the following post release steps are complete:',
'
\t
1. Update hotfix to stable wiki following documentation best practices',
'
\t\t
Wiki link:
${globals.hotfixToStableWiki}
',
'
\t\t
Best practices:
${globals.hotfixDocumentationBestPractices}
',
'
\t
2. Post announcement to flutter-announce group',
'
\t\t
Flutter Announce:
${globals.flutterAnnounceGroup}
',
'
\t
3. Post announcement to discord',
'
\t\t
Discord:
${globals.discordReleaseChannel}
',
'
\t
4. Post announcement flutter release hotline chat room',
'
\t\t
Chatroom:
${globals.flutterReleaseHotline}
',
"""
;
String
luciConsoleLink
(
String
channel
,
String
groupName
)
{
String
luciConsoleLink
(
String
channel
,
String
groupName
)
{
assert
(
assert
(
kReleaseChannels
.
contains
(
channel
),
globals
.
kReleaseChannels
.
contains
(
channel
),
'channel
$channel
not recognized'
,
'channel
$channel
not recognized'
,
);
);
assert
(
assert
(
...
@@ -30,7 +51,8 @@ String luciConsoleLink(String channel, String groupName) {
...
@@ -30,7 +51,8 @@ String luciConsoleLink(String channel, String groupName) {
String
defaultStateFilePath
(
Platform
platform
)
{
String
defaultStateFilePath
(
Platform
platform
)
{
final
String
?
home
=
platform
.
environment
[
'HOME'
];
final
String
?
home
=
platform
.
environment
[
'HOME'
];
if
(
home
==
null
)
{
if
(
home
==
null
)
{
throw
ConductorException
(
r'Environment variable $HOME must be set!'
);
throw
globals
.
ConductorException
(
r'Environment variable $HOME must be set!'
);
}
}
return
<
String
>[
return
<
String
>[
home
,
home
,
...
@@ -134,7 +156,7 @@ String phaseInstructions(pb.ConductorState state) {
...
@@ -134,7 +156,7 @@ String phaseInstructions(pb.ConductorState state) {
'at
${state.engine.checkoutPath}
in order:'
,
'at
${state.engine.checkoutPath}
in order:'
,
for
(
final
pb
.
Cherrypick
cherrypick
in
state
.
engine
.
cherrypicks
)
for
(
final
pb
.
Cherrypick
cherrypick
in
state
.
engine
.
cherrypicks
)
'
\t
${cherrypick.trunkRevision}
'
,
'
\t
${cherrypick.trunkRevision}
'
,
'See
$
kReleaseDocumentationUrl
for more information.'
,
'See
$
{globals.kReleaseDocumentationUrl}
for more information.'
,
].
join
(
'
\n
'
);
].
join
(
'
\n
'
);
case
ReleasePhase
.
CODESIGN_ENGINE_BINARIES
:
case
ReleasePhase
.
CODESIGN_ENGINE_BINARIES
:
if
(!
requiresEnginePR
(
state
))
{
if
(!
requiresEnginePR
(
state
))
{
...
@@ -143,7 +165,7 @@ String phaseInstructions(pb.ConductorState state) {
...
@@ -143,7 +165,7 @@ String phaseInstructions(pb.ConductorState state) {
}
}
// User's working branch was pushed to their mirror, but a PR needs to be
// User's working branch was pushed to their mirror, but a PR needs to be
// opened on GitHub.
// opened on GitHub.
final
String
newPrLink
=
getNewPrLink
(
final
String
newPrLink
=
g
lobals
.
g
etNewPrLink
(
userName:
githubAccount
(
state
.
engine
.
mirror
.
url
),
userName:
githubAccount
(
state
.
engine
.
mirror
.
url
),
repoName:
'engine'
,
repoName:
'engine'
,
state:
state
,
state:
state
,
...
@@ -179,7 +201,7 @@ String phaseInstructions(pb.ConductorState state) {
...
@@ -179,7 +201,7 @@ String phaseInstructions(pb.ConductorState state) {
'PR is necessary.'
;
'PR is necessary.'
;
}
}
final
String
newPrLink
=
getNewPrLink
(
final
String
newPrLink
=
g
lobals
.
g
etNewPrLink
(
userName:
githubAccount
(
state
.
framework
.
mirror
.
url
),
userName:
githubAccount
(
state
.
framework
.
mirror
.
url
),
repoName:
'flutter'
,
repoName:
'flutter'
,
state:
state
,
state:
state
,
...
@@ -195,44 +217,21 @@ String phaseInstructions(pb.ConductorState state) {
...
@@ -195,44 +217,21 @@ String phaseInstructions(pb.ConductorState state) {
case
ReleasePhase
.
VERIFY_RELEASE
:
case
ReleasePhase
.
VERIFY_RELEASE
:
return
'Release archive packages must be verified on cloud storage:
${luciConsoleLink(state.releaseChannel, 'packaging')}
'
;
return
'Release archive packages must be verified on cloud storage:
${luciConsoleLink(state.releaseChannel, 'packaging')}
'
;
case
ReleasePhase
.
RELEASE_COMPLETED
:
case
ReleasePhase
.
RELEASE_COMPLETED
:
const
String
DISCORD_RELEASE_CHANNEL
=
'https://discord.com/channels/608014603317936148/783492179922124850'
;
const
String
FLUTTER_RELEASE_HOTLINE
=
'https://mail.google.com/chat/u/0/#chat/space/AAAA6RKcK2k'
;
const
String
HOTFIX_TO_STABLE_WIKI
=
'https://github.com/flutter/flutter/wiki/Hotfixes-to-the-Stable-Channel'
;
const
String
FLUTTER_ANNOUNCE_GROUP
=
'https://groups.google.com/g/flutter-announce'
;
const
String
DOCUMENTATION_BEST_PRACTICES
=
'https://github.com/flutter/flutter/wiki/Hotfix-Documentation-Best-Practices'
;
if
(
state
.
releaseChannel
==
'beta'
)
{
if
(
state
.
releaseChannel
==
'beta'
)
{
return
<
String
>[
return
<
String
>[
'Ensure the following post release steps are complete:'
,
betaPostReleaseMsg
,
'
\t
1. Post announcement to discord'
,
'
\t\t
Discord:
$DISCORD_RELEASE_CHANNEL
'
,
'
\t
2. Post announcement flutter release hotline chat room'
,
'
\t\t
Chatroom:
$FLUTTER_RELEASE_HOTLINE
'
,
'-----------------------------------------------------------------------'
,
'-----------------------------------------------------------------------'
,
'This release has been completed.'
,
'This release has been completed.'
,
].
join
(
'
\n
'
);
].
join
(
'
\n
'
);
}
}
return
<
String
>[
return
<
String
>[
'Ensure the following post release steps are complete:'
,
stablePostReleaseMsg
,
'
\t
1. Update hotfix to stable wiki following documentation best practices'
,
'
\t\t
Wiki link:
$HOTFIX_TO_STABLE_WIKI
'
,
'
\t\t
Best practices:
$DOCUMENTATION_BEST_PRACTICES
'
,
'
\t
2. Post announcement to flutter-announce group'
,
'
\t\t
Flutter Announce:
$FLUTTER_ANNOUNCE_GROUP
'
,
'
\t
3. Post announcement to discord'
,
'
\t\t
Discord:
$DISCORD_RELEASE_CHANNEL
'
,
'
\t
4. Post announcement flutter release hotline chat room'
,
'
\t\t
Chatroom:
$FLUTTER_RELEASE_HOTLINE
'
,
'-----------------------------------------------------------------------'
,
'-----------------------------------------------------------------------'
,
'This release has been completed.'
,
'This release has been completed.'
,
].
join
(
'
\n
'
);
].
join
(
'
\n
'
);
}
}
// For analyzer
// For analyzer
throw
ConductorException
(
'Unimplemented phase
${state.currentPhase}
'
);
throw
globals
.
ConductorException
(
'Unimplemented phase
${state.currentPhase}
'
);
}
}
/// Regex pattern for git remote host URLs.
/// Regex pattern for git remote host URLs.
...
@@ -250,13 +249,13 @@ String githubAccount(String remoteUrl) {
...
@@ -250,13 +249,13 @@ String githubAccount(String remoteUrl) {
final
String
engineUrl
=
remoteUrl
;
final
String
engineUrl
=
remoteUrl
;
final
RegExpMatch
?
match
=
githubRemotePattern
.
firstMatch
(
engineUrl
);
final
RegExpMatch
?
match
=
githubRemotePattern
.
firstMatch
(
engineUrl
);
if
(
match
==
null
)
{
if
(
match
==
null
)
{
throw
ConductorException
(
throw
globals
.
ConductorException
(
'Cannot determine the GitHub account from
$engineUrl
'
,
'Cannot determine the GitHub account from
$engineUrl
'
,
);
);
}
}
final
String
?
accountName
=
match
.
group
(
2
);
final
String
?
accountName
=
match
.
group
(
2
);
if
(
accountName
==
null
||
accountName
.
isEmpty
)
{
if
(
accountName
==
null
||
accountName
.
isEmpty
)
{
throw
ConductorException
(
throw
globals
.
ConductorException
(
'Cannot determine the GitHub account from
$match
'
,
'Cannot determine the GitHub account from
$match
'
,
);
);
}
}
...
@@ -271,7 +270,7 @@ ReleasePhase getNextPhase(ReleasePhase currentPhase) {
...
@@ -271,7 +270,7 @@ ReleasePhase getNextPhase(ReleasePhase currentPhase) {
assert
(
currentPhase
!=
null
);
assert
(
currentPhase
!=
null
);
final
ReleasePhase
?
nextPhase
=
ReleasePhase
.
valueOf
(
currentPhase
.
value
+
1
);
final
ReleasePhase
?
nextPhase
=
ReleasePhase
.
valueOf
(
currentPhase
.
value
+
1
);
if
(
nextPhase
==
null
)
{
if
(
nextPhase
==
null
)
{
throw
ConductorException
(
'There is no next ReleasePhase!'
);
throw
globals
.
ConductorException
(
'There is no next ReleasePhase!'
);
}
}
return
nextPhase
;
return
nextPhase
;
}
}
...
...
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