From f770c4cf27cf7af52784b27085d7efce09f70004 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 10:05:54 -0500 Subject: [PATCH 1/7] build(deps): bump actions/cache from 3 to 4 (#1833) Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Giancarlo Buenaflor --- .github/workflows/flutter_test.yml | 2 +- .github/workflows/metrics.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flutter_test.yml b/.github/workflows/flutter_test.yml index 33990219b3..9a5b583420 100644 --- a/.github/workflows/flutter_test.yml +++ b/.github/workflows/flutter_test.yml @@ -57,7 +57,7 @@ jobs: uses: gradle/gradle-build-action@v2 - name: AVD cache - uses: actions/cache@v3 + uses: actions/cache@v4 id: avd-cache with: path: | diff --git a/.github/workflows/metrics.yml b/.github/workflows/metrics.yml index c190889723..1e383a93ea 100644 --- a/.github/workflows/metrics.yml +++ b/.github/workflows/metrics.yml @@ -65,7 +65,7 @@ jobs: - run: ./metrics/prepare.sh - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: app-plain-cache with: path: ${{ matrix.appPlain }} From b4b36f589128e047dd1b1e97982328606e1d80e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 15:43:46 -0500 Subject: [PATCH 2/7] build(deps): bump dart-lang/setup-dart from 1.6.0 to 1.6.1 (#1817) Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.6.0 to 1.6.1. - [Release notes](https://github.com/dart-lang/setup-dart/releases) - [Changelog](https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md) - [Commits](https://github.com/dart-lang/setup-dart/compare/b64355ae6ca0b5d484f0106a033dd1388965d06d...ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b) --- updated-dependencies: - dependency-name: dart-lang/setup-dart dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Giancarlo Buenaflor --- .github/workflows/analyze.yml | 2 +- .github/workflows/dart.yml | 2 +- .github/workflows/diagrams.yml | 2 +- .github/workflows/dio.yml | 2 +- .github/workflows/e2e_dart.yml | 2 +- .github/workflows/file.yml | 2 +- .github/workflows/flutter-symbols.yml | 4 ++-- .github/workflows/format-and-fix.yml | 2 +- .github/workflows/hive.yml | 2 +- .github/workflows/logging.yml | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 6218eaa27a..bde8004cec 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -32,7 +32,7 @@ jobs: working-directory: ${{ inputs.package }} steps: - uses: actions/checkout@v4 - - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d # pin@v1 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 if: ${{ inputs.sdk == 'dart' }} - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 # pin@v2.12.0 if: ${{ inputs.sdk == 'flutter' }} diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 2eedf96de9..b68c1426ee 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -40,7 +40,7 @@ jobs: - os: macos-latest sdk: beta steps: - - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d # pin@v1 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 with: sdk: ${{ matrix.sdk }} - uses: actions/checkout@v4 diff --git a/.github/workflows/diagrams.yml b/.github/workflows/diagrams.yml index a534112e8b..8b8cee500e 100644 --- a/.github/workflows/diagrams.yml +++ b/.github/workflows/diagrams.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest name: "Create class diagrams of all packages" steps: - - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d # pin@v1 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 with: sdk: stable diff --git a/.github/workflows/dio.yml b/.github/workflows/dio.yml index c85ab43a1a..8f9fa41dc5 100644 --- a/.github/workflows/dio.yml +++ b/.github/workflows/dio.yml @@ -40,7 +40,7 @@ jobs: - os: macos-latest sdk: beta steps: - - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d # pin@v1 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 with: sdk: ${{ matrix.sdk }} - uses: actions/checkout@v4 diff --git a/.github/workflows/e2e_dart.yml b/.github/workflows/e2e_dart.yml index 2d66eaf9e2..8a6953a0aa 100644 --- a/.github/workflows/e2e_dart.yml +++ b/.github/workflows/e2e_dart.yml @@ -37,7 +37,7 @@ jobs: matrix: sdk: [stable, beta] steps: - - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d # pin@v1 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 with: sdk: ${{ matrix.sdk }} - uses: actions/checkout@v4 diff --git a/.github/workflows/file.yml b/.github/workflows/file.yml index 322c24b22e..3d1431f63b 100644 --- a/.github/workflows/file.yml +++ b/.github/workflows/file.yml @@ -41,7 +41,7 @@ jobs: - os: macos-latest sdk: beta steps: - - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d # pin@v1 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 with: sdk: ${{ matrix.sdk }} - uses: actions/checkout@v4 diff --git a/.github/workflows/flutter-symbols.yml b/.github/workflows/flutter-symbols.yml index cf4af7c71c..4462ccccc8 100644 --- a/.github/workflows/flutter-symbols.yml +++ b/.github/workflows/flutter-symbols.yml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d # pin@v1 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 - run: dart pub get @@ -33,7 +33,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d # pin@v1 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 - run: dart pub get diff --git a/.github/workflows/format-and-fix.yml b/.github/workflows/format-and-fix.yml index 89fc66cede..f7d0ec9cfb 100644 --- a/.github/workflows/format-and-fix.yml +++ b/.github/workflows/format-and-fix.yml @@ -30,7 +30,7 @@ jobs: working-directory: ${{ matrix.package.name }} steps: - uses: actions/checkout@v4 - - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d # pin@v1 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 if: ${{ matrix.package.sdk == 'dart' }} - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 # pin@v2.12.0 if: ${{ matrix.package.sdk == 'flutter' }} diff --git a/.github/workflows/hive.yml b/.github/workflows/hive.yml index 1ff1a8483e..15bef1ecdb 100644 --- a/.github/workflows/hive.yml +++ b/.github/workflows/hive.yml @@ -40,7 +40,7 @@ jobs: - os: macos-latest sdk: beta steps: - - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d # pin@v1 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 with: sdk: ${{ matrix.sdk }} - uses: actions/checkout@v4 diff --git a/.github/workflows/logging.yml b/.github/workflows/logging.yml index d6af6538bd..4e39833caa 100644 --- a/.github/workflows/logging.yml +++ b/.github/workflows/logging.yml @@ -40,7 +40,7 @@ jobs: - os: macos-latest sdk: beta steps: - - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d # pin@v1 + - uses: dart-lang/setup-dart@ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b # pin@v1 with: sdk: ${{ matrix.sdk }} - uses: actions/checkout@v4 From 4477d2eb1051cec2f698e56dcaba09b1f87e2227 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 15:44:04 -0500 Subject: [PATCH 3/7] chore(deps): update Flutter SDK (metrics) to v3.16.8 (#1825) * chore: update metrics/flutter.properties to 3.16.8 * update path --------- Co-authored-by: GitHub Co-authored-by: Giancarlo Buenaflor --- .github/workflows/flutter.yml | 1 + metrics/flutter.properties | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index e21b884a01..8847114974 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -11,6 +11,7 @@ on: - "!**/class-diagram.svg" - "dart/**" - "flutter/**" + - "metrics/flutter.properties" jobs: cancel-previous-workflow: diff --git a/metrics/flutter.properties b/metrics/flutter.properties index d423be6b0c..8a0f53ceea 100644 --- a/metrics/flutter.properties +++ b/metrics/flutter.properties @@ -1,2 +1,2 @@ -version = 3.16.7 +version = 3.16.8 repo = https://github.com/flutter/flutter From 2f0d4155e6da1ce20cb783aa4a0638b5cf277ce5 Mon Sep 17 00:00:00 2001 From: Igor Khramtsov Date: Wed, 24 Jan 2024 18:31:44 +0400 Subject: [PATCH 4/7] feat: tracing without performance for dio (#1837) * feat: tracing without performance for dio * chore: update CHANGELOG.md --- CHANGELOG.md | 1 + dio/lib/src/tracing_client_adapter.dart | 31 +++++++++++++++---- dio/test/tracing_client_adapter_test.dart | 37 ++++++++++++++++++----- 3 files changed, 56 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc9e7352bd..c4509dcbf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Features +- Tracing without performance for Dio integration ([#1837](https://github.com/getsentry/sentry-dart/pull/1837)) - Accept `Map` in `Hint` class ([#1807](https://github.com/getsentry/sentry-dart/pull/1807)) - Please check if everything works as expected when using `Hint` - Factory constructor `Hint.withMap(Map map)` now takes `Map` instead of `Map` diff --git a/dio/lib/src/tracing_client_adapter.dart b/dio/lib/src/tracing_client_adapter.dart index 19a003b633..0c8def1442 100644 --- a/dio/lib/src/tracing_client_adapter.dart +++ b/dio/lib/src/tracing_client_adapter.dart @@ -51,12 +51,12 @@ class TracingClientAdapter implements HttpClientAdapter { ResponseBody? response; try { - if (span != null) { - if (containsTargetOrMatchesRegExp( - // ignore: invalid_use_of_internal_member - _hub.options.tracePropagationTargets, - options.uri.toString(), - )) { + if (containsTargetOrMatchesRegExp( + // ignore: invalid_use_of_internal_member + _hub.options.tracePropagationTargets, + options.uri.toString(), + )) { + if (span != null) { addSentryTraceHeaderFromSpan(span, options.headers); addBaggageHeaderFromSpan( span, @@ -64,6 +64,25 @@ class TracingClientAdapter implements HttpClientAdapter { // ignore: invalid_use_of_internal_member logger: _hub.options.logger, ); + } else { + // ignore: invalid_use_of_internal_member + final scope = _hub.scope; + // ignore: invalid_use_of_internal_member + final propagationContext = scope.propagationContext; + + final traceHeader = propagationContext.toSentryTrace(); + addSentryTraceHeader(traceHeader, options.headers); + + final baggage = propagationContext.baggage; + if (baggage != null) { + final baggageHeader = SentryBaggageHeader.fromBaggage(baggage); + addBaggageHeader( + baggageHeader, + options.headers, + // ignore: invalid_use_of_internal_member + logger: _hub.options.logger, + ); + } } } diff --git a/dio/test/tracing_client_adapter_test.dart b/dio/test/tracing_client_adapter_test.dart index b758c5a765..f67ec4c14d 100644 --- a/dio/test/tracing_client_adapter_test.dart +++ b/dio/test/tracing_client_adapter_test.dart @@ -127,25 +127,48 @@ void main() { ); }); - test('captured span do not add headers if NoOp', () async { + test('do not throw if no span bound to the scope', () async { + final sut = fixture.getSut( + client: fixture.getClient(statusCode: 200, reason: 'OK'), + ); + + await sut.get(requestOptions); + }); + + test('set headers from propagationContext when tracing is disabled', + () async { + fixture._options.enableTracing = false; final sut = fixture.getSut( client: fixture.getClient(statusCode: 200, reason: 'OK'), ); - await fixture._hub - .configureScope((scope) => scope.span = NoOpSentrySpan()); + + final propagationContext = fixture._hub.scope.propagationContext; + propagationContext.baggage = SentryBaggage({'foo': 'bar'}); final response = await sut.get(requestOptions); - expect(response.headers['baggage'], null); - expect(response.headers['sentry-trace'], null); + expect( + response.headers['sentry-trace'], + [propagationContext.toSentryTrace().value], + ); + expect(response.headers['baggage'], ['foo=bar']); }); - test('do not throw if no span bound to the scope', () async { + test('set headers from propagationContext when no transaction', () async { final sut = fixture.getSut( client: fixture.getClient(statusCode: 200, reason: 'OK'), ); - await sut.get(requestOptions); + final propagationContext = fixture._hub.scope.propagationContext; + propagationContext.baggage = SentryBaggage({'foo': 'bar'}); + + final response = await sut.get(requestOptions); + + expect( + response.headers['sentry-trace'], + [propagationContext.toSentryTrace().value], + ); + expect(response.headers['baggage'], ['foo=bar']); }); }); } From 920ec411c43151f7d10b9fc46ddfd5d348136599 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 24 Jan 2024 14:07:36 -0500 Subject: [PATCH 5/7] chore: reenable testing sentry-dart on windows (#1838) * enable windows again * test with chrome * test with chrome * reenable windows test --- .github/workflows/dart.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index b68c1426ee..6ce30080f8 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -31,8 +31,7 @@ jobs: strategy: fail-fast: false matrix: - # TODO: exclude windows for now, because of failing tests in the new image runner - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, windows-latest, macos-latest] sdk: [stable, beta] exclude: - os: windows-latest From 7e4a1ec92cb05cfd6226a72e9533240aaa97f180 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Wed, 24 Jan 2024 15:04:14 -0500 Subject: [PATCH 6/7] chore: add isar to craft (#1843) * add isar * Update Changelog --- .craft.yml | 1 + CHANGELOG.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.craft.yml b/.craft.yml index 45554efb25..ac5e86e3c7 100644 --- a/.craft.yml +++ b/.craft.yml @@ -13,6 +13,7 @@ targets: sqflite: hive: drift: + isar: - name: github - name: registry sdks: diff --git a/CHANGELOG.md b/CHANGELOG.md index c4509dcbf5..29749471f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Features +- APM for isar ([#1726](https://github.com/getsentry/sentry-dart/pull/1726)) - Tracing without performance for Dio integration ([#1837](https://github.com/getsentry/sentry-dart/pull/1837)) - Accept `Map` in `Hint` class ([#1807](https://github.com/getsentry/sentry-dart/pull/1807)) - Please check if everything works as expected when using `Hint` @@ -20,7 +21,6 @@ - Set `options.spotlight = Spotlight(enabled: true)` to enable Spotlight - Add `ConnectivityIntegration` for web ([#1765](https://github.com/getsentry/sentry-dart/pull/1765)) - We only get the info if online/offline on web platform. The added breadcrumb is set to either `wifi` or `none`. -- APM for isar ([#1726](https://github.com/getsentry/sentry-dart/pull/1726)) - Add isar breadcrumbs ([#1800](https://github.com/getsentry/sentry-dart/pull/1800)) - Starting with Flutter 3.16, Sentry adds the [`appFlavor`](https://api.flutter.dev/flutter/services/appFlavor-constant.html) to the `flutter_context` ([#1799](https://github.com/getsentry/sentry-dart/pull/1799)) - Add beforeScreenshotCallback to SentryFlutterOptions ([#1805](https://github.com/getsentry/sentry-dart/pull/1805)) From bd1b99021721963c751db2b5418473c5cea711f1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 25 Jan 2024 11:06:00 -0500 Subject: [PATCH 7/7] chore(deps): update Cocoa SDK to v8.19.0 (#1844) * chore: update flutter/scripts/update-cocoa.sh to 8.19.0 --------- Co-authored-by: GitHub Co-authored-by: GIancarlo Buenaflor --- CHANGELOG.md | 2 +- flutter/ios/sentry_flutter.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29749471f6..b92af634f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Features -- APM for isar ([#1726](https://github.com/getsentry/sentry-dart/pull/1726)) +- Performance monitoring support for isar ([#1726](https://github.com/getsentry/sentry-dart/pull/1726)) - Tracing without performance for Dio integration ([#1837](https://github.com/getsentry/sentry-dart/pull/1837)) - Accept `Map` in `Hint` class ([#1807](https://github.com/getsentry/sentry-dart/pull/1807)) - Please check if everything works as expected when using `Hint` diff --git a/flutter/ios/sentry_flutter.podspec b/flutter/ios/sentry_flutter.podspec index 1dc2c0fa06..03220ac7bf 100644 --- a/flutter/ios/sentry_flutter.podspec +++ b/flutter/ios/sentry_flutter.podspec @@ -12,7 +12,7 @@ Sentry SDK for Flutter with support to native through sentry-cocoa. :tag => s.version.to_s } s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' - s.dependency 'Sentry/HybridSDK', '8.18.0' + s.dependency 'Sentry/HybridSDK', '8.19.0' s.ios.dependency 'Flutter' s.osx.dependency 'FlutterMacOS' s.ios.deployment_target = '11.0'