Skip to content

Commit

Permalink
Merge branch 'main' into feat/add-profiling-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
vaind authored Nov 22, 2024
2 parents 24e6bde + 7bda98c commit bd53758
Show file tree
Hide file tree
Showing 200 changed files with 4,729 additions and 3,974 deletions.
39 changes: 31 additions & 8 deletions .generated.NoMobile.sln
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Samples.Serilog", "samples\Sentry.Samples.Serilog\Sentry.Samples.Serilog.csproj", "{AA98FD8D-1254-4B34-840C-06BB263933DE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{230B9384-90FD-4551-A5DE-1A5C197F25B6}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
src\Directory.Build.targets = src\Directory.Build.targets
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Android.AssemblyReader", "src\Sentry.Android.AssemblyReader\Sentry.Android.AssemblyReader.csproj", "{20386BBE-1F55-4503-9F5F-F2C6B29DE865}"
EndProject
Expand Down Expand Up @@ -148,15 +152,16 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SingleFileTestApp", "test\SingleFileTestApp\SingleFileTestApp.csproj", "{162A1CAE-ACEE-45CA-A6D0-7702ADE4D3DE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "modules", "modules", "{A3CCA27E-4DF8-479D-833C-CAA0950715AA}"
ProjectSection(SolutionItems) = preProject
modules\sentry-cocoa.properties = modules\sentry-cocoa.properties
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TraceEvent", "modules\perfview\src\TraceEvent\TraceEvent.csproj", "{67269916-C417-4CEE-BD7D-CA66C3830AEE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FastSerialization", "modules\perfview\src\FastSerialization\FastSerialization.csproj", "{8032310D-3C06-442C-A318-F365BCC4C804}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Samples.Console.Native", "samples\Sentry.Samples.Console.Native\Sentry.Samples.Console.Native.csproj", "{FC8AEABA-1A40-4891-9EBA-4B6A1F7244B2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Samples.Console.Metrics", "samples\Sentry.Samples.Console.Metrics\Sentry.Samples.Console.Metrics.csproj", "{BD2D08FC-8675-4157-A73C-D75F6A3856D3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Samples.MacOS", "samples\Sentry.Samples.MacOS\Sentry.Samples.MacOS.csproj", "{5B100CC0-1A78-407E-A5A5-94BC06D67461}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Samples.Hangfire", "samples\Sentry.Samples.Hangfire\Sentry.Samples.Hangfire.csproj", "{407C477D-69C0-4B02-8A68-EE6B5A81C696}"
Expand All @@ -165,7 +170,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Hangfire", "src\Sent
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Hangfire.Tests", "test\Sentry.Hangfire.Tests\Sentry.Hangfire.Tests.csproj", "{46E40BE8-1AB0-4846-B0A2-A40AD0272C64}"
EndProject
Project("{{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Samples.AspNetCore.WebAPI.Profiling", "samples\Sentry.Samples.AspNetCore.WebAPI.Profiling\Sentry.Samples.AspNetCore.WebAPI.Profiling.csproj", "{A5B26C14-7313-4EDC-91E3-287F9374AB75}"
Project("{00000000-0000-0000-0000-000000000000}") = "Sentry.Samples.AspNetCore.WebAPI.Profiling", "samples\Sentry.Samples.AspNetCore.WebAPI.Profiling\Sentry.Samples.AspNetCore.WebAPI.Profiling.csproj", "{A5B26C14-7313-4EDC-91E3-287F9374AB75}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{233D34AB-970E-4913-AA1E-172E833FB5B2}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -176,10 +181,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{233D34AB-9
Directory.Build.targets = Directory.Build.targets
global.json = global.json
nuget.config = nuget.config
.codecov.yml = .codecov.yml
.gitignore = .gitignore
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.AspNetCore.Blazor.WebAssembly", "src\Sentry.AspNetCore.Blazor.WebAssembly\Sentry.AspNetCore.Blazor.WebAssembly.csproj", "{8298202C-9983-4D0A-851D-805539EE481A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Analyzers", "src\Sentry.Analyzers\Sentry.Analyzers.csproj", "{E36C8DCA-464E-41CB-B189-F58553AAA8D4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Analyzers.Tests", "test\Sentry.Analyzers.Tests\Sentry.Analyzers.Tests.csproj", "{5A17FEF9-07BB-47B8-9883-9C2CC93F09E8}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Samples.Console.HeapDump", "samples\Sentry.Samples.Console.HeapDump\Sentry.Samples.Console.HeapDump.csproj", "{D7DF0B26-AD43-4F8B-9BFE-C4471CCC9821}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -276,6 +288,7 @@ Global
{4E0DC405-C372-4396-A5DF-F6AA108DA01C}.Release|Any CPU.Build.0 = Release|Any CPU
{9B175EC8-6B64-4345-A158-091CB8876077}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9B175EC8-6B64-4345-A158-091CB8876077}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9B175EC8-6B64-4345-A158-091CB8876077}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{9B175EC8-6B64-4345-A158-091CB8876077}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9B175EC8-6B64-4345-A158-091CB8876077}.Release|Any CPU.Build.0 = Release|Any CPU
{EE0DC846-52F3-46AF-BC0D-DEF81150CEC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -470,10 +483,6 @@ Global
{FC8AEABA-1A40-4891-9EBA-4B6A1F7244B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC8AEABA-1A40-4891-9EBA-4B6A1F7244B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC8AEABA-1A40-4891-9EBA-4B6A1F7244B2}.Release|Any CPU.Build.0 = Release|Any CPU
{BD2D08FC-8675-4157-A73C-D75F6A3856D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD2D08FC-8675-4157-A73C-D75F6A3856D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD2D08FC-8675-4157-A73C-D75F6A3856D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD2D08FC-8675-4157-A73C-D75F6A3856D3}.Release|Any CPU.Build.0 = Release|Any CPU
{5B100CC0-1A78-407E-A5A5-94BC06D67461}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B100CC0-1A78-407E-A5A5-94BC06D67461}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B100CC0-1A78-407E-A5A5-94BC06D67461}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -498,6 +507,18 @@ Global
{A5B26C14-7313-4EDC-91E3-287F9374AB75}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A5B26C14-7313-4EDC-91E3-287F9374AB75}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A5B26C14-7313-4EDC-91E3-287F9374AB75}.Release|Any CPU.Build.0 = Release|Any CPU
{E36C8DCA-464E-41CB-B189-F58553AAA8D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E36C8DCA-464E-41CB-B189-F58553AAA8D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E36C8DCA-464E-41CB-B189-F58553AAA8D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E36C8DCA-464E-41CB-B189-F58553AAA8D4}.Release|Any CPU.Build.0 = Release|Any CPU
{5A17FEF9-07BB-47B8-9883-9C2CC93F09E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5A17FEF9-07BB-47B8-9883-9C2CC93F09E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5A17FEF9-07BB-47B8-9883-9C2CC93F09E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5A17FEF9-07BB-47B8-9883-9C2CC93F09E8}.Release|Any CPU.Build.0 = Release|Any CPU
{D7DF0B26-AD43-4F8B-9BFE-C4471CCC9821}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7DF0B26-AD43-4F8B-9BFE-C4471CCC9821}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7DF0B26-AD43-4F8B-9BFE-C4471CCC9821}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7DF0B26-AD43-4F8B-9BFE-C4471CCC9821}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -574,12 +595,14 @@ Global
{67269916-C417-4CEE-BD7D-CA66C3830AEE} = {A3CCA27E-4DF8-479D-833C-CAA0950715AA}
{8032310D-3C06-442C-A318-F365BCC4C804} = {A3CCA27E-4DF8-479D-833C-CAA0950715AA}
{FC8AEABA-1A40-4891-9EBA-4B6A1F7244B2} = {21B42F60-5802-404E-90F0-AEBCC56760C0}
{BD2D08FC-8675-4157-A73C-D75F6A3856D3} = {21B42F60-5802-404E-90F0-AEBCC56760C0}
{5B100CC0-1A78-407E-A5A5-94BC06D67461} = {21B42F60-5802-404E-90F0-AEBCC56760C0}
{407C477D-69C0-4B02-8A68-EE6B5A81C696} = {21B42F60-5802-404E-90F0-AEBCC56760C0}
{EADF25F5-8D02-4747-AB54-5F2BAA648471} = {230B9384-90FD-4551-A5DE-1A5C197F25B6}
{46E40BE8-1AB0-4846-B0A2-A40AD0272C64} = {6987A1CC-608E-4868-A02C-09D30C8B7B2D}
{8298202C-9983-4D0A-851D-805539EE481A} = {230B9384-90FD-4551-A5DE-1A5C197F25B6}
{A5B26C14-7313-4EDC-91E3-287F9374AB75} = {21B42F60-5802-404E-90F0-AEBCC56760C0}
{E36C8DCA-464E-41CB-B189-F58553AAA8D4} = {230B9384-90FD-4551-A5DE-1A5C197F25B6}
{5A17FEF9-07BB-47B8-9883-9C2CC93F09E8} = {6987A1CC-608E-4868-A02C-09D30C8B7B2D}
{D7DF0B26-AD43-4F8B-9BFE-C4471CCC9821} = {21B42F60-5802-404E-90F0-AEBCC56760C0}
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @bitsandfoxes @jamescrosswell
* @bruno-garcia @jamescrosswell
37 changes: 33 additions & 4 deletions .github/actions/environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,56 @@ runs:
with:
log-accepted-android-sdk-licenses: false

