From ecbb69424f56ef0081a67c2d9f6914059b4beb08 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Tue, 9 May 2023 14:48:26 +0200 Subject: [PATCH 01/16] add changelog entry --- flutter/ios/sentry_flutter.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flutter/ios/sentry_flutter.podspec b/flutter/ios/sentry_flutter.podspec index 9a3c297073..898b17c275 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.5.0' + s.dependency 'Sentry/HybridSDK', '8.6.0' s.ios.dependency 'Flutter' s.osx.dependency 'FlutterMacOS' s.ios.deployment_target = '11.0' From a46a83866d8224c75f19b5b087bbc014c1423dfe Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Tue, 16 May 2023 11:47:05 +0200 Subject: [PATCH 02/16] set user in flutter plugin --- .../io/sentry/flutter/SentryFlutterPlugin.kt | 82 ++----------------- 1 file changed, 9 insertions(+), 73 deletions(-) diff --git a/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt b/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt index e869834171..da5663caf9 100644 --- a/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt +++ b/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt @@ -287,86 +287,22 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { } private fun setUser(user: Map?, result: Result) { - if (user == null) { + if (user != null) { + val options = HubAdapter.getInstance().options as SentryAndroidOptions + val userInstance = User.fromMap(user, options) + Sentry.setUser(userInstance) + } else { Sentry.setUser(null) - result.success("") - return } - - val userInstance = User() - val userData = mutableMapOf() - val unknown = mutableMapOf() - - (user["email"] as? String)?.let { userInstance.email = it } - (user["id"] as? String)?.let { userInstance.id = it } - (user["username"] as? String)?.let { userInstance.username = it } - (user["ip_address"] as? String)?.let { userInstance.ipAddress = it } - (user["segment"] as? String)?.let { userInstance.segment = it } - (user["name"] as? String)?.let { userInstance.name = it } - (user["geo"] as? Map)?.let { - val geo = Geo() - geo.city = it["city"] as? String - geo.countryCode = it["country_code"] as? String - geo.region = it["region"] as? String - userInstance.geo = geo - } - - (user["extras"] as? Map)?.let { extras -> - for ((key, value) in extras.entries) { - if (value != null) { - userData[key] = value.toString() - } - } - } - (user["data"] as? Map)?.let { data -> - for ((key, value) in data.entries) { - if (value != null) { - // data has precedence over extras - userData[key] = value.toString() - } - } - } - - if (userData.isNotEmpty()) { - userInstance.data = userData - } - if (unknown.isNotEmpty()) { - userInstance.unknown = unknown - } - - Sentry.setUser(userInstance) - result.success("") } private fun addBreadcrumb(breadcrumb: Map?, result: Result) { - if (breadcrumb == null) { - result.success("") - return + if (breadcrumb != null) { + val options = HubAdapter.getInstance().options as SentryAndroidOptions + val breadcrumbInstance = Breadcrumb.fromMap(breadcrumb, options) + Sentry.addBreadcrumb(breadcrumbInstance) } - val breadcrumbInstance = Breadcrumb() - - (breadcrumb["message"] as? String)?.let { breadcrumbInstance.message = it } - (breadcrumb["type"] as? String)?.let { breadcrumbInstance.type = it } - (breadcrumb["category"] as? String)?.let { breadcrumbInstance.category = it } - (breadcrumb["level"] as? String)?.let { - breadcrumbInstance.level = when (it) { - "fatal" -> SentryLevel.FATAL - "warning" -> SentryLevel.WARNING - "info" -> SentryLevel.INFO - "debug" -> SentryLevel.DEBUG - "error" -> SentryLevel.ERROR - else -> SentryLevel.INFO - } - } - (breadcrumb["data"] as? Map)?.let { data -> - for ((key, value) in data.entries) { - breadcrumbInstance.data[key] = value - } - } - - Sentry.addBreadcrumb(breadcrumbInstance) - result.success("") } From d3a9087c66b9b4ca9f8eb919dc047770f3776db9 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Tue, 16 May 2023 11:54:26 +0200 Subject: [PATCH 03/16] use in swift plugin --- .../Classes/SentryFlutterPluginApple.swift | 84 +------------------ 1 file changed, 4 insertions(+), 80 deletions(-) diff --git a/flutter/ios/Classes/SentryFlutterPluginApple.swift b/flutter/ios/Classes/SentryFlutterPluginApple.swift index 0dd162e3f9..b2ba2ad6f4 100644 --- a/flutter/ios/Classes/SentryFlutterPluginApple.swift +++ b/flutter/ios/Classes/SentryFlutterPluginApple.swift @@ -569,44 +569,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { // swiftlint:disable:next cyclomatic_complexity private func setUser(user: [String: Any?]?, result: @escaping FlutterResult) { if let user = user { - let userInstance = User() - - if let email = user["email"] as? String { - userInstance.email = email - } - if let id = user["id"] as? String { - userInstance.userId = id - } - if let username = user["username"] as? String { - userInstance.username = username - } - if let ipAddress = user["ip_address"] as? String { - userInstance.ipAddress = ipAddress - } - if let segment = user["segment"] as? String { - userInstance.segment = segment - } - if let extras = user["extras"] as? [String: Any] { - userInstance.data = extras - } - if let data = user["data"] as? [String: Any] { - if let oldData = userInstance.data { - userInstance.data = oldData.reduce(into: data) { (first, second) in first[second.0] = second.1 } - } else { - userInstance.data = data - } - } - if let name = user["name"] as? String { - userInstance.name = name - } - if let geoData = user["geo"] as? [String: Any] { - let geo = Geo() - geo.city = geoData["city"] as? String - geo.countryCode = geoData["country_code"] as? String - geo.region = geoData["region"] as? String - userInstance.geo = geo - } - + let userInstance = PrivateSentrySDKOnly.user(with: user) SentrySDK.setUser(userInstance) } else { SentrySDK.setUser(nil) @@ -616,49 +579,10 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { // swiftlint:disable:next cyclomatic_complexity private func addBreadcrumb(breadcrumb: [String: Any?]?, result: @escaping FlutterResult) { - guard let breadcrumb = breadcrumb else { - result("") - return - } - - let breadcrumbInstance = Breadcrumb() - - if let message = breadcrumb["message"] as? String { - breadcrumbInstance.message = message + if let breadcrumb = breadcrumb { + let breadcrumbInstance = PrivateSentrySDKOnly.breadcrumb(with: breadcrumb) + SentrySDK.addBreadcrumb(breadcrumbInstance) } - if let type = breadcrumb["type"] as? String { - breadcrumbInstance.type = type - } - if let category = breadcrumb["category"] as? String { - breadcrumbInstance.category = category - } - if let level = breadcrumb["level"] as? String { - switch level { - case "fatal": - breadcrumbInstance.level = SentryLevel.fatal - case "warning": - breadcrumbInstance.level = SentryLevel.warning - case "info": - breadcrumbInstance.level = SentryLevel.info - case "debug": - breadcrumbInstance.level = SentryLevel.debug - case "error": - breadcrumbInstance.level = SentryLevel.error - default: - breadcrumbInstance.level = SentryLevel.error - } - } - if let data = breadcrumb["data"] as? [String: Any] { - breadcrumbInstance.data = data - } - - if let timestampValue = breadcrumb["timestamp"] as? String, - let timestamp = dateFrom(iso8601String: timestampValue) { - breadcrumbInstance.timestamp = timestamp - } - - SentrySDK.addBreadcrumb(breadcrumbInstance) - result("") } From 29452cffd257ce66c2acd78621f54fd7e7b8f4a1 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Tue, 16 May 2023 11:55:34 +0200 Subject: [PATCH 04/16] no need to cast --- .../src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt b/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt index da5663caf9..00819cc1ed 100644 --- a/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt +++ b/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt @@ -288,7 +288,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { private fun setUser(user: Map?, result: Result) { if (user != null) { - val options = HubAdapter.getInstance().options as SentryAndroidOptions + val options = HubAdapter.getInstance().options val userInstance = User.fromMap(user, options) Sentry.setUser(userInstance) } else { @@ -299,7 +299,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { private fun addBreadcrumb(breadcrumb: Map?, result: Result) { if (breadcrumb != null) { - val options = HubAdapter.getInstance().options as SentryAndroidOptions + val options = HubAdapter.getInstance().options val breadcrumbInstance = Breadcrumb.fromMap(breadcrumb, options) Sentry.addBreadcrumb(breadcrumbInstance) } From 2d5a8618a9fe83ca17a21321a967052303f19e97 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Tue, 16 May 2023 11:59:51 +0200 Subject: [PATCH 05/16] fix Superfluous Disable Command Violation --- flutter/ios/Classes/SentryFlutterPluginApple.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/flutter/ios/Classes/SentryFlutterPluginApple.swift b/flutter/ios/Classes/SentryFlutterPluginApple.swift index b2ba2ad6f4..0715d38da2 100644 --- a/flutter/ios/Classes/SentryFlutterPluginApple.swift +++ b/flutter/ios/Classes/SentryFlutterPluginApple.swift @@ -565,8 +565,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { result("") } } - - // swiftlint:disable:next cyclomatic_complexity + private func setUser(user: [String: Any?]?, result: @escaping FlutterResult) { if let user = user { let userInstance = PrivateSentrySDKOnly.user(with: user) @@ -577,7 +576,6 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { result("") } - // swiftlint:disable:next cyclomatic_complexity private func addBreadcrumb(breadcrumb: [String: Any?]?, result: @escaping FlutterResult) { if let breadcrumb = breadcrumb { let breadcrumbInstance = PrivateSentrySDKOnly.breadcrumb(with: breadcrumb) From 632e8fe8202f965e2fb1a031eb2c0d0f915ab345 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Tue, 16 May 2023 13:31:08 +0200 Subject: [PATCH 06/16] =?UTF-8?q?run=20swiftling=20=E2=80=94fix=20for=20Se?= =?UTF-8?q?ntryFlutterPluginApple.swift?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/analyze.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index ee77ad291e..b0f8356bc7 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -44,6 +44,9 @@ jobs: - run: dart fix --apply + - run: swiftlint --fix --path 'ios/Classes/SentryFlutterPluginApple.swift' + if: ${{ inputs.package == 'flutter' }} + # actions/checkout fetches only a single commit in a detached HEAD state. Therefore # we need to pass the current branch, otherwise we can't commit the changes. # GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs. From 22d15314362171372cfa8766eb4038eabeef2b7a Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Tue, 16 May 2023 13:40:35 +0200 Subject: [PATCH 07/16] add swiftlint to action --- .github/workflows/analyze.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index b0f8356bc7..56bd8f0783 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -37,6 +37,8 @@ jobs: if: ${{ inputs.sdk == 'dart' }} - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0 if: ${{ inputs.sdk == 'flutter' }} + - uses: norio-nomura/action-swiftlint@9f4dcd7 # pin@v3.2.1 + if: ${{ inputs.package == 'flutter' }} - run: ${{ inputs.sdk }} pub get From 692c9a1621ccb214133870f36a2be6c2cbd2cc6c Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Tue, 16 May 2023 14:08:13 +0200 Subject: [PATCH 08/16] fix commit sha --- .github/workflows/analyze.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 56bd8f0783..cbdceda39e 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -37,7 +37,7 @@ jobs: if: ${{ inputs.sdk == 'dart' }} - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0 if: ${{ inputs.sdk == 'flutter' }} - - uses: norio-nomura/action-swiftlint@9f4dcd7 # pin@v3.2.1 + - uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # pin@v3.2.1 if: ${{ inputs.package == 'flutter' }} - run: ${{ inputs.sdk }} pub get From d5fdd3d3201d7d84e1a8c8d27986d741047b2e88 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Tue, 16 May 2023 14:17:11 +0200 Subject: [PATCH 09/16] provide args to action --- .github/workflows/analyze.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index cbdceda39e..6a58e007ec 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -37,8 +37,6 @@ jobs: if: ${{ inputs.sdk == 'dart' }} - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0 if: ${{ inputs.sdk == 'flutter' }} - - uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # pin@v3.2.1 - if: ${{ inputs.package == 'flutter' }} - run: ${{ inputs.sdk }} pub get @@ -46,8 +44,11 @@ jobs: - run: dart fix --apply - - run: swiftlint --fix --path 'ios/Classes/SentryFlutterPluginApple.swift' + - name: swiftlint --fix + uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # pin@v3.2.1 if: ${{ inputs.package == 'flutter' }} + with: + args: --fix --path 'ios/Classes/SentryFlutterPluginApple.swift' # actions/checkout fetches only a single commit in a detached HEAD state. Therefore # we need to pass the current branch, otherwise we can't commit the changes. From cdf0dc138e81c71e6fb9097ebac214eb243023a8 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Tue, 16 May 2023 14:23:46 +0200 Subject: [PATCH 10/16] fix deprecated path param --- .github/workflows/analyze.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 6a58e007ec..13f30d6957 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -48,7 +48,7 @@ jobs: uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # pin@v3.2.1 if: ${{ inputs.package == 'flutter' }} with: - args: --fix --path 'ios/Classes/SentryFlutterPluginApple.swift' + args: --fix ios/Classes/SentryFlutterPluginApple.swift # actions/checkout fetches only a single commit in a detached HEAD state. Therefore # we need to pass the current branch, otherwise we can't commit the changes. From fe2a9fc483c304db9a62921404f9fc5bf14c4779 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Tue, 16 May 2023 14:24:18 +0200 Subject: [PATCH 11/16] run ls --- .github/workflows/analyze.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 13f30d6957..de44fe340c 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -44,6 +44,9 @@ jobs: - run: dart fix --apply + - name: ls + run: ls + - name: swiftlint --fix uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # pin@v3.2.1 if: ${{ inputs.package == 'flutter' }} From 0c8e87d67bb2482cfeee621ad16a2e58da835cc3 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Tue, 16 May 2023 14:29:35 +0200 Subject: [PATCH 12/16] only run swiftlint fix in analyze step --- .github/workflows/analyze.yml | 2 +- .github/workflows/flutter.yml | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index de44fe340c..59c0e158b6 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -51,7 +51,7 @@ jobs: uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # pin@v3.2.1 if: ${{ inputs.package == 'flutter' }} with: - args: --fix ios/Classes/SentryFlutterPluginApple.swift + args: --strict --fix # actions/checkout fetches only a single commit in a detached HEAD state. Therefore # we need to pass the current branch, otherwise we can't commit the changes. diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index e03cb7d394..d3e7d2355a 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -160,18 +160,6 @@ jobs: # https://github.com/CocoaPods/CocoaPods/issues/5275#issuecomment-315461879 - run: pod lib lint ios/sentry_flutter.podspec --configuration=Debug --skip-import-validation --allow-warnings - swift-lint: - runs-on: ubuntu-latest - timeout-minutes: 20 - defaults: - run: - working-directory: ./flutter - steps: - - uses: actions/checkout@v3 - - uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # pin@3.2.1 - with: - args: --strict - ktlint: runs-on: ubuntu-latest timeout-minutes: 20 From 199d52b283a5bfc36761adc491afeadfca7daa92 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Tue, 16 May 2023 14:31:36 +0200 Subject: [PATCH 13/16] remove ls step --- .github/workflows/analyze.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 59c0e158b6..8687fc752d 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -43,10 +43,7 @@ jobs: - run: dart format . - run: dart fix --apply - - - name: ls - run: ls - + - name: swiftlint --fix uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # pin@v3.2.1 if: ${{ inputs.package == 'flutter' }} From 69978641243b852eaa6efbc1bdceb046bfa0e15e Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Tue, 16 May 2023 14:40:47 +0200 Subject: [PATCH 14/16] introduce fixable issues --- .github/workflows/analyze.yml | 2 +- flutter/ios/Classes/SentryFlutterPluginApple.swift | 4 +++- flutter/lib/src/sentry_flutter_options.dart | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 8687fc752d..78c373c809 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -43,7 +43,7 @@ jobs: - run: dart format . - run: dart fix --apply - + - name: swiftlint --fix uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # pin@v3.2.1 if: ${{ inputs.package == 'flutter' }} diff --git a/flutter/ios/Classes/SentryFlutterPluginApple.swift b/flutter/ios/Classes/SentryFlutterPluginApple.swift index 0715d38da2..196edea2a2 100644 --- a/flutter/ios/Classes/SentryFlutterPluginApple.swift +++ b/flutter/ios/Classes/SentryFlutterPluginApple.swift @@ -565,7 +565,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { result("") } } - + private func setUser(user: [String: Any?]?, result: @escaping FlutterResult) { if let user = user { let userInstance = PrivateSentrySDKOnly.user(with: user) @@ -576,6 +576,8 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { result("") } + + private func addBreadcrumb(breadcrumb: [String: Any?]?, result: @escaping FlutterResult) { if let breadcrumb = breadcrumb { let breadcrumbInstance = PrivateSentrySDKOnly.breadcrumb(with: breadcrumb) diff --git a/flutter/lib/src/sentry_flutter_options.dart b/flutter/lib/src/sentry_flutter_options.dart index 2f5ccd96d1..f2b31cc891 100644 --- a/flutter/lib/src/sentry_flutter_options.dart +++ b/flutter/lib/src/sentry_flutter_options.dart @@ -38,7 +38,8 @@ class SentryFlutterOptions extends SentryOptions { /// /// Disabling this feature affects the [enableAutoSessionTracking] /// feature, as this is required to mark Sessions as Crashed. - bool enableNativeCrashHandling = true; + bool enableNativeCrashHandling = + true; Duration _autoSessionTrackingInterval = Duration(milliseconds: 30000); From b3c1faf96ec5e30091d68f80fe5b9ef325925188 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Tue, 16 May 2023 15:00:58 +0200 Subject: [PATCH 15/16] test banch name --- .github/workflows/analyze.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 78c373c809..9d0ab12127 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -53,8 +53,11 @@ jobs: # actions/checkout fetches only a single commit in a detached HEAD state. Therefore # we need to pass the current branch, otherwise we can't commit the changes. # GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs. - - run: ../scripts/commit-formatted-code.sh $GITHUB_HEAD_REF - if: env.GITHUB_HEAD_REF != null + - name: commit formatted code + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + run: echo $BRANCH_NAME # ../scripts/commit-formatted-code.sh $BRANCH_NAME + if: $BRANCH_NAME != null - name: dart analyze uses: invertase/github-action-dart-analyzer@cdd8652b05bf7ed08ffce30f425436780f869f13 # pin@v1 From 00385e1a4b7ef1c0838636916af3cbdce56d0d82 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Tue, 16 May 2023 16:24:46 +0200 Subject: [PATCH 16/16] revert ci changes --- .github/workflows/analyze.yml | 13 ++----------- .github/workflows/flutter.yml | 12 ++++++++++++ flutter/ios/Classes/SentryFlutterPluginApple.swift | 2 -- flutter/lib/src/sentry_flutter_options.dart | 3 +-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 9d0ab12127..ee77ad291e 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -44,20 +44,11 @@ jobs: - run: dart fix --apply - - name: swiftlint --fix - uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # pin@v3.2.1 - if: ${{ inputs.package == 'flutter' }} - with: - args: --strict --fix - # actions/checkout fetches only a single commit in a detached HEAD state. Therefore # we need to pass the current branch, otherwise we can't commit the changes. # GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs. - - name: commit formatted code - env: - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} - run: echo $BRANCH_NAME # ../scripts/commit-formatted-code.sh $BRANCH_NAME - if: $BRANCH_NAME != null + - run: ../scripts/commit-formatted-code.sh $GITHUB_HEAD_REF + if: env.GITHUB_HEAD_REF != null - name: dart analyze uses: invertase/github-action-dart-analyzer@cdd8652b05bf7ed08ffce30f425436780f869f13 # pin@v1 diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index d3e7d2355a..e03cb7d394 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -160,6 +160,18 @@ jobs: # https://github.com/CocoaPods/CocoaPods/issues/5275#issuecomment-315461879 - run: pod lib lint ios/sentry_flutter.podspec --configuration=Debug --skip-import-validation --allow-warnings + swift-lint: + runs-on: ubuntu-latest + timeout-minutes: 20 + defaults: + run: + working-directory: ./flutter + steps: + - uses: actions/checkout@v3 + - uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # pin@3.2.1 + with: + args: --strict + ktlint: runs-on: ubuntu-latest timeout-minutes: 20 diff --git a/flutter/ios/Classes/SentryFlutterPluginApple.swift b/flutter/ios/Classes/SentryFlutterPluginApple.swift index 196edea2a2..d5baa5fd0f 100644 --- a/flutter/ios/Classes/SentryFlutterPluginApple.swift +++ b/flutter/ios/Classes/SentryFlutterPluginApple.swift @@ -576,8 +576,6 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { result("") } - - private func addBreadcrumb(breadcrumb: [String: Any?]?, result: @escaping FlutterResult) { if let breadcrumb = breadcrumb { let breadcrumbInstance = PrivateSentrySDKOnly.breadcrumb(with: breadcrumb) diff --git a/flutter/lib/src/sentry_flutter_options.dart b/flutter/lib/src/sentry_flutter_options.dart index f2b31cc891..2f5ccd96d1 100644 --- a/flutter/lib/src/sentry_flutter_options.dart +++ b/flutter/lib/src/sentry_flutter_options.dart @@ -38,8 +38,7 @@ class SentryFlutterOptions extends SentryOptions { /// /// Disabling this feature affects the [enableAutoSessionTracking] /// feature, as this is required to mark Sessions as Crashed. - bool enableNativeCrashHandling = - true; + bool enableNativeCrashHandling = true; Duration _autoSessionTrackingInterval = Duration(milliseconds: 30000);