Repository navigation
fix(refiner): return 400 for unmappable source webhooks - #5719
Conversation
|
👋 I'm rudder-devbox. I opened this PR from task Mention |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
|
There was a problem hiding this comment.
🟢 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



What are the changes introduced in this PR?
InstrumentationErrorwhenresponse,form.uuid, andform.nameare all absent.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.propertiesobject and being classified as retryable transformer failures. Validation uses the post-mapping properties object so it remains aligned withsetPropertiesV2presence 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, orform.namenow 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
TypeError, embeddedstatusCode: 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.command -v mini && mini help | head -n 12exited 0: the local stack uses a SHA-pinned rudder-transformer image, so it cannot prove this source edit is running.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.