{
  "slug": "datadog-ci-sourcemaps-inject-adds-deterministic-debug-ids-ff59b6b3121e",
  "title": "datadog-ci sourcemaps inject adds deterministic debug IDs",
  "tools": [
    "datadog-ci"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-09-11T07:53:18.000Z",
  "announced_at": "2026-09-11T07:53:18.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "After building JavaScript bundles and sourcemaps, run `datadog-ci sourcemaps inject <build-dir>` before deployment, then upload the same injected artifacts with `datadog-ci sourcemaps upload <build-dir> --debug-id`. Rebuild cleanly after source or build-configuration changes, and keep artifacts unchanged between injection, upload, and deployment.",
    "examples": [
      "datadog-ci sourcemaps inject <build-dir>",
      "datadog-ci sourcemaps inject <build-dir>\ndatadog-ci sourcemaps upload <build-dir> --debug-id"
    ],
    "gotchas": [
      "Version: v5.24.0",
      "<build-dir> (required): Directory containing sourcemaps; the CLI searches recursively for `.js.map` files.",
      "--debug-id (required): Upload only bundles that already contain a Debug ID; upload reads the ID from the JavaScript bundle and does not modify build artifacts.",
      "--dry-run (inject): Preview injection without modifying files.",
      "--max-concurrency (inject): Controls concurrent artifact discovery; the inject documentation does not state a default.",
      "Prerequisite: Set `DD_API_KEY` in the environment for sourcemap upload.",
      "Prerequisite: Rebuild after source or build-configuration changes so bundles and sourcemaps are recreated without prior injection; a clean build is recommended.",
      "Prerequisite: Do not modify generated artifacts between injection, upload, and deployment; regenerate byte-dependent outputs such as SRI hashes or compressed assets after injection.",
      "The command modifies JavaScript bundles and sourcemaps in place.",
      "Bundles that already contain a debug ID are not reinjected; their sourcemap top-level `debug_id` is still added or corrected to match the bundle.",
      "Valid sourcemaps with an empty `mappings` field and their JavaScript bundles are left unchanged and reported as skipped.",
      "Upload reads the authoritative ID from the JavaScript bundle; upload matching does not depend on the sourcemap field.",
      "After source or build configuration changes, the normal build must recreate bundles and sourcemaps without the previous injection before reinjection; a clean build is recommended.",
      "Changed bundle contents receive a new debug ID, while unchanged rebuilt bundles reproduce the same deterministic ID."
    ]
  },
  "why_it_matters": "Prepare built JavaScript bundles and sourcemaps with Debug IDs before deployment and upload.",
  "sources": [
    "https://github.com/DataDog/datadog-ci/releases/tag/v5.24.0",
    "https://github.com/DataDog/datadog-ci/pull/2454",
    "https://github.com/DataDog/datadog-ci/blob/v5.24.0/packages/base/src/commands/sourcemaps/README.md"
  ],
  "rank": 0.99038,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2a-20261017",
    "verdict_id": "wave2a-20261017:wave2a-20261017-755de16d3865e730-0:gate",
    "evidence_hash": "a5eef9e998efe997cfa7b1427ab50514a9ab5a95a7e84d6781c63e618af0b6d3"
  },
  "review": {
    "draft_hash": "894b21be4eb772de0b2fea7d49fbb8e8c9ea83bac210d8f2ffb18e11083772a2",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2a-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.99 >= 0.9; 2 needed) and Jev gave 0.78 (>= 0.6 needed)."
  }
}
