← Back to Pull requests

feat(test-optimization): support DD_TEST_OPTIMIZATION_RUNTIME_TAGS #11440

Closed
unknown closed this pull request without merging on Nov 27, 2026 10:04 UTC
View on GitHub
unknown unknown commented on Nov 25, 2026 11:07 UTC
Author

What does this PR do?

Adds the DD_TEST_OPTIMIZATION_RUNTIME_TAGS setting. It takes a JSON object, such as {"os.version":"6.12.0"}, that replaces the detected OS and runtime tags reported to Test Optimization.

  • Supported keys: os.platform, os.architecture, os.version, runtime.name and runtime.version. Other keys, non-string values and blank values are ignored.

  • Values are trimmed, and keys that are not set keep their detected value.

  • The values reach the test, suite, module and session events and the configurations sent in the settings, skippable and known tests requests. Worker processes read the same variable.

  • An invalid value logs a warning and the detected tags are used.

  • The value is read through the stable configuration sources, so fleet and local configuration also work.
  • Motivation

    TIA only reuses coverage recorded with exactly the same OS and runtime tags. When a runner's kernel or Node.js version changes, the next runs skip nothing until the default branch runs again on the new value. Pinning the value keeps skipping working across those updates. datadog-ci-rb and ddtest already read this variable, and this PR is part of adding it to every Test Optimization library.

    Additional Notes

  • New unit tests in env.spec.js and a Mocha integration test that checks every event level and the skippable request. The integration test fails on master.

  • Also verified end to end on a Mocha project against a mock backend.

  • supported-configurations.json uses implementation A. The key still needs to be registered in the Feature Parity registry.
  • Diff: 201 lines (+150 / -51) across 2 files Reviewer: juan-fernandez Review duration: 2817m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 201 lines diff across 2 files
    0.36
    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.318
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #11440"
    general weight: 0.35
    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: 36.2% (MEDIUM) · Higher = larger blast radius
    36.2%
    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: 14.3% · Safe to merge
    14.3%