Skip to content

👷 Ensure test apps use peerDependencies for @datadog/* packages#4491

Merged
thomas-lebeau merged 2 commits intomainfrom
thomas.lebeau/check-clean-git-after-build-apps
Apr 16, 2026
Merged

👷 Ensure test apps use peerDependencies for @datadog/* packages#4491
thomas-lebeau merged 2 commits intomainfrom
thomas.lebeau/check-clean-git-after-build-apps

Conversation

@thomas-lebeau
Copy link
Copy Markdown
Collaborator

@thomas-lebeau thomas-lebeau commented Apr 15, 2026

Motivation

Test apps that list @datadog/* packages in dependencies cause yarn install to resolve them from the registry instead of using local workspace versions. This leads to dirty git trees after building (updated lockfiles, unexpected resolutions) and makes builds non-reproducible. The convention is to use peerDependencies so local packages are only installed at build time via build-test-apps.

see also: #4387

Changes

  • Add a check-packages rule that enforces peerDependencies for @datadog/* packages in test apps.
  • Migrate nuxt-app from dependencies to peerDependencies for @datadog/* packages.

Test instructions

  1. Run yarn node scripts/check-packages.ts — should pass.
  2. Add a @datadog/* package to dependencies in any test app's package.jsoncheck-packages should fail with a clear error.
  3. Run yarn build:apps --app nuxt-app — should not leave the directory dirty.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da Bot commented Apr 15, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 178.84 KiB 178.84 KiB 0 B 0.00%
Rum Profiler 6.16 KiB 6.16 KiB 0 B 0.00%
Rum Recorder 27.03 KiB 27.03 KiB 0 B 0.00%
Logs 56.36 KiB 56.36 KiB 0 B 0.00%
Rum Slim 134.70 KiB 134.70 KiB 0 B 0.00%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0041 0.004 -2.44%
RUM - add action 0.0135 0.0129 -4.44%
RUM - add error 0.0131 0.0124 -5.34%
RUM - add timing 0.0032 0.0025 -21.88%
RUM - start view 0.0136 0.0131 -3.68%
RUM - start/stop session replay recording 0.0008 0.0007 -12.50%
Logs - log message 0.0167 0.015 -10.18%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 31.72 KiB 30.83 KiB -909 B
RUM - add action 102.50 KiB 86.12 KiB -16.37 KiB
RUM - add timing 32.67 KiB 33.16 KiB +509 B
RUM - add error 106.81 KiB 94.09 KiB -12.72 KiB
RUM - start/stop session replay recording 32.50 KiB 31.73 KiB -789 B
RUM - start view 482.63 KiB 488.68 KiB +6.05 KiB
Logs - log message 101.45 KiB 103.37 KiB +1.92 KiB

🔗 RealWorld

@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 Bot commented Apr 15, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 77.01% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: dd2ceb5 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@thomas-lebeau thomas-lebeau force-pushed the thomas.lebeau/check-clean-git-after-build-apps branch 4 times, most recently from 507aaed to fbe0a2e Compare April 16, 2026 08:14
@thomas-lebeau thomas-lebeau changed the title 👷 Fail build-test-apps when git tree is dirty after build 👷 Ensure test apps use peerDependencies for @datadog/* packages Apr 16, 2026
- Add `checkTestAppPackage` to `check-packages.ts` that iterates over
  `test/apps/*` and fails if any `@datadog/*` package appears in
  `dependencies` instead of `peerDependencies`
- Extend the `PackageJson` interface with `dependencies`
@thomas-lebeau thomas-lebeau force-pushed the thomas.lebeau/check-clean-git-after-build-apps branch from fbe0a2e to dd2ceb5 Compare April 16, 2026 08:34
@thomas-lebeau thomas-lebeau marked this pull request as ready for review April 16, 2026 08:43
@thomas-lebeau thomas-lebeau requested a review from a team as a code owner April 16, 2026 08:43
Copy link
Copy Markdown
Collaborator

@bcaudan bcaudan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thomas-lebeau thomas-lebeau merged commit 489e27d into main Apr 16, 2026
23 checks passed
@thomas-lebeau thomas-lebeau deleted the thomas.lebeau/check-clean-git-after-build-apps branch April 16, 2026 15:32
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants