Skip to content

Commit

Permalink
Merge branch 'main' into feat/fn-idx
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjohnsonpint committed Oct 19, 2022
2 parents 2e92fba + e2fd223 commit f297cf1
Show file tree
Hide file tree
Showing 134 changed files with 2,163 additions and 768 deletions.
8 changes: 4 additions & 4 deletions .github/actions/buildnative/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ runs:
- name: Build C Project
if: runner.os == 'Linux' || runner.os == 'macOS'
shell: bash
run: src/Sentry/Platforms/Android/C/build.sh
run: lib/sentrysupplemental/build.sh

- name: Build C Project
if: runner.os == 'Windows'
shell: cmd
run: src\Sentry\Platforms\Android\C\build.cmd
run: lib\sentrysupplemental\build.cmd

- name: Build Java Project
if: runner.os == 'Linux' || runner.os == 'macOS'
shell: bash
run: src/Sentry/Platforms/Android/Java/build.sh
run: lib/sentry-android-supplemental/build.sh

- name: Build Java Project
if: runner.os == 'Windows'
shell: cmd
run: src\Sentry\Platforms\Android\Java\build.cmd
run: lib\sentry-android-supplemental\build.cmd
20 changes: 19 additions & 1 deletion .github/actions/environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,27 @@ runs:
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" >> $GITHUB_ENV
echo "DOTNET_NOLOGO=1" >> $GITHUB_ENV
- name: Set Java Version
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

# Note, the following is needed on the windows-2019 image only.
# All other versions of .NET we need are pre-installed on the GitHub Actions virtual images.
- name: Install .NET 6 SDK
uses: actions/setup-dotnet@v3
if: runner.os == 'Windows'
env:
# Prevent setup-dotnet action from stepping on pre-installed dotnet SDKs
DOTNET_INSTALL_DIR: C:\Program Files\dotnet
with:
dotnet-version: 6.x.x

- name: Dependency Caching
uses: actions/cache@v3
if: runner.os != 'Windows' # Cache is too slow on Windows to be useful. See https://github.com/actions/cache/issues/752
# Cache is too slow on Windows to be useful. See https://github.com/actions/cache/issues/752
if: runner.os != 'Windows'
with:
path: ~/.nuget/packages
# We don't use a lockfile, so hash all files where we might be keeping <PackageReference> tags.
Expand Down
33 changes: 20 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ jobs:
fail-fast: false
matrix:
# Using macos-12 because we need Xcode 13.3 or later to build Sentry.Samples.Maui. (macos-latest currently points at macos-11 which uses Xcode 13.2)
os: [ubuntu-latest, windows-latest, macos-12]
# Using windows-2019 because windows-latest is much slower and we don't need anything in particular from it.
os: [ubuntu-latest, windows-2019, macos-12]

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # Tag: 0.11.0

- name: Checkout
uses: actions/checkout@v3
with:
Expand All @@ -30,28 +34,31 @@ jobs:
- name: Build Native Dependencies
uses: ./.github/actions/buildnative

- name: Restore .NET Dependencies
run: dotnet restore Sentry-CI-Build-${{ runner.os }}.slnf --nologo

- name: Build
run: dotnet build -c Release --nologo /p:CopyLocalLockFileAssemblies=true
run: dotnet build Sentry-CI-Build-${{ runner.os }}.slnf -c Release --no-restore --nologo /p:CopyLocalLockFileAssemblies=true

- name: Test
run: dotnet test -c Release --no-build --nologo -l GitHubActions -l "trx;LogFilePrefix=testresults_${{ runner.os }}"

- name: Pack
# Only pack in one build environment. We'll use macOS so we can build for ios/maccatalyst targets
if: startsWith(matrix.os, 'macos')
run: dotnet pack -c Release --no-build --nologo
run: dotnet test Sentry-CI-Test.slnf -c Release --no-build --nologo -l GitHubActions -l "trx;LogFilePrefix=testresults_${{ runner.os }}"

- name: Upload Verify Results
if: failure()
uses: actions/upload-artifact@v3
with:
name: verify-test-results
path: |
**/*.received.*
path: "**/*.received.*"

# To save time and disk space, we only create and archive the Nuget packages when we're actually releasing.
# We use macOS for that so we we get all the iOS/macCatalyst targets in the packages

- name: Create Nuget Packages (release only)
if: startsWith(matrix.os, 'macos') && startsWith(github.ref_name, 'release/')
run: dotnet pack Sentry-CI-Pack.slnf -c Release --no-build --nologo

