Repository navigation
test(user-transform): cover log in v1 fail-open path - #5617
gitcommitshow merged 1 commit into
Conversation
|
👋 I'm rudder-devbox. I opened this PR from a Linear ticket. Mention |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5617 +/- ##
===========================================
+ Coverage 93.33% 93.37% +0.04%
===========================================
Files 703 703
Lines 38759 38759
Branches 9073 9077 +4
===========================================
+ Hits 36174 36190 +16
+ Misses 2381 2366 -15
+ Partials 204 203 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
1957c9c to
f0f6b83
Compare
|
lvrach
left a comment
There was a problem hiding this comment.
Approved. The test runs a codeVersion 1 transformation that calls log inside a catch, then asserts the returned event, its metadata and the captured log line. That covers the fail-open path RUD-3167 asks about.



What are the changes introduced in this PR?
Adds focused regression coverage for a codeVersion 1 transformation that invokes the RudderStack sandbox
log(...)function from a fail-open catch block. The test verifies that execution succeeds, the original event and metadata are preserved, and the log is captured in test mode.What is the related Linear task?
Resolves RUD-3167
Please explain the objectives of your changes below
This confirms that the Jev template's undeclared-
logsecurity finding is a static-analysis false positive for the transformer runtime. codeVersion 1 transformations are delegated throughcustomTransformer-v1.js, andivmFactory.jsinstallslogin the isolate before compiling and evaluating the transformation module.The remaining Jev findings concern template logic and source metadata owned by
rudder-control-plane; they are not addressed in this repository.Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
No runtime behavior changes. The existing codeVersion 1 sandbox behavior is now protected by a service-level regression test.
Any new dependencies introduced with this change?
N/A
Any new generic utility introduced or modified. Please explain the changes.
N/A
Any technical or performance related pointers to consider with the change?
The test exercises
UserTransformService.testTransformRoutine, which underpins transformation test execution and enables test-mode log capture. Production logging remains a no-op as designed.Validation
npm run lint— passedNODE_OPTIONS='--no-node-snapshot' node_modules/.bin/jest -c jest.config.typescript.js test/__tests__/user_transformation_ts.test.ts --runInBand— 2 tests passedNODE_OPTIONS='--no-node-snapshot' node_modules/.bin/jest -c jest.default.config.js test/__tests__/user_transformation.test.js --runInBand— 59 tests passednode_modules/.bin/tsc --noEmit -p tsconfig.test.json— passedgit diff --check— passedNODE_OPTIONS='--no-node-snapshot' npx jest -c jest.config.typescript.js --runInBand test/__tests__/user_transformation_ts.test.tsexited 0 with 2/2 tests passedcurl ... http://localhost:19090/transformation/testRunexited 0 with HTTP 200, the unchanged event/metadata, and the captured fail-open logDeveloper checklist
My code follows the style guidelines of this project
No breaking changes are being introduced.
All related docs linked with the PR?
All changes manually tested?
Any documentation changes needed with this change?
Is the PR limited to 10 file changes?
Is the PR limited to one linear task?
Are relevant unit and component test-cases added in new readability format?
Reviewer checklist
Is the type of change in the PR title appropriate as per the changes?
Verified that there are no credentials or confidential data exposed with the changes.
🔭 Live preview
Resumable while this task is open.