From 3407b67c4bf6df375423fe959c80e54e00de1a23 Mon Sep 17 00:00:00 2001 From: Sigve Hansen Date: Tue, 20 Aug 2024 09:54:35 +0200 Subject: [PATCH] feat(sentry): add dsym uploads --- Authentication/Package.swift | 4 +- .../Sources/Authentication/Userinfo.swift | 6 +-- .../BCC Media tvOS.xcodeproj/project.pbxproj | 34 ++++++------ BCC Media tvOS/BCC_Media_tvOSApp.swift | 3 +- .../xcshareddata/swiftpm/Package.resolved | 54 +++++++++++++++++++ Gemfile.lock | 16 ++++-- fastlane/Fastfile | 6 +++ fastlane/Pluginfile | 1 + 8 files changed, 96 insertions(+), 28 deletions(-) diff --git a/Authentication/Package.swift b/Authentication/Package.swift index 358eaa7..6630b7d 100644 --- a/Authentication/Package.swift +++ b/Authentication/Package.swift @@ -17,7 +17,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/auth0/Auth0.swift", from: "2.5.0"), - .package(url: "https://github.com/firebase/firebase-ios-sdk", from: "10.26.0") + .package(url: "https://github.com/getsentry/sentry-cocoa", from: "8.34.0") ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. @@ -26,7 +26,7 @@ let package = Package( name: "Authentication", dependencies: [ .product(name: "Auth0", package: "auth0.swift"), - .product(name: "FirebaseCrashlytics", package: "firebase-ios-sdk") + .product(name: "Sentry", package: "sentry-cocoa") ] ), .testTarget( diff --git a/Authentication/Sources/Authentication/Userinfo.swift b/Authentication/Sources/Authentication/Userinfo.swift index 4596073..61ea73f 100644 --- a/Authentication/Sources/Authentication/Userinfo.swift +++ b/Authentication/Sources/Authentication/Userinfo.swift @@ -1,6 +1,6 @@ import Auth0 -import FirebaseCrashlytics +import Sentry import Foundation public func getAgeGroup(_ age: Int?) -> String { @@ -91,8 +91,8 @@ public extension Provider { "original_error": error.localizedDescription, ] let customError = NSError(domain: "tv.brunstad.app", code: 9999, userInfo: customErrorInfo) - // Report the custom error to Crashlytics - Crashlytics.crashlytics().record(error: customError) + // Report the custom error to Sentry + SentrySDK.capture(error: customError) } return nil } diff --git a/BCC Media tvOS/BCC Media tvOS.xcodeproj/project.pbxproj b/BCC Media tvOS/BCC Media tvOS.xcodeproj/project.pbxproj index b5f1da9..e538000 100644 --- a/BCC Media tvOS/BCC Media tvOS.xcodeproj/project.pbxproj +++ b/BCC Media tvOS/BCC Media tvOS.xcodeproj/project.pbxproj @@ -69,10 +69,10 @@ 7E31D57B2BE13D6B00A3A7C5 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 7E31D57A2BE13D6B00A3A7C5 /* PrivacyInfo.xcprivacy */; }; 816CD9F82C2C38C600D536B4 /* Animation+CustomTimingFunctions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 816CD9F72C2C38C600D536B4 /* Animation+CustomTimingFunctions.swift */; }; 817A8CEA2C05BCDE00E48E23 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 817A8CE92C05BCDE00E48E23 /* GoogleService-Info.plist */; }; - 817A8CEC2C05BD6200E48E23 /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = 817A8CEB2C05BD6200E48E23 /* FirebaseCrashlytics */; }; 81F594BC2BC6EDC500A3BFC0 /* MainUITest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81F594BB2BC6EDC500A3BFC0 /* MainUITest.swift */; }; 81F828772BC7E6C500F1D35C /* InvisibleAVPlayerStatusIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81F828762BC7E6C500F1D35C /* InvisibleAVPlayerStatusIndicator.swift */; }; C141D2DD2C73412200C95EF8 /* Sentry in Frameworks */ = {isa = PBXBuildFile; productRef = C141D2DC2C73412200C95EF8 /* Sentry */; }; + C156BE062C74822A0005BCDA /* FirebaseFirestore in Frameworks */ = {isa = PBXBuildFile; productRef = C156BE052C74822A0005BCDA /* FirebaseFirestore */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -177,8 +177,8 @@ C141D2DD2C73412200C95EF8 /* Sentry in Frameworks */, 090559BF2B57FB600019FB9A /* Auth0 in Frameworks */, 090559AC2B57F9810019FB9A /* API in Frameworks */, - 817A8CEC2C05BD6200E48E23 /* FirebaseCrashlytics in Frameworks */, 09055A782B594E7F0019FB9A /* FeatureFlags in Frameworks */, + C156BE062C74822A0005BCDA /* FirebaseFirestore in Frameworks */, 09055A602B5807920019FB9A /* NpawPlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -396,8 +396,8 @@ 090559AB2B57F9810019FB9A /* API */, 09055A6A2B59247A0019FB9A /* FeatureFlags */, 09DDD6C62B6BB05000E56631 /* Rudder */, - 817A8CEB2C05BD6200E48E23 /* FirebaseCrashlytics */, C141D2DC2C73412200C95EF8 /* Sentry */, + C156BE052C74822A0005BCDA /* FirebaseFirestore */, ); productName = "BCC Media tvOS"; productReference = 090559992B57F22F0019FB9A /* BCC Media tvOS.app */; @@ -470,11 +470,11 @@ mainGroup = 090559902B57F22F0019FB9A; packageReferences = ( 090559B02B57FB560019FB9A /* XCRemoteSwiftPackageReference "apollo-ios" */, - 090559BD2B57FB600019FB9A /* XCRemoteSwiftPackageReference "Auth0.swift" */, + 090559BD2B57FB600019FB9A /* XCRemoteSwiftPackageReference "Auth0" */, 09055A5E2B5807920019FB9A /* XCRemoteSwiftPackageReference "plugin-ios" */, - 09055A702B594E6B0019FB9A /* XCLocalSwiftPackageReference "API" */, - 09055A732B594E740019FB9A /* XCLocalSwiftPackageReference "Authentication" */, - 09055A762B594E7F0019FB9A /* XCLocalSwiftPackageReference "FeatureFlags" */, + 09055A702B594E6B0019FB9A /* XCLocalSwiftPackageReference "../API" */, + 09055A732B594E740019FB9A /* XCLocalSwiftPackageReference "../Authentication" */, + 09055A762B594E7F0019FB9A /* XCLocalSwiftPackageReference "../FeatureFlags" */, 09DDD6C52B6BB05000E56631 /* XCRemoteSwiftPackageReference "rudder-sdk-ios" */, 817A8CE72C05BCA300E48E23 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */, 81480B342C3C0CCE0023D5B2 /* XCRemoteSwiftPackageReference "plugin-ios" */, @@ -888,15 +888,15 @@ /* End XCConfigurationList section */ /* Begin XCLocalSwiftPackageReference section */ - 09055A702B594E6B0019FB9A /* XCLocalSwiftPackageReference "API" */ = { + 09055A702B594E6B0019FB9A /* XCLocalSwiftPackageReference "../API" */ = { isa = XCLocalSwiftPackageReference; relativePath = ../API; }; - 09055A732B594E740019FB9A /* XCLocalSwiftPackageReference "Authentication" */ = { + 09055A732B594E740019FB9A /* XCLocalSwiftPackageReference "../Authentication" */ = { isa = XCLocalSwiftPackageReference; relativePath = ../Authentication; }; - 09055A762B594E7F0019FB9A /* XCLocalSwiftPackageReference "FeatureFlags" */ = { + 09055A762B594E7F0019FB9A /* XCLocalSwiftPackageReference "../FeatureFlags" */ = { isa = XCLocalSwiftPackageReference; relativePath = ../FeatureFlags; }; @@ -911,7 +911,7 @@ minimumVersion = 1.8.0; }; }; - 090559BD2B57FB600019FB9A /* XCRemoteSwiftPackageReference "Auth0.swift" */ = { + 090559BD2B57FB600019FB9A /* XCRemoteSwiftPackageReference "Auth0" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/auth0/Auth0.swift"; requirement = { @@ -973,7 +973,7 @@ }; 090559BE2B57FB600019FB9A /* Auth0 */ = { isa = XCSwiftPackageProductDependency; - package = 090559BD2B57FB600019FB9A /* XCRemoteSwiftPackageReference "Auth0.swift" */; + package = 090559BD2B57FB600019FB9A /* XCRemoteSwiftPackageReference "Auth0" */; productName = Auth0; }; 09055A5F2B5807920019FB9A /* NpawPlugin */ = { @@ -999,16 +999,16 @@ package = 09DDD6C52B6BB05000E56631 /* XCRemoteSwiftPackageReference "rudder-sdk-ios" */; productName = Rudder; }; - 817A8CEB2C05BD6200E48E23 /* FirebaseCrashlytics */ = { - isa = XCSwiftPackageProductDependency; - package = 817A8CE72C05BCA300E48E23 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; - productName = FirebaseCrashlytics; - }; C141D2DC2C73412200C95EF8 /* Sentry */ = { isa = XCSwiftPackageProductDependency; package = C163D4E42C733C4000B238C2 /* XCRemoteSwiftPackageReference "sentry-cocoa" */; productName = Sentry; }; + C156BE052C74822A0005BCDA /* FirebaseFirestore */ = { + isa = XCSwiftPackageProductDependency; + package = 817A8CE72C05BCA300E48E23 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = FirebaseFirestore; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 090559912B57F22F0019FB9A /* Project object */; diff --git a/BCC Media tvOS/BCC_Media_tvOSApp.swift b/BCC Media tvOS/BCC_Media_tvOSApp.swift index 474fd40..0e09c20 100644 --- a/BCC Media tvOS/BCC_Media_tvOSApp.swift +++ b/BCC Media tvOS/BCC_Media_tvOSApp.swift @@ -26,7 +26,8 @@ class AppDelegate: NSObject, UIApplicationDelegate { FirebaseApp.configure() SentrySDK.start{ options in - options.dsn = "https://3ffd6244935a49dab6913bdc148d8d41@o1045703.ingest.us.sentry.io/4504299662278656" + options.dsn = "https://905cd79d515c1c75c7bfc0dc5e2d83b4@o4507803294892032.ingest.de.sentry.io/4507803304394832" + options.tracesSampleRate = 0.5 } return true diff --git a/BCC Media.xcworkspace/xcshareddata/swiftpm/Package.resolved b/BCC Media.xcworkspace/xcshareddata/swiftpm/Package.resolved index cd48484..6fbd3ec 100644 --- a/BCC Media.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/BCC Media.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -36,6 +36,15 @@ "version" : "2.8.0" } }, + { + "identity" : "crash-reporter-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/rudderlabs/crash-reporter-ios", + "state" : { + "revision" : "ee563535b64d9d5feacd0fa243663b2658033a19", + "version" : "1.0.1" + } + }, { "identity" : "firebase-ios-sdk", "kind" : "remoteSourceControl", @@ -117,6 +126,15 @@ "version" : "1.22.5" } }, + { + "identity" : "metrics-reporter-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/rudderlabs/metrics-reporter-ios", + "state" : { + "revision" : "c5fe7cc861a83ec75978a516c02398c2a2cb1f20", + "version" : "1.2.1" + } + }, { "identity" : "nanopb", "kind" : "remoteSourceControl", @@ -126,6 +144,15 @@ "version" : "2.30910.0" } }, + { + "identity" : "plugin-ios", + "kind" : "remoteSourceControl", + "location" : "https://repo.plugin.npaw.com/release/plugin-ios.git", + "state" : { + "revision" : "2d4fe6eed38932645b63bceb23dad8c0cec88150", + "version" : "7.2.35" + } + }, { "identity" : "promises", "kind" : "remoteSourceControl", @@ -135,6 +162,33 @@ "version" : "2.4.0" } }, + { + "identity" : "rudder-ios-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/rudderlabs/rudder-ios-kit", + "state" : { + "revision" : "8a557a80cc1b0e0bc948c2b17fe0fd3809bcfd61", + "version" : "1.4.0" + } + }, + { + "identity" : "rudder-sdk-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/rudderlabs/rudder-sdk-ios", + "state" : { + "revision" : "27153f90086f3eb903ed7cea960d2074d1131ab1", + "version" : "1.28.0" + } + }, + { + "identity" : "sentry-cocoa", + "kind" : "remoteSourceControl", + "location" : "https://github.com/getsentry/sentry-cocoa.git", + "state" : { + "revision" : "d2ced2d961b34573ebd2ea0567a2f1408e90f0ae", + "version" : "8.34.0" + } + }, { "identity" : "simplekeychain", "kind" : "remoteSourceControl", diff --git a/Gemfile.lock b/Gemfile.lock index 1112b6c..399e93c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -32,7 +32,8 @@ GEM declarative (0.0.20) digest-crc (0.6.5) rake (>= 12.0.0, < 14.0.0) - domain_name (0.6.20240107) + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) dotenv (2.8.1) emoji_regex (3.2.3) excon (0.109.0) @@ -64,7 +65,7 @@ GEM faraday-retry (1.0.3) faraday_middleware (1.2.0) faraday (~> 1.0) - fastimage (2.3.0) + fastimage (2.3.1) fastlane (2.219.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) @@ -106,6 +107,8 @@ GEM xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) + fastlane-plugin-sentry (1.24.0) + os (~> 1.1, >= 1.1.4) fastlane-plugin-versioning (0.5.2) gh_inspector (1.1.3) google-apis-androidpublisher_v3 (0.54.0) @@ -130,11 +133,11 @@ GEM google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) google-cloud-errors (1.3.1) - google-cloud-storage (1.47.0) + google-cloud-storage (1.37.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.31.0) + google-apis-storage_v1 (~> 0.1) google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) @@ -145,7 +148,7 @@ GEM os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) highline (2.0.3) - http-cookie (1.0.5) + http-cookie (1.0.7) domain_name (~> 0.5) httpclient (2.8.3) jmespath (1.6.2) @@ -189,6 +192,7 @@ GEM tty-spinner (0.9.3) tty-cursor (~> 0.7) uber (0.1.0) + unf (0.2.0) unicode-display_width (2.5.0) word_wrap (1.0.0) xcodeproj (1.23.0) @@ -205,9 +209,11 @@ GEM PLATFORMS arm64-darwin-22 + arm64-darwin-23 DEPENDENCIES fastlane + fastlane-plugin-sentry fastlane-plugin-versioning BUNDLED WITH diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 3354c38..7a7a378 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -100,6 +100,12 @@ platform :ios do postfix: "+"+current_build_number, ) push_git_tags + sentry_debug_files_upload( + auth_token: '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', + org_slug: 'bcc-media-sti', + project_slug: 'bcc-media-platform', + include_sources: true + ) end end diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile index 87578f8..e9dc05e 100644 --- a/fastlane/Pluginfile +++ b/fastlane/Pluginfile @@ -3,3 +3,4 @@ # Ensure this file is checked in to source control! gem 'fastlane-plugin-versioning' +gem 'fastlane-plugin-sentry'