Repository navigation
fix(discord): classify customer template failures as configuration errors - #5751
shekhar-rudder merged 5 commits into
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
|
The test mocked Handlebars.compile to assert the hardcoded default templates still surface as 500s, which pins implementation rather than behaviour. Component cases in processor/data.ts and the util tests cover the change. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5751 +/- ##
========================================
Coverage 92.42% 92.42%
========================================
Files 741 741
Lines 41048 41050 +2
Branches 9635 9558 -77
========================================
+ Hits 37938 37940 +2
- Misses 2848 2926 +78
+ Partials 262 184 -78 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Configuration-error responses can still expose event values through raw Handlebars exception text, requiring value-free diagnostics and a dynamic-partial privacy regression test.
1 open issue
What changed in this PR
This PR classifies Discord customer-template compilation and rendering failures as 400 configuration errors to avoid futile retries, while preserving 500 errors for internally generated templates.
Changes:
- Adds a shared helper for customer-template compilation and rendering.
- Applies the helper to Discord event, identify, and embed templates.
- Adds unit and component regression coverage for template failures.
| File | Description |
|---|---|
test/integrations/destinations/discord/processor/data.ts |
Adds failure cases for all four configured template types. |
test/integrations/destinations/discord/common.ts |
Provides shared event, destination, and error fixtures. |
src/v0/util/index.test.js |
Tests valid rendering, error classification, and parse-excerpt removal. |
src/v0/util/index.js |
Adds and exports the customer-template error wrapper. |
src/v0/destinations/discord/transform.js |
Wraps configured templates while leaving fallback handling unchanged. |
Review effort: Balanced
|
I couldn’t fix this in the repository. All five live jobs failed in |
…erTemplate" This reverts commit fdfa1fc. The label tells customers which of the four Discord template fields failed to render. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|





What are the changes introduced in this PR?
Classify compilation and rendering failures in Discord’s customer-configured event, identify, and embed templates as 400
dataValidationconfiguration errors. Add unit and component regression coverage.What is the related Linear task?
Resolves RUD-3442
Please explain the objectives of your changes below
Stop retrying events that cannot succeed because of a customer template error, while keeping internal defects distinguishable as 500s.
Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
Bad configured templates now report an actionable 400 naming the template rather than a retryable 500. Valid output and internally generated fallback error classification are unchanged.
Any new dependencies introduced with this change?
None.
Any new generic utility introduced or modified. Please explain the changes.
Added
compileAndRenderUserTemplateto guard Handlebars compilation and rendering of customer-configured templates only.Any technical or performance related pointers to consider with the change?
No material performance change. Full-corpus secret-path regeneration and byte comparison passed with no artifact diff.
Validation
npm run lint— passed.git diff --check, andnpm run check:secret-paths— passed.miniverification — skipped.mini psandmini listexited 0 and showed no running stack or workspace; no live transform request was made. The task designates the passing component tests as sufficient and does not require manual smoke.ministack. No stack was running, so live provenance is unconfirmed; the recorded unit and component suites provide the validation evidence.Developer checklist
Reviewer checklist
Adversarial self-review surfaced findings that were not auto-fixed. Each carries its disposition — please evaluate before merging.
src/v0/util/index.js:909— not auto-fixed (iteration budget exhausted)