Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(sturdy): Update to version 0.5.0 #52

Merged
merged 9 commits into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -2,9 +2,12 @@ name: CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

env:
DART_VERSION: 3.5.0

jobs:
build:
@@ -14,10 +17,10 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.2
- uses: dart-lang/setup-dart@65c82982aa686933bf10d50aced7a27b2b63f2a6 #v1.6.3
with:
sdk: 3.0.7
sdk: ${{ env.DART_VERSION }}
- name: Install dependencies
run: dart pub global activate melos 2.3.1 && melos bs

- name: Run build_runner
run: melos exec --depends-on="build_runner" --fail-fast -- "dart run build_runner build --delete-conflicting-outputs"

@@ -39,7 +42,7 @@ jobs:

- name: Run tests and generate coverage report
run: melos exec --fail-fast -- "../../tool/generate_code_coverage.sh"

- name: Upload test_track code coverage
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed #v4.3.0
with:
@@ -53,16 +56,16 @@ jobs:
working-directory: packages/test_track_test_support

pana:
runs-on: ubuntu-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.2
- uses: dart-lang/setup-dart@65c82982aa686933bf10d50aced7a27b2b63f2a6 #v1.6.3
with:
sdk: 3.0.7
- name: Install dependencies
run: |
dart pub global activate melos 2.3.1 && melos bs
dart pub global activate pana
- name: Verify pub score
run: melos exec -- "../../tool/verify_pub_score.sh 110"
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.2
- uses: dart-lang/setup-dart@65c82982aa686933bf10d50aced7a27b2b63f2a6 #v1.6.3
with:
sdk: ${{ env.DART_VERSION }}
- name: Install dependencies
run: |
dart pub global activate melos 2.3.1 && melos bs
dart pub global activate pana
- name: Verify pub score
run: melos exec -- "../../tool/verify_pub_score.sh"
8 changes: 3 additions & 5 deletions packages/test_track/lib/src/domain/get_visitor_config.dart
Original file line number Diff line number Diff line change
@@ -40,11 +40,9 @@ class GetVisitorConfig {
'${appVersionBuild.version}/builds/'
'${appVersionBuild.buildTimestamp}/visitors/$visitorId/config',
),
onResponse: (r) {
return r.maybeWhen(
ok: (json) => AppVisitorConfig.fromJson(json),
orElse: () => throw Exception(r.toString()),
);
onResponse: (r) => switch (r) {
OkResponse(:final response) => AppVisitorConfig.fromJson(response),
_ => throw Exception(r.toString()),
},
);

Original file line number Diff line number Diff line change
@@ -30,11 +30,9 @@ class OverrideAssignments {
'assignments': assignmentOverrides.map((a) => a.toJson()).toList(),
}),
),
onResponse: (r) {
return r.maybeWhen(
okNoContent: () => null,
orElse: () => throw Exception('Failed to override assignments: $r'),
);
onResponse: (r) => switch (r) {
OkNoContent() => null,
_ => throw Exception('Failed to override assignments: $r'),
},
);

Original file line number Diff line number Diff line change
@@ -35,12 +35,10 @@ class ReportAssignmentEvent {
},
),
),
onResponse: (r) {
return r.maybeWhen(
okNoContent: () => null,
orElse: () => _logger.error(
'Unable to report assignment event: $assignmentEvent with error: $r'),
);
onResponse: (r) => switch (r) {
OkNoContent() => null,
_ => _logger.error(
'Unable to report assignment event: $assignmentEvent with error: $r'),
},
);
}
10 changes: 3 additions & 7 deletions packages/test_track/lib/src/domain/test_track_login.dart
Original file line number Diff line number Diff line change
@@ -54,13 +54,9 @@ class Login {
},
),
),
onResponse: (r) {
return r.maybeWhen(
ok: (json) => AppVisitorConfig.fromJson(json),
orElse: () => throw TestTrackLoginFailureException(
message: r.toString(),
),
);
onResponse: (r) => switch (r) {
OkResponse(:final response) => AppVisitorConfig.fromJson(response),
_ => throw TestTrackLoginFailureException(message: r.toString()),
},
);

Original file line number Diff line number Diff line change
@@ -24,8 +24,12 @@ mixin _$AppVersionBuild {
String get version => throw _privateConstructorUsedError;
String get buildTimestamp => throw _privateConstructorUsedError;

/// Serializes this AppVersionBuild to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)

/// Create a copy of AppVersionBuild
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$AppVersionBuildCopyWith<AppVersionBuild> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -49,6 +53,8 @@ class _$AppVersionBuildCopyWithImpl<$Res, $Val extends AppVersionBuild>
// ignore: unused_field
final $Res Function($Val) _then;

/// Create a copy of AppVersionBuild
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -92,6 +98,8 @@ class __$$AppVersionBuildImplCopyWithImpl<$Res>
_$AppVersionBuildImpl _value, $Res Function(_$AppVersionBuildImpl) _then)
: super(_value, _then);

/// Create a copy of AppVersionBuild
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -151,12 +159,14 @@ class _$AppVersionBuildImpl implements _AppVersionBuild {
other.buildTimestamp == buildTimestamp));
}

@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, appName, version, buildTimestamp);

