Skip to content

Commit 7be4fc0

Browse files
Merge branch 'version-5.0.0' into net9-ga
2 parents 8007513 + 6c3eb13 commit 7be4fc0

File tree

15 files changed

+141
-68
lines changed

15 files changed

+141
-68
lines changed

.github/actions/environment/action.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,35 @@ runs:
2222
with:
2323
log-accepted-android-sdk-licenses: false
2424

25+
# https://github.com/actions/runner-images/issues/10814
26+
- name: Workaround build-tools issue
27+
if: runner.os == 'macOS'
28+
shell: bash
29+
run: |
30+
curl https://dl.google.com/android/repository/build-tools_r35_macosx.zip > $ANDROID_HOME/build-tools_r35_macosx.zip
31+
cd $ANDROID_HOME
32+
mkdir -p build-tools
33+
unzip build-tools_r35_macosx.zip
34+
mv android-15 build-tools/35.0.0
35+
cd -
36+
2537
- name: Set Java Version
2638
uses: actions/setup-java@v3
2739
with:
2840
distribution: 'temurin'
2941
java-version: '11'
3042

31-
# .NET 6 and .NET 8 are not built-in with macos-13
43+
- name: Install Mono
44+
if: runner.os == 'macOS'
45+
shell: bash
46+
# Attempt to install Mono, allowing it to fail silently
47+
# Then ensure mono is correctly linked, overwriting any conflicting symlinks
48+
run: |
49+
brew install mono || true
50+
brew link --overwrite mono
51+
3252
- name: Install .NET SDK
53+
if: runner.os != 'Windows'
3354
uses: actions/setup-dotnet@v4
3455
with:
3556
dotnet-version: |

.github/actions/freediskspace/action.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,3 @@ runs:
3333
sudo apt-get autoremove -y || echo "::warning::The command [sudo apt-get autoremove -y] failed to complete successfully. Proceeding..."
3434
sudo apt-get clean || echo "::warning::The command [sudo apt-get clean] failed to complete successfully. Proceeding..."
3535
df -h /dev/root
36-
37-
# We only use Xcode 16
38-
- name: Remove unused applications
39-
if: runner.os == 'macOS'
40-
shell: bash
41-
run: |
42-
df -hI /dev/disk3s1s1
43-
sudo rm -rf /Applications/Xcode_14.3.1.app
44-
sudo rm -rf /Applications/Xcode_15.0.1.app
45-
sudo rm -rf /Applications/Xcode_15.1.app
46-
sudo rm -rf /Applications/Xcode_15.2.app
47-
sudo rm -rf /Applications/Xcode_15.3.app
48-
df -hI /dev/disk3s1s1

.github/workflows/build.yml

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@ on:
99
paths-ignore:
1010
- "**.md"
1111

12-
env:
13-
XCODE_VERSION: 16
14-
1512
jobs:
1613
build-sentry-native:
1714
name: sentry-native (${{ matrix.os }})
1815
runs-on: ${{ matrix.os }}
1916
strategy:
2017
fail-fast: false
2118
matrix:
22-
os: [ubuntu-latest, windows-latest, macos-latest]
19+
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
20+
os: [ubuntu-latest, windows-latest, macos-15]
2321

2422
steps:
2523
- name: Checkout
@@ -55,7 +53,8 @@ jobs:
5553
strategy:
5654
fail-fast: false
5755
matrix:
58-
os: [ubuntu-latest, windows-latest, macos-latest]
56+
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
57+
os: [ubuntu-latest, windows-latest, macos-15]
5958

6059
steps:
6160
- name: Cancel Previous Runs
@@ -68,18 +67,12 @@ jobs:
6867
submodules: recursive
6968
fetch-depth: 2 # default is 1 and codecov needs > 1
7069

71-
- name: Setup Xcode
72-
if: matrix.os == 'macos-latest'
73-
run: |
74-
sudo xcode-select --switch /Applications/Xcode_${{env.XCODE_VERSION}}.app/Contents/Developer
75-
xcodebuild -version
76-
7770
- name: Remove unused applications
7871
uses: ./.github/actions/freediskspace
7972

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

8578
- name: Download sentry-native (Linux)
@@ -116,6 +109,12 @@ jobs:
116109
- name: Restore .NET Dependencies
117110
run: dotnet restore Sentry-CI-Build-${{ runner.os }}.slnf --nologo
118111

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

@@ -156,7 +155,8 @@ jobs:
156155
strategy:
157156
fail-fast: false
158157
matrix:
159-
os: [ubuntu-latest, windows-latest, macos-latest]
158+
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
159+
os: [ubuntu-latest, windows-latest, macos-15]
160160

161161
steps:
162162
- uses: actions/checkout@v4
@@ -166,6 +166,8 @@ jobs:
166166
sparse-checkout: |
167167
Directory.Build.props
168168
integration-test
169+
.github
170+
169171
- name: Fetch Nuget Packages
170172
uses: actions/download-artifact@v4
171173
with:
@@ -178,30 +180,8 @@ jobs:
178180
sudo apt update
179181
sudo apt install libcurl4-openssl-dev
180182
181-
# Possibly instead of installing net9.0 here we could pin the workload version when installing workloads
182-
- uses: actions/setup-dotnet@v4
183-
with:
184-
dotnet-version: |
185-
8.0.x
186-
9.0.100
187-
188-
- name: Setup Xcode
189-
if: matrix.os == 'macos-latest'
190-
run: |
191-
sudo xcode-select --switch /Applications/Xcode_${{env.XCODE_VERSION}}.app/Contents/Developer
192-
xcodebuild -version
193-
194-
# Needed for Android SDK setup step
195-
- uses: actions/setup-java@v4
196-
with:
197-
distribution: 'temurin'
198-
java-version: '17'
199-
200-
- name: Setup Android SDK
201-
uses: android-actions/setup-android@00854ea68c109d98c75d956347303bf7c45b0277 # v3.2.1
202-
203-
- name: Install android Workloads
204-
run: dotnet workload install maui-android
183+
- name: Setup Environment
184+
uses: ./.github/actions/environment
205185

