chore: Move shared code out of core and rum into types #446
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 377 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.355
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #446"
general
weight: 0.35
fuzzybinary
refs: RUM-20123
The
typesandcrash_processingmodules are meant to have no dependency on the SDK's core, since the Crashpad handler process compiles them without it, andloggingis meant to have no dependency onrum. In practice, all three included headers from those modules. This change moves the code they need intotypes, so that each of these modules can be built as a library of its own in RUM-20125.## What moves
All of this moves within
src/datadog/impl/:core/attribute/types.hpptotypes/attribute/types.hppcore/version.hpptotypes/version.hppcore/platform/uuid.hppanduuid_{linux,macos,windows}.cpptotypes/platform/core/tracing/deterministic_sampler.{hpp,cpp}andsampler.hpptotypes/tracing/core/util/insecure_random_generator.hpptotypes/util/, since the sampler's tests use itSite_ToString, fromcore/types.hppto a newtypes/site.hppExtractErrorSourceType,ExtractErrorFingerprintand their attribute keys, fromrum/scopes/event_enrichment.hppto a newtypes/error_attributes.hppMoved code is unchanged apart from its include paths.
core/types.hppandevent_enrichment.hppinclude the new headers, so their existing callers don't change. The tests for the sampler, UUID generation and the random generator move totests/impl/types/.No file under
types/now includes a header fromcore/or from a feature, no file undercrash_processing/includes one fromcore/, and no file underlogging/includes one fromrum/.Nothing in the build configuration actually enforces these module boundaries yet, hence why the original refactor missed some cross-module references and why some new one snuck in over time. RUM-20125 encapsulates the CMake configuration changes necessary to enforce module separation.
## Crashpad handler
The Crashpad handler's
handler/BUILD.gnlists the sampler and UUID sources by path, sodatadog.patchis regenerated to update those paths. Having to manually maintain a paralell list of source files in the Crashpad build is fragile; RUM-20124 describes a fix for this, where the CMake build would output a list of module source files for the GN build to consume.## Testing
check-allpasses in the default build, and in Crashpad mode both from the pinned revision withdatadog.patchand from a local clone of the fork. The Crashpad builds compile the moved sampler and UUID sources from their new paths.[RUM-20125]: https://datadoghq.atlassian.net/browse/RUM-20125?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[RUM-20125]: https://datadoghq.atlassian.net/browse/RUM-20125?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