Skip to content

Commit 5ff1b04

Browse files
authored
ref: Remove deprecated integrations option (#6492)
* ref: Remove deprecated integrations option * Remove deprecation tags * PR feedback
1 parent da97e57 commit 5ff1b04

23 files changed

+86
-298
lines changed

SentryTestUtils/TestOptions.swift

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,27 @@ import Foundation
22
import Sentry
33

44
public extension Options {
5-
@available(*, deprecated)
6-
func setIntegrations(_ integrations: [AnyClass]) {
7-
self.integrations = integrations.map {
8-
NSStringFromClass($0)
9-
}
10-
}
115

12-
@available(*, deprecated)
136
func removeAllIntegrations() {
14-
self.integrations = []
7+
enableAutoSessionTracking = false
8+
enableWatchdogTerminationTracking = false
9+
enableAutoPerformanceTracing = false
10+
enableCrashHandler = false
11+
swiftAsyncStacktraces = false
12+
enableAppHangTracking = false
13+
enableNetworkTracking = false
14+
enableNetworkBreadcrumbs = false
15+
enableCaptureFailedRequests = false
16+
enableAutoBreadcrumbTracking = false
17+
enableCoreDataTracing = false
18+
enableFileIOTracing = false
19+
#if (os(iOS) || os(tvOS) || (swift(>=5.9) && os(visionOS))) && !SENTRY_NO_UIKIT
20+
enableUserInteractionTracing = false
21+
attachViewHierarchy = false
22+
enableUIViewControllerTracing = false
23+
#endif
1524
}
16-
17-
@available(*, deprecated)
25+
1826
static func noIntegrations() -> Options {
1927
let options = Options()
2028
options.removeAllIntegrations()

Sources/Sentry/Public/SentryOptions.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,6 @@ NS_SWIFT_NAME(Options)
207207
@property (nullable, nonatomic, copy)
208208
SentryOnCrashedLastRunCallback onCrashedLastRun NS_SWIFT_SENDABLE;
209209

210-
#if !SDK_V9
211-
/**
212-
* Array of integrations to install.
213-
*/
214-
@property (nullable, nonatomic, copy) NSArray<NSString *> *integrations DEPRECATED_MSG_ATTRIBUTE(
215-
"Setting `SentryOptions.integrations` is deprecated. Integrations should be enabled or "
216-
"disabled using their respective `SentryOptions.enable*` property.");
217-
#endif // !SDK_V9
218-
219210
/**
220211
* Array of default integrations. Will be used if @c integrations is @c nil .
221212
*/

Sources/Sentry/SentryOptions.m

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ - (instancetype)init
7373
self.debug = NO;
7474
self.maxBreadcrumbs = defaultMaxBreadcrumbs;
7575
self.maxCacheItems = 30;
76-
#if !SDK_V9
77-
_integrations = [SentryOptions defaultIntegrations];
78-
#endif // !SDK_V9
7976
self.sampleRate = SENTRY_DEFAULT_SAMPLE_RATE;
8077
self.enableAutoSessionTracking = YES;
8178
self.enableGraphQLOperationTracking = NO;
@@ -213,13 +210,6 @@ - (void)setFailedRequestTargets:(NSArray *)failedRequestTargets
213210
_failedRequestTargets = failedRequestTargets;
214211
}
215212

216-
#if !SDK_V9
217-
- (void)setIntegrations:(NSArray<NSString *> *)integrations
218-
{
219-
_integrations = integrations.mutableCopy;
220-
}
221-
#endif // !SDK_V9
222-
223213
- (void)setDsn:(NSString *)dsn
224214
{
225215
NSError *error = nil;

Sources/Sentry/SentrySDKInternal.m

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -559,15 +559,7 @@ + (void)installIntegrations
559559
return;
560560
}
561561
SentryOptions *options = [SentrySDKInternal.currentHub getClient].options;
562-
#if SDK_V9
563562
NSMutableArray<NSString *> *integrationNames = [SentryOptions defaultIntegrations].mutableCopy;
564-
#else
565-
# pragma clang diagnostic push
566-
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
567-
NSMutableArray<NSString *> *integrationNames =
568-
[SentrySDKInternal.currentHub getClient].options.integrations.mutableCopy;
569-
# pragma clang diagnostic pop
570-
#endif // SDK_V9
571563

572564
NSArray<Class> *defaultIntegrations = SentryOptionsInternal.defaultIntegrationClasses;
573565

Sources/Sentry/SentyOptionsInternal.m

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,16 +200,6 @@ + (BOOL)validateOptions:(NSDictionary<NSString *, id> *)options
200200
sentryOptions.onCrashedLastRun = options[@"onCrashedLastRun"];
201201
}
202202

203-
#if !SDK_V9
204-
if ([options[@"integrations"] isKindOfClass:[NSArray class]]) {
205-
# pragma clang diagnostic push
206-
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
207-
sentryOptions.integrations =
208-
[[options[@"integrations"] filteredArrayUsingPredicate:isNSString] mutableCopy];
209-
# pragma clang diagnstic pop
210-
}
211-
#endif // !SDK_V9
212-
213203
if ([options[@"sampleRate"] isKindOfClass:[NSNumber class]]) {
214204
sentryOptions.sampleRate = options[@"sampleRate"];
215205
}

Tests/SentryProfilerTests/SentryProfilingPublicAPITests.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import XCTest
77
// swiftlint:disable file_length
88
class SentryProfilingPublicAPITests: XCTestCase {
99
private class Fixture {
10-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
1110
let options: Options = {
1211
let options = Options.noIntegrations()
1312
options.dsn = TestConstants.dsnAsString(username: "SentrySDKTests")
@@ -36,9 +35,7 @@ class SentryProfilingPublicAPITests: XCTestCase {
3635

3736
let currentDate = TestCurrentDateProvider()
3837
lazy var timerFactory = TestSentryNSTimerFactory(currentDateProvider: currentDate)
39-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
4038
lazy var client = TestClient(options: options)!
41-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
4239
lazy var hub = SentryHub(client: client, andScope: scope)
4340
}
4441

@@ -55,7 +52,6 @@ class SentryProfilingPublicAPITests: XCTestCase {
5552
SentryDependencyContainer.sharedInstance().dateProvider = fixture.currentDate
5653
}
5754

58-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
5955
override func tearDown() {
6056
super.tearDown()
6157

@@ -72,7 +68,6 @@ class SentryProfilingPublicAPITests: XCTestCase {
7268
}
7369

7470
// MARK: continuous profiling v2
75-
@available(*, deprecated, message: "This is only deprecated because profilesSampleRate is deprecated. Once that is removed this attribute can be removed.")
7671
extension SentryProfilingPublicAPITests {
7772
func testSentryOptionsReportsContinuousProfilingV2Enabled() {
7873
// Arrange
@@ -481,14 +476,12 @@ extension SentryProfilingPublicAPITests {
481476
}
482477

483478
private extension SentryProfilingPublicAPITests {
484-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
485479
func givenSdkWithHub() {
486480
SentrySDKInternal.setCurrentHub(fixture.hub)
487481
SentrySDKInternal.setStart(with: fixture.options)
488482
sentry_sdkInitProfilerTasks(fixture.options, fixture.hub)
489483
}
490484

491-
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
492485
func givenSdkWithHubButNoClient() {
493486
SentrySDKInternal.setCurrentHub(SentryHub(client: nil, andScope: nil))
494487
SentrySDKInternal.setStart(with: fixture.options)

Tests/SentryTests/Integrations/Performance/CoreData/SentryCoreDataTrackingIntegrationTest.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ class SentryCoreDataTrackingIntegrationTests: XCTestCase {
1313
init(testName: String) {
1414
coreDataStack = TestCoreDataStack(databaseFilename: "db-\(testName.hashValue).sqlite")
1515
options = Options()
16+
options.removeAllIntegrations()
17+
options.enableAutoPerformanceTracing = true
18+
options.enableSwizzling = true
1619
options.enableCoreDataTracing = true
1720
options.tracesSampleRate = 1
18-
options.setIntegrations([SentryCoreDataTrackingIntegration.self])
1921
}
2022

2123
func getSut() -> SentryCoreDataTrackingIntegration {

Tests/SentryTests/Integrations/Performance/IO/DataSentryTracingIntegrationTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class DataSentryTracingIntegrationTests: XCTestCase {
3838
// Configure options required by File I/O tracking integration
3939
options.enableAutoPerformanceTracing = true
4040
options.enableFileIOTracing = isEnabled
41-
options.setIntegrations(isEnabled ? [SentryFileIOTrackingIntegration.self] : [])
4241

4342
// Configure the tracing sample rate to record all traces
4443
options.tracesSampleRate = 1.0

Tests/SentryTests/Integrations/Performance/IO/FileManagerTracingIntegrationTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class FileManagerSentryTracingIntegrationTests: XCTestCase {
4141
// Configure options required by File I/O tracking integration
4242
options.enableAutoPerformanceTracing = true
4343
options.enableFileIOTracing = isEnabled
44-
options.setIntegrations(isEnabled ? [SentryFileIOTrackingIntegration.self] : [])
4544

4645
// Configure the tracing sample rate to record all traces
4746
options.tracesSampleRate = 1.0

Tests/SentryTests/Integrations/Performance/IO/SentryFileIOTrackingIntegrationTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ class SentryFileIOTrackingIntegrationTests: XCTestCase {
1414
@available(*, deprecated, message: "This is deprecated because SentryOptions integrations is deprecated")
1515
func getOptions(enableAutoPerformanceTracing: Bool = true, enableFileIOTracing: Bool = true, enableSwizzling: Bool = true, enableDataSwizzling: Bool = true, enableFileManagerSwizzling: Bool = true, tracesSampleRate: NSNumber = 1) -> Options {
1616
let result = Options()
17+
result.removeAllIntegrations()
1718
result.enableAutoPerformanceTracing = enableAutoPerformanceTracing
1819
result.enableFileIOTracing = enableFileIOTracing
1920
result.enableSwizzling = enableSwizzling
2021
result.tracesSampleRate = tracesSampleRate
2122
result.experimental.enableDataSwizzling = enableDataSwizzling
2223
result.experimental.enableFileManagerSwizzling = enableFileManagerSwizzling
23-
result.setIntegrations([SentryFileIOTrackingIntegration.self])
2424
return result
2525
}
2626

0 commit comments

Comments
 (0)