# https://github.com/actions/runner-images/issues/10814
- name: Workaround build-tools issue
if: runner.os == 'macOS'
shell: bash
run: |
curl https://dl.google.com/android/repository/build-tools_r35_macosx.zip > $ANDROID_HOME/build-tools_r35_macosx.zip
cd $ANDROID_HOME
mkdir -p build-tools
unzip build-tools_r35_macosx.zip
mv android-15 build-tools/35.0.0
cd -
- name: Set Java Version
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

# .NET 6 and .NET 8 are not built-in with macos-13
- name: Install Mono
if: runner.os == 'macOS'
shell: bash
# Attempt to install Mono, allowing it to fail silently
# Then ensure mono is correctly linked, overwriting any conflicting symlinks
run: |
brew install mono || true
brew link --overwrite mono
- name: Install .NET SDK
uses: actions/setup-dotnet@v3
if: runner.os != 'Windows'
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
9.0.100
- name: Install .NET 9
if: runner.os == 'Windows'
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.100
- name: Install .NET Workloads
shell: bash
run: >
dotnet workload install \
wasm-tools maui-android \
wasm-tools wasm-tools-net8 maui-android \
${{ runner.os == 'macOS' && 'maui-ios maui-maccatalyst maui-windows macos' || '' }} \
${{ runner.os == 'Windows' && 'maui-windows' || '' }} \
${{ runner.os == 'Windows' && 'maui-ios maui-maccatalyst maui-windows' || '' }} \
--temp-dir "${{ runner.temp }}" \
--skip-sign-check
35 changes: 35 additions & 0 deletions .github/actions/freediskspace/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Remove unused applications
description: Frees disk space by removing unused applications
runs:
using: composite
steps:

- name: Free Disk Space
if: runner.os == 'Linux'
uses: jlumbroso/free-disk-space@f68fdb76e2ea636224182cfb7377ff9a1708f9b8
with:
android: false
dotnet: false
haskell: true
large-packages: false
docker-images: true
swap-storage: true

# TODO: Do we need all of these or just one?
# 514M /usr/lib/llvm-15
# 486M /usr/lib/llvm-14
# 448M /usr/lib/llvm-13
- name: Remove unused applications
if: runner.os == 'Linux'
shell: bash
run: |
df -h /dev/root
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /usr/local/julia1.10.5
sudo rm -rf /usr/lib/heroku
sudo rm -rf /opt/hostedtoolcache/go
sudo rm -rf /opt/hostedtoolcache/Ruby
sudo apt-get remove -y '^mysql-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mysql-.*' --fix-missing] failed to complete successfully. Proceeding..."
sudo apt-get autoremove -y || echo "::warning::The command [sudo apt-get autoremove -y] failed to complete successfully. Proceeding..."
sudo apt-get clean || echo "::warning::The command [sudo apt-get clean] failed to complete successfully. Proceeding..."
df -h /dev/root
82 changes: 24 additions & 58 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ on:
paths-ignore:
- "**.md"

env:
XCODE_VERSION: 16

jobs:
build-sentry-native:
name: sentry-native (${{ matrix.os }})
runs-on: ${{ matrix.os }}-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
os: [ubuntu-latest, windows-latest, macos-15]

steps:
- name: Checkout
Expand All @@ -34,16 +32,8 @@ jobs:
key: sentry-native-${{ runner.os }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }}
enableCrossOsArchive: true

- name: Free Disk Space (Ubuntu)
if: matrix.os == 'ubuntu-latest'
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
android: true
dotnet: false
haskell: true
large-packages: false
docker-images: false
swap-storage: true
- name: Remove unused applications
uses: ./.github/actions/freediskspace