206186
- name: Test
207187
uses: getsentry/github-workflows/sentry-cli/integration-test/@v2

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
uses: ./.github/actions/environment
3636

3737
- name: Initialize CodeQL
38-
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # pin@v2
38+
uses: github/codeql-action/init@4f3212b61783c3c68e8309a0f18a699764811cda # pin@v2
3939
with:
4040
languages: csharp
4141

@@ -49,6 +49,6 @@ jobs:
4949
run: dotnet build Sentry-CI-CodeQL.slnf --no-restore --nologo
5050

5151
- name: Perform CodeQL Analysis
52-
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # pin@v2
52+
uses: github/codeql-action/analyze@4f3212b61783c3c68e8309a0f18a699764811cda # pin@v2
5353
with:
5454
category: '/language:csharp'

.github/workflows/format-code.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ on:
1010
jobs:
1111
format-code:
1212
name: Format Code
13-
# Running on 'macos' because Linux is missing the `ios` workload
14-
# See: https://github.com/dotnet/runtime/issues/85505
15-
runs-on: macos-latest
13+
# Run on 'macos' because Linux is missing the `ios` workload: https://github.com/dotnet/runtime/issues/85505
14+
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
15+
runs-on: macos-15
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v4

.github/workflows/vulnerabilities.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ on:
1010
jobs:
1111
list-vulnerable-packages:
1212
name: List vulnerable packages
13-
runs-on: macos-latest
13+
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
14+
runs-on: macos-15
1415

1516
steps:
1617
- name: Checkout

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@
1919

2020
## Unreleased
2121

22+
### Fixes
23+
24+
- Fixed ArgumentNullException in FormRequestPayloadExtractor when handling invalid form data on ASP.NET ([#3734](https://github.com/getsentry/sentry-dotnet/pull/3734))
25+
2226
### Dependencies
2327

2428
- Bump Cocoa SDK from v8.36.0 to v8.39.0 ([#3727](https://github.com/getsentry/sentry-dotnet/pull/3727))
25-
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8390)
26-
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.36.0...8.39.0)
29+
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8390)
30+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.36.0...8.39.0)
2731
- Bump Native SDK from v0.7.11 to v0.7.12 ([#3731](https://github.com/getsentry/sentry-dotnet/pull/3731))
2832
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0712)
2933
- [diff](https://github.com/getsentry/sentry-native/compare/0.7.11...0.7.12)

integration-test/cli.Tests.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@ Describe 'MAUI' -ForEach @(
141141
}
142142

143143
AddPackageReference $name 'Sentry.Maui'
144+
145+
if (Test-Path env:CI)
146+
{
147+
dotnet build $name/$name.csproj -t:InstallAndroidDependencies -f:$framework-android -p:AcceptAndroidSDKLicenses=True -p:AndroidSdkPath="/usr/local/lib/android/sdk/" | ForEach-Object { Write-Host $_ }
148+
if ($LASTEXITCODE -ne 0)
149+
{
150+
throw "Failed to install android dependencies."
151+
}
152+
}
144153
}
145154

146155
It "uploads symbols and sources for an Android build" {

src/Sentry.AspNet/Internal/SystemWebHttpRequest.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Collections.Specialized;
12
using Sentry.Extensibility;
23

34
namespace Sentry.AspNet.Internal;
@@ -12,8 +13,19 @@ internal class SystemWebHttpRequest : IHttpRequest
1213

1314
public Stream? Body => _request?.InputStream;
1415

15-
public IEnumerable<KeyValuePair<string, IEnumerable<string>>>? Form
16-
=> _request.Form.AllKeys.Select(kv => new KeyValuePair<string, IEnumerable<string>>(kv, _request.Form.GetValues(kv)));
16+
public IEnumerable<KeyValuePair<string, IEnumerable<string>>>? Form => GetFormData(_request.Form);
1717

1818
public SystemWebHttpRequest(HttpRequest request) => _request = request;
19+
20+
internal static IEnumerable<KeyValuePair<string, IEnumerable<string>>> GetFormData(NameValueCollection formdata)
21+
{
22+
return StripNulls(formdata.AllKeys).Select(key => new KeyValuePair<string, IEnumerable<string>>(
23+
key, StripNulls(formdata.GetValues(key)
24+
)));
25+
26+
// Poorly constructed form submissions can result in null keys/values on .NET Framework.
27+
// See: https://github.com/getsentry/sentry-dotnet/issues/3701
28+
IEnumerable<string> StripNulls(IEnumerable<string>? values) => values?.Where(x => x is not null) ?? [];
29+
}
30+
1931
}

src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
<!-- Generate bindings -->
9292
<Target Name="_GenerateSentryCocoaBindings" AfterTargets="SetupCocoaSDK"
9393
Condition="$([MSBuild]::IsOSPlatform('OSX')) and Exists('$(SentryCocoaFrameworkHeaders)')"
94+
Inputs="../../modules/sentry-cocoa.properties"
9495
Outputs="ApiDefinitions.cs;StructsAndEnums.cs">
9596
<MSBuild Projects="$(MSBuildProjectFile)" Targets="_InnerGenerateSentryCocoaBindings" Properties="TargetFramework=once" />
9697
</Target>

0 commit comments

Comments
 (0)