Skip to content

feat(http): support v2 event-name request overrides - #5782

Merged
shekhar-rudder merged 14 commits into
developfrom
harness/INT-7542-feat-http-support-v2-event-name-f6555a5f
Nov 13, 2026
Merged

shekhar-rudder merged 14 commits into
developfrom
harness/INT-7542-feat-http-support-v2-event-name-f6555a5f

Conversation

@rudder-devbox

@rudder-devbox rudder-devbox Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

Add HTTP v2 event-name override routing, group-aware request-field evaluation and batching, and parse-template group verification. Add router, controller, helper, and component tests.

What is the related Linear task?

Resolves INT-7542

Please explain the objectives of your changes below

Ship the transformer portion before config-backend, webapp, and integrations-config expose and allowlist eventOverrides. Those dependent repository changes are required for save validation, the edit UI, and data-plane config propagation.

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

HTTP v2 requests with configured override groups split by the first group whose events exactly match the message's top-level event (any message type) and use its effective path, query parameters, template, and batch size. Requests without groups retain existing behavior; HTTP major 1 is unchanged.

Any new dependencies introduced with this change?

None.

Any new generic utility introduced or modified. Please explain the changes.

No new metric: override mismatches show in the delivered requests (path, body, batch size). The shared DestinationIntegration framework is unchanged.

Any technical or performance related pointers to consider with the change?

Each router call evaluates all request fields in one isolate call and all body templates in as few isolate calls as fit, each capped at 5000 bodies (the most one group can send) (plus one request-field call per dontBatch event), through typed job-list functions in httpTemplateSandbox.ts (a deliberate change to the sandbox contract). The framework's fixed /http endpointPath and FORM single-event limit remain unchanged.


Validation

  • npm run lint — passed.
  • npm test -- --testPathPattern=http --no-coverage --runInBand --silent — passed, 89 tests.
  • npm test -- --testPathPattern=eventTest --no-coverage --runInBand --silent — passed, 41 tests.
  • npm run test:ts -- component --destination=http --runInBand --silent — passed, 21 tests.
  • npx tsc --noEmit -p tsconfig.json and git diff --check — passed.
  • Regenerated HTTP and then full secret paths against local integrations-config; HTTP remains ["headers"] and the final manifest has no diff.
  • Code-simplify fixed duplicate code, partition-key indirection, a stale comment, and serial partition evaluations.

⚠️ Known Issues

  • Combined mini E2E was blocked by webapp login 403 and the seeded account rejecting HTTP destination creation. The local transformer container is stock and cannot source-verify this repository in the sandbox; router behavior is supported by the listed unit and component tests. A transformer built from this branch was also run locally and exercised through /routerTransform (override groups, per-event path params, dontBatch, a failing group template): router output matched the previous commit exactly, with isolate calls down from 11/14/7 to 2/5/2 across the three scenarios.

Developer checklist

  • My code follows the style guidelines of this project
  • No breaking changes are being introduced.
  • All related docs linked with the PR? HTTP event-overrides spec
  • All changes manually tested? Automated router and component verification completed; cross-repository E2E remains dependent on rollout.
  • Any documentation changes needed with this change? No transformer documentation change.
  • Is the PR limited to 10 file changes? No; 11 files cover implementation and tests.
  • 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.

⚠️ Auto-review unresolved

Adversarial self-review surfaced findings that were not auto-fixed. Each carries its disposition — please evaluate before merging.

  • medium: Parse-template limits reject configurations the HTTP schema permits — src/controllers/eventTest.ts:186 — not auto-fixed (iteration budget exhausted)

🔭 Live preview

Resumable while this task is open.

@coderabbitai

coderabbitai Bot commented Nov 12, 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: 2984913d-b55a-448e-a4b4-13279862f2a5

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

@rudder-devbox

rudder-devbox Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

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

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.

@rudder-devbox

rudder-devbox Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

The CI log shows npm run format:ci failed because Prettier flagged src/v0/destinations/http/routerTransform.ts. I applied the required line wrap and pushed it. The repository-wide Prettier and ESLint checks, 95 HTTP unit tests, 21 HTTP component tests, and TypeScript check pass. Live end-to-end verification was skipped because the local stack runs transformer from a stock image.

517700a

@rudder-devbox

rudder-devbox Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox

rudder-devbox Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

I found two live-provider failures in the logs. Pushwoosh rejected the track batch with verdict 503 and temporary failure, retry later (the proxy itself returned HTTP 200). HubSpot's hs-es-contacts-dontbatch-v1-private-app delivery step passed, but its contact read-back stayed null through the configured retries; 115 other HubSpot assertions passed. The log also records a failed HubSpot contact cleanup.

These are external delivery/read-back failures, with no evidence of an HTTP override regression or a source fix in this branch. I made no code change; the live checks need a fresh run when the providers respond consistently.

shekhar-rudder and others added 2 commits November 12, 2026 22:53
- Share one field-surfacing helper for destination and override templates
  in parse-template, and the override limit as MAX_EVENT_OVERRIDES.
- Resolve override groups through one overrideAt helper and drop the
  groupIndices cache; recompute the cheap lookup in transformEvent.
- Let groups that set no path or query params share the default request
  field evaluation instead of a separate isolate call.
- Make recordCallMetrics an optional hook instead of a no-op needing
  three eslint-disable lines; drop guards zod already guarantees.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Counting inputs that fail validation is not required, so the
