From f2188feda363ea07a0cdb18e0208e0a623d0eb3b Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Wed, 30 Nov 2022 09:12:39 +0100 Subject: [PATCH 01/11] Update deps --- .github/workflows/flutter.yml | 10 +++++----- dart/example/pubspec.yaml | 2 +- dart/example_web/pubspec.yaml | 4 ++-- dio/pubspec.yaml | 2 +- e2e_test/pubspec.yaml | 4 ++-- flutter/example/analysis_options.yaml | 2 +- flutter/example/pubspec.yaml | 6 +++--- min_version_test/pubspec.yaml | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index 3fe254734c..3e9e381393 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -99,11 +99,11 @@ jobs: flutter test --coverage --test-randomize-ordering-seed=random # remove comment after https://github.com/codecov/codecov-action/issues/600 - # - uses: codecov/codecov-action@v2 - # if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' - # with: - # name: sentry_flutter - # file: ./flutter/coverage/lcov.info + - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # pin@v3 + if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' + with: + name: sentry_flutter + file: ./flutter/coverage/lcov.info - uses: VeryGoodOpenSource/very_good_coverage@84e5b54ab888644554e5573dca87d7f76dec9fb3 # pin@v2.0.0 if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' diff --git a/dart/example/pubspec.yaml b/dart/example/pubspec.yaml index 3b8fd30f44..2e5348a269 100644 --- a/dart/example/pubspec.yaml +++ b/dart/example/pubspec.yaml @@ -12,4 +12,4 @@ dependencies: path: ../../dart dev_dependencies: - lints: ^1.0.1 + lints: ^2.0.0 diff --git a/dart/example_web/pubspec.yaml b/dart/example_web/pubspec.yaml index 3ab1d596ab..1788065332 100644 --- a/dart/example_web/pubspec.yaml +++ b/dart/example_web/pubspec.yaml @@ -11,7 +11,7 @@ dependencies: path: ../../dart dev_dependencies: - build_runner: ^2.1.7 + build_runner: ^2.1.8 build_web_compilers: ^3.2.2 - lints: ^1.0.1 + lints: ^2.0.0 webdev: ^2.7.6 diff --git a/dio/pubspec.yaml b/dio/pubspec.yaml index 319cff0bf7..409a12c38a 100644 --- a/dio/pubspec.yaml +++ b/dio/pubspec.yaml @@ -18,4 +18,4 @@ dev_dependencies: test: ^1.21.1 coverage: ^1.3.0 mockito: ^5.1.0 - http: ^0.13.4 + http: ^0.13.0 diff --git a/e2e_test/pubspec.yaml b/e2e_test/pubspec.yaml index f61847795a..806f641072 100644 --- a/e2e_test/pubspec.yaml +++ b/e2e_test/pubspec.yaml @@ -11,7 +11,7 @@ dependencies: sentry: path: ./../dart - http: ^0.13.3 + http: ^0.13.0 dev_dependencies: - lints: ^1.0.1 + lints: ^2.0.0 diff --git a/flutter/example/analysis_options.yaml b/flutter/example/analysis_options.yaml index 55e3702167..86b85ea02c 100644 --- a/flutter/example/analysis_options.yaml +++ b/flutter/example/analysis_options.yaml @@ -1,4 +1,4 @@ -include: package:pedantic/analysis_options.yaml +include: package:flutter_lints/flutter.yaml analyzer: errors: diff --git a/flutter/example/pubspec.yaml b/flutter/example/pubspec.yaml index 932b06af70..6d9d3a2fa0 100644 --- a/flutter/example/pubspec.yaml +++ b/flutter/example/pubspec.yaml @@ -15,15 +15,15 @@ dependencies: sentry_flutter: sentry_dio: sentry_logging: - universal_platform: ^1.0.0-nullsafety + universal_platform: ^1.0.0 feedback: ^2.0.0 provider: ^6.0.0 dio: ^4.0.0 - logging: ^1.0.2 + logging: ^1.0.0 package_info_plus: ^3.0.0 dev_dependencies: - pedantic: ^1.11.1 + flutter_lints: ^2.0.0 sentry_dart_plugin: ^1.0.0-beta.1 integration_test: sdk: flutter diff --git a/min_version_test/pubspec.yaml b/min_version_test/pubspec.yaml index f82985aa50..368deb46d7 100644 --- a/min_version_test/pubspec.yaml +++ b/min_version_test/pubspec.yaml @@ -35,7 +35,7 @@ dependencies: sentry_dio: sentry_logging: dio: ^4.0.0 - logging: ^1.0.2 + logging: ^1.0.0 dev_dependencies: flutter_test: From 8ab495fb53f66d091348bbd534c9d30ea9f93109 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Wed, 30 Nov 2022 11:58:13 +0100 Subject: [PATCH 02/11] fix --- dio/pubspec.yaml | 1 - dio/test/mocks/mock_http_client_adapter.dart | 10 +++- dio/test/sentry_dio_client_adapter_test.dart | 37 +++++++----- dio/test/tracing_client_adapter_test.dart | 4 -- .../integration_test/integration_test.dart | 10 ++-- flutter/example/lib/main.dart | 59 +++++++++++-------- flutter/example/lib/user_feedback_dialog.dart | 47 ++++++++------- 7 files changed, 93 insertions(+), 75 deletions(-) diff --git a/dio/pubspec.yaml b/dio/pubspec.yaml index 409a12c38a..050eb3d5c9 100644 --- a/dio/pubspec.yaml +++ b/dio/pubspec.yaml @@ -18,4 +18,3 @@ dev_dependencies: test: ^1.21.1 coverage: ^1.3.0 mockito: ^5.1.0 - http: ^0.13.0 diff --git a/dio/test/mocks/mock_http_client_adapter.dart b/dio/test/mocks/mock_http_client_adapter.dart index 95dedd10a8..8f55d6b9d1 100644 --- a/dio/test/mocks/mock_http_client_adapter.dart +++ b/dio/test/mocks/mock_http_client_adapter.dart @@ -10,11 +10,14 @@ typedef MockFetchMethod = Future Function( Future? cancelFuture, ); +typedef MockCloseMethod = void Function({bool force}); + class MockHttpClientAdapter extends HttpClientAdapter with NoSuchMethodProvider { - MockHttpClientAdapter(this.mockFetchMethod); + MockHttpClientAdapter(this.mockFetchMethod, {this.mockCloseMethod}); final MockFetchMethod mockFetchMethod; + final MockCloseMethod? mockCloseMethod; @override Future fetch( @@ -24,4 +27,9 @@ class MockHttpClientAdapter extends HttpClientAdapter ) { return mockFetchMethod(options, requestStream, cancelFuture); } + + @override + void close({bool force = false}) { + return mockCloseMethod?.call(force: force); + } } diff --git a/dio/test/sentry_dio_client_adapter_test.dart b/dio/test/sentry_dio_client_adapter_test.dart index d81620ee3b..5fe1f406b1 100644 --- a/dio/test/sentry_dio_client_adapter_test.dart +++ b/dio/test/sentry_dio_client_adapter_test.dart @@ -1,6 +1,4 @@ import 'package:dio/dio.dart'; -import 'package:http/http.dart'; -import 'package:mockito/mockito.dart'; import 'package:sentry/sentry.dart'; import 'package:sentry_dio/src/sentry_dio_client_adapter.dart'; import 'package:test/test.dart'; @@ -47,16 +45,10 @@ void main() { }); test('close does get called for user defined client', () async { - final mockHub = MockHub(); + final client = createCloseClient(); + final sut = fixture.getSut(client: client); - final mockClient = CloseableMockClient(); - - final client = SentryHttpClient(client: mockClient, hub: mockHub); - client.close(); - - expect(mockHub.addBreadcrumbCalls.length, 0); - expect(mockHub.captureExceptionCalls.length, 0); - verify(mockClient.close()); + sut.close(force: true); }); test('no captured span if tracing disabled', () async { @@ -96,7 +88,18 @@ MockHttpClientAdapter createThrowingClient() { ); } -class CloseableMockClient extends Mock implements BaseClient {} +void _close({bool force = false}) { + expect(force, true); +} + +MockHttpClientAdapter createCloseClient() { + return MockHttpClientAdapter( + (_, __, ___) async { + return ResponseBody.fromString('', 200); + }, + mockCloseMethod: _close, + ); +} class Fixture { Dio getSut({ @@ -121,10 +124,12 @@ class Fixture { final MockHub hub = MockHub(); MockHttpClientAdapter getClient({int statusCode = 200, String? reason}) { - return MockHttpClientAdapter((options, _, __) async { - expect(options.uri, requestUri); - return ResponseBody.fromString('', statusCode); - }); + return MockHttpClientAdapter( + (options, _, __) async { + expect(options.uri, requestUri); + return ResponseBody.fromString('', statusCode); + }, + ); } } diff --git a/dio/test/tracing_client_adapter_test.dart b/dio/test/tracing_client_adapter_test.dart index 4251786c8b..8db5efb4cd 100644 --- a/dio/test/tracing_client_adapter_test.dart +++ b/dio/test/tracing_client_adapter_test.dart @@ -2,8 +2,6 @@ // The lint above is okay, because we're using another Sentry package import 'package:dio/dio.dart'; -import 'package:http/http.dart'; -import 'package:mockito/mockito.dart'; import 'package:sentry/sentry.dart'; import 'package:sentry/src/sentry_tracer.dart'; import 'package:sentry_dio/src/tracing_client_adapter.dart'; @@ -153,8 +151,6 @@ MockHttpClientAdapter createThrowingClient() { ); } -class CloseableMockClient extends Mock implements BaseClient {} - class Fixture { final _options = SentryOptions(dsn: fakeDsn); late Hub _hub; diff --git a/flutter/example/integration_test/integration_test.dart b/flutter/example/integration_test/integration_test.dart index 9889eb5371..918e1bb600 100644 --- a/flutter/example/integration_test/integration_test.dart +++ b/flutter/example/integration_test/integration_test.dart @@ -13,7 +13,7 @@ void main() { await tester.pumpWidget(SentryScreenshotWidget( child: DefaultAssetBundle( bundle: SentryAssetBundle(enableStructuredDataTracing: true), - child: MyApp(), + child: const MyApp(), ))); await tester.pumpAndSettle(); }); @@ -34,20 +34,20 @@ void main() { final event = SentryEvent(); final sentryId = await Sentry.captureEvent(event); - expect(sentryId != SentryId.empty(), true); + expect(sentryId != const SentryId.empty(), true); }); testWidgets('setup sentry and capture exception', (tester) async { await setupSentryAndApp(tester); try { - throw SentryException( + throw const SentryException( type: 'StarError', value: 'I have a bad feeling about this...'); } catch (exception, stacktrace) { final sentryId = await Sentry.captureException(exception, stackTrace: stacktrace); - expect(sentryId != SentryId.empty(), true); + expect(sentryId != const SentryId.empty(), true); } }); @@ -56,7 +56,7 @@ void main() { final sentryId = await Sentry.captureMessage('hello world!'); - expect(sentryId != SentryId.empty(), true); + expect(sentryId != const SentryId.empty(), true); }); testWidgets('setup sentry and capture user feedback', (tester) async { diff --git a/flutter/example/lib/main.dart b/flutter/example/lib/main.dart index c60642d02d..f522066a42 100644 --- a/flutter/example/lib/main.dart +++ b/flutter/example/lib/main.dart @@ -1,3 +1,5 @@ +// ignore_for_file: library_private_types_in_public_api + import 'dart:async'; import 'dart:convert'; @@ -18,7 +20,7 @@ import 'package:sentry_logging/sentry_logging.dart'; const String _exampleDsn = 'https://e85b375ffb9f43cf8bdf9787768149e0@o447951.ingest.sentry.io/5428562'; -final _channel = const MethodChannel('example.flutter.sentry.io'); +const _channel = MethodChannel('example.flutter.sentry.io'); Future main() async { await setupSentry(() => runApp( @@ -26,7 +28,7 @@ Future main() async { child: SentryUserInteractionWidget( child: DefaultAssetBundle( bundle: SentryAssetBundle(enableStructuredDataTracing: true), - child: MyApp(), + child: const MyApp(), ), ), ), @@ -58,6 +60,8 @@ Future setupSentry(AppRunner appRunner) async { } class MyApp extends StatefulWidget { + const MyApp({Key? key}) : super(key: key); + @override _MyAppState createState() => _MyAppState(); } @@ -110,13 +114,13 @@ class MainScaffold extends StatelessWidget { onPressed: () { themeProvider.updatePrimatryColor(Colors.orange); }, - icon: Icon(Icons.circle, color: Colors.orange), + icon: const Icon(Icons.circle, color: Colors.orange), ), IconButton( onPressed: () { themeProvider.updatePrimatryColor(Colors.green); }, - icon: Icon(Icons.circle, color: Colors.lime), + icon: const Icon(Icons.circle, color: Colors.lime), ), ], ), @@ -130,7 +134,7 @@ class MainScaffold extends StatelessWidget { ), ElevatedButton( onPressed: () => tryCatch(), - key: Key('dart_try_catch'), + key: const Key('dart_try_catch'), child: const Text('Dart: try catch'), ), ElevatedButton( @@ -174,7 +178,7 @@ class MainScaffold extends StatelessWidget { ), ElevatedButton( onPressed: () => Future.delayed( - Duration(milliseconds: 100), + const Duration(milliseconds: 100), () => throw Exception('Throws in Future.delayed'), ), child: const Text('Throws in Future.delayed'), @@ -208,12 +212,13 @@ class MainScaffold extends StatelessWidget { child: const Text('Flutter: Load assets'), ), ElevatedButton( - key: Key('dio_web_request'), + key: const Key('dio_web_request'), onPressed: () async => await makeWebRequestWithDio(context), child: const Text('Dio: Web request'), ), ElevatedButton( onPressed: () { + // ignore: avoid_print print('A print breadcrumb'); Sentry.captureMessage('A message with a print() Breadcrumb'); }, @@ -242,7 +247,7 @@ class MainScaffold extends StatelessWidget { transaction.setTag('myTag', 'myValue'); transaction.setData('myExtra', 'myExtraValue'); - await Future.delayed(Duration(milliseconds: 50)); + await Future.delayed(const Duration(milliseconds: 50)); final span = transaction.startChild( 'childOfMyOp', @@ -251,29 +256,29 @@ class MainScaffold extends StatelessWidget { span.setTag('myNewTag', 'myNewValue'); span.setData('myNewData', 'myNewDataValue'); - await Future.delayed(Duration(milliseconds: 70)); + await Future.delayed(const Duration(milliseconds: 70)); - await span.finish(status: SpanStatus.resourceExhausted()); + await span.finish(status: const SpanStatus.resourceExhausted()); - await Future.delayed(Duration(milliseconds: 90)); + await Future.delayed(const Duration(milliseconds: 90)); final spanChild = span.startChild( 'childOfChildOfMyOp', description: 'childOfChildOfMyOp span', ); - await Future.delayed(Duration(milliseconds: 110)); + await Future.delayed(const Duration(milliseconds: 110)); spanChild.startChild( 'unfinishedChild', description: 'I wont finish', ); - await spanChild.finish(status: SpanStatus.internalError()); + await spanChild.finish(status: const SpanStatus.internalError()); - await Future.delayed(Duration(milliseconds: 50)); + await Future.delayed(const Duration(milliseconds: 50)); - await transaction.finish(status: SpanStatus.ok()); + await transaction.finish(status: const SpanStatus.ok()); }, child: const Text('Capture transaction'), ), @@ -282,7 +287,7 @@ class MainScaffold extends StatelessWidget { Sentry.captureMessage( 'This message has an attachment', withScope: (scope) { - final txt = 'Lorem Ipsum dolar sit amet'; + const txt = 'Lorem Ipsum dolar sit amet'; scope.addAttachment( SentryAttachment.fromIntList( utf8.encode(txt), @@ -474,6 +479,8 @@ int loop(int val) { } class SecondaryScaffold extends StatelessWidget { + const SecondaryScaffold({Key? key}) : super(key: key); + static Future openSecondaryScaffold(BuildContext context) { return Navigator.push( context, @@ -481,7 +488,7 @@ class SecondaryScaffold extends StatelessWidget { settings: const RouteSettings(name: 'SecondaryScaffold', arguments: 'foobar'), builder: (context) { - return SecondaryScaffold(); + return const SecondaryScaffold(); }, ), ); @@ -537,12 +544,12 @@ Future makeWebRequest(BuildContext context) async { // In case of an exception, let it get caught and reported to Sentry final response = await client.get(Uri.parse('https://flutter.dev/')); - await transaction.finish(status: SpanStatus.ok()); + await transaction.finish(status: const SpanStatus.ok()); await showDialog( context: context, // gets tracked if using SentryNavigatorObserver - routeSettings: RouteSettings( + routeSettings: const RouteSettings( name: 'flutter.dev dialog', ), builder: (context) { @@ -584,10 +591,10 @@ Future makeWebRequestWithDio(BuildContext context) async { Response? response; try { response = await dio.get('https://flutter.dev/'); - span.status = SpanStatus.ok(); + span.status = const SpanStatus.ok(); } catch (exception, stackTrace) { span.throwable = exception; - span.status = SpanStatus.internalError(); + span.status = const SpanStatus.internalError(); await Sentry.captureException(exception, stackTrace: stackTrace); } finally { await span.finish(); @@ -596,7 +603,7 @@ Future makeWebRequestWithDio(BuildContext context) async { await showDialog( context: context, // gets tracked if using SentryNavigatorObserver - routeSettings: RouteSettings( + routeSettings: const RouteSettings( name: 'flutter.dev dialog', ), builder: (context) { @@ -628,12 +635,12 @@ Future showDialogWithTextAndImage(BuildContext context) async { await showDialog( context: context, // gets tracked if using SentryNavigatorObserver - routeSettings: RouteSettings( + routeSettings: const RouteSettings( name: 'AssetBundle dialog', ), builder: (context) { return AlertDialog( - title: Text('Asset Example'), + title: const Text('Asset Example'), content: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.min, @@ -646,13 +653,13 @@ Future showDialogWithTextAndImage(BuildContext context) async { actions: [ MaterialButton( onPressed: () => Navigator.pop(context), - child: Text('Close'), + child: const Text('Close'), ) ], ); }, ); - await transaction.finish(status: SpanStatus.ok()); + await transaction.finish(status: const SpanStatus.ok()); } class ThemeProvider extends ChangeNotifier { diff --git a/flutter/example/lib/user_feedback_dialog.dart b/flutter/example/lib/user_feedback_dialog.dart index 7fdc077c94..6eac0db7ba 100644 --- a/flutter/example/lib/user_feedback_dialog.dart +++ b/flutter/example/lib/user_feedback_dialog.dart @@ -1,3 +1,5 @@ +// ignore_for_file: library_private_types_in_public_api + import 'package:flutter/material.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; @@ -34,7 +36,7 @@ class _UserFeedbackDialogState extends State { textAlign: TextAlign.center, style: Theme.of(context).textTheme.headline6, ), - SizedBox(height: 4), + const SizedBox(height: 4), Text( 'Our team has been notified. ' "If you'd like to help, tell us what happened below.", @@ -44,46 +46,46 @@ class _UserFeedbackDialogState extends State { .subtitle1 ?.copyWith(color: Colors.grey), ), - Divider(height: 24), + const Divider(height: 24), TextField( - key: ValueKey('sentry_name_textfield'), - decoration: InputDecoration( + key: const ValueKey('sentry_name_textfield'), + decoration: const InputDecoration( border: OutlineInputBorder(), hintText: 'Name', ), controller: nameController, keyboardType: TextInputType.text, ), - SizedBox(height: 8), + const SizedBox(height: 8), TextField( - key: ValueKey('sentry_email_textfield'), - decoration: InputDecoration( + key: const ValueKey('sentry_email_textfield'), + decoration: const InputDecoration( border: OutlineInputBorder(), hintText: 'E-Mail', ), controller: emailController, keyboardType: TextInputType.emailAddress, ), - SizedBox(height: 8), + const SizedBox(height: 8), TextField( - key: ValueKey('sentry_comment_textfield'), + key: const ValueKey('sentry_comment_textfield'), minLines: 5, maxLines: null, - decoration: InputDecoration( + decoration: const InputDecoration( border: OutlineInputBorder(), hintText: 'What happened?', ), controller: commentController, keyboardType: TextInputType.multiline, ), - SizedBox(height: 8), + const SizedBox(height: 8), const _PoweredBySentryMessage(), ], ), ), actions: [ ElevatedButton( - key: ValueKey('sentry_submit_feedback_button'), + key: const ValueKey('sentry_submit_feedback_button'), onPressed: () async { final feedback = SentryUserFeedback( eventId: widget.eventId, @@ -92,15 +94,16 @@ class _UserFeedbackDialogState extends State { name: nameController.text, ); await _submitUserFeedback(feedback); + // ignore: use_build_context_synchronously Navigator.pop(context); }, - child: Text('Submit Crash Report')), + child: const Text('Submit Crash Report')), TextButton( - key: ValueKey('sentry_close_button'), + key: const ValueKey('sentry_close_button'), onPressed: () { Navigator.pop(context); }, - child: Text('Close'), + child: const Text('Close'), ) ], ); @@ -123,8 +126,8 @@ class _PoweredBySentryMessage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, mainAxisSize: MainAxisSize.min, children: [ - Text('Crash reports powered by'), - SizedBox(width: 8), + const Text('Crash reports powered by'), + const SizedBox(width: 8), SizedBox( height: 30, child: _SentryLogo(), @@ -141,13 +144,13 @@ class _SentryLogo extends StatelessWidget { var color = Colors.white; final brightenss = Theme.of(context).brightness; if (brightenss == Brightness.light) { - color = Color(0xff362d59).withOpacity(1.0); + color = const Color(0xff362d59).withOpacity(1.0); } return FittedBox( fit: BoxFit.contain, child: CustomPaint( - size: Size(222, 66), + size: const Size(222, 66), painter: _SentryLogoCustomPainter(color), ), ); @@ -448,9 +451,9 @@ class _SentryLogoCustomPainter extends CustomPainter { size.height * 0.3378788); path_0.close(); - final paint_0_fill = Paint()..style = PaintingStyle.fill; - paint_0_fill.color = color; - canvas.drawPath(path_0, paint_0_fill); + final paint0Fill = Paint()..style = PaintingStyle.fill; + paint0Fill.color = color; + canvas.drawPath(path_0, paint0Fill); } @override From 583e0febded50cd5d8f7fee80ffe1f820a798ff8 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Wed, 30 Nov 2022 12:01:43 +0100 Subject: [PATCH 03/11] format fix --- flutter/example/lib/main.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flutter/example/lib/main.dart b/flutter/example/lib/main.dart index f522066a42..46665eadf2 100644 --- a/flutter/example/lib/main.dart +++ b/flutter/example/lib/main.dart @@ -274,7 +274,8 @@ class MainScaffold extends StatelessWidget { description: 'I wont finish', ); - await spanChild.finish(status: const SpanStatus.internalError()); + await spanChild.finish( + status: const SpanStatus.internalError()); await Future.delayed(const Duration(milliseconds: 50)); From 7348345f2170997278d1e007abe9e5259ad9f12d Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Wed, 30 Nov 2022 12:56:57 +0100 Subject: [PATCH 04/11] android --- .github/workflows/flutter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index 3e9e381393..90ce2e9323 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -100,7 +100,7 @@ jobs: # remove comment after https://github.com/codecov/codecov-action/issues/600 - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # pin@v3 - if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' + if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'android' with: name: sentry_flutter file: ./flutter/coverage/lcov.info From af3270136860e671c13a4b7068a6219e5fd8ce08 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Wed, 30 Nov 2022 13:45:21 +0100 Subject: [PATCH 05/11] disablw codecov --- .github/workflows/flutter.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index 90ce2e9323..d556a925af 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -99,11 +99,11 @@ jobs: flutter test --coverage --test-randomize-ordering-seed=random # remove comment after https://github.com/codecov/codecov-action/issues/600 - - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # pin@v3 - if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'android' - with: - name: sentry_flutter - file: ./flutter/coverage/lcov.info + # - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # pin@v3 + # if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' + # with: + # name: sentry_flutter + # file: ./flutter/coverage/lcov.info - uses: VeryGoodOpenSource/very_good_coverage@84e5b54ab888644554e5573dca87d7f76dec9fb3 # pin@v2.0.0 if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' From 9f7cbf0ea9cd4fa66e7cfb1c25f91e4bf4599269 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Wed, 30 Nov 2022 13:57:37 +0100 Subject: [PATCH 06/11] use codecov binary --- .github/workflows/flutter.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index d556a925af..096fe555ba 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -98,12 +98,13 @@ jobs: cd flutter flutter test --coverage --test-randomize-ordering-seed=random - # remove comment after https://github.com/codecov/codecov-action/issues/600 - # - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # pin@v3 - # if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' - # with: - # name: sentry_flutter - # file: ./flutter/coverage/lcov.info + # use codecov/codecov-action after this https://github.com/codecov/codecov-action/issues/600 + - name: Upload coverage to Codecov + if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' + run: | + curl --remote-name https://uploader.codecov.io/linux/latest/codecov + chmod +x codecov + ./codecov --file ./flutter/coverage/lcov.info - uses: VeryGoodOpenSource/very_good_coverage@84e5b54ab888644554e5573dca87d7f76dec9fb3 # pin@v2.0.0 if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' From f3de39e94e5096651cbfc74246a0e9a2a6977b5f Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Wed, 30 Nov 2022 14:33:33 +0100 Subject: [PATCH 07/11] fix --- .github/workflows/flutter.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index 096fe555ba..26c39cd6ed 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -9,6 +9,9 @@ on: - 'logging/**' - 'dio/**' +env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + jobs: cancel-previous-workflow: runs-on: ubuntu-latest @@ -102,9 +105,9 @@ jobs: - name: Upload coverage to Codecov if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' run: | - curl --remote-name https://uploader.codecov.io/linux/latest/codecov + curl -Os https://uploader.codecov.io/linux/latest/codecov chmod +x codecov - ./codecov --file ./flutter/coverage/lcov.info + ./codecov -t ${CODECOV_TOKEN} -n sentry_flutter -f ./flutter/coverage/lcov.info - uses: VeryGoodOpenSource/very_good_coverage@84e5b54ab888644554e5573dca87d7f76dec9fb3 # pin@v2.0.0 if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' From 9db15791db7d978c62b43578ffcd737da05d87f0 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Wed, 30 Nov 2022 15:01:46 +0100 Subject: [PATCH 08/11] fix --- .github/workflows/flutter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index 26c39cd6ed..18ca06f4e8 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -103,11 +103,11 @@ jobs: # use codecov/codecov-action after this https://github.com/codecov/codecov-action/issues/600 - name: Upload coverage to Codecov - if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' + if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' && env.CODECOV_TOKEN != null run: | curl -Os https://uploader.codecov.io/linux/latest/codecov chmod +x codecov - ./codecov -t ${CODECOV_TOKEN} -n sentry_flutter -f ./flutter/coverage/lcov.info + ./codecov -t env.CODECOV_TOKEN -n sentry_flutter -f ./flutter/coverage/lcov.info - uses: VeryGoodOpenSource/very_good_coverage@84e5b54ab888644554e5573dca87d7f76dec9fb3 # pin@v2.0.0 if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' From 4b676a9f3920da19d401dfea17c0b52793add798 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Wed, 30 Nov 2022 15:12:20 +0100 Subject: [PATCH 09/11] fix --- .github/workflows/flutter.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index 18ca06f4e8..b86dbc515e 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -9,9 +9,6 @@ on: - 'logging/**' - 'dio/**' -env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - jobs: cancel-previous-workflow: runs-on: ubuntu-latest @@ -103,9 +100,11 @@ jobs: # use codecov/codecov-action after this https://github.com/codecov/codecov-action/issues/600 - name: Upload coverage to Codecov + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' && env.CODECOV_TOKEN != null run: | - curl -Os https://uploader.codecov.io/linux/latest/codecov + curl -Os https://uploader.codecov.io/latest/linux/codecov chmod +x codecov ./codecov -t env.CODECOV_TOKEN -n sentry_flutter -f ./flutter/coverage/lcov.info From 6fa706a36d2f46c5955b107a51f9034183d39a8e Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Wed, 30 Nov 2022 16:46:21 +0100 Subject: [PATCH 10/11] fix --- .github/workflows/flutter.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index b86dbc515e..8267baf4f4 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -98,15 +98,13 @@ jobs: cd flutter flutter test --coverage --test-randomize-ordering-seed=random - # use codecov/codecov-action after this https://github.com/codecov/codecov-action/issues/600 - - name: Upload coverage to Codecov - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' && env.CODECOV_TOKEN != null - run: | - curl -Os https://uploader.codecov.io/latest/linux/codecov - chmod +x codecov - ./codecov -t env.CODECOV_TOKEN -n sentry_flutter -f ./flutter/coverage/lcov.info + # remove comment after https://github.com/codecov/codecov-action/issues/600 + # - uses: codecov/codecov-action@v2 + # if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' + # with: + # name: sentry_flutter + # file: ./flutter/coverage/lcov.info + # or - uses: VeryGoodOpenSource/very_good_coverage@84e5b54ab888644554e5573dca87d7f76dec9fb3 # pin@v2.0.0 if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux' From 9c4c844807b97fa33a2cccab5c7b4e136311e87f Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Wed, 30 Nov 2022 16:46:55 +0100 Subject: [PATCH 11/11] fix --- .github/workflows/flutter.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index 8267baf4f4..3fe254734c 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -104,7 +104,6 @@ jobs: # with: # name: sentry_flutter # file: ./flutter/coverage/lcov.info - # or - uses: VeryGoodOpenSource/very_good_coverage@84e5b54ab888644554e5573dca87d7f76dec9fb3 # pin@v2.0.0 if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux'