Skip to content

Commit

Permalink
chore(deps): upgrade to Dart 3.7 (#2894)
Browse files Browse the repository at this point in the history
  • Loading branch information
felangel authored Feb 14, 2025
1 parent c89089d commit c1bdc82
Show file tree
Hide file tree
Showing 279 changed files with 12,164 additions and 13,926 deletions.
8 changes: 3 additions & 5 deletions packages/artifact_proxy/lib/src/artifact_manifest_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'package:quiver/collection.dart';
class ArtifactManifestClient {
/// {@macro artifact_manifest_client}
ArtifactManifestClient({http.Client? httpClient})
: _httpClient = httpClient ?? http.Client();
: _httpClient = httpClient ?? http.Client();

final http.Client _httpClient;

Expand All @@ -33,11 +33,9 @@ class ArtifactManifestClient {
);
final response = await _httpClient.get(url);
if (response.statusCode != HttpStatus.ok) {
throw Exception(
'''
throw Exception('''
Failed to fetch artifacts manifest for revision $revision.
${response.statusCode} ${response.reasonPhrase}''',
);
${response.statusCode} ${response.reasonPhrase}''');
}

return checkedYamlDecode(
Expand Down
7 changes: 4 additions & 3 deletions packages/artifact_proxy/lib/src/artifact_proxy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ String getFlutterArtifactLocation({
required String artifactPath,
String? engine,
}) {
final adjustedPath = engine != null
? artifactPath.replaceAll(r'$engine', engine)
: artifactPath;
final adjustedPath =
engine != null
? artifactPath.replaceAll(r'$engine', engine)
: artifactPath;

return 'https://storage.googleapis.com/$adjustedPath';
}
Expand Down
52 changes: 28 additions & 24 deletions packages/artifact_proxy/lib/src/models/artifacts_manifest.g.dart

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

2 changes: 1 addition & 1 deletion packages/artifact_proxy/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -599,4 +599,4 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.6.0 <4.0.0"
dart: ">=3.7.0 <4.0.0"
4 changes: 2 additions & 2 deletions packages/artifact_proxy/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repository: https://github.com/shorebirdtech/shorebird/
publish_to: "none"

environment:
sdk: ">=3.0.0 <4.0.0"
sdk: ">=3.7.0 <4.0.0"

dependencies:
checked_yaml: ^2.0.2
Expand All @@ -17,7 +17,7 @@ dependencies:
shelf_hotreload: ^1.5.0

dev_dependencies:
build_runner: ^2.4.13
build_runner: ^2.4.13
json_serializable: ^6.9.3
mocktail: ^1.0.4
test: ^1.25.15
Expand Down
17 changes: 5 additions & 12 deletions packages/artifact_proxy/test/artifact_proxy_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,17 @@ void main() {
verify(() => client.getManifest(shorebirdEngineRevision)).called(1);
});

test(
'should proxy to Flutter artifacts '
test('should proxy to Flutter artifacts '
'when no engine revision is detected', () async {
const path =
'flutter_infra_release/flutter/fonts/3012db47f3130e62f7cc0beabff968a33cbec8d8/fonts.zip';
final request = buildRequest(path);
final response = await handler(request);
expect(
response,
isRedirectTo('https://storage.googleapis.com/$path'),
);
expect(response, isRedirectTo('https://storage.googleapis.com/$path'));
verifyNever(() => client.getManifest(any()));
});

test(
'should proxy to Shorebird artifacts '
test('should proxy to Shorebird artifacts '
'when an engine revision is detected with an override', () async {
const path =
'flutter_infra_release/flutter/$shorebirdEngineRevision/android-x64-release/artifacts.zip';
Expand All @@ -93,8 +88,7 @@ void main() {
verify(() => client.getManifest(shorebirdEngineRevision)).called(1);
});

test(
'should proxy to Flutter artifacts '
test('should proxy to Flutter artifacts '
'when an engine revision is detected with no override', () async {
const path =
'flutter_infra_release/flutter/$shorebirdEngineRevision/windows-x64/font-subset.zip';
Expand All @@ -109,8 +103,7 @@ void main() {
verify(() => client.getManifest(shorebirdEngineRevision)).called(1);
});

test(
'should return 404 '
test('should return 404 '
'when pattern is not recognized', () async {
const path =
'flutter_infra_release/flutter/$shorebirdEngineRevision/unknown/artifacts.zip';
Expand Down
2 changes: 1 addition & 1 deletion packages/discord_gcp_alerts/lib/src/gcp_alert_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Handler gcpAlertHandler({required String webhookUrl, http.Client? client}) {
{'name': 'Resource', 'value': resource, 'inline': true},
{'name': 'Condition', 'value': conditionName, 'inline': true},
],
}
},
],
'attachments': const <dynamic>[],
};
Expand Down
59 changes: 29 additions & 30 deletions packages/discord_gcp_alerts/lib/src/models/gcp_alert.g.dart

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

2 changes: 1 addition & 1 deletion packages/discord_gcp_alerts/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -591,4 +591,4 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.6.0 <4.0.0"
dart: ">=3.7.0 <4.0.0"
2 changes: 1 addition & 1 deletion packages/discord_gcp_alerts/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 1.0.0
publish_to: none

environment:
sdk: '>=3.0.0 <4.0.0'
sdk: ">=3.7.0 <4.0.0"

dependencies:
http: ^1.3.0
Expand Down
98 changes: 48 additions & 50 deletions packages/discord_gcp_alerts/test/src/gcp_alert_handler_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,57 +33,55 @@ void main() {
Request(
'POST',
Uri.parse('http://localhost:8080/'),
body: json.encode(
{
'version': 'test',
'incident': {
'incident_id': '12345',
'scoping_project_id': '12345',
'scoping_project_number': 12345,
'url': 'http://www.example.com',
'started_at': 0,
'ended_at': 0,
'state': 'OPEN',
'summary': 'Test Incident',
'apigee_url': 'http://www.example.com',
'observed_value': '1.0',
'resource': {
'type': 'example_resource',
'labels': {'example': 'label'},
},
'resource_type_display_name': 'Example Resource Type',
'resource_id': '12345',
'resource_display_name': 'Example Resource',
'resource_name': 'projects/12345/example_resources/12345',
'metric': {
'type': 'test.googleapis.com/metric',
'displayName': 'Test Metric',
'labels': {'example': 'label'},
},
'metadata': {
'system_labels': {'example': 'label'},
'user_labels': {'example': 'label'},
},
'policy_name': 'projects/12345/alertPolicies/12345',
'policy_user_labels': {'example': 'label'},
'documentation': 'Test documentation',
'condition': {
'name': 'projects/12345/alertPolicies/12345/conditions/12345',
'displayName': 'Example condition',
'conditionThreshold': {
'filter':
'metric.type="test.googleapis.com/metric" resource.type="example_resource"',
'comparison': 'COMPARISON_GT',
'thresholdValue': 0.5,
'duration': '0s',
'trigger': {'count': 1},
},
body: json.encode({
'version': 'test',
'incident': {
'incident_id': '12345',
'scoping_project_id': '12345',
'scoping_project_number': 12345,
'url': 'http://www.example.com',
'started_at': 0,
'ended_at': 0,
'state': 'OPEN',
'summary': 'Test Incident',
'apigee_url': 'http://www.example.com',
'observed_value': '1.0',
'resource': {
'type': 'example_resource',
'labels': {'example': 'label'},
},
'resource_type_display_name': 'Example Resource Type',
'resource_id': '12345',
'resource_display_name': 'Example Resource',
'resource_name': 'projects/12345/example_resources/12345',
'metric': {
'type': 'test.googleapis.com/metric',
'displayName': 'Test Metric',
'labels': {'example': 'label'},
},
'metadata': {
'system_labels': {'example': 'label'},
'user_labels': {'example': 'label'},
},
'policy_name': 'projects/12345/alertPolicies/12345',
'policy_user_labels': {'example': 'label'},
'documentation': 'Test documentation',
'condition': {
'name': 'projects/12345/alertPolicies/12345/conditions/12345',
'displayName': 'Example condition',
'conditionThreshold': {
'filter':
'metric.type="test.googleapis.com/metric" resource.type="example_resource"',
'comparison': 'COMPARISON_GT',
'thresholdValue': 0.5,
'duration': '0s',
'trigger': {'count': 1},
},
'condition_name': 'Example condition',
'threshold_value': '0.5',
},
'condition_name': 'Example condition',
'threshold_value': '0.5',
},
),
}),
),
);

Expand All @@ -109,9 +107,9 @@ void main() {
'name': 'Condition',
'value': 'Example condition',
'inline': true,
}
},
],
}
},
],
'attachments': <dynamic>[],
}),
Expand Down
Loading

0 comments on commit c1bdc82

Please sign in to comment.