Skip to content

Commit

Permalink
chore: move command metadata classes (#2442)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanoltman authored Aug 23, 2024
1 parent a2a7014 commit d2daea2
Show file tree
Hide file tree
Showing 44 changed files with 180 additions and 188 deletions.
1 change: 1 addition & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ coverage:
# and enforce that all changes have 100% coverage of affected lines.
ignore:
- third_party
- lib/**.g.dart

flag_management:
default_rules: # the rules that will be followed for any flag added, generally
Expand Down
187 changes: 94 additions & 93 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,112 +3,113 @@ version: "0.2"
ignorePaths:
["coverage", "bin/cache", "third_party", "build", "*.xcscheme", "fixtures"]
words:
- pubspec
- podfile
- ANDROIDD
- Apks
- metadatas
- logcat
- mktemp
- gradlew
- bundletool
- genhtml
- sideload
- endtemplate
- mocktail
- libapp
- Azul
- Entra
- FLUSHALL
- LOCALAPPDATA
- NOAUTH
- Oltman
- PRNG
- RSAPKCS
- Retryable
- SIGSTOP
- USERPROFILE
- Unpatchable
- VCRUNTIME
- Verdana
- WRONGPASS
- aabs
- aapt
- aarch
- codesign
- xcarchive
- xcrun
- vmcode
- xcodebuild
- sideloadable
- bryanoltman
- signup
- lerping
- precache
- devicectl
- exitcode
- writeln
- xcodeproj
- xcschemes
- xcshareddata
- armeabi
- cipd
- canvaskit
- libimobiledevice
- hotreload
- libflutter
- aars # Android Archive
- allprojects # From gradle files
- altool
- apigee
- pointycastle
- pkcs
- appbundle
- felangel
- bitcode
- xcscheme
- archs
- shorebirdtech
- aapt
- USERPROFILE
- LOCALAPPDATA
- Unpatchable
- multioption
- xcframework
- deflavored
- dylib
- libplist
- usbmuxd
- pwsh
- readlink
- unawaited
- NOAUTH
- WRONGPASS
- FLUSHALL
- pana
- idevicesyslog
- Entra
- xlink
- propertylistserialization
- Retryable
- storyboardc
- iphoneos
- lproj
- iokit
- armeabi
- backboardd
- dyld
- bintools
- bitcode
- bryanoltman
- bundletool
- canvaskit
- carryforward
- cipd
- codesign
- codesigned
- codesigning
- previewable
- udid # Unique Device Identifier
- podspec
- deflavored
- devicectl
- dorny # From .github dir, doesn't show up in "**" check?
- dyld
- dylib
- endtemplate
- exitcode
- exportoptions
- ANDROIDD
- propertylistserialization
- VCRUNTIME
- Oltman
- xcworkspace
- SIGSTOP
- felangel
- genhtml
- gradlew
- hotreload
- idevicesyslog
- iokit
- iphoneos
- lerping
- libapp
- libflutter
- libimobiledevice
- libplist
- lldb
- logcat
- lproj
- metadatas
- mktemp
- mocktail
- multioption
- noaudio # From .github dir, doesn't show up in "**" check?
- nserror
- sysroot
- RSAPKCS
- PRNG
- sideloaded
- Azul
- altool
- aabs
- upvote
- Verdana
- reinit
- allprojects # From gradle files
- aars # Android Archive
- orri # Arm64 instruction, Or Register with Immediate
- unmockable
- dorny # From .github dir, doesn't show up in "**" check?
- pana
- pkcs
- podfile
- podspec
- pointycastle
- precache
- previewable
- propertylistserialization
- propertylistserialization
- pubspec
- pwsh
- reactivecircus # From .github dir, doesn't show up in "**" check?
- readlink
- reinit
- requirepass # From .github dir, doesn't show up in "**" check?
- temurin # From .github dir, doesn't show up in "**" check?
- shorebirdtech
- sideload
- sideloadable
- sideloaded
- signup
- storyboardc
- subosito # From .github dir, doesn't show up in "**" check?
- reactivecircus # From .github dir, doesn't show up in "**" check?
- swiftshader # From .github dir, doesn't show up in "**" check?
- noaudio # From .github dir, doesn't show up in "**" check?
- sysroot
- temurin # From .github dir, doesn't show up in "**" check?
- udid # Unique Device Identifier
- unawaited
- unmockable
- upvote
- usbmuxd
- vmcode
- writeln
- xcarchive
- xcframework
- xcodebuild
- xcodeproj
- xcrun
- xcscheme
- xcschemes
- xcshareddata
- xcworkspace
- xlink
10 changes: 5 additions & 5 deletions packages/shorebird_cli/lib/src/code_push_client_wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ Please create a release using "shorebird release" and try again.
required int releaseId,
required ReleasePlatform platform,
required ReleaseStatus status,
UpdateReleaseMetadata? metadata,
Json? metadata,
}) async {
final updateStatusProgress = logger.progress('Updating release status');
try {
Expand All @@ -298,7 +298,7 @@ Please create a release using "shorebird release" and try again.
releaseId: releaseId,
platform: platform,
status: status,
metadata: metadata?.toJson(),
metadata: metadata,
);
updateStatusProgress.complete();
} catch (error) {
Expand Down Expand Up @@ -693,14 +693,14 @@ aar artifact already exists, continuing...''',
Future<Patch> createPatch({
required String appId,
required int releaseId,
required CreatePatchMetadata metadata,
required Json metadata,
}) async {
final createPatchProgress = logger.progress('Creating patch');
try {
final patch = await codePushClient.createPatch(
appId: appId,
releaseId: releaseId,
metadata: metadata.toJson(),
metadata: metadata,
);
createPatchProgress.complete();
return patch;
Expand Down Expand Up @@ -758,7 +758,7 @@ aar artifact already exists, continuing...''',
Future<void> publishPatch({
required String appId,
required int releaseId,
required CreatePatchMetadata metadata,
required Json metadata,
required ReleasePlatform platform,
required DeploymentTrack track,
required Map<Arch, PatchArtifactBundle> patchArtifactBundles,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'package:shorebird_cli/src/executables/aot_tools.dart';
import 'package:shorebird_cli/src/executables/xcodebuild.dart';
import 'package:shorebird_cli/src/extensions/arg_results.dart';
import 'package:shorebird_cli/src/logger.dart';
import 'package:shorebird_cli/src/metadata/metadata.dart';
import 'package:shorebird_cli/src/patch_diff_checker.dart';
import 'package:shorebird_cli/src/platform/platform.dart';
import 'package:shorebird_cli/src/release_type.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import 'package:shorebird_cli/src/doctor.dart';
import 'package:shorebird_cli/src/executables/executables.dart';
import 'package:shorebird_cli/src/extensions/arg_results.dart';
import 'package:shorebird_cli/src/logger.dart';
import 'package:shorebird_cli/src/metadata/metadata.dart';
import 'package:shorebird_cli/src/patch_diff_checker.dart';
import 'package:shorebird_cli/src/platform/platform.dart';
import 'package:shorebird_cli/src/release_type.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'package:shorebird_cli/src/deployment_track.dart';
import 'package:shorebird_cli/src/extensions/arg_results.dart';
import 'package:shorebird_cli/src/formatters/formatters.dart';
import 'package:shorebird_cli/src/logger.dart';
import 'package:shorebird_cli/src/metadata/metadata.dart';
import 'package:shorebird_cli/src/patch_diff_checker.dart';
import 'package:shorebird_cli/src/platform.dart';
import 'package:shorebird_cli/src/platform/platform.dart';
Expand Down Expand Up @@ -315,11 +316,14 @@ NOTE: this is ${styleBold.wrap('not')} recommended. Asset changes cannot be incl
shorebirdVersion: packageVersion,
),
);
final updateMetadata = await patcher.updatedCreatePatchMetadata(
baseMetadata,
);

await codePushClientWrapper.publishPatch(
appId: appId,
releaseId: release.id,
metadata: await patcher.updatedCreatePatchMetadata(baseMetadata),
metadata: updateMetadata.toJson(),
platform: patcher.releaseType.releasePlatform,
track:
isStaging ? DeploymentTrack.staging : DeploymentTrack.production,
Expand Down
1 change: 1 addition & 0 deletions packages/shorebird_cli/lib/src/commands/patch/patcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:path/path.dart' as p;
import 'package:shorebird_cli/src/code_push_client_wrapper.dart';
import 'package:shorebird_cli/src/common_arguments.dart';
import 'package:shorebird_cli/src/extensions/iterable.dart';
import 'package:shorebird_cli/src/metadata/metadata.dart';
import 'package:shorebird_cli/src/patch_diff_checker.dart';
import 'package:shorebird_cli/src/platform/platform.dart';
import 'package:shorebird_cli/src/release_type.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:shorebird_cli/src/commands/release/releaser.dart';
import 'package:shorebird_cli/src/doctor.dart';
import 'package:shorebird_cli/src/extensions/arg_results.dart';
import 'package:shorebird_cli/src/logger.dart';
import 'package:shorebird_cli/src/metadata/metadata.dart';
import 'package:shorebird_cli/src/platform/platform.dart';
import 'package:shorebird_cli/src/release_type.dart';
import 'package:shorebird_cli/src/shorebird_android_artifacts.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:shorebird_cli/src/doctor.dart';
import 'package:shorebird_cli/src/executables/xcodebuild.dart';
import 'package:shorebird_cli/src/extensions/arg_results.dart';
import 'package:shorebird_cli/src/logger.dart';
import 'package:shorebird_cli/src/metadata/metadata.dart';
import 'package:shorebird_cli/src/release_type.dart';
import 'package:shorebird_cli/src/shorebird_env.dart';
import 'package:shorebird_cli/src/shorebird_flutter.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'package:shorebird_cli/src/doctor.dart';
import 'package:shorebird_cli/src/executables/xcodebuild.dart';
import 'package:shorebird_cli/src/extensions/arg_results.dart';
import 'package:shorebird_cli/src/logger.dart';
import 'package:shorebird_cli/src/metadata/metadata.dart';
import 'package:shorebird_cli/src/platform/ios.dart';
import 'package:shorebird_cli/src/release_type.dart';
import 'package:shorebird_cli/src/shorebird_documentation.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:shorebird_cli/src/config/config.dart';
import 'package:shorebird_cli/src/extensions/arg_results.dart';
import 'package:shorebird_cli/src/extensions/version.dart';
import 'package:shorebird_cli/src/logger.dart';
import 'package:shorebird_cli/src/metadata/metadata.dart';
import 'package:shorebird_cli/src/platform.dart';
import 'package:shorebird_cli/src/platform/platform.dart';
import 'package:shorebird_cli/src/release_type.dart';
Expand Down Expand Up @@ -488,13 +489,13 @@ ${summary.join('\n')}
shorebirdVersion: packageVersion,
),
);

final updatedMetadata = await releaser.updatedReleaseMetadata(baseMetadata);
await codePushClientWrapper.updateReleaseStatus(
appId: appId,
releaseId: release.id,
platform: releaser.releaseType.releasePlatform,
status: ReleaseStatus.active,
metadata: await releaser.updatedReleaseMetadata(baseMetadata),
metadata: updatedMetadata.toJson(),
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:io';

import 'package:args/args.dart';
import 'package:shorebird_cli/src/metadata/metadata.dart';
import 'package:shorebird_cli/src/release_type.dart';
import 'package:shorebird_cli/src/shorebird_env.dart';
import 'package:shorebird_code_push_client/shorebird_code_push_client.dart';
Expand Down
1 change: 0 additions & 1 deletion packages/shorebird_cli/lib/src/config/shorebird_yaml.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ part 'shorebird_yaml.g.dart';
@JsonSerializable(
anyMap: true,
disallowUnrecognizedKeys: true,
createToJson: false,
)
class ShorebirdYaml {
/// {@macro shorebird_yaml}
Expand Down
8 changes: 8 additions & 0 deletions packages/shorebird_cli/lib/src/config/shorebird_yaml.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:shorebird_code_push_protocol/src/models/models.dart';
import 'package:shorebird_cli/src/metadata/build_environment_metadata.dart';
import 'package:shorebird_code_push_protocol/shorebird_code_push_protocol.dart';

part 'create_patch_metadata.g.dart';

Expand Down
Loading

0 comments on commit d2daea2

Please sign in to comment.