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
ad936b4e
Unverified
Commit
ad936b4e
authored
Sep 14, 2021
by
Christopher Fujino
Committed by
GitHub
Sep 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_conductor] Support initial stable release version (#89775)
parent
ff5dd54c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
197 additions
and
1 deletion
+197
-1
start.dart
dev/conductor/lib/start.dart
+15
-1
start_test.dart
dev/conductor/test/start_test.dart
+182
-0
No files found.
dev/conductor/lib/start.dart
View file @
ad936b4e
...
...
@@ -315,7 +315,21 @@ class StartCommand extends Command<void> {
if
(
incrementLetter
==
'm'
)
{
nextVersion
=
Version
.
fromCandidateBranch
(
candidateBranch
);
}
else
{
nextVersion
=
Version
.
increment
(
lastVersion
,
incrementLetter
);
if
(
incrementLetter
==
'z'
)
{
if
(
lastVersion
.
type
==
VersionType
.
stable
)
{
nextVersion
=
Version
.
increment
(
lastVersion
,
incrementLetter
);
}
else
{
// This is the first stable release, so hardcode the z as 0
nextVersion
=
Version
(
x:
lastVersion
.
x
,
y:
lastVersion
.
y
,
z:
0
,
type:
VersionType
.
stable
,
);
}
}
else
{
nextVersion
=
Version
.
increment
(
lastVersion
,
incrementLetter
);
}
}
state
.
releaseVersion
=
nextVersion
.
toString
();
...
...
dev/conductor/test/start_test.dart
View file @
ad936b4e
...
...
@@ -289,6 +289,188 @@ void main() {
expect
(
state
.
conductorVersion
,
revision
);
expect
(
state
.
incrementLevel
,
incrementLevel
);
});
test
(
'can convert from dev style version to stable version'
,
()
async
{
const
String
revision2
=
'def789'
;
const
String
revision3
=
'123abc'
;
const
String
previousDartRevision
=
'171876a4e6cf56ee6da1f97d203926bd7afda7ef'
;
const
String
nextDartRevision
=
'f6c91128be6b77aef8351e1e3a9d07c85bc2e46e'
;
const
String
previousVersion
=
'1.2.0-1.0.pre'
;
const
String
nextVersion
=
'1.2.0'
;
const
String
incrementLevel
=
'z'
;
final
Directory
engine
=
fileSystem
.
directory
(
checkoutsParentDirectory
)
.
childDirectory
(
'flutter_conductor_checkouts'
)
.
childDirectory
(
'engine'
);
final
File
depsFile
=
engine
.
childFile
(
'DEPS'
);
final
List
<
FakeCommand
>
engineCommands
=
<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
'git'
,
'clone'
,
'--origin'
,
'upstream'
,
'--'
,
EngineRepository
.
defaultUpstream
,
engine
.
path
,
],
onRun:
()
{
// Create the DEPS file which the tool will update
engine
.
createSync
(
recursive:
true
);
depsFile
.
writeAsStringSync
(
generateMockDeps
(
previousDartRevision
));
}
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'remote'
,
'add'
,
'mirror'
,
engineMirror
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'fetch'
,
'mirror'
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'checkout'
,
'upstream/
$candidateBranch
'
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision2
,
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'checkout'
,
'-b'
,
'cherrypicks-
$candidateBranch
'
,
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'status'
,
'--porcelain'
],
stdout:
'MM path/to/DEPS'
,
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'add'
,
'--all'
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'commit'
,
"--message='Update Dart SDK to
$nextDartRevision
'"
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision2
,
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision2
,
),
];
final
List
<
FakeCommand
>
frameworkCommands
=
<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
'git'
,
'clone'
,
'--origin'
,
'upstream'
,
'--'
,
FrameworkRepository
.
defaultUpstream
,
fileSystem
.
path
.
join
(
checkoutsParentDirectory
,
'flutter_conductor_checkouts'
,
'framework'
,
),
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'remote'
,
'add'
,
'mirror'
,
frameworkMirror
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'fetch'
,
'mirror'
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'checkout'
,
'upstream/
$candidateBranch
'
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision3
,
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'checkout'
,
'-b'
,
'cherrypicks-
$candidateBranch
'
,
],
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'describe'
,
'--match'
,
'*.*.*'
,
'--tags'
,
'refs/remotes/upstream/
$candidateBranch
'
,
],
stdout:
'
$previousVersion
-42-gabc123'
,
),
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision3
,
),
];
final
CommandRunner
<
void
>
runner
=
createRunner
(
commands:
<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'git'
,
'rev-parse'
,
'HEAD'
],
stdout:
revision
,
),
...
engineCommands
,
...
frameworkCommands
,
],
);
final
String
stateFilePath
=
fileSystem
.
path
.
join
(
platform
.
environment
[
'HOME'
]!,
kStateFileName
,
);
await
runner
.
run
(<
String
>[
'start'
,
'--
$kFrameworkMirrorOption
'
,
frameworkMirror
,
'--
$kEngineMirrorOption
'
,
engineMirror
,
'--
$kCandidateOption
'
,
candidateBranch
,
'--
$kReleaseOption
'
,
releaseChannel
,
'--
$kStateOption
'
,
stateFilePath
,
'--
$kDartRevisionOption
'
,
nextDartRevision
,
'--
$kIncrementOption
'
,
incrementLevel
,
]);
final
File
stateFile
=
fileSystem
.
file
(
stateFilePath
);
final
pb
.
ConductorState
state
=
pb
.
ConductorState
();
state
.
mergeFromProto3Json
(
jsonDecode
(
stateFile
.
readAsStringSync
()),
);
expect
(
processManager
.
hasRemainingExpectations
,
false
);
expect
(
state
.
isInitialized
(),
true
);
expect
(
state
.
releaseChannel
,
releaseChannel
);
expect
(
state
.
releaseVersion
,
nextVersion
);
expect
(
state
.
engine
.
candidateBranch
,
candidateBranch
);
expect
(
state
.
engine
.
startingGitHead
,
revision2
);
expect
(
state
.
engine
.
dartRevision
,
nextDartRevision
);
expect
(
state
.
framework
.
candidateBranch
,
candidateBranch
);
expect
(
state
.
framework
.
startingGitHead
,
revision3
);
expect
(
state
.
currentPhase
,
ReleasePhase
.
APPLY_ENGINE_CHERRYPICKS
);
expect
(
state
.
conductorVersion
,
revision
);
expect
(
state
.
incrementLevel
,
incrementLevel
);
});
},
onPlatform:
<
String
,
dynamic
>{
'windows'
:
const
Skip
(
'Flutter Conductor only supported on macos/linux'
),
});
...
...
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