http_event_override_events counter moves into HttpIntegration's own
transformEvents, reusing the group lookup it already does. This drops the
recordCallMetrics hook from the shared DestinationIntegration base and
orchestrator, the second safeParse of raw config, and the defensive
message checks in resolveOverrideGroup. Counters add up across the
per-event dontBatch calls.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@rudder-devbox

rudder-devbox Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

This run failed in HubSpot test setup, before the transformer pipeline ran: hs-es-contacts-nonunique-lookup-existing-v3-private-app created a contact, but HubSpot's firstname search never became stably available after 25 polls (pollUntil: ... not satisfied after 25 attempts). The following transform and read-back failures are explicit skips caused by that setup failure. The previous run's legacy dontBatch case passed here, and 113 other assertions passed.

The failure depends on HubSpot's external search indexing; no HS destination or test code changed on this branch, and the logs do not support an HTTP override code fix. I made no repository change. A fresh live run is needed when HubSpot search is consistent.

Request fields were evaluated in one isolate call per override partition,
and body templates in one call per request group (endpoint, headers,
params, override group), so per-event path params cost one call per
event. The sandbox now takes a list of jobs and returns results per job:

- transformEvents evaluates every partition's request fields in one call.
- Bodies for every request group, including dontBatch events, are
  evaluated in one call on the first batch() call; results are keyed by
  chunk job IDs, and a re-batched chunk falls back to its own call.

A compile error in one job still fails only that job's events or chunks.
For one 40-event router call with four override groups the isolate calls
drop from 11 to 2, with identical router output.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…emplate

parse-template now reports missing pathParams[].path / queryParams[].from
as 'is required' errors instead of a 400, rejects an event listed in two
override groups, and adds a pre-joined message string next to the
structured errors so config-backend's save validation can pass it through
without knowing the error shape. The errors array stays for the webapp.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Dedupe each group's events before the cross-group check (drops the
within-group branch and a repeated error for a group listing the same
event twice), destructure the parsed fields instead of copying them,
spread the optional message, share MAX_OVERRIDE_EVENTS with the router
schema, and correct the comment: the router picks the first group, so a
later group listing the event never applies.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@rudder-devbox

rudder-devbox Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

The log shows commitlint --from ... --to ... rejected commit 7abda642 because its subject starts with perf(http):; this repository's type-enum allows only fix, feat, chore, refactor, docs, test, ci, style, and revert. All other commits in the checked range passed.

I could not fix this from the workspace: the invalid commit is already pushed, and changing the PR title or adding another commit does not remove it from commitlint's range. Correcting its message requires a branch-history rewrite, which is disallowed for this branch. I made no code or PR-metadata change.

@shekhar-rudder
shekhar-rudder force-pushed the harness/INT-7542-feat-http-support-v2-event-name-f6555a5f branch from 929568d to 39d475a Compare November 12, 2026 18:02
shekhar-rudder and others added 4 commits November 12, 2026 23:39
Revert httpTemplateSandbox.ts to develop: the client now runs its job list
inside one isolate call with a script that loops over the existing
evaluateRequestFieldsInSandbox / evaluateHttpBodyInSandbox globals, so the
isolate call count is unchanged and the sandbox contract is untouched.

In the router, partition request fields by override index (every partition
is already one job in the same isolate call), key body results by job IDs,
and drop the intermediate bodies array and PayloadChunk import.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Replace the job-loop script string with typed job-list globals in the
HTTP sandbox (evaluateRequestFieldsInSandbox / evaluateHttpBodyInSandbox
take [expressions, events] / [template, chunks] jobs and return results
per job), so isolate batching stays at one call per operation without
untyped code in a script string.

Remove the http_event_override_events counter and its test: override
mismatches are already visible in the delivered requests, and the counter
had no alert or dashboard.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
resolveOverrideGroup no longer requires type === 'track': any message
whose top-level `event` is a string listed in a group uses that group.
Messages without a string `event` (page/screen names, identify without
an event) still use the defaults. Matching stays exact and
case-sensitive, first group wins.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Build the parse-template body and override items from one field schema
(overrides omit headers), type verificationFields from it instead of a
Pick of the body type, surface headers and queryParams in one loop, and
share the workspaceId schema with the custom-audience parse body. Field
order, labels and responses are unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@shekhar-rudder
shekhar-rudder marked this pull request as ready for review November 13, 2026 04:01
@shekhar-rudder
shekhar-rudder requested review from a team as code owners November 13, 2026 04:01
shekhar-rudder
shekhar-rudder previously approved these changes Nov 13, 2026
@shekhar-rudder
shekhar-rudder enabled auto-merge (squash) November 13, 2026 04:14
The first batch call evaluated every request group's bodies in one isolate
call, so one router batch could exceed the per-call time and memory limits
that each group used to get alone; the platform error then failed the whole
batch on every retry. Calls now hold at most MAX_BATCH_SIZE bodies, the most
a single group could send before.

The current group was also evaluated twice on that call: it was both in
pendingGroups and passed in again. It is now evaluated after the pending
groups, where it is normally found already.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…rides type

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The router rejected every event for a destination whose overrides had a
missing name, an empty event list, no request settings, or more groups or
events than the save-time caps, though it could deliver them: a group that
sets nothing uses the defaults and one that lists no events matches none.
The destination's config schema and parse-template enforce these at save
time, so the router now only checks what it uses.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

@shekhar-rudder
shekhar-rudder merged commit 4ed8d4f into develop Nov 13, 2026
52 checks passed
@shekhar-rudder
shekhar-rudder deleted the harness/INT-7542-feat-http-support-v2-event-name-f6555a5f branch November 13, 2026 09:46
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.

2 participants