You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(am): gate router delivery gzip by workspace and endpoint - #5786
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.
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.
👋 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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 comparebody.GZIP.payloaddirectly 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:ciandgit diff --check— passed.AM: []; restored the full artifact because scoped generation replaces, rather than merges, the map.npm run buildpasses TypeScript compilation and sandbox bundling but cannot complete its copy step because systemcpiois missing.check:secret-pathscompares its one-destination result against the entire committed map and exits with drift for other destinations; Amplitude’s derived entry itself is unchanged.apiSecretas its secret key, while the transformer usesapiKey; secret-path derivation consequently reportsAM: []. This upstream masking mismatch needs separate correction.mini psexited 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
Reviewer checklist
Adversarial self-review surfaced findings that were not auto-fixed. Each carries its disposition — please evaluate before merging.
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.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.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.