@JsonKey(ignore: true)
/// Create a copy of AppVersionBuild
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$AppVersionBuildImplCopyWith<_$AppVersionBuildImpl> get copyWith =>
@@ -186,8 +196,11 @@ abstract class _AppVersionBuild implements AppVersionBuild {
String get version;
@override
String get buildTimestamp;

/// Create a copy of AppVersionBuild
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$AppVersionBuildImplCopyWith<_$AppVersionBuildImpl> get copyWith =>
throw _privateConstructorUsedError;
}
Original file line number Diff line number Diff line change
@@ -23,8 +23,12 @@ mixin _$AppVisitorConfig {
List<Split> get splits => throw _privateConstructorUsedError;
Visitor get visitor => throw _privateConstructorUsedError;

/// Serializes this AppVisitorConfig to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)

/// Create a copy of AppVisitorConfig
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$AppVisitorConfigCopyWith<AppVisitorConfig> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -50,6 +54,8 @@ class _$AppVisitorConfigCopyWithImpl<$Res, $Val extends AppVisitorConfig>
// ignore: unused_field
final $Res Function($Val) _then;

/// Create a copy of AppVisitorConfig
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -68,6 +74,8 @@ class _$AppVisitorConfigCopyWithImpl<$Res, $Val extends AppVisitorConfig>
) as $Val);
}

/// Create a copy of AppVisitorConfig
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$VisitorCopyWith<$Res> get visitor {
@@ -99,6 +107,8 @@ class __$$AppVisitorConfigImplCopyWithImpl<$Res>
$Res Function(_$AppVisitorConfigImpl) _then)
: super(_value, _then);

/// Create a copy of AppVisitorConfig
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -153,12 +163,14 @@ class _$AppVisitorConfigImpl implements _AppVisitorConfig {
(identical(other.visitor, visitor) || other.visitor == visitor));
}

@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType, const DeepCollectionEquality().hash(_splits), visitor);

@JsonKey(ignore: true)
/// Create a copy of AppVisitorConfig
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$AppVisitorConfigImplCopyWith<_$AppVisitorConfigImpl> get copyWith =>
@@ -185,8 +197,11 @@ abstract class _AppVisitorConfig implements AppVisitorConfig {
List<Split> get splits;
@override
Visitor get visitor;

/// Create a copy of AppVisitorConfig
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$AppVisitorConfigImplCopyWith<_$AppVisitorConfigImpl> get copyWith =>
throw _privateConstructorUsedError;
}
21 changes: 17 additions & 4 deletions packages/test_track/lib/src/models/assignment.freezed.dart
Original file line number Diff line number Diff line change
@@ -24,8 +24,12 @@ mixin _$Assignment {
String get variant => throw _privateConstructorUsedError;
String get context => throw _privateConstructorUsedError;

/// Serializes this Assignment to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)

/// Create a copy of Assignment
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$AssignmentCopyWith<Assignment> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -49,6 +53,8 @@ class _$AssignmentCopyWithImpl<$Res, $Val extends Assignment>
// ignore: unused_field
final $Res Function($Val) _then;

/// Create a copy of Assignment
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -92,6 +98,8 @@ class __$$AssignmentImplCopyWithImpl<$Res>
_$AssignmentImpl _value, $Res Function(_$AssignmentImpl) _then)
: super(_value, _then);

/// Create a copy of Assignment
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -149,11 +157,13 @@ class _$AssignmentImpl implements _Assignment {
(identical(other.context, context) || other.context == context));
}

@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, splitName, variant, context);

@JsonKey(ignore: true)
/// Create a copy of Assignment
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$AssignmentImplCopyWith<_$AssignmentImpl> get copyWith =>
@@ -182,8 +192,11 @@ abstract class _Assignment implements Assignment {
String get variant;
@override
String get context;

/// Create a copy of Assignment
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$AssignmentImplCopyWith<_$AssignmentImpl> get copyWith =>
throw _privateConstructorUsedError;
}
Original file line number Diff line number Diff line change
@@ -24,8 +24,12 @@ mixin _$AssignmentEvent {
String get splitName => throw _privateConstructorUsedError;
String get context => throw _privateConstructorUsedError;

/// Serializes this AssignmentEvent to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)

/// Create a copy of AssignmentEvent
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$AssignmentEventCopyWith<AssignmentEvent> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -49,6 +53,8 @@ class _$AssignmentEventCopyWithImpl<$Res, $Val extends AssignmentEvent>
// ignore: unused_field
final $Res Function($Val) _then;

/// Create a copy of AssignmentEvent
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -92,6 +98,8 @@ class __$$AssignmentEventImplCopyWithImpl<$Res>
_$AssignmentEventImpl _value, $Res Function(_$AssignmentEventImpl) _then)
: super(_value, _then);

/// Create a copy of AssignmentEvent
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -151,11 +159,13 @@ class _$AssignmentEventImpl implements _AssignmentEvent {
(identical(other.context, context) || other.context == context));
}

@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, visitorId, splitName, context);

@JsonKey(ignore: true)
/// Create a copy of AssignmentEvent
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$AssignmentEventImplCopyWith<_$AssignmentEventImpl> get copyWith =>
@@ -185,8 +195,11 @@ abstract class _AssignmentEvent implements AssignmentEvent {
String get splitName;
@override
String get context;

/// Create a copy of AssignmentEvent
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false, includeToJson: false)
_$$AssignmentEventImplCopyWith<_$AssignmentEventImpl> get copyWith =>
throw _privateConstructorUsedError;
}
Loading
Loading