From 3eff8bac9f3a32f93fb9110aa4a5043f606a9253 Mon Sep 17 00:00:00 2001 From: Felix Angelov Date: Fri, 17 Mar 2023 17:12:44 -0500 Subject: [PATCH] fix(shorebird_cli): create patch request (#91) --- .../shorebird_cli/lib/src/commands/publish_command.dart | 2 +- .../test/src/commands/publish_command_test.dart | 6 +++--- packages/shorebird_code_push_client/README.md | 2 +- packages/shorebird_code_push_client/example/main.dart | 2 +- .../lib/src/code_push_client.dart | 4 ++-- .../test/src/code_push_client_test.dart | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/shorebird_cli/lib/src/commands/publish_command.dart b/packages/shorebird_cli/lib/src/commands/publish_command.dart index f7254a70..6c8c255a 100644 --- a/packages/shorebird_cli/lib/src/commands/publish_command.dart +++ b/packages/shorebird_cli/lib/src/commands/publish_command.dart @@ -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', ); diff --git a/packages/shorebird_cli/test/src/commands/publish_command_test.dart b/packages/shorebird_cli/test/src/commands/publish_command_test.dart index cc04531d..a7eb94fe 100644 --- a/packages/shorebird_cli/test/src/commands/publish_command_test.dart +++ b/packages/shorebird_cli/test/src/commands/publish_command_test.dart @@ -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', diff --git a/packages/shorebird_code_push_client/README.md b/packages/shorebird_code_push_client/README.md index 64121564..28928f4c 100644 --- a/packages/shorebird_code_push_client/README.md +++ b/packages/shorebird_code_push_client/README.md @@ -34,7 +34,7 @@ Future main() async { // Create a new patch. await client.createPatch( artifactPath: '', // e.g. 'libapp.so' - baseVersion: '', // e.g. '1.0.0' + releaseVersion: '', // e.g. '1.0.0' appId: '', // e.g. 'shorebird-example' channel: '', // e.g. 'stable' ); diff --git a/packages/shorebird_code_push_client/example/main.dart b/packages/shorebird_code_push_client/example/main.dart index ba9da696..6a54aaa3 100644 --- a/packages/shorebird_code_push_client/example/main.dart +++ b/packages/shorebird_code_push_client/example/main.dart @@ -17,7 +17,7 @@ Future main() async { // Create a new patch. await client.createPatch( artifactPath: '', // e.g. 'libapp.so' - baseVersion: '', // e.g. '1.0.0' + releaseVersion: '', // e.g. '1.0.0' appId: '', // e.g. 'shorebird-example' channel: '', // e.g. 'stable' ); diff --git a/packages/shorebird_code_push_client/lib/src/code_push_client.dart b/packages/shorebird_code_push_client/lib/src/code_push_client.dart index 81a9f707..bc66495e 100644 --- a/packages/shorebird_code_push_client/lib/src/code_push_client.dart +++ b/packages/shorebird_code_push_client/lib/src/code_push_client.dart @@ -42,7 +42,7 @@ class CodePushClient { /// Create a new patch. Future 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, }); diff --git a/packages/shorebird_code_push_client/test/src/code_push_client_test.dart b/packages/shorebird_code_push_client/test/src/code_push_client_test.dart index 103b3828..018890af 100644 --- a/packages/shorebird_code_push_client/test/src/code_push_client_test.dart +++ b/packages/shorebird_code_push_client/test/src/code_push_client_test.dart @@ -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', );