Skip to content

feat(am): gate router delivery gzip by workspace and endpoint - #5786

Merged
achettyiitr merged 2 commits into
developfrom
harness/INT-6924-feat-am-gate-router-delivery-gz-2755c93b
Nov 16, 2026
Merged

achettyiitr merged 2 commits into
developfrom
harness/INT-6924-feat-am-gate-router-delivery-gz-2755c93b

Conversation

@rudder-devbox

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

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

Add independently gated gzip payload selection for Amplitude’s four router-delivery endpoints, after batching. Dedicated router gzip unit tests and component fixtures cover enabled, disabled, and mixed-endpoint behavior.

What is the related Linear task?

Resolves INT-6924

Please explain the objectives of your changes below

Preserve default-off output and existing batching while allowing workspace-specific rollout. Pre-merge dependency: INT-6922 must add the shared proxy’s one-format guard; that shared change is intentionally excluded here. Live integration coverage is deferred to INT-7548.

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

Only flagged Amplitude router requests move serialized JSON or FORM data into body.GZIP.payload. FORM requests receive the form content type; the proxy supplies gzip encoding.

Any new dependencies introduced with this change?

None.

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

No shared utility or type changed. The component fixtures use a local GZIP body type until INT-6922 adds the shared type.

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

Conversion occurs after batching and applies only to successful requests with a workspace ID.

Validation

  • npm run lint — passed.
  • npm test -- --testPathPattern=am --no-coverage --runInBand — 121 tests passed. The dedicated gzip tests compare body.GZIP.payload directly with flag-off JSON or FORM serialization and assert the FORM content type.
  • npm run test:ts -- component --destination=am --runInBand — 114 tests passed.
  • npx tsc --noEmit -p tsconfig.test.json — passed.
  • npm run build:ci and git diff --check — passed.
  • Scoped Amplitude secret-path regeneration derived the existing AM: []; restored the full artifact because scoped generation replaces, rather than merges, the map.
  • Code-simplify review: no further simplifications after isolating the gzip tests and removing the shared proxy round-trip test.
  • Local mini integration verification — skipped; no source-linked transformer was exercised, so no runtime pass is claimed.

⚠️ Known Issues

  • npm run build passes TypeScript compilation and sandbox bundling but cannot complete its copy step because system cpio is missing.
  • Scoped check:secret-paths compares its one-destination result against the entire committed map and exits with drift for other destinations; Amplitude’s derived entry itself is unchanged.
  • The integrations-config Amplitude definition declares apiSecret as its secret key, while the transformer uses apiKey; secret-path derivation consequently reports AM: []. This upstream masking mismatch needs separate correction.
  • INT-6922’s shared proxy one-format guard is required before merge.
  • Local mini integration verification was skipped: mini ps exited 0 with no services running, and the current build-tier rule prohibits source-building this transformer. The mini catalog advertises a source build overlay despite that restriction.

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? No documentation changes in this PR; rollout configuration is tracked in INT-7547.
  • 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.

⚠️ Auto-review unresolved

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

  • high: Group gzip fixture will fail because required group traits are missing — test/integrations/destinations/am/router/data.ts:1679 — implementer declined: The fixture overrides the destination with Config: { apiKey: ... }, so groupTypeTrait and groupValueTrait are absent. getGroupInfo does not require traits in that configuration, and the Amplitude component fixture passes unchanged.
  • high: Mixed fixture expects an alias field the builder does not emit — test/integrations/destinations/am/router/data.ts:1846 — implementer declined: responseBuilderSimple initializes rawPayload.user_properties to {} before handling the alias. The byte-exact Amplitude component fixture passes with that field present.
  • high: Gzip payloads carry the API key without a published masking path — src/v0/destinations/am/transform.js:1142 — implementer declined: The masking gap is real, but it cannot be safely fixed in this single-repository change. Secret paths are generated from rudder-integrations-config's secretKeys, which currently declares apiSecret but not apiKey for AM; regenerating here would still emit AM: [], while hand-editing the generated JSON would fail the byte-compare check. apiKey must be declared in integrations-config, then the paths regenerated and masking verified before enabling the rollout flags.

@rudder-devbox

rudder-devbox Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

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

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 Nov 13, 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: 599ecba8-a408-49a0-9b95-d0aa40d0adac

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

@sonarqubecloud

Copy link
Copy Markdown

@achettyiitr
achettyiitr marked this pull request as ready for review November 16, 2026 08:12
@achettyiitr
achettyiitr requested review from a team as code owners November 16, 2026 08:12
@achettyiitr
achettyiitr merged commit 567e7e9 into develop Nov 16, 2026
52 checks passed
@achettyiitr
achettyiitr deleted the harness/INT-6924-feat-am-gate-router-delivery-gz-2755c93b branch November 16, 2026 08:15
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