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
b2e37c65
Unverified
Commit
b2e37c65
authored
Feb 10, 2023
by
Casey Hillers
Committed by
GitHub
Feb 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[conductor] Tag engine versions (#120419)
* [conductor] Tag engine versions * Move tag to repository
parent
25c2c22d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
27 deletions
+76
-27
next.dart
dev/conductor/core/lib/src/next.dart
+19
-6
repository.dart
dev/conductor/core/lib/src/repository.dart
+21
-21
next_test.dart
dev/conductor/core/test/next_test.dart
+36
-0
No files found.
dev/conductor/core/lib/src/next.dart
View file @
b2e37c65
...
...
@@ -264,21 +264,33 @@ class NextContext extends Context {
case
pb
.
ReleasePhase
.
PUBLISH_VERSION
:
stdio
.
printStatus
(
'Please ensure that you have merged your framework PR and that'
);
stdio
.
printStatus
(
'post-submit CI has finished successfully.
\n
'
);
final
Remote
u
pstream
=
Remote
(
final
Remote
frameworkU
pstream
=
Remote
(
name:
RemoteName
.
upstream
,
url:
state
.
framework
.
upstream
.
url
,
);
final
FrameworkRepository
framework
=
FrameworkRepository
(
checkouts
,
// We explicitly want to check out the merged version from upstream
initialRef:
'
${
u
pstream.name}
/
${state.framework.candidateBranch}
'
,
upstreamRemote:
u
pstream
,
initialRef:
'
${
frameworkU
pstream.name}
/
${state.framework.candidateBranch}
'
,
upstreamRemote:
frameworkU
pstream
,
previousCheckoutLocation:
state
.
framework
.
checkoutPath
,
);
final
String
headRevision
=
await
framework
.
reverseParse
(
'HEAD'
);
final
String
frameworkHead
=
await
framework
.
reverseParse
(
'HEAD'
);
final
Remote
engineUpstream
=
Remote
(
name:
RemoteName
.
upstream
,
url:
state
.
engine
.
upstream
.
url
,
);
final
EngineRepository
engine
=
EngineRepository
(
checkouts
,
// We explicitly want to check out the merged version from upstream
initialRef:
'
${engineUpstream.name}
/
${state.engine.candidateBranch}
'
,
upstreamRemote:
engineUpstream
,
previousCheckoutLocation:
state
.
engine
.
checkoutPath
,
);
final
String
engineHead
=
await
engine
.
reverseParse
(
'HEAD'
);
if
(
autoAccept
==
false
)
{
final
bool
response
=
await
prompt
(
'Are you ready to tag commit
$
headRevision
as
${state.releaseVersion}
\n
'
'Are you ready to tag commit
$
frameworkHead
as
${state.releaseVersion}
\n
'
'and push to remote
${state.framework.upstream.url}
?'
,
);
if
(!
response
)
{
...
...
@@ -287,7 +299,8 @@ class NextContext extends Context {
return
;
}
}
await
framework
.
tag
(
headRevision
,
state
.
releaseVersion
,
upstream
.
name
);
await
framework
.
tag
(
frameworkHead
,
state
.
releaseVersion
,
frameworkUpstream
.
name
);
await
engine
.
tag
(
engineHead
,
state
.
releaseVersion
,
engineUpstream
.
name
);
break
;
case
pb
.
ReleasePhase
.
PUBLISH_CHANNEL
:
final
Remote
upstream
=
Remote
(
...
...
dev/conductor/core/lib/src/repository.dart
View file @
b2e37c65
...
...
@@ -319,6 +319,27 @@ abstract class Repository {
);
}
/// Tag [commit] and push the tag to the remote.
Future
<
void
>
tag
(
String
commit
,
String
tagName
,
String
remote
)
async
{
assert
(
commit
.
isNotEmpty
);
assert
(
tagName
.
isNotEmpty
);
assert
(
remote
.
isNotEmpty
);
stdio
.
printStatus
(
'About to tag commit
$commit
as
$tagName
...'
);
await
git
.
run
(
<
String
>[
'tag'
,
tagName
,
commit
],
'tag the commit with the version label'
,
workingDirectory:
(
await
checkoutDirectory
).
path
,
);
stdio
.
printStatus
(
'Tagging successful.'
);
stdio
.
printStatus
(
'About to push
$tagName
to remote
$remote
...'
);
await
git
.
run
(
<
String
>[
'push'
,
remote
,
tagName
],
'publish the tag to the repo'
,
workingDirectory:
(
await
checkoutDirectory
).
path
,
);
stdio
.
printStatus
(
'Tag push successful.'
);
}
/// List commits in reverse chronological order.
Future
<
List
<
String
>>
revList
(
List
<
String
>
args
)
async
{
return
(
await
git
.
getOutput
(<
String
>[
'rev-list'
,
...
args
],
...
...
@@ -592,27 +613,6 @@ class FrameworkRepository extends Repository {
);
}
/// Tag [commit] and push the tag to the remote.
Future
<
void
>
tag
(
String
commit
,
String
tagName
,
String
remote
)
async
{
assert
(
commit
.
isNotEmpty
);
assert
(
tagName
.
isNotEmpty
);
assert
(
remote
.
isNotEmpty
);
stdio
.
printStatus
(
'About to tag commit
$commit
as
$tagName
...'
);
await
git
.
run
(
<
String
>[
'tag'
,
tagName
,
commit
],
'tag the commit with the version label'
,
workingDirectory:
(
await
checkoutDirectory
).
path
,
);
stdio
.
printStatus
(
'Tagging successful.'
);
stdio
.
printStatus
(
'About to push
$tagName
to remote
$remote
...'
);
await
git
.
run
(
<
String
>[
'push'
,
remote
,
tagName
],
'publish the tag to the repo'
,
workingDirectory:
(
await
checkoutDirectory
).
path
,
);
stdio
.
printStatus
(
'Tag push successful.'
);
}
@override
Future
<
FrameworkRepository
>
cloneRepository
(
String
?
cloneName
)
async
{
assert
(
localUpstream
);
...
...
dev/conductor/core/test/next_test.dart
View file @
b2e37c65
...
...
@@ -758,6 +758,10 @@ void main() {
candidateBranch:
candidateBranch
,
upstream:
pb
.
Remote
(
url:
FrameworkRepository
.
defaultUpstream
),
),
engine:
pb
.
Repository
(
candidateBranch:
candidateBranch
,
upstream:
pb
.
Remote
(
url:
EngineRepository
.
defaultUpstream
),
),
releaseVersion:
releaseVersion
,
);
platform
=
FakePlatform
(
...
...
@@ -773,6 +777,18 @@ void main() {
stdio
.
stdin
.
add
(
'n'
);
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(
<
FakeCommand
>[
// Framework checkout
const
FakeCommand
(
command:
<
String
>[
'git'
,
'fetch'
,
'upstream'
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'checkout'
,
'
$remoteName
/
$candidateBranch
'
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision1
,
),
// Engine checkout
const
FakeCommand
(
command:
<
String
>[
'git'
,
'fetch'
,
'upstream'
],
),
...
...
@@ -818,6 +834,7 @@ void main() {
test
(
'updates state.currentPhase if user responds yes'
,
()
async
{
stdio
.
stdin
.
add
(
'y'
);
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
// Framework checkout
const
FakeCommand
(
command:
<
String
>[
'git'
,
'fetch'
,
'upstream'
],
),
...
...
@@ -828,12 +845,31 @@ void main() {
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision1
,
),
// Engine checkout
const
FakeCommand
(
command:
<
String
>[
'git'
,
'fetch'
,
'upstream'
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'checkout'
,
'
$remoteName
/
$candidateBranch
'
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision2
,
),
// Framework tag
const
FakeCommand
(
command:
<
String
>[
'git'
,
'tag'
,
releaseVersion
,
revision1
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'push'
,
remoteName
,
releaseVersion
],
),
// Engine tag
const
FakeCommand
(
command:
<
String
>[
'git'
,
'tag'
,
releaseVersion
,
revision2
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'push'
,
remoteName
,
releaseVersion
],
),
]);
final
FakePlatform
platform
=
FakePlatform
(
environment:
<
String
,
String
>{
...
...
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