diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 664ee22c713..fa5a87de2ac 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -22,7 +22,7 @@ jobs: uses: actions/checkout@v3 - name: Initialize CodeQL - uses: github/codeql-action/init@b2a92eb56d8cb930006a1c6ed86b0782dd8a4297 # pin@v2 + uses: github/codeql-action/init@a669cc5936cc5e1b6a362ec1ff9e410dc570d190 # pin@v2 with: languages: ${{ matrix.language }} @@ -35,4 +35,4 @@ jobs: -destination platform="iOS Simulator,OS=latest,name=iPhone 11 Pro" - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@b2a92eb56d8cb930006a1c6ed86b0782dd8a4297 # pin@v2 + uses: github/codeql-action/analyze@a669cc5936cc5e1b6a362ec1ff9e410dc570d190 # pin@v2 diff --git a/.github/workflows/format-code.yml b/.github/workflows/format-code.yml index df27c07186a..c998579e620 100644 --- a/.github/workflows/format-code.yml +++ b/.github/workflows/format-code.yml @@ -13,13 +13,14 @@ jobs: # if necessary format-code: name: Format Code - runs-on: macos-11 + runs-on: macos-12 steps: - uses: actions/checkout@v3 ## Update internal list of formulae to the latest - run: brew update - name: Install Clang-Format run: brew install clang-format + - run: swiftlint --version - name: Format Code run: make format diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a1b16865b9a..beb4a8da363 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -68,6 +68,20 @@ jobs: run: pod lib lint --verbose --platforms=${{ matrix.platform }} Sentry.podspec --include-podspecs=SentryPrivate.podspec --use-libraries shell: sh + validate-SentrySwiftUI-podspec: + name: Validate SentrySwiftUI Podspec + runs-on: macos-12 + strategy: + matrix: + platform: ['ios', 'macos', 'tvos', 'watchos'] + + steps: + - uses: actions/checkout@v3 + - run: ./scripts/ci-select-xcode.sh + - name: Validate Podspec + run: pod lib lint --verbose --platforms=${{ matrix.platform }} SentrySwiftUI.podspec --include-podspecs=Sentry.podspec,SentryPrivate.podspec + shell: sh + validate-high-risk-files: name: No changes in high risk files runs-on: ubuntu-latest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cc5db69e8d2..5b674877932 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -183,6 +183,9 @@ jobs: sudo ln -s /Applications/Xcode_12.5.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 14.5.simruntime xcrun simctl create custom-test-device "iPhone 8" "com.apple.CoreSimulator.SimRuntime.iOS-14-5" + - name: Install Slather + run: gem install slather + - name: Running tests # We call a script with the platform so the destination # passed to xcodebuild doesn't end up in the job name, @@ -206,13 +209,6 @@ jobs: path: | raw-test-output.log - # Some tests run only on iOS so we only collect code coverage there. - - name: Run Slather - if: success() && ${{ contains(matrix.platform, 'iOS') }} - run: | - gem install slather - slather coverage -x --output-directory slather/ --scheme Sentry --workspace Sentry.xcworkspace Sentry.xcodeproj - # We can upload all coverage reports, because codecov merges them. # See https://docs.codecov.io/docs/merging-reports # Checkout .codecov.yml to see the config of Codecov @@ -220,6 +216,9 @@ jobs: uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # pin@v3.1.1 if: ${{ contains(matrix.platform, 'iOS') }} with: + # Although public repos should not have to specify a token there seems to be a bug with the Codecov GH action, which can + # be solved by specifying the token, see https://github.com/codecov/codecov-action/issues/557#issuecomment-1224970469 + token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true verbose: true diff --git a/.github/workflows/testflight.yml b/.github/workflows/testflight.yml index cc7b452b62d..f57a80b5219 100644 --- a/.github/workflows/testflight.yml +++ b/.github/workflows/testflight.yml @@ -17,7 +17,8 @@ jobs: runs-on: macos-12 steps: - uses: actions/checkout@v3 - - run: ./scripts/ci-select-xcode.sh + # Xcode 14.1 has a bug with fastlane see https://github.com/fastlane/fastlane/issues/20910 + - run: ./scripts/ci-select-xcode.sh 14.0.1 - run: bundle install # We upload a new version to TestFlight on every commit on Master diff --git a/.slather.yml b/.slather.yml new file mode 100644 index 00000000000..322b84775fd --- /dev/null +++ b/.slather.yml @@ -0,0 +1,8 @@ +# .slather.yml + +coverage_service: cobertura_xml +xcodeproj: Sentry.xcodeproj +workspace: Sentry.xcworkspace +scheme: Sentry +source_directory: Sources +output_directory: slather diff --git a/Brewfile.lock.json b/Brewfile.lock.json index 3040a4cf859..a8da3e1e4b5 100644 --- a/Brewfile.lock.json +++ b/Brewfile.lock.json @@ -2,50 +2,45 @@ "entries": { "brew": { "clang-format": { - "version": "15.0.4", + "version": "15.0.6", "bottle": { "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { "arm64_ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:22ce42d45047a82dbaeb294c988491c8dc41a14db585aba895289b94c98567b5", - "sha256": "22ce42d45047a82dbaeb294c988491c8dc41a14db585aba895289b94c98567b5" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:fbf56abfb24a21c165be6354c24784fda0404eb0009acb24e7764f985cc46396", + "sha256": "fbf56abfb24a21c165be6354c24784fda0404eb0009acb24e7764f985cc46396" }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:e6687055a4bbb8c45c534c97593da173020a89464131f8e28d9c51635abdf85e", - "sha256": "e6687055a4bbb8c45c534c97593da173020a89464131f8e28d9c51635abdf85e" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:863c6e225f28a486e59d9581a15a138f12a79be7ec0e88bfbb7a13dce69caed2", + "sha256": "863c6e225f28a486e59d9581a15a138f12a79be7ec0e88bfbb7a13dce69caed2" }, "arm64_big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:635e65e903d7509bc7b66246b33e80c2c6fa7970ae5ae976b8115346298684af", - "sha256": "635e65e903d7509bc7b66246b33e80c2c6fa7970ae5ae976b8115346298684af" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:9dff09df90416010de10c0f2d5827d7088f752747b79c4b1dc2fdbfc8ec82bf2", + "sha256": "9dff09df90416010de10c0f2d5827d7088f752747b79c4b1dc2fdbfc8ec82bf2" }, "ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:313506ad3a59bdea702b964c76784cb280041960faff6f4ef30327a28e79107b", - "sha256": "313506ad3a59bdea702b964c76784cb280041960faff6f4ef30327a28e79107b" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:eaa6987f545e773b2af7030555198e441ce18ff1fc0be8728757cb167e271a4b", + "sha256": "eaa6987f545e773b2af7030555198e441ce18ff1fc0be8728757cb167e271a4b" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:840020306f475284733e073f7d3d1f4c2f2e14b8e1a89d79bfa2df8d4dee2c53", - "sha256": "840020306f475284733e073f7d3d1f4c2f2e14b8e1a89d79bfa2df8d4dee2c53" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:f2057cfecd05af214a620f359634001fe78fb25b21ec2c19885cd57e38af9e6f", + "sha256": "f2057cfecd05af214a620f359634001fe78fb25b21ec2c19885cd57e38af9e6f" }, "big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:9743f1cb8befbaacba5b60e22762fab2db9337fcbddb66ee9fae69ccb54174ab", - "sha256": "9743f1cb8befbaacba5b60e22762fab2db9337fcbddb66ee9fae69ccb54174ab" - }, - "catalina": { - "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:44458ac88b30b5fddfa0a9679339a6fdca3ad0cd9591f655387d7d12f85ce383", - "sha256": "44458ac88b30b5fddfa0a9679339a6fdca3ad0cd9591f655387d7d12f85ce383" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:047d4e2321824b31d4ec0208a85e114e579255c210f62e0415f618f1fbbe3362", + "sha256": "047d4e2321824b31d4ec0208a85e114e579255c210f62e0415f618f1fbbe3362" }, "x86_64_linux": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:ba30cee4820b592e8ff594fe0174246286ed062c709e058c713d882a073ac388", - "sha256": "ba30cee4820b592e8ff594fe0174246286ed062c709e058c713d882a073ac388" + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:6a0d2f67c64a65e9411420b052c6f3cc234879ff62c8306c3090c19298abb4cc", + "sha256": "6a0d2f67c64a65e9411420b052c6f3cc234879ff62c8306c3090c19298abb4cc" } } } @@ -65,35 +60,35 @@ } }, "swiftlint": { - "version": "0.49.1", + "version": "0.50.1", "bottle": { "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { "arm64_ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:de4f931704cfdbd7300a74d8f0ef807394f3366ed1d3d59eabb87edcefa926af", - "sha256": "de4f931704cfdbd7300a74d8f0ef807394f3366ed1d3d59eabb87edcefa926af" + "url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:7d447fe250b531775462560ed2179b284addb279f7dd0b6d2533da12b3c9b42f", + "sha256": "7d447fe250b531775462560ed2179b284addb279f7dd0b6d2533da12b3c9b42f" }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:d983879e2d9ea075bf80e223da5adb258f01d9fab4fc6f71f83c4add80490290", - "sha256": "d983879e2d9ea075bf80e223da5adb258f01d9fab4fc6f71f83c4add80490290" + "url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:77a486aa11b6a3cfea372752d945ff5a7f20a953261449199bdb0b0ed62da336", + "sha256": "77a486aa11b6a3cfea372752d945ff5a7f20a953261449199bdb0b0ed62da336" }, "ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:509e34c1cfdfda9dace98481bc42cc57575c78ffe7711d381b851c330ee4d8b8", - "sha256": "509e34c1cfdfda9dace98481bc42cc57575c78ffe7711d381b851c330ee4d8b8" + "url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:d2c6d79212a79f3b1acee88ab44018eccf20e9fce12c69c31c782536f92493d6", + "sha256": "d2c6d79212a79f3b1acee88ab44018eccf20e9fce12c69c31c782536f92493d6" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:73a9664d8a62c7b5d506a70bf100e0289795df04ece6df12f0b77651e497d42b", - "sha256": "73a9664d8a62c7b5d506a70bf100e0289795df04ece6df12f0b77651e497d42b" + "url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:af0964ac41d78b6dd2eb3affba7b1a01cdb43649196fe0bf139d72589195e110", + "sha256": "af0964ac41d78b6dd2eb3affba7b1a01cdb43649196fe0bf139d72589195e110" }, "x86_64_linux": { "cellar": "/home/linuxbrew/.linuxbrew/Cellar", - "url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:705904346a73422be8f053d7b1c413e5d18623bd7244cb33d188d921a072e600", - "sha256": "705904346a73422be8f053d7b1c413e5d18623bd7244cb33d188d921a072e600" + "url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:13328073f6c8f572ab9c5e5e1fe170b54ff43ac7038b13d602e361619cbea474", + "sha256": "13328073f6c8f572ab9c5e5e1fe170b54ff43ac7038b13d602e361619cbea474" } } } @@ -202,50 +197,50 @@ } }, "pre-commit": { - "version": "2.20.0", + "version": "2.20.0_1", "bottle": { - "rebuild": 2, + "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { "arm64_ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:5270c8f90c5343d8b0e5eeccfd01d1058957f05c5da7fd2c0d4e4af1fab1ed9f", - "sha256": "5270c8f90c5343d8b0e5eeccfd01d1058957f05c5da7fd2c0d4e4af1fab1ed9f" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:bc4ab3b751e5a0aafab0d8943ea66309034aed85392e8d09d252e0f14e17f08e", + "sha256": "bc4ab3b751e5a0aafab0d8943ea66309034aed85392e8d09d252e0f14e17f08e" }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:70cb628421bae2e6136cbc076dd620b2e3a1229ce93e47ad5592fe7739e3420b", - "sha256": "70cb628421bae2e6136cbc076dd620b2e3a1229ce93e47ad5592fe7739e3420b" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:1cf2fbb0c8ffe108e30a425fc95eb2942fc07f5af69dc9cc023c2ef85cf56591", + "sha256": "1cf2fbb0c8ffe108e30a425fc95eb2942fc07f5af69dc9cc023c2ef85cf56591" }, "arm64_big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:667e0b88c513b4ebc18265f3885c2fe5da0f0126f759cdf4cecaf52b5b1123b8", - "sha256": "667e0b88c513b4ebc18265f3885c2fe5da0f0126f759cdf4cecaf52b5b1123b8" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:7503a587bdf501da0dcef03fa9a56839d35f6f8750eb420397ed334bb9728fe3", + "sha256": "7503a587bdf501da0dcef03fa9a56839d35f6f8750eb420397ed334bb9728fe3" }, "ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:b091378b66c94fbdf5b901c4b1a8894501e7a109722b9994de794e41136f3c5d", - "sha256": "b091378b66c94fbdf5b901c4b1a8894501e7a109722b9994de794e41136f3c5d" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:f5082e39ff0265fdaf0d6b34e5711f447b5442df8d39db831cce7b28718ea30b", + "sha256": "f5082e39ff0265fdaf0d6b34e5711f447b5442df8d39db831cce7b28718ea30b" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:aff7fa28a2dacf9fbee3688cdea29c3fcf389044f791cc6284919b4f69172a5a", - "sha256": "aff7fa28a2dacf9fbee3688cdea29c3fcf389044f791cc6284919b4f69172a5a" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:a2c37345ccf7aaf9bc5f46559f3f1fff0651f2af4370e5f8c20ed1dc20513580", + "sha256": "a2c37345ccf7aaf9bc5f46559f3f1fff0651f2af4370e5f8c20ed1dc20513580" }, "big_sur": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:53f5ba9dca685812cf1de4a2760313fe134a5f7e5bd1eff1439e82c16129a94f", - "sha256": "53f5ba9dca685812cf1de4a2760313fe134a5f7e5bd1eff1439e82c16129a94f" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:72c36305b1d3fb44c59e11c3b937339c4e9759cdbe6671e134fd3f58b25131e6", + "sha256": "72c36305b1d3fb44c59e11c3b937339c4e9759cdbe6671e134fd3f58b25131e6" }, "catalina": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:0d801a89ff2c787a8c8980ff53833dc8255c885fbd1cbdf4934c27d5cd49f407", - "sha256": "0d801a89ff2c787a8c8980ff53833dc8255c885fbd1cbdf4934c27d5cd49f407" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:bb51f828d685794021556971cd2269c141fdb2f696f26e475f22104527673a3e", + "sha256": "bb51f828d685794021556971cd2269c141fdb2f696f26e475f22104527673a3e" }, "x86_64_linux": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:b08cce9e555890e9d84d0bd987ce9e9a3b87da1297c8bb6a728c17d3f59ed2c3", - "sha256": "b08cce9e555890e9d84d0bd987ce9e9a3b87da1297c8bb6a728c17d3f59ed2c3" + "url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:9ce40596bbb828e137dcf918ba0954a3095f99b922c053cc4e9c13bb55a5b283", + "sha256": "9ce40596bbb828e137dcf918ba0954a3095f99b922c053cc4e9c13bb55a5b283" } } } @@ -305,6 +300,14 @@ "CLT": "14.0.0.0.1.1661618636", "Xcode": "14.1", "macOS": "12.6" + }, + "ventura": { + "HOMEBREW_VERSION": "3.6.14", + "HOMEBREW_PREFIX": "/opt/homebrew", + "Homebrew/homebrew-core": "456895e7fb9656a4fdc13f2b6035f208e071cbb8", + "CLT": "14.1.0.0.1.1666437224", + "Xcode": "14.1", + "macOS": "13.0.1" } } } diff --git a/CHANGELOG.md b/CHANGELOG.md index c6c409b721c..7d7367fc643 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,18 @@ # Changelog -## Unreleased +## Unreleased This version adds a dependency on Swift. ### Features - Properly demangle Swift class name (#2162) +- SwiftUI performance tracking (#2271) +- Enable [File I/O Tracking](https://docs.sentry.io/platforms/apple/performance/instrumentation/automatic-instrumentation/#file-io-tracking) by default (#2497) +- [User Interaction Tracing](https://docs.sentry.io/platforms/apple/performance/instrumentation/automatic-instrumentation/#user-interaction-tracing) is stable and enabled by default(#2503) +- Add synthetic for mechanism (#2501) +- Enable CaptureFailedRequests by default (#2507) +- Support the [`SENTRY_DSN` environment variable](https://docs.sentry.io/platforms/apple/guides/macos/configuration/options/#dsn) on macOS (#2534) ### Fixes @@ -15,7 +21,10 @@ This version adds a dependency on Swift. - Increase `SentryCrashMAX_STRINGBUFFERSIZE` to reduce the instances where we're dropping a crash due to size limit (#2465) - `SentryAppStateManager` correctly unsubscribes from `NSNotificationCenter` when closing the SDK (#2460) - The SDK no longer reports an OOM when a crash happens after closing the SDK (#2468) +- Don't capture zero size screenshots ([#2459](https://github.com/getsentry/sentry-cocoa/pull/2459)) - Use the preexisting app release version format for profiles (#2470) +- Don't add out of date context for crashes (#2523) +- Fix ARC issue for FileManager (#2525) ### Breaking Changes @@ -48,7 +57,61 @@ This version adds a dependency on Swift. - Rename `SentryOptions.enableCoreDataTracking` to `enableCoreDataTracing` - SentrySDK.close calls flush, which is a blocking call (#2453) - Bump minimum Xcode version to 13 (#2483) - +- Rename `SentryOptions.enableOutOfMemoryTracking` to `SentryOptions.enableWatchdogTerminationTracking` (#2499) +- Remove the automatic `viewAppearing` span for UIViewController APM (#2511) +- Remove the permission context for events (#2529) + +## 8.0.0-beta.4 + +This version adds a dependency on Swift. + +### Features + +- Properly demangle Swift class name (#2162) + +### Fixes + +- Errors shortly after `SentrySDK.init` now affect the session (#2430) +- Use the same default environment for events and sessions (#2447) +- Increase `SentryCrashMAX_STRINGBUFFERSIZE` to reduce the instances where we're dropping a crash due to size limit (#2465) +- `SentryAppStateManager` correctly unsubscribes from `NSNotificationCenter` when closing the SDK (#2460) +- The SDK no longer reports an OOM when a crash happens after closing the SDK (#2468) +- Don't capture zero size screenshots ([#2459](https://github.com/getsentry/sentry-cocoa/pull/2459)) +- Use the preexisting app release version format for profiles (#2470) +- Remove `SentrySystemEventBreadcrumbs` observers with the most specific detail possible (#2489) + +### Breaking Changes + +- Rename `- [SentrySDK startWithOptionsObject:]` to `- [SentrySDK startWithOptions:]` (#2404) +- Make `SpanProtocol.data` non nullable (#2409) +- Mark `- [SpanProtocol setExtraValue:forKey:]` as deprecated (#2413) +- Make SpanContext immutable (#2408) + - Remove tags from SpanContext + - Remove context property from SentrySpan +- Bump minimum supported OS versions to macOS 10.13, iOS 11, tvOS 11, and watchOS 4 (#2414) +- Make public APIs Swift friendly + - Rename `SentrySDK.addBreadcrumb(crumb:)` to `SentrySDK.addBreadcrumb(_ crumb:)` (#2416) + - Rename `SentryScope.add(_ crumb:)` to `SentryScope.addBreadcrumb(_ crumb:)` (#2416) + - Rename `SentryScope.add(_ attachment:)` to `SentryScope.addAttachment(_ attachment:)` (#2416) + - Rename `Client` to `SentryClient` (#2403) +- Remove public APIs + - Remove `SentryScope.apply(to:)` (#2416) + - Remove `SentryScope.apply(to:maxBreadcrumb:)` (#2416) + - Remove `- [SentryOptions initWithDict:didFailWithError:]` (#2404) + - Remove `- [SentryOptions sdkInfo]` (#2404) + - Make SentrySession and SentrySDKInfo internal (#2451) +- Marks App hang's event stacktrace snapshot as true (#2441) +- Enable user interaction tracing by default (#2442) +- Remove default attachment content type (#2443) +- Rename APM tracking feature flags to tracing (#2450) + - Rename `SentryOptions.enableAutoPerformanceTracking` to `enableAutoPerformanceTracing` + - Rename `SentryOptions.enableUIViewControllerTracking` to `enableUIViewControllerTracing` + - Rename `SentryOptions.enablePreWarmedAppStartTracking` to `enablePreWarmedAppStartTracing` + - Rename `SentryOptions.enableFileIOTracking` to `enableFileIOTracing` + - Rename `SentryOptions.enableCoreDataTracking` to `enableCoreDataTracing` +- SentrySDK.close calls flush, which is a blocking call (#2453) +- Bump minimum Xcode version to 13 (#2483) + ## 7.31.3 ### Fixes diff --git a/Gemfile b/Gemfile index 5cce8ee3bad..0767766c40a 100644 --- a/Gemfile +++ b/Gemfile @@ -5,5 +5,6 @@ gem "cocoapods", ">= 1.9.1" gem "fastlane" gem "rest-client" gem "xcpretty" +gem "slather" eval_gemfile("fastlane/Pluginfile") diff --git a/Gemfile.lock b/Gemfile.lock index 4473934b048..591b0d62997 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -34,6 +34,7 @@ GEM aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) claide (1.1.0) + clamp (1.3.2) cocoapods (1.11.3) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) @@ -215,6 +216,7 @@ GEM mime-types-data (3.2022.0105) mini_magick (4.11.0) mini_mime (1.1.2) + mini_portile2 (2.8.0) minitest (5.16.3) molinillo (0.8.0) multi_json (1.15.0) @@ -223,10 +225,14 @@ GEM nap (1.1.0) naturally (2.2.1) netrc (0.11.0) + nokogiri (1.13.10) + mini_portile2 (~> 2.8.0) + racc (~> 1.4) optparse (0.1.1) os (1.1.4) plist (3.6.0) public_suffix (4.0.7) + racc (1.6.1) rake (13.0.6) representable (3.2.0) declarative (< 0.1.0) @@ -252,6 +258,12 @@ GEM simctl (1.6.8) CFPropertyList naturally + slather (2.7.3) + CFPropertyList (>= 2.2, < 4) + activesupport + clamp (~> 1.3) + nokogiri (>= 1.13.9) + xcodeproj (~> 1.21) terminal-notifier (2.0.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) @@ -293,6 +305,7 @@ DEPENDENCIES fastlane fastlane-plugin-sentry rest-client + slather xcpretty BUNDLED WITH diff --git a/Makefile b/Makefile index e79704e8f28..ea43494c8f4 100644 --- a/Makefile +++ b/Makefile @@ -34,9 +34,13 @@ format-clang: format-swift: swiftlint --fix + +## Current git reference name +GIT-REF := $(shell git rev-parse --abbrev-ref HEAD) + test: @echo "--> Running all tests" - xcodebuild -workspace Sentry.xcworkspace -scheme Sentry -configuration Test GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES -enableCodeCoverage YES -destination "platform=macOS" test | rbenv exec bundle exec xcpretty -t + ./scripts/xcode-test.sh iOS latest $(GIT-REF) YES .PHONY: test run-test-server: @@ -98,3 +102,4 @@ git-commit-add: release-pod: pod trunk push SentryPrivate.podspec pod trunk push Sentry.podspec + pod trunk push SentrySwiftUI.podspec diff --git a/Package.swift b/Package.swift index 361dc3cf3a6..a98125dadba 100644 --- a/Package.swift +++ b/Package.swift @@ -6,15 +6,10 @@ let package = Package( platforms: [.iOS(.v11), .macOS(.v10_13), .tvOS(.v11), .watchOS(.v4)], products: [ .library(name: "Sentry", targets: ["Sentry"]), - .library(name: "Sentry-Dynamic", type: .dynamic, targets: ["Sentry"]) + .library(name: "Sentry-Dynamic", type: .dynamic, targets: ["Sentry"]), + .library(name: "SentrySwiftUI", targets: ["SentrySwiftUI"]) ], targets: [ - .target( name: "SentryPrivate", - path: "Sources", - sources: [ - "Swift" - ] - ), .target( name: "Sentry", dependencies: ["SentryPrivate"], @@ -41,7 +36,29 @@ let package = Package( .linkedLibrary("z"), .linkedLibrary("c++") ] - ) + ), + .target( name: "SentryPrivate", + path: "Sources", + sources: [ + "Swift" + ] + ), + .target ( name: "SentrySwiftUI", + dependencies: ["Sentry", "SentryInternal"], + path: "Sources", + exclude: ["SentrySwiftUI/SentryInternal/"], + sources: [ + "SentrySwiftUI" + ] + ), + //SentryInternal is how we expose some internal Sentry SDK classes to SentrySwiftUI. + .target( name: "SentryInternal", + path: "Sources", + sources: [ + "SentrySwiftUI/SentryInternal/" + ], + publicHeadersPath: "SentrySwiftUI/SentryInternal/" + ) ], cxxLanguageStandard: .cxx14 ) diff --git a/Samples/TrendingMovies/TrendingMovies/ImageProcessing/ColorArt.swift b/Samples/TrendingMovies/TrendingMovies/ImageProcessing/ColorArt.swift index e59a410d2ef..b0c6a7b2d86 100644 --- a/Samples/TrendingMovies/TrendingMovies/ImageProcessing/ColorArt.swift +++ b/Samples/TrendingMovies/TrendingMovies/ImageProcessing/ColorArt.swift @@ -319,7 +319,7 @@ private struct RGBADecimalComponents: Hashable { // Relative luminance formula: https://en.wikipedia.org/wiki/Relative_luminance var luminance: CGFloat { - 0.212_6 * r + 0.715_2 * g + 0.072_2 * b + 0.2126 * r + 0.7152 * g + 0.0722 * b } var isDarkColor: Bool { diff --git a/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj b/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj index c1c94c626d4..7f48d852725 100644 --- a/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj +++ b/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj @@ -16,6 +16,8 @@ 637AFDB3243B02770034958B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 637AFDB2243B02770034958B /* Assets.xcassets */; }; 637AFDB6243B02770034958B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 637AFDB4243B02770034958B /* LaunchScreen.storyboard */; }; 7B3427F825876A5200056519 /* Tongariro.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 7B3427F725876A5200056519 /* Tongariro.jpg */; }; + 7B5525B32938B5B5006A2932 /* DiskWriteException.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B5525B22938B5B5006A2932 /* DiskWriteException.swift */; }; + 7B5525B62938B644006A2932 /* DiskWriteException.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B5525B22938B5B5006A2932 /* DiskWriteException.swift */; }; 7B64386B26A6C544000D0F65 /* LaunchUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B64386A26A6C544000D0F65 /* LaunchUITests.swift */; }; 7B79000429028C7300A7F467 /* MetricKitManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B79000329028C7300A7F467 /* MetricKitManager.swift */; }; 7BFC8B0626D4D24B000D3504 /* LoremIpsum.txt in Resources */ = {isa = PBXBuildFile; fileRef = 7BFC8B0526D4D24B000D3504 /* LoremIpsum.txt */; }; @@ -245,6 +247,7 @@ 7B3427F725876A5200056519 /* Tongariro.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Tongariro.jpg; sourceTree = ""; }; 7B4F33F7271EBD2500C8591E /* SwiftUI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUI.swift; sourceTree = ""; }; 7B4F33FA271EBE0C00C8591E /* SwiftUIViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIViewController.swift; sourceTree = ""; }; + 7B5525B22938B5B5006A2932 /* DiskWriteException.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiskWriteException.swift; sourceTree = ""; }; 7B64386826A6C544000D0F65 /* iOS-SwiftUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "iOS-SwiftUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 7B64386A26A6C544000D0F65 /* LaunchUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaunchUITests.swift; sourceTree = ""; }; 7B64386C26A6C544000D0F65 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -511,6 +514,7 @@ D8D7BB492750067900044146 /* UIAssert.swift */, D8D7BB4D27501B9400044146 /* SpanObserver.swift */, 84FB812C2840021B00F3A94A /* iOS-Swift-Bridging-Header.h */, + 7B5525B22938B5B5006A2932 /* DiskWriteException.swift */, ); path = Tools; sourceTree = ""; @@ -809,6 +813,7 @@ D8444E4C275E38090042F4DE /* UIViewControllerExtension.swift in Sources */, 637AFDAE243B02760034958B /* ViewController.swift in Sources */, 0AABE2EA28855FF80057ED69 /* PermissionsViewController.swift in Sources */, + 7B5525B32938B5B5006A2932 /* DiskWriteException.swift in Sources */, 84FB8120283EEDB900F3A94A /* PerformanceViewController.swift in Sources */, D8F3D062274EBD4800B56F8C /* SpanExtension.swift in Sources */, 637AFDAA243B02760034958B /* AppDelegate.swift in Sources */, @@ -858,6 +863,7 @@ D8269A4F274C09A400BD5BD5 /* SwiftUI.swift in Sources */, D8444E57275F795D0042F4DE /* UIViewControllerExtension.swift in Sources */, D8F3D058274E57D600B56F8C /* TableViewController.swift in Sources */, + 7B5525B62938B644006A2932 /* DiskWriteException.swift in Sources */, D8269A58274C0FC700BD5BD5 /* ViewController.swift in Sources */, 844DA821282584C300E6B62E /* CoreDataViewController.swift in Sources */, D8444E55275F79570042F4DE /* SpanExtension.swift in Sources */, diff --git a/Samples/iOS-Swift/iOS-Swift/AppDelegate.swift b/Samples/iOS-Swift/iOS-Swift/AppDelegate.swift index eb0d35b2004..a75b8981e05 100644 --- a/Samples/iOS-Swift/iOS-Swift/AppDelegate.swift +++ b/Samples/iOS-Swift/iOS-Swift/AppDelegate.swift @@ -19,6 +19,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { return event } options.debug = true + if #available(iOS 14.0, *) { + options.enableMetricKit = true + } // Sampling 100% - In Production you probably want to adjust this options.tracesSampleRate = 1.0 options.sessionTrackingIntervalMillis = 5_000 diff --git a/Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard b/Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard index f835a859630..c5caddff8b0 100644 --- a/Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard +++ b/Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard @@ -18,13 +18,13 @@ - + - + - + - + +