- name: Archive Artifacts
# only archive on macos since we only pack on macos. See Pack step.
if: startsWith(matrix.os, 'macos')
- name: Archive Nuget Packages (release only)
if: startsWith(matrix.os, 'macos') && startsWith(github.ref_name, 'release/')
uses: actions/upload-artifact@v3
with:
name: ${{ github.sha }}
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
fail-fast: false

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # Tag: 0.11.0

- name: Checkout repository
uses: actions/checkout@v3
with:
Expand All @@ -31,8 +34,11 @@ jobs:
with:
languages: csharp

- name: Restore .NET Dependencies
run: dotnet restore Sentry-CI-CodeQL.slnf --nologo

- name: Build
run: dotnet build --nologo
run: dotnet build Sentry-CI-CodeQL.slnf --no-restore --nologo

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@807578363a7869ca324a79039e6db9c843e0e100 # pin@v2
45 changes: 41 additions & 4 deletions .github/workflows/device-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # Tag: 0.11.0

- name: Checkout
uses: actions/checkout@v3
with:
Expand All @@ -22,8 +25,11 @@ jobs:
- name: Build Native Dependencies
uses: ./.github/actions/buildnative

- name: Restore .NET Dependencies
run: dotnet restore test/Sentry.Maui.Device.TestApp --nologo

- name: Build Android Test App
run: dotnet build -c Release -f net6.0-android test/Sentry.Maui.Device.TestApp
run: dotnet build test/Sentry.Maui.Device.TestApp -c Release -f net6.0-android --no-restore --nologo

- name: Upload Android Test App
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -56,12 +62,43 @@ jobs:
- name: Install xharness
run: dotnet tool install Microsoft.DotNet.XHarness.CLI --global --version "1.*-*"

- name: Test
# Cached AVD setup per https://github.com/ReactiveCircus/android-emulator-runner/blob/main/README.md

- name: Gradle cache
uses: gradle/gradle-build-action@fd32ae908111fe31afa48827bd1ee909540aa971 # pin@v2

- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}

- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
timeout-minutes: 30
uses: reactivecircus/android-emulator-runner@d7b53ddc6e44254e1f4cf4a6ad67345837027a66 # pin@v2
with:
api-level: ${{ matrix.api-level }}
# We don't need the Google APIs, but the default images are not available for 32+
target: ${{ matrix.api-level >= 32 && 'google_apis' || 'default' }}
force-avd-creation: false
ram-size: 2048M
arch: x86_64
disk-size: 4096M
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Run Tests
timeout-minutes: 30
uses: reactivecircus/android-emulator-runner@d7b53ddc6e44254e1f4cf4a6ad67345837027a66 # pin@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.api-level >= 32 && 'google_apis' || 'default' }} # We don't need the Google APIs, but the default images are not available for 32+
# We don't need the Google APIs, but the default images are not available for 32+
target: ${{ matrix.api-level >= 32 && 'google_apis' || 'default' }}
force-avd-creation: false
ram-size: 2048M
arch: x86_64
Expand All @@ -70,7 +107,7 @@ jobs:
disable-animations: false
script: xharness android test --output-directory=./test_output --app=bin/io.sentry.dotnet.maui.device.testapp-Signed.apk --package-name=io.sentry.dotnet.maui.device.testapp

- name: Test Report
- name: Create Test Report
if: success() || failure()
run: scripts/parse-xunit2-xml.ps1 ./test_output/TestResults.xml | Out-File $env:GITHUB_STEP_SUMMARY
shell: pwsh
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/vulnerabilities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
fail-fast: false
matrix:
# Using macos-12 because we need Xcode 13.3 or later to build Sentry.Samples.Maui. (macos-latest currently points at macos-11 which uses Xcode 13.2)
os: [ubuntu-latest, windows-latest, macos-12]
# Using windows-2019 because windows-latest is much slower and we don't need anything in particular from it.
os: [ubuntu-latest, windows-2019, macos-12]

steps:
- name: Checkout
Expand All @@ -26,10 +27,14 @@ jobs:
- name: Setup Environment
uses: ./.github/actions/environment

# Everything above here is the same as the main build.
# We only need to restore to check for vulnerable packages
- name: Restore dependencies
run: dotnet restore
- name: Restore .NET Dependencies
run: dotnet restore --nologo

# The dotnet list package command doesn't change its exit code on detection, so tee to a file and scan it
# See https://github.com/NuGet/Home/issues/11315#issuecomment-1243055173
- name: List vulnerable packages
run: dotnet list package --vulnerable --include-transitive
shell: bash
run: |
dotnet list package --vulnerable --include-transitive | tee vulnerable.txt
sh -c "! grep 'has the following vulnerable packages' vulnerable.txt"
24 changes: 21 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
# Changelog

