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
74881c12
Unverified
Commit
74881c12
authored
Feb 19, 2022
by
Christopher Fujino
Committed by
GitHub
Feb 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_conductor] fix auto-tagging branch point (#98618)
parent
a059a383
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
14 deletions
+40
-14
globals.dart
dev/conductor/core/lib/src/globals.dart
+1
-1
start.dart
dev/conductor/core/lib/src/start.dart
+15
-6
next_test.dart
dev/conductor/core/test/next_test.dart
+2
-2
repository_test.dart
dev/conductor/core/test/repository_test.dart
+0
-3
start_test.dart
dev/conductor/core/test/start_test.dart
+22
-2
No files found.
dev/conductor/core/lib/src/globals.dart
View file @
74881c12
...
...
@@ -12,7 +12,7 @@ const String gsutilBinary = 'gsutil.py';
const
String
kFrameworkDefaultBranch
=
'master'
;
const
String
kForceFlag
=
'force'
;
const
List
<
String
>
kBaseReleaseChannels
=
<
String
>[
'stable'
,
'beta'
,
'dev'
];
const
List
<
String
>
kBaseReleaseChannels
=
<
String
>[
'stable'
,
'beta'
];
const
List
<
String
>
kReleaseChannels
=
<
String
>[...
kBaseReleaseChannels
,
FrameworkRepository
.
defaultBranch
];
...
...
dev/conductor/core/lib/src/start.dart
View file @
74881c12
...
...
@@ -383,7 +383,9 @@ class StartContext extends Context {
}
Version
nextVersion
=
calculateNextVersion
(
lastVersion
);
if
(!
force
)
{
nextVersion
=
await
ensureBranchPointTagged
(
nextVersion
,
framework
);
}
state
.
releaseVersion
=
nextVersion
.
toString
();
...
...
@@ -438,15 +440,22 @@ class StartContext extends Context {
Version
requestedVersion
,
FrameworkRepository
framework
,
)
async
{
if
(
incrementLetter
!=
'm'
)
{
// in this case, there must have been a previous tagged release, so skip
// tagging the branch point
return
requestedVersion
;
}
final
String
branchPoint
=
await
framework
.
branchPoint
(
candidateBranch
,
FrameworkRepository
.
defaultBranch
,
);
if
(
await
framework
.
isCommitTagged
(
branchPoint
))
{
// The branch point is tagged, no work to be done
return
requestedVersion
;
}
if
(
requestedVersion
.
n
!=
0
)
{
stdio
.
printError
(
'Tried to tag the branch point, however the target version is '
'
$requestedVersion
, which does not have n == 0!'
,
);
return
requestedVersion
;
}
final
bool
response
=
await
prompt
(
'About to tag the release candidate branch branchpoint of
$branchPoint
'
'as
$requestedVersion
and push it to
${framework.upstreamRemote.url}
. '
...
...
dev/conductor/core/test/next_test.dart
View file @
74881c12
...
...
@@ -191,7 +191,7 @@ void main() {
test
(
'updates lastPhase if user responds yes'
,
()
async
{
const
String
remoteUrl
=
'https://github.com/org/repo.git'
;
const
String
releaseChannel
=
'
dev
'
;
const
String
releaseChannel
=
'
beta
'
;
stdio
.
stdin
.
add
(
'y'
);
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
...
...
@@ -1175,7 +1175,7 @@ void _initializeCiYamlFile(
File
file
,
{
List
<
String
>?
enabledBranches
,
})
{
enabledBranches
??=
<
String
>[
'master'
,
'
dev'
,
'
beta'
,
'stable'
];
enabledBranches
??=
<
String
>[
'master'
,
'beta'
,
'stable'
];
file
.
createSync
(
recursive:
true
);
final
StringBuffer
buffer
=
StringBuffer
(
'enabled_branches:
\n
'
);
for
(
final
String
branch
in
enabledBranches
)
{
...
...
dev/conductor/core/test/repository_test.dart
View file @
74881c12
...
...
@@ -408,9 +408,6 @@ vars = {
const
FakeCommand
(
command:
<
String
>[
'git'
,
'checkout'
,
'beta'
,
'--'
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'checkout'
,
'dev'
,
'--'
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'checkout'
,
FrameworkRepository
.
defaultBranch
,
'--'
],
),
...
...
dev/conductor/core/test/start_test.dart
View file @
74881c12
...
...
@@ -19,6 +19,7 @@ import './common.dart';
void
main
(
)
{
group
(
'start command'
,
()
{
const
String
branchPointRevision
=
'5131a6e5e0c50b8b7b2906cd58dab8746d6450be'
;
const
String
flutterRoot
=
'/flutter'
;
const
String
checkoutsParentDirectory
=
'
$flutterRoot
/dev/tools/'
;
const
String
frameworkMirror
=
'https://github.com/user/flutter.git'
;
...
...
@@ -93,7 +94,7 @@ void main() {
'--
$kCandidateOption
'
,
candidateBranch
,
'--
$kReleaseOption
'
,
'
dev
'
,
'
beta
'
,
'--
$kStateOption
'
,
'/path/to/statefile.json'
,
'--
$kIncrementOption
'
,
...
...
@@ -309,7 +310,6 @@ void main() {
stdio
.
stdin
.
add
(
'y'
);
// accept prompt from ensureBranchPointTagged()
const
String
revision2
=
'def789'
;
const
String
revision3
=
'123abc'
;
const
String
branchPointRevision
=
'deadbeef'
;
const
String
previousDartRevision
=
'171876a4e6cf56ee6da1f97d203926bd7afda7ef'
;
const
String
nextDartRevision
=
'f6c91128be6b77aef8351e1e3a9d07c85bc2e46e'
;
const
String
previousVersion
=
'1.2.0-1.0.pre'
;
...
...
@@ -435,6 +435,12 @@ void main() {
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
],
),
...
...
@@ -624,6 +630,14 @@ void main() {
],
stdout:
'
$previousVersion
-42-gabc123'
,
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'merge-base'
,
candidateBranch
,
'master'
],
stdout:
branchPointRevision
,
),
// check if commit is tagged, 0 exit code thus it is tagged
const
FakeCommand
(
command:
<
String
>[
'git'
,
'describe'
,
'--exact-match'
,
'--tags'
,
branchPointRevision
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision3
,
...
...
@@ -811,6 +825,12 @@ void main() {
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 code means branch point is NOT tagged
exitCode:
128
,
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'tag'
,
branchPointTag
,
branchPointRevision
],
),
...
...
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