Skip to content

Commit

Permalink
Merge branch 'develop' into fix.remove-log-cdkv2
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSudip authored Dec 18, 2023
2 parents 3a64845 + c875ad4 commit 010c18d
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-hotfix-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

# Only allow these users to create new hotfix branch from 'main'
if: github.ref == 'refs/heads/main' && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823' || github.actor == 'chandumlg' || github.actor == 'mihir-4116' || github.actor == 'ujjwal-ab') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823' || github.triggering_actor == 'chandumlg' || github.triggering_actor == 'mihir-4116' || github.triggering_actor == 'ujjwal-ab')
if: github.ref == 'refs/heads/main' && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'koladilip' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823' || github.actor == 'chandumlg' || github.actor == 'mihir-4116' || github.actor == 'ujjwal-ab') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'koladilip' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823' || github.triggering_actor == 'chandumlg' || github.triggering_actor == 'mihir-4116' || github.triggering_actor == 'ujjwal-ab')
steps:
- name: Create Branch
uses: peterjgrainger/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/housekeeping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: actions/[email protected]

- name: Delete Old Branches
uses: beatlabs/[email protected].9
uses: beatlabs/[email protected].10
with:
repo_token: ${{ secrets.PAT }}
date: '3 months ago'
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

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.

### [1.52.2](https://github.com/rudderlabs/rudder-transformer/compare/v1.52.1...v1.52.2) (2023-12-15)


### Bug Fixes

