Skip to content

feat: WER integration - #1837

Merged
jpnurmi merged 9 commits into
masterfrom
jpnurmi/feat/wer-integration
Jul 23, 2026
Merged

feat: WER integration#1837
jpnurmi merged 9 commits into
masterfrom
jpnurmi/feat/wer-integration

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Based on:

The WER (Windows Error Reporting) integration:

  • enabled via cmake -DSENTRY_INTEGRATION_WER=ON (inspired by the existing Qt integration)
  • automatically wired up during sentry_init
  • based on the scope observer API (sentry_scope_observer_t, also WIP)
  • syncs tags and attachments to WER
    • WerRegisterCustomMetadata / WerUnregisterCustomMetadata (Windows 10 1703+)
    • WerRegisterFile / WerUnregisterFile
    • WerRegisterMemoryBlock / WerUnregisterMemoryBlock

The implementation is backend-agnostic, but does not work with breakpad or crashpad, which prevent WER from handling exceptions.

> pytest -v --with_wer tests\test_integration_wer.py
=================================================================== test session starts ====================================================================
platform win32 -- Python 3.13.3, pytest-9.0.3, pluggy-1.6.0 -- C:\Users\jpnurmi\Projects\sentry\sentry-native\.venv\Scripts\python.exe
cachedir: .pytest_cache
rootdir: C:\Users\jpnurmi\Projects\sentry\sentry-native
plugins: flaky-3.8.1, pytest_httpserver-1.0.10, xdist-3.8.0
collected 5 items

tests/test_integration_wer.py::test_wer_custom_metadata[none] PASSED                                                                                  [ 20%]
tests/test_integration_wer.py::test_wer_custom_metadata[inproc] PASSED                                                                                [ 40%]
tests/test_integration_wer.py::test_wer_custom_metadata[breakpad] XFAIL (breakpad swallows the exception)                                             [ 60%]
tests/test_integration_wer.py::test_wer_custom_metadata[crashpad] XFAIL (crashpad handler terminates the process)                                     [ 80%]
tests/test_integration_wer.py::test_wer_custom_metadata[native] PASSED                                                                                [100%]

@jpnurmi
jpnurmi marked this pull request as draft July 2, 2026 13:52
Comment thread src/integrations/sentry_integration_wer.c
Comment thread src/sentry_scope.c Outdated
@jpnurmi
jpnurmi force-pushed the jpnurmi/feat/wer-integration branch 2 times, most recently from 75d0c15 to c7fc095 Compare July 6, 2026 18:46
@jpnurmi
jpnurmi marked this pull request as ready for review July 6, 2026 18:48
Comment thread src/integrations/sentry_integration_wer.c
Comment thread src/integrations/sentry_integration_wer.c
Comment thread src/sentry_scope.c Outdated
Comment thread src/sentry_scope.c Outdated
Comment thread src/integrations/sentry_integration_wer.c
@jpnurmi
jpnurmi force-pushed the jpnurmi/feat/wer-integration branch from 48dffcf to 6b31a5c Compare July 7, 2026 11:36
Comment thread src/integrations/sentry_integration_wer.c
Comment thread src/integrations/sentry_integration_wer.c
Adds sentry_integration_wer_new() which creates an integration that uses
a scope observer to sync sentry scope state to Windows Error Reporting:

- Tags are synced via WerRegisterCustomMetadata (loaded dynamically for
  compatibility with pre-19H1 Windows 10 builds).
- File attachments are registered with WerRegisterFile.
- Buffer attachments are registered with WerRegisterMemoryBlock.

When tags or attachments are removed via the sentry API, the
corresponding WER registrations are cleaned up.
@jpnurmi
jpnurmi force-pushed the jpnurmi/feat/wer-integration branch from c0fd76e to 1c53bf6 Compare July 21, 2026 10:57
Comment thread src/integrations/sentry_integration_wer.c
Comment thread src/integrations/sentry_integration_wer.c
@jpnurmi
jpnurmi force-pushed the jpnurmi/feat/wer-integration branch from 6b89e31 to f5e185d Compare July 21, 2026 11:10
Comment thread src/integrations/sentry_integration_wer.c
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.76%. Comparing base (cb14a09) to head (9a2b042).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1837   +/-   ##
=======================================
  Coverage   75.76%   75.76%           
=======================================
  Files          92       92           
  Lines       21989    21989           
  Branches     3918     3918           
=======================================
+ Hits        16660    16661    +1     
  Misses       4447     4447           
+ Partials      882      881    -1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi jpnurmi changed the title WIP: feat: WER integration feat: WER integration Jul 21, 2026
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 9a2b042

Comment thread src/integrations/sentry_integration_wer.c
Comment thread src/integrations/sentry_integration_wer.c
Comment thread src/integrations/sentry_integration_wer.c
Comment thread src/integrations/sentry_integration_wer.c
Comment thread src/integrations/sentry_integration_wer.c

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 005cbea. Configure here.

Comment thread src/integrations/sentry_integration_wer.c
Comment thread src/integrations/sentry_integration_wer.c
@jpnurmi
jpnurmi merged commit 0f4163a into master Jul 23, 2026
67 checks passed
@jpnurmi
jpnurmi deleted the jpnurmi/feat/wer-integration branch July 23, 2026 09:41
jpnurmi added a commit to getsentry/sentry-docs that referenced this pull request Jul 27, 2026
<!-- Use this checklist to make sure your PR is ready for merge. You may
delete any sections you don't need. -->

## DESCRIBE YOUR PR

The Windows Error Reporting (WER) page documents:
- WER Compatibility:
getsentry/sentry-native#1904
- WER Integration: getsentry/sentry-native#1837
- WER Migration: getsentry/sentry-native#1827

## IS YOUR CHANGE URGENT?  

Help us prioritize incoming PRs by letting us know when the change needs
to go live.
- [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE -->
- [ ] Other deadline: <!-- ENTER DATE HERE -->
- [x] None: Not urgent, can wait up to 1 week+

## SLA

- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
added an urgent due date to it.
Thanks in advance for your help!

## PRE-MERGE CHECKLIST

*Make sure you've checked the following before merging your changes:*

- [x] Checked Vercel preview for correctness, including links
- [x] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)

## LEGAL BOILERPLATE

<!-- Sentry employees and contractors can delete or ignore this section.
-->

Look, I get it. The entity doing business as "Sentry" was incorporated
in the State of Delaware in 2015 as Functional Software, Inc. and is
gonna need some rights from me in order to utilize my contributions in
this here PR. So here's the deal: I retain all rights, title and
interest in and to my contributions, and by keeping this boilerplate
intact I confirm that Sentry can use, modify, copy, and redistribute my
contributions, under Sentry's choice of terms.

## EXTRA RESOURCES

- [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants