Skip to content

Commit 5b7a188

Browse files
itaybresupervacuus
andauthored
ref: Remove Sentry traits from integrations + V10 only (#9852)
* ci: Test 3rd-party integrations as V10 source The SDK sources are becoming V10 only, so the integration tests can no longer build the package in its default layout or against a separately built XCFramework. Set SDK_V10=1 for the SPM test job. In that mode Package.swift exposes the source build as the Sentry product, which the integrations' default trait already depends on, so the binary matrix leg and the XCFramework build job are no longer needed. Remove options.enableLogs from the integration tests. The option does not exist in V10, where logs are always enabled. * ref: Make the V10 package layout unconditional main is V10 only, so the SDK_V10 environment switch in the package manifests no longer needs to select a layout. Always expose the source build as the Sentry product and module, and remove the binary products, the SentrySPM product and the V9-only profiler test targets. Keep passing SDK_V10 to the compiler, now unconditionally, because the sources still gate V10 code on it. Update the 3rd-party integrations to depend on the single Sentry product and import Sentry directly. Their SentryFromBinary and SentryFromSource traits no longer select different products, so the integration workflow runs plain swift test without SDK_V10. * ref: Limit V10 change to 3rd-party integrations Restore the root package manifests, the README, the macOS-CLI test app and the checksum verification script to their state on main. The package layout change does not belong in this pull request. The integrations keep depending on the single Sentry product, so the integration workflow sets SDK_V10=1 again to make the root package expose the source build under that name. --------- Co-authored-by: Mischan Toosarani-Hausberger <mischan@abovevacant.com>
1 parent 1b0f1bd commit 5b7a188

18 files changed

Lines changed: 20 additions & 181 deletions

‎.github/file-filters.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,7 @@ run_3rd_party_integrations_tests_for_prs: &run_3rd_party_integrations_tests_for_
840840
- "Sources/SentryObjCCompat/**"
841841
- "Sources/Swift/**"
842842
- "3rd-party-integrations/**"
843+
- "Package*.swift"
843844

844845
# GH Actions
845846
- ".github/workflows/test-3rd-party-integrations.yml"

‎.github/workflows/test-3rd-party-integrations.yml‎

Lines changed: 11 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -54,61 +54,20 @@ jobs:
5454
token: ${{ github.token }}
5555
filters: .github/file-filters.yml
5656

57-
# Build xcframeworks from source code once for all integration tests.
58-
# This ensures tests use the current source code instead of the latest GitHub release.
59-
# We only build the Static variant since 3rd-party integrations only use the "Sentry" product.
57+
# SPM tests for all 3rd-party integrations.
58+
# The integrations build the SDK from the current source code as V10. Package.swift reads SDK_V10
59+
# from the environment, exposes the source build as the "Sentry" product, and drops the binary
60+
# targets. The integrations' default trait depends on that product, so there is no separate
61+
# precompiled variant to test.
6062
# Intentionally skipped on release branches.
61-
build-xcframeworks:
62-
name: Build XCFrameworks
63-
needs: files-changed
64-
if: startsWith(github.ref, 'refs/heads/release/') == false && (github.event_name != 'pull_request' || needs.files-changed.outputs.run_3rd_party_integrations_tests_for_prs == 'true')
65-
runs-on: xcode-27
66-
timeout-minutes: 30
67-
steps:
68-
# === Checkout and independent preparation ===
69-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
70-
- name: Setup Git access
71-
uses: ./.github/actions/setup-git-access
72-
with:
73-
ssh-key-base64: ${{ secrets.GIT_SSH_PRIVATE_KEY_BASE64 }}
74-
ssh-key-passphrase: ${{ secrets.GIT_SSH_KEY_PASSPHRASE }}
75-
76-
# === Toolchain and simulator preparation ===
77-
- name: Setup Xcode
78-
uses: ./.github/actions/setup-xcode
79-
with:
80-
version: "27"
81-
resolve-simulators: "false"
82-
- name: Warm CoreSimulator
83-
id: warm-coresimulator
84-
background: true
85-
continue-on-error: true
86-
run: xcrun simctl list runtimes -j > /dev/null
87-
88-
# === Build and validation ===
89-
- name: Wait for CoreSimulator warmup
90-
wait: warm-coresimulator
91-
- name: Build XCFramework (Static)
92-
run: |
93-
./scripts/build-xcframework-variant.sh --scheme "Sentry" --mach-o-type "staticlib" --sdks "macOSOnly"
94-
./scripts/validate-xcframework.sh --xcframework "Sentry.xcframework"
95-
./scripts/compress-xcframework.sh --xcframework "Sentry.xcframework"
96-
97-
# === Artifacts and diagnostics ===
98-
- name: Upload XCFrameworks
99-
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
100-
with:
101-
name: xcframeworks-for-3rd-party-integration-tests
102-
path: "Sentry.xcframework.zip"
103-
retention-days: 1
104-
105-
# SPM tests for all 3rd-party integrations
10663
test-integrations-spm:
107-
name: SPM Tests (${{matrix.trait}}) | ${{matrix.integration_dir}}
108-
needs: [files-changed, build-xcframeworks]
64+
name: SPM Tests | ${{matrix.integration_dir}}
65+
needs: files-changed
10966
if: startsWith(github.ref, 'refs/heads/release/') == false && (github.event_name != 'pull_request' || needs.files-changed.outputs.run_3rd_party_integrations_tests_for_prs == 'true')
11067
runs-on: xcode-27
11168
timeout-minutes: 30
69+
env:
70+
SDK_V10: "1"
11271
strategy:
11372
fail-fast: false
11473
matrix:
@@ -118,16 +77,9 @@ jobs:
11877
"SentryCocoaLumberjack",
11978
"SentryPulse",
12079
]
121-
trait: ["SentryFromBinary", "SentryFromSource"]
12280
steps:
12381
# === Checkout and independent preparation ===
12482
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
125-
- name: Download XCFrameworks
126-
id: download-xcframework
127-
background: true
128-
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
129-
with:
130-
name: xcframeworks-for-3rd-party-integration-tests
13183
- name: Setup Git access
13284
uses: ./.github/actions/setup-git-access
13385
with:
@@ -147,29 +99,24 @@ jobs:
14799
run: xcrun simctl list runtimes -j > /dev/null
148100
- name: Remove versioned Package files
149101
run: rm -f Package@swift-*.swift
150-
- name: Modify Package.swift to use local xcframeworks
151-
run: ./scripts/prepare-package.sh --package-file Package.swift --is-pr true --remove-duplicate true --change-path true
152102
- name: Use local sentry-cocoa
153103
working-directory: 3rd-party-integrations/${{matrix.integration_dir}}
154104
run: |
155105
sed -i '' 's|\.package(url: "https://github\.com/getsentry/sentry-cocoa", from: "[^"]*")|.package(name: "sentry-cocoa", path: "../..")|g' Package.swift
156106
157-
- name: Wait for XCFramework download
158-
wait: download-xcframework
159-
160107
# === Build and validation ===
161108
- name: Wait for CoreSimulator warmup
162109
wait: warm-coresimulator
163110
- name: Run SPM Tests
164111
working-directory: 3rd-party-integrations/${{matrix.integration_dir}}
165-
run: swift test --traits ${{ matrix.trait }}
112+
run: swift test
166113