* braze dedup for adding non-billable attributes ([#2921](https://github.com/rudderlabs/rudder-transformer/issues/2921)) ([4196b1b](https://github.com/rudderlabs/rudder-transformer/commit/4196b1bfec2fc3f7c2c5d0b305853b39033e894c))
* inclusion of right status-code & error details in proxy response ([#2916](https://github.com/rudderlabs/rudder-transformer/issues/2916)) ([5d295c2](https://github.com/rudderlabs/rudder-transformer/commit/5d295c232ff91bfb8564d4d6fcce49dc1e07958b))
* supportTransformerProxyV1 set to false ([#2920](https://github.com/rudderlabs/rudder-transformer/issues/2920)) ([90ee7ad](https://github.com/rudderlabs/rudder-transformer/commit/90ee7ad13921830c920ee60361adb0e0c5dc1d43))

### [1.52.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.52.0...v1.52.1) (2023-12-14)


### Bug Fixes

* update response handling for v1 proxy ([7d275ca](https://github.com/rudderlabs/rudder-transformer/commit/7d275ca1d58c38859fce95d7d0677e11342c662a))

## [1.52.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.51.1...v1.52.0) (2023-12-12)


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.52.0",
"version": "1.52.2",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/delivery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class DeliveryController {
);
}
ctx.body = { output: deliveryResponse };
ControllerUtility.deliveryPostProcess(ctx);
ControllerUtility.deliveryPostProcess(ctx, deliveryResponse.status);

logger.debug('Native(Delivery):: Response from transformer::', JSON.stringify(ctx.body));
return ctx;
Expand Down
2 changes: 1 addition & 1 deletion src/features.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@
"REDDIT": true
},
"supportSourceTransformV1": true,
"supportTransformerProxyV1": true
"supportTransformerProxyV1": false
}
3 changes: 3 additions & 0 deletions src/services/destination/nativeIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ export class NativeIntegrationDestinationService implements DestinationService {
);
responseProxy = {
response: jobStates,
status: v0Response.status,
message: v0Response.message,
authErrorCategory: v0Response.authErrorCategory,
} as DeliveriesResponse;
}
return responseProxy;
Expand Down
3 changes: 3 additions & 0 deletions src/services/destination/postTransformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ export class DestinationPostTransformationService {
const resp = {
response: responses,
statTags: errObj.statTags,
authErrorCategory: errObj.authErrorCategory,
message: errObj.message.toString(),
status: errObj.status,
} as DeliveriesResponse;

ErrorReportingService.reportError(error, metaTo.errorContext, resp);
Expand Down
53 changes: 53 additions & 0 deletions src/v0/destinations/braze/braze.util.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,9 +660,58 @@ describe('dedup utility tests', () => {
color: 'green',
age: 30,
gender: 'male',
country: 'US',
language: 'en',
email_subscribe: true,
push_subscribe: false,
subscription_groups: ['group1', 'group2'],
};
const storeData = {
external_id: '123',
country: 'US',
language: 'en',
email_subscribe: true,
push_subscribe: false,
subscription_groups: ['group1', 'group2'],
custom_attributes: {
color: 'blue',
age: 25,
},
};
store.set('123', storeData);
const result = BrazeDedupUtility.deduplicate(userData, store);
expect(store.size).toBe(1);
expect(result).toEqual({
external_id: '123',
color: 'green',
age: 30,
gender: 'male',
country: 'US',
language: 'en',
email_subscribe: true,
push_subscribe: false,
subscription_groups: ['group1', 'group2'],
});
});

test('deduplicates user data correctly 2', () => {
const userData = {
external_id: '123',
color: 'green',
age: 30,
gender: 'male',
language: 'en',
email_subscribe: true,
push_subscribe: false,
subscription_groups: ['group1', 'group2'],
};
const storeData = {
external_id: '123',
country: 'US',
language: 'en',
email_subscribe: true,
push_subscribe: false,
subscription_groups: ['group1', 'group2'],
custom_attributes: {
color: 'blue',
age: 25,
Expand All @@ -676,6 +725,10 @@ describe('dedup utility tests', () => {
color: 'green',
age: 30,
gender: 'male',
language: 'en',
email_subscribe: true,
push_subscribe: false,
subscription_groups: ['group1', 'group2'],
});
});

Expand Down
8 changes: 8 additions & 0 deletions src/v0/destinations/braze/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,14 @@ const BrazeDedupUtility = {
};
const identifier = external_id || user_alias?.alias_name;
store.set(identifier, { ...storedUserData, ...deduplicatedUserData });

// add non billable attributes back to the deduplicated user object
BRAZE_NON_BILLABLE_ATTRIBUTES.forEach((key) => {
if (isDefinedAndNotNull(userData[key])) {
deduplicatedUserData[key] = userData[key];
}
});

return removeUndefinedValues(deduplicatedUserData);
},
};
Expand Down
12 changes: 10 additions & 2 deletions test/integrations/destinations/braze/dataDelivery/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ export const data = [
status: 200,
body: {
output: {
message: 'Request for braze Processed Successfully',
response: [
{
error: '{"aliases_processed":1,"message":"success"}',
Expand All @@ -563,6 +564,7 @@ export const data = [
},
},
],
status: 201,
},
},
},
Expand Down Expand Up @@ -627,9 +629,10 @@ export const data = [
},
output: {
response: {
status: 200,
status: 401,
body: {
output: {
status: 401,
response: [
{
error: '{"code":400,"message":"Bad Req","status":"Fail Case"}',
Expand Down Expand Up @@ -659,6 +662,8 @@ export const data = [
module: 'destination',
workspaceId: '2Csl0lSTbuM3qyHdaOQB2GcDH8o',
},
authErrorCategory: '',
message: 'Request failed for braze with status: 401',
},
},
},
Expand Down Expand Up @@ -765,9 +770,10 @@ export const data = [
},
output: {
response: {
status: 200,
status: 401,
body: {
output: {
status: 401,
response: [
{
error:
Expand Down Expand Up @@ -834,6 +840,8 @@ export const data = [
module: 'destination',
workspaceId: '2Csl0lSTbuM3qyHdaOQB2GcDH8o',
},
authErrorCategory: '',
message: 'Request failed for braze with status: 401',
},
},
},
Expand Down

0 comments on commit 010c18d

Please sign in to comment.