ci(all-green): link uploaded junit tests to their pipeline #11386
Overall package size
Self size: 9.55 MB
Deduped: 10.3 MB
No deduping: 10.3 MB
<details><summary>Dependency sizes</summary>
| name | version | self size | total size |
|------|---------|-----------|------------|
| import-in-the-middle | 3.5.3 | 131.25 kB | 531.9 kB |
| opentracing | 0.14.7 | 194.81 kB | 194.81 kB |
| dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |
</details>
<sub>🤖 This report was automatically generated by heaviest-objects-in-the-universe<sub>
<a target='_blank' href='https://app.datadoghq.com/ci/pipeline-executions?query=ci_level%3Ajob+%40git.commit.sha%3Aa9c344603eee098d34a1240faa3885ac27fa5109&referrer=pr-comment&start=1795443472000'><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.datadoghq.com/static/images/pr_comments/software_delivery/badges_header/pipelines-ok.svg"/><img src="https://static.datadoghq.com/static/images/pr_comments/software_delivery/badges_header/pipelines-ok-light.svg" alt="Pipelines" align="center" /></picture></a> <a target='_blank' href='https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest+%40git.commit.sha%3A7a523685fe38225398b3bca5e64cafa8d7ec06ef&referrer=pr-comment&start=1795443472000'><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.datadoghq.com/static/images/pr_comments/software_delivery/badges_header/tests-ok.svg"/><img src="https://static.datadoghq.com/static/images/pr_comments/software_delivery/badges_header/tests-ok-light.svg" alt="Tests" align="center" /></picture></a>
<details><summary><b>🎉 All green!</b></summary>
🧪 All tests passed
❄️ No new flaky tests detected
</details>
🎯 Code Coverage (<a target='_blank' href='https://app.datadoghq.com/ci/code-coverage/github.com%2Fdatadog%2Fdd-trace-js/pull-requests/11386'>details</a>)<br>• <strong><span title="Percentage of modified executable lines covered by tests in this PR">Patch Coverage</span></strong>: 100.00%<br>• <strong><span title="Percentage of all executable lines covered by tests in the entire codebase">Overall Coverage</span></strong>: 98.57% <span title="Change in overall coverage compared to the base branch">(+0.01%)</span><br>
<sub>
This comment will be updated automatically if new data arrives. <br />
🔗 Commit SHA: a9c3446 | <a href="https://docs.datadoghq.com/integrations/guide/source-code-integration/#pr-comments">Docs</a> | <a href="https://app.datadoghq.com/ci/pull-request/Z2l0aHViLmNvbS9kYXRhZG9nL2RkLXRyYWNlLWpzLzExMzg2?referrer=pr-comment">View more details</a> | Give us <a href="https://dd.enterprise.slack.com/archives/C07E3U2QRMM">feedback</a>!
</sub>
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 99.15%. Comparing base (
58f3376) to head (a9c3446).:warning: Report is 3 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
@@ Coverage Diff @@
## master #11386 +/- ##
=======================================
Coverage 99.15% 99.15%
=======================================
Files 1136 1136
Lines 188152 188159 +7
Branches 86 86
=======================================
+ Hits 186563 186570 +7
Misses 1589 1589
| Flag | Coverage Δ | |
|---|---|---|
| ai-guard | 63.29% <ø> (-0.02%) | :arrow_down: |
| apm-capabilities | 55.13% <ø> (-0.01%) | :arrow_down: |
| apm-integrations | 81.92% <ø> (-0.01%) | :arrow_down: |
| appsec | 59.14% <ø> (-0.01%) | :arrow_down: |
| debugger | 70.85% <ø> (-0.02%) | :arrow_down: |
| instrumentation | 60.11% <ø> (+0.05%) | :arrow_up: |
| llmobs | 82.50% <ø> (-0.02%) | :arrow_down: |
| master-coverage | 99.15% <ø> (?) | |
| openfeature | 68.02% <ø> (-0.02%) | :arrow_down: |
| platform | 68.11% <ø> (-0.01%) | :arrow_down: |
| profiling | 66.46% <ø> (-0.02%) | :arrow_down: |
| serverless | 66.63% <ø> (-0.02%) | :arrow_down: |
| test-optimization | 82.00% <ø> (+<0.01%) | :arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
</details>
:umbrella: View full report in Codecov by Harness.
:loudspeaker: Have feedback on the report? Share it here.
<details><summary> :rocket: New features to boost your workflow: </summary>
</details>
Benchmarks
Benchmark execution time: 2026-11-23 15:00:14
Comparing candidate commit a9c344603eee098d34a1240faa3885ac27fa5109 in PR branch elena.juarros/SDCT-1176-correlate-all-green-junit with baseline commit 58f3376a0a914bb7fc737850519f8c464e00a8bb in branch master.
Found 0 performance improvements and 0 performance regressions! Performance is the same for 2472 metrics, 15 unstable metrics.
<details>
<summary><h3>Explanation</h3></summary>
This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:
🟩 = significantly better candidate vs. baseline
🟥 = significantly worse candidate vs. baseline
We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.
If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.
Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.
<details>
<summary><h4>More details about the CI and significant changes</h4></summary>
You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.
CIs of the difference of means are often centered around 0%, because often changes are not that big:
---------------------------------(------|---^--------)-------------------------------->
-0.6% 0% 0.3% +1.2%
| | |
lower bound of the CI --' | |
sample mean (center of the CI) -------------' |
upper bound of the CI ----------------------'
As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).
For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:
----------------------------------------|---------|---(---------^---------)---------->
0% 1% 1.3% 2.2% 3.1%
| | | |
significant impact threshold --------------' | | |
lower bound of CI --------------' | |
sample mean (center of the CI) --------------------------' |
upper bound of CI ----------------------------------'
</details>
</details>
<details>
<summary><h3>Unstable benchmarks</h3></summary>
These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.
scenario:appsec-appsec-enabled-20
max_rss_usage [-65.201MB; +54.128MB] or [-24.855%; +20.634%]scenario:appsec-iast-no-vulnerability-iast-enabled-default-config-20
max_rss_usage [-18.359MB; +5.993MB] or [-7.896%; +2.577%]scenario:appsec-iast-no-vulnerability-iast-enabled-default-config-24
max_rss_usage [-37.106MB; +13.528MB] or [-11.084%; +4.041%]scenario:appsec-iast-with-vulnerability-iast-enabled-default-config-20
max_rss_usage [-37.715MB; +19.558MB] or [-10.741%; +5.570%]scenario:appsec-iast-with-vulnerability-iast-enabled-default-config-26
max_rss_usage [-29.475MB; +14.652MB] or [-9.584%; +4.764%]scenario:openfeature-initialization-configuration-20
max_rss_usage [-4.437MB; +7.472MB] or [-5.639%; +9.494%]scenario:openfeature-initialization-error-20
max_rss_usage [-7.980MB; +2.459MB] or [-10.223%; +3.150%]scenario:openfeature-scale-full-24
max_rss_usage [-21.323MB; +31.428MB] or [-8.012%; +11.809%]scenario:openfeature-scale-full-26
max_rss_usage [-6.641MB; +33.583MB] or [-2.888%; +14.604%]scenario:plugin-cassandra-driver-batch-20
cpu_user_time [-115.202ms; +181.546ms] or [-5.383%; +8.484%]execution_time [-116.730ms; +181.961ms] or [-5.444%; +8.486%]throughput [-59745.242op/s; +38696.420op/s] or [-6.343%; +4.108%]scenario:plugin-graphql-long-with-depth-off-26
execution_time [-344.799ms; +318.774ms] or [-5.361%; +4.956%]max_rss_usage [-27.316MB; +38.953MB] or [-13.728%; +19.577%]scenario:plugin-graphql-long-with-depth-on-max-26
max_rss_usage [-34270.047KB; +33778.714KB] or [-17.620%; +17.367%]</details>
/datadog autotest review
@codex review
<!-- codex-pull-request-review-summary -->
<!-- codex-review-state:v1 {"code_review":{"commit_sha":"a9c344603eee098d34a1240faa3885ac27fa5109","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":"a9c344603eee098d34a1240faa3885ac27fa5109","has_any_findings":null,"has_unresolved_findings":null,"status":"completed"}} -->
<!-- codex-security-review:v1 {"blockingSeverityThreshold":"P0","headSha":"a9c344603eee098d34a1240faa3885ac27fa5109","mergeGateEnabled":false,"pullRequestNumber":11386,"repository":"DataDog/dd-trace-js","status":"completed"} -->
<details>
<summary><strong>Codex Review Summary</strong>: ✅ Completed</summary>
This comment shows the latest Codex review activity on this pull request.
| Review | Status | Commit | Review trigger |
| --- | --- | --- | --- |
| 📝 Code Review | ✅ Completed <relative-time datetime="2026-11-23T15:15:49.855420Z">2026-11-23T15:15:49.855420Z</relative-time> | a9c3446 | Draft marked ready |
| 🔒 Security Review | ✅ Completed <relative-time datetime="2026-11-23T15:17:17.695619Z">2026-11-23T15:17:17.695619Z</relative-time> | a9c3446 | Draft marked ready |
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
</details>
</details>
<!-- codex-review-receipt:v1 -->
Codex Review: Didn't find any major issues. Nice work!
Reviewed commit: bff12874c0
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
</details>
<!-- codex-review-receipt:v1 -->
🛡️ Codex Security Review · _Automatically triggered_
Security review completed. No security issues were found in this pull request.
Reviewed commit: bff12874c0
_Only the user who started this review can view the report in Codex._
<details> <summary>ℹ️ About Codex security reviews in GitHub</summary>
<br/>
This is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found.
</details>
<!-- datadog-code-review reviewer-id=bad90057-5c12-4101-ad47-d91c9dff0f90 -->
<!-- datadog-autotest-inline:v1:prod -->
<!-- datadog-autotest-delivery:v1:prod:5ed1152c32b4ef47d14f1ae720e4f9f66cf9981cd518aa3321da053f714dce54:inline-0 -->
<sub><sub>!P1</sub></sub> Sync Git metadata once across JUnit upload groups
<!-- autotest-finding-meta prod_data_type=none finding_id=cff30493-f8dd-496c-9fe5-c6c74fa03e9b prod_effect=static -->
When All Green finds multiple JUnit groups, every upload runs its own Git metadata sync against the same checkout. This repeats the commit lookup and, when Datadog is missing commits, can make several processes try to deepen the checkout and generate Git packs concurrently. The previous single JUnit upload ran this sync once.
return await Promise.all(groupJunitReports(INPUT_DIR).map(async (group, index) => {
await uploadSemaphore.acquire()
try {
return await runUpload('datadog-ci', [
'junit', 'upload', '--service', 'dd-trace-js-tests',
...(index === 0 ? [] : ['--skip-git-metadata-upload']),
<!-- datadog-autotest-feedback-legend:v1 -->
React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it
<details><summary>What each reaction means</summary>
</details>
<sub>🤖 Bits Code Review</sub> <sub>· <a href="https://app.datadoghq.com/code/d9b102e9-f2ed-4d70-97d9-1d9ce79dace1?referrer=autotest-pr-comment">Open Bits AI session</a></sub>
Each JUnit upload group repeats Git metadata synchronization against the same checkout. When runner diagnostic logs are readable, a sibling workflow’s run ID and attempt can also be sent alongside All Green’s job name.
<sub>Open Bits AI session</sub>
<sub>🤖 Bits Code Review · Commit bff1287</sub>
<!-- autotest-meta model=gpt-6.1-sol engine=codex reasoning_effort=high verdict=FAIL ddrs_bucket=unknown session_id=d9b102e9-f2ed-4d70-97d9-1d9ce79dace1 -->
<!-- datadog-code-review reviewer-id=bad90057-5c12-4101-ad47-d91c9dff0f90 -->
<!-- datadog-autotest:v1:prod -->
<!-- datadog-autotest-delivery:v1:prod:5ed1152c32b4ef47d14f1ae720e4f9f66cf9981cd518aa3321da053f714dce54:bundle -->
<!-- datadog-code-review reviewer-id=bad90057-5c12-4101-ad47-d91c9dff0f90 -->
<!-- datadog-autotest-inline:v1:prod -->
<!-- datadog-autotest-delivery:v1:prod:5ed1152c32b4ef47d14f1ae720e4f9f66cf9981cd518aa3321da053f714dce54:inline-1 -->
<sub><sub>!P2</sub></sub> Suppress All Green’s job name in correlated uploads
<!-- autotest-finding-meta prod_data_type=none finding_id=da8159d2-1d4d-4f11-856c-6239fd0314ec prod_effect=static -->
When the runner's diagnostic logs expose the job display name, datadog-ci 5.17.0 puts All Green’s name in _dd.ci.env_vars.DD_GITHUB_JOB_NAME. The newly correlated uploads then pair a sibling workflow’s run ID and attempt with All Green’s job name, even though the XPath tag still identifies the job that ran the tests. Set DD_GITHUB_JOB_NAME to an empty string in the upload environment and update the environment assertions.
<!-- datadog-autotest-feedback-legend:v1 -->
React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it
<details><summary>What each reaction means</summary>
</details>
<sub>🤖 Bits Code Review</sub> <sub>· <a href="https://app.datadoghq.com/code/d9b102e9-f2ed-4d70-97d9-1d9ce79dace1?referrer=autotest-pr-comment">Open Bits AI session</a></sub>
/datadog autotest review
@codex review
<!-- codex-review-receipt:v1 -->
Codex Review: Didn't find any major issues. Nice work!
Reviewed commit: a9c344603e
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
</details>
<details>
<summary>More details</summary>
Run-attempt grouping and upload environments are consistent with the stamped report metadata. End-to-end Datadog pipeline correlation remains unverified.
</details>
Was this helpful? React 👍 or 👎
<sub>Open Bits AI session</sub>
<sub>🤖 Bits Code Review · Commit a9c3446</sub>
<!-- autotest-meta model=gpt-6.1-sol engine=codex reasoning_effort=high verdict=PASS ddrs_bucket=unknown session_id=6bb5a7a1-d67d-42ea-9aa6-60795dc93236 -->
<!-- datadog-code-review reviewer-id=bad90057-5c12-4101-ad47-d91c9dff0f90 -->
<!-- datadog-autotest:v1:prod -->
<!-- datadog-autotest-delivery:v1:prod:1a7c9733758a34ddc5f7d2a2bbb801a97b0c725c94f02e9763e1b9d57c74be1a:bundle -->
Approved these changes.
juan-fernandez
Eleee28
What does this PR do?
Links the JUnit results that All Green uploads back to the pipeline (workflow run attempt) that produced them, so Datadog can correlate them.
.mochamultireporterrc.jsstampsGITHUB_RUN_ATTEMPTinto each JUnit testsuite as a property, next to the existingci.properties. The stampedci.pipeline.urlnow includes/attempts/N.scripts/upload-junit.mjsgroups the downloaded reports underjunit-results/<run-id>/by run id and stamped run attempt. It runs onedatadog-ci junit uploadper group, with that run'sGITHUB_RUN_IDandGITHUB_RUN_ATTEMPT(up to 4 uploads at a time).-
GITHUB_WORKFLOW,GITHUB_JOBandGITHUB_RUN_NUMBERstay blank, so pipeline name/number and job name still come from the existing--xpath-tagmappings.-
JOB_CHECK_RUN_IDis now blanked too. Otherwise datadog-ci tags the tests with All Green's own job id.- Reports without a stamped attempt (e.g. artifacts from older commits) keep the previous unattributed upload.
scripts/upload-junit.spec.mjscovers the grouping and the upload env.Motivation
Since JUnit uploads moved to All Green, every report is uploaded with
GITHUB_RUN_ID=''. Datadog builds the pipeline correlation id of a GitHub test event fromGITHUB_SERVER_URL,GITHUB_REPOSITORY,GITHUB_RUN_IDandGITHUB_RUN_ATTEMPT. With an empty run id, the uploaded tests can't be linked to their pipeline. As a result, pipeline-level test flags such as@ci.tests.has_runsand@_dd.ci.tests.has_failed_runsare never set on these workflows' pipelines, even when tests failed.Additional Notes
ci.tests.flags.npm run lint,scripts/upload-junit.spec.mjsandintegration-tests/mocha-parallel-files.spec.js..mochamultireporterrc.jsonly stamps the run attempt (and/attempts/Nin the URL) whenGITHUB_RUN_ATTEMPTis set.