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
31ee09f6
Unverified
Commit
31ee09f6
authored
Nov 23, 2021
by
Christopher Fujino
Committed by
GitHub
Nov 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make .prompt() async (#94067)
parent
12f5bb20
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
context.dart
dev/conductor/core/lib/src/context.dart
+1
-1
next.dart
dev/conductor/core/lib/src/next.dart
+6
-6
start.dart
dev/conductor/core/lib/src/start.dart
+1
-1
next_test.dart
dev/conductor/core/test/next_test.dart
+4
-4
No files found.
dev/conductor/core/lib/src/context.dart
View file @
31ee09f6
...
@@ -28,7 +28,7 @@ abstract class Context {
...
@@ -28,7 +28,7 @@ abstract class Context {
///
///
/// The default implementation reads from STDIN. This can be overriden in UI
/// The default implementation reads from STDIN. This can be overriden in UI
/// implementations that capture user interaction differently.
/// implementations that capture user interaction differently.
bool
prompt
(
String
message
)
{
Future
<
bool
>
prompt
(
String
message
)
async
{
stdio
.
write
(
'
${message.trim()}
(y/n) '
);
stdio
.
write
(
'
${message.trim()}
(y/n) '
);
final
String
response
=
stdio
.
readLineSync
().
trim
();
final
String
response
=
stdio
.
readLineSync
().
trim
();
final
String
firstChar
=
response
[
0
].
toUpperCase
();
final
String
firstChar
=
response
[
0
].
toUpperCase
();
...
...
dev/conductor/core/lib/src/next.dart
View file @
31ee09f6
...
@@ -141,7 +141,7 @@ class NextContext extends Context {
...
@@ -141,7 +141,7 @@ class NextContext extends Context {
'
${state.engine.checkoutPath}
before proceeding.
\n
'
);
'
${state.engine.checkoutPath}
before proceeding.
\n
'
);
}
}
if
(
autoAccept
==
false
)
{
if
(
autoAccept
==
false
)
{
final
bool
response
=
prompt
(
final
bool
response
=
await
prompt
(
'Are you ready to push your engine branch to the repository '
'Are you ready to push your engine branch to the repository '
'
${state.engine.mirror.url}
?'
,
'
${state.engine.mirror.url}
?'
,
);
);
...
@@ -167,7 +167,7 @@ class NextContext extends Context {
...
@@ -167,7 +167,7 @@ class NextContext extends Context {
].
join
(
'
\n
'
));
].
join
(
'
\n
'
));
if
(
autoAccept
==
false
)
{
if
(
autoAccept
==
false
)
{
// TODO(fujino): actually test if binaries have been codesigned on macOS
// TODO(fujino): actually test if binaries have been codesigned on macOS
final
bool
response
=
prompt
(
final
bool
response
=
await
prompt
(
'Has CI passed for the engine PR and binaries been codesigned?'
,
'Has CI passed for the engine PR and binaries been codesigned?'
,
);
);
if
(!
response
)
{
if
(!
response
)
{
...
@@ -274,7 +274,7 @@ class NextContext extends Context {
...
@@ -274,7 +274,7 @@ class NextContext extends Context {
}
}
if
(
autoAccept
==
false
)
{
if
(
autoAccept
==
false
)
{
final
bool
response
=
prompt
(
final
bool
response
=
await
prompt
(
'Are you ready to push your framework branch to the repository '
'Are you ready to push your framework branch to the repository '
'
${state.framework.mirror.url}
?'
,
'
${state.framework.mirror.url}
?'
,
);
);
...
@@ -308,7 +308,7 @@ class NextContext extends Context {
...
@@ -308,7 +308,7 @@ class NextContext extends Context {
);
);
final
String
headRevision
=
await
framework
.
reverseParse
(
'HEAD'
);
final
String
headRevision
=
await
framework
.
reverseParse
(
'HEAD'
);
if
(
autoAccept
==
false
)
{
if
(
autoAccept
==
false
)
{
final
bool
response
=
prompt
(
final
bool
response
=
await
prompt
(
'Are you ready to tag commit
$headRevision
as
${state.releaseVersion}
\n
'
'Are you ready to tag commit
$headRevision
as
${state.releaseVersion}
\n
'
'and push to remote
${state.framework.upstream.url}
?'
,
'and push to remote
${state.framework.upstream.url}
?'
,
);
);
...
@@ -343,7 +343,7 @@ class NextContext extends Context {
...
@@ -343,7 +343,7 @@ class NextContext extends Context {
dryRun:
true
,
dryRun:
true
,
);
);
final
bool
response
=
prompt
(
'Are you ready to publish this release?'
);
final
bool
response
=
await
prompt
(
'Are you ready to publish this release?'
);
if
(!
response
)
{
if
(!
response
)
{
stdio
.
printError
(
'Aborting command.'
);
stdio
.
printError
(
'Aborting command.'
);
updateState
(
state
,
stdio
.
logs
);
updateState
(
state
,
stdio
.
logs
);
...
@@ -363,7 +363,7 @@ class NextContext extends Context {
...
@@ -363,7 +363,7 @@ class NextContext extends Context {
'
\t
$kLuciPackagingConsoleLink
'
,
'
\t
$kLuciPackagingConsoleLink
'
,
);
);
if
(
autoAccept
==
false
)
{
if
(
autoAccept
==
false
)
{
final
bool
response
=
prompt
(
'Have all packaging builds finished successfully?'
);
final
bool
response
=
await
prompt
(
'Have all packaging builds finished successfully?'
);
if
(!
response
)
{
if
(!
response
)
{
stdio
.
printError
(
'Aborting command.'
);
stdio
.
printError
(
'Aborting command.'
);
updateState
(
state
,
stdio
.
logs
);
updateState
(
state
,
stdio
.
logs
);
...
...
dev/conductor/core/lib/src/start.dart
View file @
31ee09f6
...
@@ -447,7 +447,7 @@ class StartContext extends Context {
...
@@ -447,7 +447,7 @@ class StartContext extends Context {
candidateBranch
,
candidateBranch
,
FrameworkRepository
.
defaultBranch
,
FrameworkRepository
.
defaultBranch
,
);
);
final
bool
response
=
prompt
(
final
bool
response
=
await
prompt
(
'About to tag the release candidate branch branchpoint of
$branchPoint
'
'About to tag the release candidate branch branchpoint of
$branchPoint
'
'as
$requestedVersion
and push it to
${framework.upstreamRemote.url}
. '
'as
$requestedVersion
and push it to
${framework.upstreamRemote.url}
. '
'Is this correct?'
,
'Is this correct?'
,
...
...
dev/conductor/core/test/next_test.dart
View file @
31ee09f6
...
@@ -1055,7 +1055,7 @@ void main() {
...
@@ -1055,7 +1055,7 @@ void main() {
});
});
group
(
'prompt'
,
()
{
group
(
'prompt'
,
()
{
test
(
'can be overridden for different frontend implementations'
,
()
{
test
(
'can be overridden for different frontend implementations'
,
()
async
{
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
Stdio
stdio
=
_UnimplementedStdio
.
instance
;
final
Stdio
stdio
=
_UnimplementedStdio
.
instance
;
final
Checkouts
checkouts
=
Checkouts
(
final
Checkouts
checkouts
=
Checkouts
(
...
@@ -1070,7 +1070,7 @@ void main() {
...
@@ -1070,7 +1070,7 @@ void main() {
stateFile:
fileSystem
.
file
(
'/statefile.json'
),
stateFile:
fileSystem
.
file
(
'/statefile.json'
),
);
);
final
bool
response
=
context
.
prompt
(
final
bool
response
=
await
context
.
prompt
(
'A prompt that will immediately be agreed to'
,
'A prompt that will immediately be agreed to'
,
);
);
expect
(
response
,
true
);
expect
(
response
,
true
);
...
@@ -1149,9 +1149,9 @@ class _TestNextContext extends NextContext {
...
@@ -1149,9 +1149,9 @@ class _TestNextContext extends NextContext {
);
);
@override
@override
bool
prompt
(
String
message
)
{
Future
<
bool
>
prompt
(
String
message
)
{
// always say yes
// always say yes
return
true
;
return
Future
<
bool
>.
value
(
true
)
;
}
}
}
}
...
...
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