Skip to content

test(user-transform): cover log in v1 fail-open path - #5617

Merged
gitcommitshow merged 1 commit into
developfrom
harness/RUD-3167-test-user-transform-cover-log-i-6db817d1
Oct 26, 2026
Merged

gitcommitshow merged 1 commit into
developfrom
harness/RUD-3167-test-user-transform-cover-log-i-6db817d1

Conversation

@rudder-devbox

@rudder-devbox rudder-devbox Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

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-log security finding is a static-analysis false positive for the transformer runtime. codeVersion 1 transformations are delegated through customTransformer-v1.js, and ivmFactory.js installs log in 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 — passed
  • NODE_OPTIONS='--no-node-snapshot' node_modules/.bin/jest -c jest.config.typescript.js test/__tests__/user_transformation_ts.test.ts --runInBand — 2 tests passed
  • NODE_OPTIONS='--no-node-snapshot' node_modules/.bin/jest -c jest.default.config.js test/__tests__/user_transformation.test.js --runInBand — 59 tests passed
  • node_modules/.bin/tsc --noEmit -p tsconfig.test.json — passed
  • git diff --check — passed
  • Inner integration verification: NODE_OPTIONS='--no-node-snapshot' npx jest -c jest.config.typescript.js --runInBand test/__tests__/user_transformation_ts.test.ts exited 0 with 2/2 tests passed
  • Live stock runtime: curl ... http://localhost:19090/transformation/testRun exited 0 with HTTP 200, the unchanged event/metadata, and the captured fail-open log

⚠️ Known Issues

  • The local mini transformer image is SHA-pinned and does not include the branch test-only change; the exit-0 focused source test validates the new coverage, while the live stock endpoint confirms the existing runtime contract.

Developer 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.

@rudder-devbox

rudder-devbox Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

👋 I'm rudder-devbox. I opened this PR from a Linear ticket.

Mention @devbox or @rudder-devbox and I'll act on it — on a top-level PR comment,
in a review summary, or on an inline comment on the diff. Without a mention I won't see it.

@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f4325313-5e94-4055-88a2-9a8460c8cc4f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.37%. Comparing base (938e883) to head (f0f6b83).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gitcommitshow
gitcommitshow marked this pull request as ready for review October 7, 2026 06:16
@gitcommitshow
gitcommitshow requested review from a team as code owners October 7, 2026 06:16
@gitcommitshow
gitcommitshow enabled auto-merge (squash) October 7, 2026 06:16
@gitcommitshow
gitcommitshow force-pushed the harness/RUD-3167-test-user-transform-cover-log-i-6db817d1 branch from 1957c9c to f0f6b83 Compare October 7, 2026 06:16
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

@lvrach lvrach left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@gitcommitshow
gitcommitshow merged commit ca0dbb9 into develop Oct 26, 2026
47 checks passed
@gitcommitshow
gitcommitshow deleted the harness/RUD-3167-test-user-transform-cover-log-i-6db817d1 branch October 26, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants