← Back to Pull requests

chore: Move shared code out of core and rum into types #446

Closed
unknown closed this pull request without merging on Nov 18, 2026 21:01 UTC
View on GitHub
unknown unknown commented on Nov 17, 2026 21:46 UTC
Author

refs: RUM-20123

The types and crash_processing modules are meant to have no dependency on the SDK's core, since the Crashpad handler process compiles them without it, and logging is meant to have no dependency on rum. In practice, all three included headers from those modules. This change moves the code they need into types, 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/:

  • C conversions for attributes: core/attribute/types.hpp to types/attribute/types.hpp

  • Build version and platform: core/version.hpp to types/version.hpp

  • UUID generation: core/platform/uuid.hpp and uuid_{linux,macos,windows}.cpp to types/platform/

  • Deterministic sampling: core/tracing/deterministic_sampler.{hpp,cpp} and sampler.hpp to types/tracing/

  • core/util/insecure_random_generator.hpp to types/util/, since the sampler's tests use it

  • Site_ToString, from core/types.hpp to a new types/site.hpp

  • ExtractErrorSourceType, ExtractErrorFingerprint and their attribute keys, from rum/scopes/event_enrichment.hpp to a new types/error_attributes.hpp
  • Moved code is unchanged apart from its include paths. core/types.hpp and event_enrichment.hpp include the new headers, so their existing callers don't change. The tests for the sampler, UUID generation and the random generator move to tests/impl/types/.

    No file under types/ now includes a header from core/ or from a feature, no file under crash_processing/ includes one from core/, and no file under logging/ includes one from rum/.

    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.gn lists the sampler and UUID sources by path, so datadog.patch is 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-all passes in the default build, and in Crashpad mode both from the pinned revision with datadog.patch and 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

    Diff: 377 lines (+282 / -95) across 4 files Reviewer: fuzzybinary Review duration: 1395m
    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
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.9% (MEDIUM) · Higher = larger blast radius
    42.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.9% · Safe to merge
    16.9%