167114
# === Artifacts and diagnostics ===
168115
- name: Archiving Raw Logs
169116
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
170117
if: ${{ failure() || cancelled() }}
171118
with:
172-
name: raw-output-${{matrix.integration_dir}}-${{matrix.trait}}-integration
119+
name: raw-output-${{matrix.integration_dir}}-integration
173120
path: |
174121
3rd-party-integrations/${{matrix.integration_dir}}/.build/**/*.log
175122
- name: Run CI Diagnostics
@@ -181,7 +128,6 @@ jobs:
181128
[
182129
run-full-ci-gate,
183130
files-changed,
184-
build-xcframeworks,
185131
test-integrations-spm,
186132
]
187133
name: 3rd Party Integration Tests - Required Check

‎3rd-party-integrations/SentryCocoaLumberjack/Package.swift‎

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ let package = Package(
1010
targets: ["SentryCocoaLumberjack"]
1111
)
1212
],
13-
traits: [
14-
.default(enabledTraits: ["SentryFromBinary"]),
15-
.init(name: "SentryFromBinary", description: "Use precompiled Sentry binary xcframeworks."),
16-
.init(name: "SentryFromSource", description: "Build Sentry from source instead of using precompiled binaries.")
17-
],
1813
dependencies: [
1914
.package(url: "https://github.com/CocoaLumberjack/CocoaLumberjack", from: "3.8.0"),
2015
.package(url: "https://github.com/getsentry/sentry-cocoa", from: "9.36.0")
@@ -24,25 +19,15 @@ let package = Package(
2419
name: "SentryCocoaLumberjack",
2520
dependencies: [
2621
.product(name: "CocoaLumberjackSwift", package: "CocoaLumberjack"),
27-
.product(name: "Sentry", package: "sentry-cocoa", condition: .when(traits: ["SentryFromBinary"])),
28-
.product(name: "SentrySPM", package: "sentry-cocoa", condition: .when(traits: ["SentryFromSource"]))
29-
],
30-
swiftSettings: [
31-
.define("SENTRY_FROM_BINARY", .when(traits: ["SentryFromBinary"])),
32-
.define("SENTRY_FROM_SOURCE", .when(traits: ["SentryFromSource"]))
22+
.product(name: "Sentry", package: "sentry-cocoa")
3323
]
3424
),
3525
.testTarget(
3626
name: "SentryCocoaLumberjackTests",
3727
dependencies: [
3828
"SentryCocoaLumberjack",
3929
.product(name: "CocoaLumberjackSwift", package: "CocoaLumberjack"),
40-
.product(name: "Sentry", package: "sentry-cocoa", condition: .when(traits: ["SentryFromBinary"])),
41-
.product(name: "SentrySPM", package: "sentry-cocoa", condition: .when(traits: ["SentryFromSource"]))
42-
],
43-
swiftSettings: [
44-
.define("SENTRY_FROM_BINARY", .when(traits: ["SentryFromBinary"])),
45-
.define("SENTRY_FROM_SOURCE", .when(traits: ["SentryFromSource"]))
30+
.product(name: "Sentry", package: "sentry-cocoa")
4631
]
4732
)
4833
]

‎3rd-party-integrations/SentryCocoaLumberjack/Sources/SentryCocoaLumberjackLogger.swift‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import CocoaLumberjackSwift
2-
#if SENTRY_FROM_SOURCE
3-
import SentrySwift
4-
#else
52
import Sentry
6-
#endif
73

84
/// A CocoaLumberjack logger that forwards log entries to Sentry's structured logging system.
95
///

‎3rd-party-integrations/SentryCocoaLumberjack/Sources/SentryTraitValidation.swift‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎3rd-party-integrations/SentryCocoaLumberjack/Tests/SentryCocoaLumberjackLoggerTests.swift‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
@_spi(Private) @testable import SentryCocoaLumberjack
22
import CocoaLumberjackSwift
3-
#if SENTRY_FROM_SOURCE
4-
import SentrySwift
5-
#else
63
import Sentry
7-
#endif
84
import XCTest
95

106
// swiftlint:disable cyclomatic_complexity file_length type_body_length
@@ -18,7 +14,6 @@ final class SentryCocoaLumberjackLoggerTests: XCTestCase {
1814
capturedLogs = []
1915
SentrySDK.start { options in
2016
options.dsn = "https://test@test.ingest.sentry.io/123456"
21-
options.enableLogs = true
2217
options.beforeSendLog = { [weak self] log in
2318
self?.capturedLogs.append(log)
2419
return nil

‎3rd-party-integrations/SentryPulse/Package.swift‎

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ let package = Package(
1010
targets: ["SentryPulse"]
1111
)
1212
],
13-
traits: [
14-
.default(enabledTraits: ["SentryFromBinary"]),
15-
.init(name: "SentryFromBinary", description: "Use precompiled Sentry binary xcframeworks."),
16-
.init(name: "SentryFromSource", description: "Build Sentry from source instead of using precompiled binaries.")
17-
],
1813
dependencies: [
1914
.package(url: "https://github.com/kean/Pulse", from: "5.0.0"),
2015
.package(url: "https://github.com/getsentry/sentry-cocoa", from: "9.36.0")
@@ -24,25 +19,15 @@ let package = Package(
2419
name: "SentryPulse",
2520
dependencies: [
2621
.product(name: "Pulse", package: "Pulse"),
27-
.product(name: "Sentry", package: "sentry-cocoa", condition: .when(traits: ["SentryFromBinary"])),
28-
.product(name: "SentrySPM", package: "sentry-cocoa", condition: .when(traits: ["SentryFromSource"]))
29-
],
30-
swiftSettings: [
31-
.define("SENTRY_FROM_BINARY", .when(traits: ["SentryFromBinary"])),
32-
.define("SENTRY_FROM_SOURCE", .when(traits: ["SentryFromSource"]))
22+
.product(name: "Sentry", package: "sentry-cocoa")
3323
]
3424
),
3525
.testTarget(
3626
name: "SentryPulseTests",
3727
dependencies: [
3828
"SentryPulse",
3929
.product(name: "Pulse", package: "Pulse"),
40-
.product(name: "Sentry", package: "sentry-cocoa", condition: .when(traits: ["SentryFromBinary"])),
41-
.product(name: "SentrySPM", package: "sentry-cocoa", condition: .when(traits: ["SentryFromSource"]))
42-
],
43-
swiftSettings: [
44-
.define("SENTRY_FROM_BINARY", .when(traits: ["SentryFromBinary"])),
45-
.define("SENTRY_FROM_SOURCE", .when(traits: ["SentryFromSource"]))
30+
.product(name: "Sentry", package: "sentry-cocoa")
4631
]
4732
)
4833
]

‎3rd-party-integrations/SentryPulse/Sources/SentryPulse.swift‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import Combine
22
import Pulse
3-
#if SENTRY_FROM_SOURCE
4-
import SentrySwift
5-
#else
63
import Sentry
7-
#endif
84

95
/// Automatically forwards Pulse log messages to Sentry's structured logging system.
106
///

‎3rd-party-integrations/SentryPulse/Sources/SentryTraitValidation.swift‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎3rd-party-integrations/SentryPulse/Tests/SentryPulseTests.swift‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
@testable import SentryPulse
22
import Pulse
3-
#if SENTRY_FROM_SOURCE
4-
import SentrySwift
5-
#else
63
import Sentry
7-
#endif
84
import XCTest
95

106
// swiftlint:disable cyclomatic_complexity
@@ -24,7 +20,6 @@ final class SentryPulseTests: XCTestCase {
2420

2521
SentrySDK.start { options in
2622
options.dsn = "https://test@test.ingest.sentry.io/123456"
27-
options.enableLogs = true
2823
options.beforeSendLog = { [weak self] log in
2924
self?.capturedLogs.append(log)
3025
return nil

0 commit comments

Comments
 (0)