Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): pull release/v1.45.0 into main #2712

Merged
merged 49 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
36c7f06
fix(mixpanel): batch event ordering (#2608)
Gauravudia Sep 18, 2023
e97e7ca
fix: bqstream event ordering fix (#2624)
shrouti1507 Sep 20, 2023
5fbddd1
fix: use promise for prompts in personalize create tracking script (#…
koladilip Sep 20, 2023
fd6698e
chore(release): pull main into develop post release v1.42.0 (#2636)
ItsSudip Sep 21, 2023
16a9b8e
fix(snyk): snyk updated versions merged to oen pr
Sanjay-Veernala Sep 21, 2023
5a15022
Merge branch 'develop' into feat/synk-fixes
Sanjay-Veernala Sep 21, 2023
70bdce8
chore: add ttl values for cache (#2593)
sivashanmukh Sep 21, 2023
b49d0ee
fix(hubspot): add validation for hubspotEvents (#2643)
ItsSudip Sep 22, 2023
b8209d0
Merge branch 'develop' into feat/synk-fixes
Sanjay-Veernala Sep 25, 2023
10a13bc
fix: add optional chaining for error message in network handler of In…
ItsSudip Sep 25, 2023
7030f53
Merge branch 'develop' into feat/synk-fixes
Sanjay-Veernala Sep 25, 2023
364779c
fix(snyk): removed the new added dependencies
Sanjay-Veernala Sep 25, 2023
08a3535
fix(snyk): removed aws-sdk dependency
Sanjay-Veernala Sep 25, 2023
a21ea3a
feat: add circular reference check in flattern json (#2650)
Gauravudia Sep 25, 2023
8422744
fix(snyk): fix dependencies version from snyk (#2640)
Sanjay-Veernala Sep 25, 2023
e7dbd2c
chore(release): pull main into develop post release v1.43.0 (#2654)
ItsSudip Sep 25, 2023
6fcac7a
chore: update fb_error message for invalid type of property value (#2…
ujjwal-ab Sep 26, 2023
c0ab19a
feat(iterable): user deletion support (#2621)
mihir-4116 Sep 26, 2023
0008277
feat(gaec): partial failures handling (#2631)
mihir-4116 Sep 26, 2023
deddae1
chore: move unit tests to correct place for mssql and postgres (#2657)
ujjwal-ab Sep 26, 2023
100c808
feat: add axios mocking to component test-suite (#2638)
sanpj2292 Sep 28, 2023
4d6c4b8
feat: tslint rules enable (#2604)
aashishmalik Sep 29, 2023
b784800
fix: add auth status inactive category handling to GA in userDeletion…
sanpj2292 Sep 29, 2023
f63b493
fix: refactor adjust using optional chaining (#2671)
anantjain45823 Sep 29, 2023
5dade9a
chore(release): pull main into develop post release v1.43.1 (#2662)
devops-github-rudderstack Sep 29, 2023
56c80f2
chore: update error messages of GAOC (#2655)
ItsSudip Sep 29, 2023
b5d28a3
chore: return 298 for filtered/dropped events in user transformer (#2…
psrikanth88 Oct 3, 2023
0ecd031
chore: move mixpanel tests to component test suite (#2668)
ujjwal-ab Oct 4, 2023
d4cac26
fix(garl): partial failure handling (#2666)
mihir-4116 Oct 4, 2023
e37d693
fix: main into develop conflicts (#2686)
anantjain45823 Oct 5, 2023
99f39f5
fix(kafka): add status code & batched value in response structure (#2…
ujjwal-ab Oct 5, 2023
252e168
Merge branch 'main' of github.com:rudderlabs/rudder-transformer into …
Oct 6, 2023
75d665d
fix: main -> develop conflict (#2692)
sanpj2292 Oct 6, 2023
bbf7ad4
fix: create instance of transformedObj (#2694)
ItsSudip Oct 9, 2023
6bdb01e
feat(integrations): introduced new status codes to suppress or filter…
mihir-4116 Oct 9, 2023
4ce47ec
chore(release): pull main into develop post release v1.44.2 (#2702)
devops-github-rudderstack Oct 9, 2023
f205325
feat: onboard braze stats (#2703)
utsabc Oct 10, 2023
6e20a72
chore: add metrics to prometheus (#2705)
utsabc Oct 10, 2023
bc88f13
fix(klaviyo): sending error field at root level for suppress events (…
mihir-4116 Oct 11, 2023
b211840
fix: bugsnag event sent as an object for track call (#2681)
anantjain45823 Oct 11, 2023
eca3be1
fix: correct handling of permission_denied error for GAEC & GARL (#2699)
sanpj2292 Oct 11, 2023
d681d5e
feat: support page call in snapchat conversion (#2688)
anantjain45823 Oct 11, 2023
f49244d
fix: added matchId check and timestamp conversion (#2709)
aashishmalik Oct 11, 2023
d6488d5
fix: snapchat conversion introduce missing fields (#2704)
anantjain45823 Oct 11, 2023
26ef97b
Merge remote-tracking branch 'origin/main' into develop
web-flow Oct 11, 2023
73d9295
chore(release): 1.45.0
web-flow Oct 11, 2023
2f538cc
chore: code review changes
mihir-4116 Oct 12, 2023
acac447
chore: update change log
mihir-4116 Oct 12, 2023
a210657
chore: update change log (#2717)
mihir-4116 Oct 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,45 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

krishna2020 marked this conversation as resolved.
Show resolved Hide resolved
## [1.45.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.44.2...v1.45.0) (2023-10-11)


### Features

* add axios mocking to component test-suite ([#2638](https://github.com/rudderlabs/rudder-transformer/issues/2638)) ([100c808](https://github.com/rudderlabs/rudder-transformer/commit/100c80881eb99716198231deb9ec0e69dc3fa2a0))
* add circular reference check in flattern json ([#2650](https://github.com/rudderlabs/rudder-transformer/issues/2650)) ([a21ea3a](https://github.com/rudderlabs/rudder-transformer/commit/a21ea3aaecfc3d10de3f4eaa34425dda388032ff))
* **gaec:** partial failures handling ([#2631](https://github.com/rudderlabs/rudder-transformer/issues/2631)) ([0008277](https://github.com/rudderlabs/rudder-transformer/commit/0008277fe43d20ced4066f8f1f1b0f1d12345f01))
* **integrations:** introduced new status codes to suppress or filter events ([#2611](https://github.com/rudderlabs/rudder-transformer/issues/2611)) ([6bdb01e](https://github.com/rudderlabs/rudder-transformer/commit/6bdb01e1152f52339dc6d1936cbe686e64faf070))
* **iterable:** user deletion support ([#2621](https://github.com/rudderlabs/rudder-transformer/issues/2621)) ([c0ab19a](https://github.com/rudderlabs/rudder-transformer/commit/c0ab19a293a72ea0a7575b863356aea9a0e6762f))
* onboard braze stats ([#2703](https://github.com/rudderlabs/rudder-transformer/issues/2703)) ([f205325](https://github.com/rudderlabs/rudder-transformer/commit/f2053255bedac6017f909fe8b6de3775dd50bc93))
* support page call in snapchat conversion ([#2688](https://github.com/rudderlabs/rudder-transformer/issues/2688)) ([d681d5e](https://github.com/rudderlabs/rudder-transformer/commit/d681d5e1a39c1914e3a237e1020553518c297416))
* tslint rules enable ([#2604](https://github.com/rudderlabs/rudder-transformer/issues/2604)) ([4d6c4b8](https://github.com/rudderlabs/rudder-transformer/commit/4d6c4b834de005484dc1099a52c69ab6212273e8))


### Bug Fixes

* add auth status inactive category handling to GA in userDeletion flow ([#2669](https://github.com/rudderlabs/rudder-transformer/issues/2669)) ([b784800](https://github.com/rudderlabs/rudder-transformer/commit/b7848004e2679ec7278c8381560cb1a77da6c642))
* add optional chaining for error message in network handler of Intercom ([#2648](https://github.com/rudderlabs/rudder-transformer/issues/2648)) ([10a13bc](https://github.com/rudderlabs/rudder-transformer/commit/10a13bcf7f987de45540b52d414883664e43f9cd))
* added matchId check and timestamp conversion ([#2709](https://github.com/rudderlabs/rudder-transformer/issues/2709)) ([f49244d](https://github.com/rudderlabs/rudder-transformer/commit/f49244dce6cf15812d894d22c43d2432b5a4756a))
* bqstream event ordering fix ([#2624](https://github.com/rudderlabs/rudder-transformer/issues/2624)) ([e97e7ca](https://github.com/rudderlabs/rudder-transformer/commit/e97e7caed20ffb007f1c543e15c15c6e89e2dfb7))
* bugsnag event sent as an object for track call ([#2681](https://github.com/rudderlabs/rudder-transformer/issues/2681)) ([b211840](https://github.com/rudderlabs/rudder-transformer/commit/b21184019691b472650901f6002ef81b579a1146))
* correct handling of permission_denied error for GAEC & GARL ([#2699](https://github.com/rudderlabs/rudder-transformer/issues/2699)) ([eca3be1](https://github.com/rudderlabs/rudder-transformer/commit/eca3be1fdcb7ac0ebf9432e9686a75fad2d6dc78))
* create instance of transformedObj ([#2694](https://github.com/rudderlabs/rudder-transformer/issues/2694)) ([bbf7ad4](https://github.com/rudderlabs/rudder-transformer/commit/bbf7ad4da603936db4ef8f53d5734c5b4bb84ca9))
* **garl:** partial failure handling ([#2666](https://github.com/rudderlabs/rudder-transformer/issues/2666)) ([d4cac26](https://github.com/rudderlabs/rudder-transformer/commit/d4cac268193e0db9540f95c7aab39157d70765c1))
* **hubspot:** add validation for hubspotEvents ([#2643](https://github.com/rudderlabs/rudder-transformer/issues/2643)) ([b49d0ee](https://github.com/rudderlabs/rudder-transformer/commit/b49d0ee576f55e5f95e3d02b7111e995fc9b8ada))
* **kafka:** add status code & batched value in response structure ([#2684](https://github.com/rudderlabs/rudder-transformer/issues/2684)) ([99f39f5](https://github.com/rudderlabs/rudder-transformer/commit/99f39f5cd62ceb82bd8f51d1de84442b1e59c004))
* **klaviyo:** sending error field at root level for suppress events ([#2707](https://github.com/rudderlabs/rudder-transformer/issues/2707)) ([bc88f13](https://github.com/rudderlabs/rudder-transformer/commit/bc88f1303ec4f60a466492c72e8c3b57dd5070af))
* main -> develop conflict ([#2692](https://github.com/rudderlabs/rudder-transformer/issues/2692)) ([75d665d](https://github.com/rudderlabs/rudder-transformer/commit/75d665d765514c5987526e604d5a71d43b8ed3b6))
mihir-4116 marked this conversation as resolved.
Show resolved Hide resolved
* main into develop conflicts ([#2686](https://github.com/rudderlabs/rudder-transformer/issues/2686)) ([e37d693](https://github.com/rudderlabs/rudder-transformer/commit/e37d6938aa6d74685a99fd417e2b96b79619f001)), closes [#2659](https://github.com/rudderlabs/rudder-transformer/issues/2659) [#2661](https://github.com/rudderlabs/rudder-transformer/issues/2661) [#2672](https://github.com/rudderlabs/rudder-transformer/issues/2672) [#2608](https://github.com/rudderlabs/rudder-transformer/issues/2608) [#2624](https://github.com/rudderlabs/rudder-transformer/issues/2624) [#2635](https://github.com/rudderlabs/rudder-transformer/issues/2635) [#2593](https://github.com/rudderlabs/rudder-transformer/issues/2593) [#2643](https://github.com/rudderlabs/rudder-transformer/issues/2643) [#2648](https://github.com/rudderlabs/rudder-transformer/issues/2648) [#2650](https://github.com/rudderlabs/rudder-transformer/issues/2650) [#2656](https://github.com/rudderlabs/rudder-transformer/issues/2656) [#2621](https://github.com/rudderlabs/rudder-transformer/issues/2621) [#2631](https://github.com/rudderlabs/rudder-transformer/issues/2631) [#2657](https://github.com/rudderlabs/rudder-transformer/issues/2657) [#2638](https://github.com/rudderlabs/rudder-transformer/issues/2638) [#2604](https://github.com/rudderlabs/rudder-transformer/issues/2604) [#2669](https://github.com/rudderlabs/rudder-transformer/issues/2669) [#2671](https://github.com/rudderlabs/rudder-transformer/issues/2671) [#2662](https://github.com/rudderlabs/rudder-transformer/issues/2662) [#2659](https://github.com/rudderlabs/rudder-transformer/issues/2659) [#2661](https://github.com/rudderlabs/rudder-transformer/issues/2661)
* **mixpanel:** batch event ordering ([#2608](https://github.com/rudderlabs/rudder-transformer/issues/2608)) ([36c7f06](https://github.com/rudderlabs/rudder-transformer/commit/36c7f06ccfa534b751ca9b3f5c41e9bb6d2e9f00))
* refactor adjust using optional chaining ([#2671](https://github.com/rudderlabs/rudder-transformer/issues/2671)) ([f63b493](https://github.com/rudderlabs/rudder-transformer/commit/f63b4932d5ba467a82a36d3e8b80578f81f729cf))
* snapchat conversion introduce missing fields ([#2704](https://github.com/rudderlabs/rudder-transformer/issues/2704)) ([d6488d5](https://github.com/rudderlabs/rudder-transformer/commit/d6488d5a189ea90d1142e4ecb34b2af0bb940fe9))
* **snyk:** fix dependencies version from snyk ([#2640](https://github.com/rudderlabs/rudder-transformer/issues/2640)) ([8422744](https://github.com/rudderlabs/rudder-transformer/commit/8422744b3af48f71358f7acbe2df7b3688ce04a8))
* **snyk:** removed aws-sdk dependency ([08a3535](https://github.com/rudderlabs/rudder-transformer/commit/08a3535257e5d84566c95cebc701613478f0e039))
* **snyk:** removed the new added dependencies ([364779c](https://github.com/rudderlabs/rudder-transformer/commit/364779ce959d7548e5cf1cc8c718b71331dcb378))
* **snyk:** snyk updated versions merged to oen pr ([16a9b8e](https://github.com/rudderlabs/rudder-transformer/commit/16a9b8e6cc26a8df1331cb1af8774df7cc05c959))
* use promise for prompts in personalize create tracking script ([#2635](https://github.com/rudderlabs/rudder-transformer/issues/2635)) ([5fbddd1](https://github.com/rudderlabs/rudder-transformer/commit/5fbddd1490b16dbda6bca19df4cac5bef6ff78c5))

### [1.44.2](https://github.com/rudderlabs/rudder-transformer/compare/v1.44.1...v1.44.2) (2023-10-09)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rudder-transformer",
"version": "1.44.2",
"version": "1.45.0",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
5 changes: 5 additions & 0 deletions src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ const MappedToDestinationKey = 'context.mappedToDestination';
const GENERIC_TRUE_VALUES = ['true', 'True', 'TRUE', 't', 'T', '1'];
const GENERIC_FALSE_VALUES = ['false', 'False', 'FALSE', 'f', 'F', '0'];

const HTTP_CUSTOM_STATUS_CODES = {
FILTERED: 298,
};

module.exports = {
EventType,
GENERIC_TRUE_VALUES,
Expand All @@ -58,4 +62,5 @@ module.exports = {
SpecedTraits,
TraitsMapping,
WhiteListedTraits,
HTTP_CUSTOM_STATUS_CODES,
};
2 changes: 1 addition & 1 deletion src/controllers/userTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class UserTransformController {
);
const events = ctx.request.body as ProcessorTransformationRequest[];
const processedRespone: UserTransformationServiceResponse =
await UserTransformService.transformRoutine(events);
await UserTransformService.transformRoutine(events, ctx.state.features);
ctx.body = processedRespone.transformedEvents;
ControllerUtility.postProcess(ctx, processedRespone.retryStatus);
logger.debug(
Expand Down
49 changes: 49 additions & 0 deletions src/middlewares/featureFlag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { Context, Next } from 'koa';

export interface FeatureFlags {
[key: string]: boolean | string;
}

export const FEATURE_FILTER_CODE = 'filter-code';

export default class FeatureFlagMiddleware {
public static async handle(ctx: Context, next: Next): Promise<void> {
// Initialize ctx.state.features if it doesn't exist
ctx.state.features = (ctx.state.features || {}) as FeatureFlags;

// Get headers from the request
const { headers } = ctx.request;

// Filter headers that start with 'X-Feature-'
const featureHeaders = Object.keys(headers).filter((key) =>
key.toLowerCase().startsWith('x-feature-'),
);

// Convert feature headers to feature flags in ctx.state.features
featureHeaders.forEach((featureHeader) => {
// Get the feature name by removing the prefix, and convert to camelCase
const featureName = featureHeader
.substring(10)
.replace(/X-Feature-/g, '')
.toLowerCase();

let value: string | boolean | undefined;
const valueString = headers[featureHeader] as string;
if (valueString === 'true' || valueString === '?1') {
value = true;
} else if (valueString === 'false' || valueString === '?0') {
value = false;
} else {
value = valueString;
}

// Set the feature flag in ctx.state.features
if (value !== undefined) {
ctx.state.features[featureName] = value;
}
});

// Move to the next middleware
await next();
}
}
6 changes: 5 additions & 1 deletion src/routes/destination.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Router from '@koa/router';
import DestinationController from '../controllers/destination';
import RegulationController from '../controllers/regulation';
import FeatureFlagController from '../middlewares/featureFlag';
import RouteActivationController from '../middlewares/routeActivation';

const router = new Router();
Expand All @@ -9,22 +10,25 @@ router.post(
'/:version/destinations/:destination',
RouteActivationController.isDestinationRouteActive,
RouteActivationController.destinationProcFilter,
FeatureFlagController.handle,
DestinationController.destinationTransformAtProcessor,
);
router.post(
'/routerTransform',
RouteActivationController.isDestinationRouteActive,
RouteActivationController.destinationRtFilter,
FeatureFlagController.handle,
DestinationController.destinationTransformAtRouter,
);
router.post(
'/batch',
RouteActivationController.isDestinationRouteActive,
RouteActivationController.destinationBatchFilter,
FeatureFlagController.handle,
DestinationController.batchProcess,
);

router.post('/deleteUsers', RegulationController.deleteUsers);

const destinationRoutes = router.routes();
export default destinationRoutes;
export default destinationRoutes;
4 changes: 3 additions & 1 deletion src/routes/userTransform.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import Router from '@koa/router';
import RouteActivationController from '../middlewares/routeActivation';
import FeatureFlagController from '../middlewares/featureFlag';
import UserTransformController from '../controllers/userTransform';

const router = new Router();

router.post(
'/customTransform',
RouteActivationController.isUserTransformRouteActive,
FeatureFlagController.handle,
UserTransformController.transform,
);
router.post(
Expand All @@ -31,4 +33,4 @@ router.post(
);

const userTransformRoutes = router.routes();
export default userTransformRoutes;
export default userTransformRoutes;
15 changes: 9 additions & 6 deletions src/services/destination/nativeIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ export default class NativeIntegrationDestinationService implements IntegrationD
events: ProcessorTransformationRequest[],
destinationType: string,
version: string,
_requestMetadata: NonNullable<unknown>,
requestMetadata: NonNullable<unknown>,
): Promise<ProcessorTransformationResponse[]> {
const destHandler = FetchHandler.getDestHandler(destinationType, version);
const respList: ProcessorTransformationResponse[][] = await Promise.all(
events.map(async (event) => {
try {
const transformedPayloads:
| ProcessorTransformationOutput
| ProcessorTransformationOutput[] = await destHandler.process(event);
| ProcessorTransformationOutput[] = await destHandler.process(event, requestMetadata);
return DestinationPostTransformationService.handleProcessorTransformSucessEvents(
event,
transformedPayloads,
Expand Down Expand Up @@ -88,7 +88,7 @@ export default class NativeIntegrationDestinationService implements IntegrationD
events: RouterTransformationRequestData[],
destinationType: string,
version: string,
_requestMetadata: NonNullable<unknown>,
requestMetadata: NonNullable<unknown>,
): Promise<RouterTransformationResponse[]> {
const destHandler = FetchHandler.getDestHandler(destinationType, version);
const allDestEvents: NonNullable<unknown> = groupBy(
Expand All @@ -106,7 +106,7 @@ export default class NativeIntegrationDestinationService implements IntegrationD
);
try {
const doRouterTransformationResponse: RouterTransformationResponse[] =
await destHandler.processRouterDest(cloneDeep(destInputArray));
await destHandler.processRouterDest(cloneDeep(destInputArray), requestMetadata);
metaTO.metadata = destInputArray[0].metadata;
return DestinationPostTransformationService.handleRouterTransformSuccessEvents(
doRouterTransformationResponse,
Expand All @@ -132,7 +132,7 @@ export default class NativeIntegrationDestinationService implements IntegrationD
events: RouterTransformationRequestData[],
destinationType: string,
version: any,
_requestMetadata: NonNullable<unknown>,
requestMetadata: NonNullable<unknown>,
): RouterTransformationResponse[] {
const destHandler = FetchHandler.getDestHandler(destinationType, version);
if (!destHandler.batch) {
Expand All @@ -145,7 +145,10 @@ export default class NativeIntegrationDestinationService implements IntegrationD
const groupedEvents: RouterTransformationRequestData[][] = Object.values(allDestEvents);
const response = groupedEvents.map((destEvents) => {
try {
const destBatchedRequests: RouterTransformationResponse[] = destHandler.batch(destEvents);
const destBatchedRequests: RouterTransformationResponse[] = destHandler.batch(
destEvents,
requestMetadata,
);
return destBatchedRequests;
} catch (error: any) {
const metaTO = this.getTags(
Expand Down
1 change: 1 addition & 0 deletions src/services/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default class MiscService {
return {
namespace: 'Unknown',
cluster: 'Unknown',
features: ctx.state?.features || {},
};
}

Expand Down
Loading