- name: Install build dependencies
if: steps.cache.outputs.cache-hit != 'true' && runner.os == 'Linux'
Expand All @@ -63,40 +53,26 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
os: [ubuntu-latest, windows-latest, macos-15]

steps:
- name: Cancel Previous Runs
if: github.ref_name != 'main' && !startsWith(github.ref_name, 'release/')
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # Tag: 0.12.1

- name: Setup Xcode
if: matrix.os == 'macos-latest'
run: |
sudo xcode-select --switch /Applications/Xcode_${{env.XCODE_VERSION}}.app/Contents/Developer
xcodebuild -version
# We only use Xcode 16
- name: Remove unused applications
if: matrix.os == 'macos-latest'
run: |
df -hI /dev/disk3s1s1
sudo rm -rf /Applications/Xcode_14.3.1.app
sudo rm -rf /Applications/Xcode_15.0.1.app
sudo rm -rf /Applications/Xcode_15.1.app
sudo rm -rf /Applications/Xcode_15.2.app
sudo rm -rf /Applications/Xcode_15.3.app
df -hI /dev/disk3s1s1
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 2 # default is 1 and codecov needs > 1

# We use macOS for the final publishing build so we we get all the iOS/macCatalyst targets in the packages
- name: Remove unused applications
uses: ./.github/actions/freediskspace

# We use macOS for the final publishing build so we get all the iOS/macCatalyst targets in the packages
- name: Set Environment Variables
if: startsWith(matrix.os, 'macos')
if: runner.os == 'macOS'
run: echo "CI_PUBLISHING_BUILD=true" >> $GITHUB_ENV

- name: Download sentry-native (Linux)
Expand Down Expand Up @@ -133,14 +109,19 @@ jobs:
- name: Restore .NET Dependencies
run: dotnet restore Sentry-CI-Build-${{ runner.os }}.slnf --nologo

- name: Install Android SDKs
if: runner.os == 'macOS'
run: |
dotnet build src/Sentry/Sentry.csproj -t:InstallAndroidDependencies -f:net8.0-android -p:AcceptAndroidSDKLicenses=True -p:AndroidSdkPath="/usr/local/lib/android/sdk/"
- name: Build
run: dotnet build Sentry-CI-Build-${{ runner.os }}.slnf -c Release --no-restore --nologo -v:minimal -flp:logfile=build.log -p:CopyLocalLockFileAssemblies=true

- name: Test
run: dotnet test Sentry-CI-Build-${{ runner.os }}.slnf -c Release --no-build --nologo -l GitHubActions -l "trx;LogFilePrefix=testresults_${{ runner.os }}" --collect "XPlat Code Coverage"

- name: Upload code coverage
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238
uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a

- name: Upload build and test outputs
if: failure()
Expand Down Expand Up @@ -173,7 +154,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
os: [ubuntu-latest, windows-latest, macos-15]

steps:
- uses: actions/checkout@v4
Expand All @@ -183,6 +165,8 @@ jobs:
sparse-checkout: |
Directory.Build.props
integration-test
.github
- name: Fetch Nuget Packages
uses: actions/download-artifact@v4
with:
Expand All @@ -195,26 +179,8 @@ jobs:
sudo apt update
sudo apt install libcurl4-openssl-dev
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Setup Xcode
if: matrix.os == 'macos-latest'
run: |
sudo xcode-select --switch /Applications/Xcode_${{env.XCODE_VERSION}}.app/Contents/Developer
xcodebuild -version
# Needed for Android SDK setup step
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Setup Android SDK
uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2

- run: dotnet workload install android maui-android
- name: Setup Environment
uses: ./.github/actions/environment

- name: Test
uses: getsentry/github-workflows/sentry-cli/integration-test/@v2
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,20 @@ jobs:
uses: ./.github/actions/environment

- name: Initialize CodeQL
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # pin@v2
uses: github/codeql-action/init@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # pin@v2
with:
languages: csharp

- name: Restore .NET Dependencies
run: dotnet restore Sentry-CI-CodeQL.slnf --nologo
# We should be able to get rid of the restore here, if we install the correct workloads in actions/environment
run: |
dotnet workload restore
dotnet restore Sentry-CI-CodeQL.slnf --nologo
- name: Build
run: dotnet build Sentry-CI-CodeQL.slnf --no-restore --nologo

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # pin@v2
uses: github/codeql-action/analyze@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # pin@v2
with:
category: '/language:csharp'
Loading

0 comments on commit bd53758

Please sign in to comment.