## Unreleased

### Features

- Update bundled Android SDK to version 6.5.0 ([#1984](https://github.com/getsentry/sentry-dotnet/pull/1984))
- Update bundled Cocoa SDK to version 7.28.0 ([#1988](https://github.com/getsentry/sentry-dotnet/pull/1988))
- Allow custom processors to be added as a scoped dependency ([#1979](https://github.com/getsentry/sentry-dotnet/pull/1979))
- Support DI for custom transaction processors ([#1993](https://github.com/getsentry/sentry-dotnet/pull/1993))

### Fixes

- Split Android and Cocoa bindings into separate projects ([#1983](https://github.com/getsentry/sentry-dotnet/pull/1983))
- NuGet package `Sentry` now depends on `Sentry.Bindings.Android` for `net6.0-android` targets.
- NuGet package `Sentry` now depends on `Sentry.Bindings.Cocoa` for `net6.0-ios` and `net6.0-maccatalyst` targets.
- Exclude EF error message from logging ([#1980](https://github.com/getsentry/sentry-dotnet/pull/1980))
- Ensure logs with lower levels are captured by `Sentry.Extensions.Logging` ([#1992](https://github.com/getsentry/sentry-dotnet/pull/1992))
- Fix bug with pre-formatted strings passed to diagnostic loggers ([#2004](https://github.com/getsentry/sentry-dotnet/pull/2004))

## 3.22.0

## Features
### Features

- `SentryOptions.AttachStackTrace` is now enabled by default. ([#1907](https://github.com/getsentry/sentry-dotnet/pull/1907))
- Update Sentry Android SDK to version 6.4.1 ([#1911](https://github.com/getsentry/sentry-dotnet/pull/1911))
Expand All @@ -15,7 +33,7 @@
- Support more types for message template tags in SentryLogger ([#1945](https://github.com/getsentry/sentry-dotnet/pull/1945))
- Support Dynamic Sampling ([#1953](https://github.com/getsentry/sentry-dotnet/pull/1953))

## Fixes
### Fixes

- Reduce lock contention when sampling ([#1915](https://github.com/getsentry/sentry-dotnet/pull/1915))
- Dont send transaction for OPTIONS web request ([#1921](https://github.com/getsentry/sentry-dotnet/pull/1921))
Expand All @@ -34,7 +52,7 @@

_Includes Sentry.Maui Preview 3_

## Features
### Features

- Add ISentryTransactionProcessor ([#1862](https://github.com/getsentry/sentry-dotnet/pull/1862))
- Added 'integrations' to SdkVersion ([#1820](https://github.com/getsentry/sentry-dotnet/pull/1820))
Expand Down
13 changes: 13 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>

<!--
Note: The following platform-specific properties need to be set in both Directory.Build.props and DirectoryBuild.targets.
TODO: Figure out how to consolidate to a single location.
-->
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'ios'">10.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="'$(TargetPlatformIdentifier)' == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
</PropertyGroup>

<!-- We're aware it's out of support but this is a library and it doesn't require nca3.1. -->
<!-- there's no reason to cause friction to a consumer that for some reason is stuck on an unsupported version. -->
<PropertyGroup>
Expand Down
31 changes: 30 additions & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
<Project>

<!--
Note: The following platform-specific properties need to be set in both Directory.Build.props and DirectoryBuild.targets.
TODO: Figure out how to consolidate to a single location.
-->
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'ios'">10.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetPlatformIdentifier)' == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="'$(TargetPlatformIdentifier)' == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
</PropertyGroup>

<ItemGroup Condition="'$(TargetPlatformIdentifier)' != 'android'">
<Compile Remove="**\*.Android.cs" />
<Compile Remove="**\Android\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetPlatformIdentifier)' != 'ios' And '$(TargetPlatformIdentifier)' != 'maccatalyst'">
<Compile Remove="**\*.iOS.cs" />
<Compile Remove="**\iOS\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetPlatformIdentifier)' != 'windows'">
<Compile Remove="**\*.Windows.cs" />
<Compile Remove="**\Windows\**\*.cs" />
</ItemGroup>

<!-- Workaround the fact that http doesnt exist in earlier frameworks -->
<ItemGroup>
<!-- Workaround the fact that http doesnt exist in earlier frameworks -->
<Using Remove="System.Net.Http" />
<Using Remove="System.Net.Http.Json" />
</ItemGroup>
Expand Down
Loading

0 comments on commit f297cf1

Please sign in to comment.