Repository navigation
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d06c319. Configure here.
|
Mutation testing breaks the lines a PR changes on purpose, one mutation at a time, and checks that a test fails each time. A changed line no test runs fails the check, and a mutant that survives the tests only warns. Full report Sentry: tests caught 10 of 10 mutants on the changed linesSentry.Native.Transport: skipped, because no test project that runs here depends on it |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5999 +/- ##
==========================================
+ Coverage 78.15% 78.31% +0.15%
==========================================
Files 537 538 +1
Lines 20077 20160 +83
Branches 4041 4059 +18
==========================================
+ Hits 15692 15788 +96
+ Misses 3542 3525 -17
- Partials 843 847 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Now that Rate limits are the main thing the HTTP transport adds, but nothing checks that Pulling the mapping out of
For mutation testing to count those tests, the opt-out would need to shrink to the parts that call sentry-native, or the helpers would move outside it. |
6e43984 to
9acec05
Compare
sentry-native 1.0 removes `sentry_clear_crashed_last_run()`, because `sentry_init()` consumes the crash marker itself, so stop calling it. Its HTTP transport can also stream a file-backed body from an offset, so `NativeHttpClient` now sends only the requested range of the file.
Build sentry-native with `SENTRY_TRANSPORT=custom`, the way the downstream SDKs supply their own transports, and export `sentry_transport_new_default()` from `NativeHttpClient` instead of replacing the transport in `C.Init`. Native AOT apps resolve the export through `UnmanagedEntryPointsAssembly`. This prepares for the `native` backend, whose `sentry-crash` daemon creates its transport through the same function. Co-authored-by: Claude Opus 5.5 <[email protected]>
Split `NativeHttpClient` into a shared core and host-specific parts, and build the core into `sentry-crash-transport`, a Native AOT shared library that `sentry-crash` will load to send crash reports with `HttpClient`. The library exports `sentry_dotnet_transport_new()`, which takes a table of the sentry-native functions it calls, because a shared library can't link against the symbols inside `sentry-crash`. In the daemon, the `HttpClient` honors the proxy and user agent from the native options. Co-authored-by: Claude Opus 5.5 <[email protected]>
Add `-Backend native` to `build-sentry-native.ps1`. It builds sentry-native with `SENTRY_BACKEND=native` through a small CMake project that adds two sources to the `sentry-crash` target, the way sentry-xbox adds its own: - `sentry-crash-transport.c` supplies `sentry_transport_new_default()` by loading `sentry-crash-transport` from the executable's directory and passing it the sentry-native functions it calls. - `sentry-preload.c` installs the daemon's crash handlers before the .NET runtime loads. The script publishes the transport library for the RID, and deploys it with `sentry-crash`, `sentry-wer.dll` on Windows, and the native backend's libraries to `sentry-native/<rid>/native/`. Co-authored-by: Claude Opus 5.5 <[email protected]>
Native AOT apps can set the `SentryNativeBackend` property to `native` to link sentry-native's `native` backend instead of `inproc`, and get `sentry-crash`, its transport library and, on Windows, `sentry-wer.dll` next to the app. The daemon sends crashes while the app waits, instead of on the next launch. Pack the native variant for every RID, build it locally and in CI, and pass `SentryOptions.HttpProxy` to sentry-native so that the daemon uses the same proxy. Co-authored-by: Claude Opus 5.5 <[email protected]>
Publish the transport without workload resolution, because it uses no workloads and the `build-sentry-native` job doesn't install the workload set that `global.json` pins. Stop when the publish or `lipo` fails, instead of deploying an empty library. Pack `sentry-wer.dll` and `sentry-crash-transport.dll` outside `lib/` without NU5100, because they are native libraries for `sentry-crash`. Co-authored-by: Claude Opus 5.5 <[email protected]>
The daemon got only the proxy address, so it couldn't send crash reports through an authenticated proxy. Pass the credentials in the proxy URL, and turn them back into `WebProxy.Credentials` in the daemon. Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
A spurious native crash sends a minidump envelope, which the mock server can't print, so `Envelopes()` never sees it. Co-authored-by: Claude Opus 5.5 <[email protected]>
The native backend tests relied on the publish test running first. Run on their own, they tested an app published with the inproc backend. Co-authored-by: Claude Opus 5.5 <[email protected]>
2f358fc to
72c9ec8
Compare
With the NuGet package folder inside the project directory, publish kept the package-relative path of `sentry-crash` and its transport library, where sentry-native doesn't find them. Co-authored-by: Claude Opus 5.5 <[email protected]>
The test now also checks that sentry-native initializes. The image's non-root user can't write the default database path in `/app`, so the container runs in a writable working directory. Co-authored-by: Claude Opus 5.5 <[email protected]>
jamescrosswell
left a comment
There was a problem hiding this comment.
Generally looks good.
The only question mark is the package size. Sentry.nupkg goes from 70 MB in main to 114 MB in this PR.
Everyone who references Sentry downloads that even though Most of them aren't Native AOT apps, and very few will set SentryNativeBackend=native.
#4867 originally suggested shipping out-of-process crash handling as a separate opt-in package. Is that worth revisiting? @ric-oliv thoughts?
|
|
||
| // for the sentry-crash daemon of the native backend | ||
| if (options.HttpProxy is WebProxy { Address: { } address } proxy) | ||
| { |
There was a problem hiding this comment.
Dang... Mutation Testing still reports the block removal on line 111 as NoCoverage. The // Stryker disable once all on line 119 only covers the sentry_options_set_proxy call, not the if block around it. Moving the marker up above the if on line 110 would silence it.
Alternatively, we could pull the URL building out and test this, the way AddHeader/GetHeaders are. Then the credential escaping gets a unit test... probably worth doing.
Co-authored-by: Claude Opus 5.5 <[email protected]>
I thought it wouldn't matter for the final deployment because it would only include necessary dependencies, but good point that it adds tens of MBs of development-time downloads even for non-NativeAOT apps. Let's give it a try with the package split and see how it goes. The Native SDK is at 1.0.0-beta.2, and we still have at least a couple of weeks to polish and iterate this. 👍 |
Stryker can't compile mutants of a pattern that declares a variable, so none of the mutants in `GetProxyUrl` were tested.

Note
Depends on sentry-native 1.0 (preload fixes and transport changes).
Description
Native AOT apps can opt into sentry-native's out-of-process
nativebackend:The
sentry-crashdaemon then sends native crashes while the app waits, instead of on the next launch. The publish output getssentry-crash, its transport library and, on Windows,sentry-wer.dll. The default staysinproc.This requires sentry-native 1.0 (submodule pinned to 1.0.0-beta.2 for now), which lets the SDK supply its own transport. The daemon loads
sentry-crash-transport, a small Native AOT library built from the sameNativeHttpClientas the app, so crash reports go throughHttpClientwith the app's proxy. The package ships thenativevariant for every RID alongsideinproc.Docs:
Issues
Closes #4867