fix(shorebird_cli): create patch request (#91)

This commit is contained in:
Felix Angelov
2023-03-17 17:12:44 -05:00
committed by GitHub
parent a18d37b186
commit 3eff8bac9f
6 changed files with 10 additions and 10 deletions
@@ -76,7 +76,7 @@ class PublishCommand extends ShorebirdCommand with ShorebirdConfigMixin {
final version = pubspecYaml.version!;
await codePushClient.createPatch(
artifactPath: artifact.path,
baseVersion: '${version.major}.${version.minor}.${version.patch}',
releaseVersion: '${version.major}.${version.minor}.${version.patch}',
appId: shorebirdYaml.appId,
channel: 'stable',
);
@@ -76,7 +76,7 @@ flutter:
when(() => logger.progress(any())).thenReturn(_MockProgress());
when(
() => codePushClient.createPatch(
baseVersion: any(named: 'baseVersion'),
releaseVersion: any(named: 'releaseVersion'),
artifactPath: any(named: 'artifactPath'),
channel: any(named: 'channel'),
appId: any(named: 'appId'),
@@ -156,7 +156,7 @@ flutter:
const error = 'something went wrong';
when(
() => codePushClient.createPatch(
baseVersion: any(named: 'baseVersion'),
releaseVersion: any(named: 'releaseVersion'),
artifactPath: any(named: 'artifactPath'),
channel: any(named: 'channel'),
appId: any(named: 'appId'),
@@ -184,7 +184,7 @@ flutter:
verify(() => logger.success('Successfully deployed.')).called(1);
verify(
() => codePushClient.createPatch(
baseVersion: version,
releaseVersion: version,
appId: appId,
artifactPath: artifact.path,
channel: 'stable',
@@ -34,7 +34,7 @@ Future<void> main() async {
// Create a new patch.
await client.createPatch(
artifactPath: '<PATH TO ARTIFACT>', // e.g. 'libapp.so'
baseVersion: '<BASE VERSION>', // e.g. '1.0.0'
releaseVersion: '<RELEASE VERSION>', // e.g. '1.0.0'
appId: '<APP ID>', // e.g. 'shorebird-example'
channel: '<CHANNEL>', // e.g. 'stable'
);
@@ -17,7 +17,7 @@ Future<void> main() async {
// Create a new patch.
await client.createPatch(
artifactPath: '<PATH TO ARTIFACT>', // e.g. 'libapp.so'
baseVersion: '<BASE VERSION>', // e.g. '1.0.0'
releaseVersion: '<RELEASE VERSION>', // e.g. '1.0.0'
appId: '<APP ID>', // e.g. 'shorebird-example'
channel: '<CHANNEL>', // e.g. 'stable'
);
@@ -42,7 +42,7 @@ class CodePushClient {
/// Create a new patch.
Future<void> createPatch({
required String baseVersion,
required String releaseVersion,
required String appId,
required String channel,
required String artifactPath,
@@ -54,7 +54,7 @@ class CodePushClient {
final file = await http.MultipartFile.fromPath('file', artifactPath);
request.files.add(file);
request.fields.addAll({
'base_version': baseVersion,
'release_version': releaseVersion,
'app_id': appId,
'channel': channel,
});
@@ -95,7 +95,7 @@ void main() {
expect(
codePushClient.createPatch(
artifactPath: fixture.path,
baseVersion: '1.0.0',
releaseVersion: '1.0.0',
appId: 'shorebird-example',
channel: 'stable',
),
@@ -116,7 +116,7 @@ void main() {
await codePushClient.createPatch(
artifactPath: fixture.path,
baseVersion: '1.0.0',
releaseVersion: '1.0.0',
appId: 'shorebird-example',
channel: 'stable',
);