← Back to Pull requests

refactor(internal): resolve the supported-configurations registry by pull #22130

Open
unknown opened this pull request with 192 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 26, 2026 16:03 UTC
Author

Part of replacing #22018 with smaller PRs. Stacked on #22195; #22139 and #22140 stack on this one. The supported-config scan of split packages, which used to be in this PR, is now #22196, on main.

settings/env.py imported the generated registry directly, which ties it to dd-trace-py. It is meant to move to
ddtrace-internal, which never imports ddtrace. This PR declares the registry as the ddtrace_internal.supported_configurations entry point and has env.py resolve it lazily on the first lookup that needs it (validation, aliases, sensitivity), cached afterwards. Nothing is registered at import time.

  • env.py: only a first-party entry point is loaded (the shared policy in ddtrace.internal.utils.entry_points). A missing, untrusted or failing entry point is logged once and means "unregistered". register_supported_configurations() stays as an explicit override (first registration wins). Adds get_aliases(name) / is_sensitive(name); telemetry keeps reading the registry directly (#22139 adopts them).

  • Thread and fork safety: the first resolution is serialized with a lock. The lock and the resolution state are reset in the child after fork(), through the shared after-fork child hooks (ddtrace/internal/entry_points.py registers the reset so uWSGI's C-level fork is covered too).

  • Freezes settings/__init__.py (wave-1). settings/env.py stays unfrozen for now, because #22139 still edits it.
  • Tests: tests/internal/test_env.py.

    🤖 Generated with Claude Code

    Diff: 192 lines (+144 / -48) across 2 files Reviewer: gnufede Review duration: 6668m
    All Vouch review confidence checks passed
    Residual risk 0.32 = Change Risk (0.59) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.59 · 192 lines diff across 2 files
    0.59
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.315
    Sensitive Paths sensitive_paths
    0.059
    Real PR Conversation Timeline
    1 comments
    "Review active on #22130"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed sensitive_module
    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: 59.1% (MEDIUM) · Higher = larger blast radius
    59.1%
    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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 31.5% · Safe to merge
    31.5%