Skip to content

fix(refiner): return 400 for unmappable source webhooks - #5719

Merged
ItsSudip merged 1 commit into
developfrom
harness/INT-7439-fix-refiner-return-400-for-unma-64a74d1f
Oct 27, 2026
Merged

ItsSudip merged 1 commit into
developfrom
harness/INT-7439-fix-refiner-return-400-for-unma-64a74d1f

Conversation

@rudder-devbox

@rudder-devbox rudder-devbox Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

  • Guard Refiner track-property normalization when no track properties were mapped.
  • Return a handled 400 InstrumentationError when response, form.uuid, and form.name are all absent.
  • Add a source component fixture covering the malformed webhook response envelope.

What is the related Linear task?

Resolves INT-7439

Please explain the objectives of your changes below

Prevent malformed Refiner webhooks from dereferencing an undefined message.properties object and being classified as retryable transformer failures. Validation uses the post-mapping properties object so it remains aligned with setPropertiesV2 presence semantics and accepts response-only or form-only payloads.

Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

Malformed Refiner webhooks with none of response, form.uuid, or form.name now produce an embedded 400 instrumentation error instead of an unhandled 500 transformation error. Valid webhook output remains unchanged.

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 validation is scoped to the Refiner track transform. Shared Message, setPropertiesV2, and mapping files are unchanged. No secret-path regeneration is required because no destination transform, destination fixture, or destination secret configuration changed.

Validation

  • Confirmed the new fixture failed before the production fix with the existing TypeError, embedded statusCode: 500, and transformation stat tags.
  • npm run test:ts -- component --source=refiner — passed, 14 tests.
  • npm run test:ts -- component — passed, including the broader source and component regression suite.
  • npm run build:ci — passed TypeScript compilation and sandbox builds.
  • npm run lint — passed formatting and ESLint.
  • Code-simplify outcome: No simplifications worth making.
  • Live mini verification was skipped after command -v mini && mini help | head -n 12 exited 0: the local stack uses a SHA-pinned rudder-transformer image, so it cannot prove this source edit is running.

⚠️ Known Issues

  • End-to-end mini verification is unavailable for rudder-transformer source changes because the sandbox stack uses a SHA-pinned image. Repository component, lint, and build gates passed.

Developer checklist

  • My code follows the style guidelines of this project

  • No breaking changes are being introduced.

  • All related docs linked with the PR? N/A

  • All changes manually tested?

  • Any documentation changes needed with this change? No

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

@rudder-devbox

rudder-devbox Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

👋 I'm rudder-devbox. I opened this PR from task INT-7439.

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 Oct 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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 341ca7b2-4150-43cb-a234-c61d3696b0dd

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
  • Autofix · 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 Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.35%. Comparing base (a69ac12) to head (d576af5).
⚠️ Report is 13 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5719   +/-   ##
========================================
  Coverage    92.35%   92.35%           
========================================
  Files          737      737           
  Lines        40848    40851    +3     
  Branches      9581     9583    +2     
========================================
+ Hits         37726    37729    +3     
  Misses        2860     2860           
  Partials       262      262           

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

@sonarqubecloud

Copy link
Copy Markdown

@ItsSudip
ItsSudip marked this pull request as ready for review October 27, 2026 02:43
@ItsSudip
ItsSudip requested review from a team as code owners October 27, 2026 02:43
Copilot AI balanced review requested due to automatic review settings October 27, 2026 02:43
@ItsSudip
ItsSudip merged commit ac72877 into develop Oct 27, 2026
51 checks passed
@ItsSudip
ItsSudip deleted the harness/INT-7439-fix-refiner-return-400-for-unma-64a74d1f branch October 27, 2026 02:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The narrow guard follows existing mapping semantics, preserves valid payload behavior, and includes focused regression coverage.

No open issues 🎉

What changed in this PR

This PR makes the Refiner source transform return a handled validation error for unmappable webhooks instead of a retryable transformer failure.

Changes:

  • Guard response normalization when no track properties were mapped, returning an embedded 400 InstrumentationError.
  • Add a component regression fixture verifying the malformed webhook’s error message, status, and classification.
File Description
test/​integrations/​sources/​refiner/​data.ts Adds regression coverage for webhooks missing response and form fields.
src/​sources/​refiner/​transform.js Rejects unmappable webhooks before accessing undefined properties.

Review effort: Balanced

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.

3 participants