fix: failing appsec tests after iitm bump to v2.0.0#6935
Conversation
Overall package sizeSelf size: 4.35 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.0 | 68.46 kB | 797.03 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6935 +/- ##
==========================================
+ Coverage 84.77% 84.78% +0.01%
==========================================
Files 521 521
Lines 22157 22155 -2
==========================================
+ Hits 18784 18785 +1
+ Misses 3373 3370 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
BenchmarksBenchmark execution time: 2025-12-17 23:05:52 Comparing candidate commit 67ffe04 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 288 metrics, 32 unstable metrics. |
ad23362 to
0499959
Compare
BridgeAR
left a comment
There was a problem hiding this comment.
LGTM with the import being more general. The other part is optional.
91e3958 to
cc057b0
Compare
pabloerhard
left a comment
There was a problem hiding this comment.
I added dd-trace/initialize.mjs and dd-trace/register.js as flags to consider when checking whether ESM is configured, since these are the options provided in Datadog’s documentation. ESM does not directly expose the module cache, so a direct alternative to require.cache does not currently exist. I added this general comment so we can further discuss any other options or concerns, as the two open comments relate to this change.
@bengl @BridgeAR @uurien
47f2a1a to
42c78f3
Compare
ed8d73b to
bc6fe98
Compare
bc6fe98 to
c50ef6c
Compare
BridgeAR
left a comment
There was a problem hiding this comment.
LGTM with the debug log removed
4794b75 to
73490a7
Compare
* Added support for iitm v2.0.0 * Update iitm with master package.json and yarn.lock
* Added support for iitm v2.0.0 * Update iitm with master package.json and yarn.lock
* Added support for iitm v2.0.0 * Update iitm with master package.json and yarn.lock
What does this PR do?
This PR aims to fix appsec tests failing after bumping iitm to version 2.0.0
Motivation
iitm version 2.0.0 includes changes that include files being rewritten from CommonJS to ESM, which caused the conditions in the isEsmConfigured function to fail. This happened because the files are no longer keys in the require.cache. This PR adds the flag --import dd-trace/initialize.mjs as an early return statement to bypass the issues caused by the iitm change.
Plugin Checklist
Additional Notes