Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Stop using Sentry #204

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/Prototype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ jobs:
KEYCHAIN_PATH: ${{ env.KEYCHAIN_PATH }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
PP_PATH: ${{ env.PP_PATH }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
export LANG=en_US.UTF-8;
export LANGUAGE=en_US:en;
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ jobs:
KEYCHAIN_PATH: ${{ env.KEYCHAIN_PATH }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
PP_PATH: ${{ env.PP_PATH }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
export LANG=en_US.UTF-8;
export LANGUAGE=en_US:en;
Expand Down Expand Up @@ -310,7 +309,6 @@ jobs:
KEYCHAIN_PATH: ${{ env.KEYCHAIN_PATH }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
PP_PATH: ${{ env.PP_PATH }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
export LANG=en_US.UTF-8;
export LANGUAGE=en_US:en;
Expand Down
3 changes: 0 additions & 3 deletions Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@ brew "swiftgen"
brew "swiftlint"
brew "swiftformat"

tap "getsentry/tools"
brew "getsentry/tools/sentry-cli"

tap "mono0926/license-plist"
brew "mono0926/license-plist/license-plist"
17 changes: 0 additions & 17 deletions BundesIdent.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
E11EB2AD2853A8EA008B4042 /* SetupScreens.swift in Sources */ = {isa = PBXBuildFile; fileRef = E11EB2AC2853A8EA008B4042 /* SetupScreens.swift */; };
E1234DB12976E0BC00837872 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1234DB02976E0BC00837872 /* SceneDelegate.swift */; };
E1234DB32976EA3900837872 /* BundLicensePlistViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1234DB22976EA3900837872 /* BundLicensePlistViewController.swift */; };
E128E0BA288941DC00C5195F /* Sentry in Frameworks */ = {isa = PBXBuildFile; productRef = E128E0B9288941DC00C5195F /* Sentry */; };
E128E0BC28898D3400C5195F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E128E0BB28898D3400C5195F /* AppDelegate.swift */; };
E12B2D682A1F9A2E00CC6045 /* ReviewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E12B2D672A1F9A2E00CC6045 /* ReviewController.swift */; };
E12B2D6A2A1F9B4B00CC6045 /* SetupDoneTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E12B2D692A1F9B4B00CC6045 /* SetupDoneTests.swift */; };
Expand Down Expand Up @@ -392,7 +391,6 @@
43269A702A0118B500093FD7 /* AusweisApp2SDKWrapper in Frameworks */,
D2B76A7A28BE4B93000B442D /* Analytics in Frameworks */,
B9F5055829361F69009FE297 /* TCACoordinators in Frameworks */,
E128E0BA288941DC00C5195F /* Sentry in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -899,7 +897,6 @@
);
name = BundesIdent;
packageProductDependencies = (
E128E0B9288941DC00C5195F /* Sentry */,
E1BC3D8528B7E919007A7B39 /* LicensePlistViewController */,
D2B76A7928BE4B93000B442D /* Analytics */,
E144EBD528C63A31009B4900 /* MarkdownUI */,
Expand Down Expand Up @@ -945,7 +942,6 @@
mainGroup = E5CEB271281041330076B9FE;
packageReferences = (
E13925B928410F3F00161F5C /* XCRemoteSwiftPackageReference "Cuckoo" */,
E128E0B8288941DC00C5195F /* XCRemoteSwiftPackageReference "sentry-cocoa" */,
E1BC3D8428B7E919007A7B39 /* XCRemoteSwiftPackageReference "LicensePlistViewController" */,
E144EBD428C63A31009B4900 /* XCRemoteSwiftPackageReference "MarkdownUI" */,
B9F5055629361F69009FE297 /* XCRemoteSwiftPackageReference "TCACoordinators" */,
Expand Down Expand Up @@ -1952,14 +1948,6 @@
minimumVersion = 0.3.0;
};
};
E128E0B8288941DC00C5195F /* XCRemoteSwiftPackageReference "sentry-cocoa" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/getsentry/sentry-cocoa.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 7.0.0;
};
};
E13925B928410F3F00161F5C /* XCRemoteSwiftPackageReference "Cuckoo" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/Brightify/Cuckoo";
Expand Down Expand Up @@ -2006,11 +1994,6 @@
isa = XCSwiftPackageProductDependency;
productName = Analytics;
};
E128E0B9288941DC00C5195F /* Sentry */ = {
isa = XCSwiftPackageProductDependency;
package = E128E0B8288941DC00C5195F /* XCRemoteSwiftPackageReference "sentry-cocoa" */;
productName = Sentry;
};
E13925C1284110FD00161F5C /* Cuckoo */ = {
isa = XCSwiftPackageProductDependency;
package = E13925B928410F3F00161F5C /* XCRemoteSwiftPackageReference "Cuckoo" */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,6 @@
"revision" : "1d853c3b7acfdb6552f63666390e37374f87c5cd"
}
},
{
"identity" : "sentry-cocoa",
"kind" : "remoteSourceControl",
"location" : "https://github.com/getsentry/sentry-cocoa.git",
"state" : {
"revision" : "cf43eac1aa12017868c257ad3854ad87a5de0758",
"version" : "7.31.5"
}
},
{
"identity" : "swift-case-paths",
"kind" : "remoteSourceControl",
Expand Down
51 changes: 0 additions & 51 deletions BundesIdent/AppConfig.swift
Original file line number Diff line number Diff line change
@@ -1,33 +1,20 @@
import Foundation
import AVFAudio
import Sentry

protocol AppConfigType {
var sentryDSN: String { get }
var matomoSiteID: String { get }
var matomoURL: URL { get }

func configureSentry(_ options: Options)
func configureAudio()
}

struct AppConfig: AppConfigType {
let sentryDSN: String
let matomoURL: URL
let matomoSiteID: String
let unleashURL: String
let unleashClientKey: String

init(bundle: Bundle) {
// Sentry
// swiftlint:disable force_cast
let sentryProjectID = bundle.infoDictionary!["SentryProjectID"] as! String
let sentryPublicKey = bundle.infoDictionary!["SentryPublicKey"] as! String
let sentryHost = bundle.infoDictionary!["SentryHost"] as! String
// swiftlint:enable force_cast

sentryDSN = "https://\(sentryPublicKey)@\(sentryHost)/\(sentryProjectID)"

// Matomo
// swiftlint:disable force_cast
let matomoHost = bundle.infoDictionary!["MatomoHost"] as! String
Expand All @@ -43,44 +30,6 @@ struct AppConfig: AppConfigType {
// swiftlint:enable force_cast
}

func configureSentry(_ options: Options) {
options.dsn = sentryDSN
#if DEBUG
options.enabled = false
#endif
#if SENTRY_DEBUG
options.debug = true
#endif
options.tracesSampleRate = 1.0

options.enableAutoPerformanceTracking = false
options.enableAutoBreadcrumbTracking = false

options.enableNetworkBreadcrumbs = false
options.enableNetworkTracking = false

options.attachViewHierarchy = false
options.enableUIViewControllerTracking = false
options.enableUserInteractionTracing = false
options.enableAppHangTracking = false
options.beforeSend = {
guard let context: [String: [String: Any]] = $0.context else { return $0 }

let osKeys = Set(["version", "name"])
let deviceKeys = Set(["family", "model", "model_id"])
let appKeys = Set(["app_build", "app_version"])
let newContext: [String: [String: Any]] = [
"user info": context["user info"],
"os": context["os"]?.filter({ osKeys.contains($0.key) }),
"device": context["device"]?.filter({ deviceKeys.contains($0.key) }),
"app": context["app"]?.filter({ appKeys.contains($0.key) })
].compactMapValues({ $0 })

$0.context = newContext
return $0
}
}

func configureAudio() {
try? AVAudioSession.sharedInstance()
.setCategory(.ambient, options: [.mixWithOthers])
Expand Down
3 changes: 0 additions & 3 deletions BundesIdent/BundesIdentApp.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import SwiftUI
import TCACoordinators
import ComposableArchitecture
import Sentry
import Analytics
import XCTestDynamicOverlay

Expand All @@ -13,8 +12,6 @@ struct BundesIdentApp: App {

init() {
let config = AppConfig(bundle: Bundle.main)
SentrySDK.start(configureOptions: config.configureSentry)

config.configureAudio()

let userDefaults = UserDefaults.standard
Expand Down
2 changes: 0 additions & 2 deletions BundesIdent/Default.xcconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
SENTRY_PROJECT_ID = 6589396
SENTRY_PUBLIC_KEY = 70d55c1a01854e01a6360cc815b88d34
MATOMO_SITE_ID = 2
UNLEASH_CLIENT_KEY = *:development.d3f05ca02117c3949aa784da9bf7b3382a4e6b89929868a75c551a11
30 changes: 14 additions & 16 deletions BundesIdent/Helpers/IssueTracker.swift
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
import Sentry
import Analytics
import OSLog

struct SentryIssueTracker: IssueTracker {
func addBreadcrumb(crumb: Breadcrumb) {
SentrySDK.addBreadcrumb(crumb: crumb)
}

func capture(error: CustomNSError) {
SentrySDK.capture(error: error)
struct Breadcrumb {
enum Level: String {
case info
}

let level: Level
let category: String
var message: String?
}

extension IssueTracker {
func addViewBreadcrumb(view: AnalyticsView) {
let breadcrumb = Breadcrumb()
breadcrumb.level = .info
breadcrumb.category = view.route.joined(separator: "/")
let breadcrumb = Breadcrumb(level: .info, category: view.route.joined(separator: "/"))
addBreadcrumb(crumb: breadcrumb)
}

func addInfoBreadcrumb(category: String, message: String) {
let breadcrumb = Breadcrumb()
breadcrumb.level = .info
breadcrumb.category = category
breadcrumb.message = message
let breadcrumb = Breadcrumb(level: .info, category: category, message: message)
addBreadcrumb(crumb: breadcrumb)
}
}

struct LogIssueTracker: IssueTracker {

func addBreadcrumb(crumb: Breadcrumb) {
os_log(.debug, "Breadcrumb added: \(crumb)")
var literal = "[\(crumb.level.rawValue)] \(crumb.category)"
if let message = crumb.message {
literal.append(" \(message)")
}
os_log(.debug, "Breadcrumb added: \(literal)")
}

func capture(error: CustomNSError) {
Expand Down
6 changes: 0 additions & 6 deletions BundesIdent/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@
<string>bund.matomo.cloud</string>
<key>MatomoSiteID</key>
<string>$(MATOMO_SITE_ID)</string>
<key>SentryHost</key>
<string>o1248831.ingest.sentry.io</string>
<key>SentryProjectID</key>
<string>$(SENTRY_PROJECT_ID)</string>
<key>SentryPublicKey</key>
<string>$(SENTRY_PUBLIC_KEY)</string>
<key>UIAppFonts</key>
<array>
<string>BundesSans-DTP-Regular.otf</string>
Expand Down
2 changes: 0 additions & 2 deletions BundesIdent/Preview.xcconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
SENTRY_PROJECT_ID = 6589396
SENTRY_PUBLIC_KEY = 70d55c1a01854e01a6360cc815b88d34
MATOMO_SITE_ID = 2
2 changes: 0 additions & 2 deletions BundesIdent/Prototype.xcconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
SENTRY_PROJECT_ID =
SENTRY_PUBLIC_KEY =
MATOMO_SITE_ID = 5
2 changes: 0 additions & 2 deletions BundesIdent/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
SENTRY_PROJECT_ID = 6589505
SENTRY_PUBLIC_KEY = 81bc611af42347bc8d7b487f807f9577
MATOMO_SITE_ID = 3
UNLEASH_CLIENT_KEY = *:production.cf4117e736dba7c96d1d3cf714ecec1e8d88e243f5285928d0ef3e6f
1 change: 0 additions & 1 deletion BundesIdent/TCA/Coordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import ComposableArchitecture
import TCACoordinators
import SwiftUI
import Analytics
import Sentry

enum HandleURLError: Error, CustomStringConvertible, CustomNSError {
case componentsInvalid
Expand Down
2 changes: 1 addition & 1 deletion BundesIdent/TCA/Dependencies.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ enum StorageManagerKey: DependencyKey {
}

enum IssueTrackerKey: DependencyKey {
static var liveValue: IssueTracker = SentryIssueTracker()
static var liveValue: IssueTracker = LogIssueTracker()
static var testValue: IssueTracker = LogIssueTracker()
}

Expand Down
1 change: 0 additions & 1 deletion BundesIdent/Types/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import Foundation
import Combine
import Sentry

protocol EIDInteractionManagerType {
func identify(tokenURL: URL, messages: ScanOverlayMessages) -> EIDInteractionPublisher
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import SwiftUI
import ComposableArchitecture
import Combine
import Sentry

struct IdentificationCANScan: ReducerProtocol {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import ComposableArchitecture
import SwiftUI
import Sentry

struct IdentificationOverviewLoading: ReducerProtocol {
@Dependency(\.issueTracker) var issueTracker
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import SwiftUI
import ComposableArchitecture
import Combine
import Sentry

enum IdentificationScanError: Error, Equatable, CustomNSError {
case eIDInteraction(EIDInteractionError)
Expand Down
1 change: 0 additions & 1 deletion BundesIdent/Views/Setup/SetupCANScan.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import SwiftUI
import ComposableArchitecture
import Combine
import Sentry

struct SetupCANScan: ReducerProtocol {

Expand Down
1 change: 0 additions & 1 deletion BundesIdent/Views/Setup/SetupScan.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import SwiftUI
import ComposableArchitecture
import Combine
import Sentry
import OSLog

struct SetupScan: ReducerProtocol {
Expand Down
1 change: 0 additions & 1 deletion BundesIdentTests/Managers/UnleashManagerTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import XCTest
import Analytics
import Cuckoo
import Sentry
@testable import BundesIdent

final class UnleashManagerTests: XCTestCase {
Expand Down
10 changes: 0 additions & 10 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,6 @@ platform :ios do
desc 'Deliver Preview'
lane :deliverPreview do |options|
make_screenshots = options[:screenshots] == true
sentry_upload_dsym(
auth_token: ENV['SENTRY_AUTH_TOKEN'],
org_slug: 'digitalservice',
project_slug: 'useid-preview-ios',
)
upload_to_testflight(
api_key_path: ENV['APPSTORECONNECT_API_KEY_PATH'],
skip_waiting_for_build_processing: true
Expand Down Expand Up @@ -205,11 +200,6 @@ platform :ios do
desc 'Deliver Production'
lane :deliverProduction do |options|
make_screenshots = options[:screenshots] == true
sentry_upload_dsym(
auth_token: ENV['SENTRY_AUTH_TOKEN'],
org_slug: 'digitalservice',
project_slug: 'useid-ios',
)
upload_to_testflight(
api_key_path: ENV['APPSTORECONNECT_API_KEY_PATH'],
skip_waiting_for_build_processing: true
Expand Down