From 7d275ca1d58c38859fce95d7d0677e11342c662a Mon Sep 17 00:00:00 2001 From: Utsab Chowdhury Date: Thu, 14 Dec 2023 22:29:05 +0530 Subject: [PATCH 1/5] fix: update response handling for v1 proxy --- src/services/destination/postTransformation.ts | 2 ++ test/integrations/destinations/braze/dataDelivery/data.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/services/destination/postTransformation.ts b/src/services/destination/postTransformation.ts index 7e9cd52aed..3cec459f8b 100644 --- a/src/services/destination/postTransformation.ts +++ b/src/services/destination/postTransformation.ts @@ -186,6 +186,8 @@ export class DestinationPostTransformationService { const resp = { response: responses, statTags: errObj.statTags, + authErrorCategory: errObj.authErrorCategory, + message: errObj.message.toString(), } as DeliveriesResponse; ErrorReportingService.reportError(error, metaTo.errorContext, resp); diff --git a/test/integrations/destinations/braze/dataDelivery/data.ts b/test/integrations/destinations/braze/dataDelivery/data.ts index d62361e7f9..49a6d607e5 100644 --- a/test/integrations/destinations/braze/dataDelivery/data.ts +++ b/test/integrations/destinations/braze/dataDelivery/data.ts @@ -659,6 +659,8 @@ export const data = [ module: 'destination', workspaceId: '2Csl0lSTbuM3qyHdaOQB2GcDH8o', }, + authErrorCategory: '', + message: 'Request failed for braze with status: 401', }, }, }, @@ -834,6 +836,8 @@ export const data = [ module: 'destination', workspaceId: '2Csl0lSTbuM3qyHdaOQB2GcDH8o', }, + authErrorCategory: '', + message: 'Request failed for braze with status: 401', }, }, }, From 5f1887501c7dbaeb97a580058f23af7c96fff78a Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 14 Dec 2023 17:08:12 +0000 Subject: [PATCH 2/5] chore(release): 1.52.1 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 561aaa900f..bc9a32f4cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ 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.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) diff --git a/package-lock.json b/package-lock.json index 440bb9ea46..8b14350448 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.52.0", + "version": "1.52.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.52.0", + "version": "1.52.1", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "^0.7.24", diff --git a/package.json b/package.json index fe3c9f51b3..6e5ce2f9a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.52.0", + "version": "1.52.1", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From 52e5a0d43402dac068d3b3b42cad7a57a3f42614 Mon Sep 17 00:00:00 2001 From: Sai Kumar Battinoju Date: Fri, 15 Dec 2023 12:22:26 +0530 Subject: [PATCH 3/5] chore: upgrade delete old branches action --- .github/workflows/housekeeping.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/housekeeping.yml b/.github/workflows/housekeeping.yml index 9259f2db0e..388b80c15f 100644 --- a/.github/workflows/housekeeping.yml +++ b/.github/workflows/housekeeping.yml @@ -36,7 +36,7 @@ jobs: uses: actions/checkout@v4.1.1 - name: Delete Old Branches - uses: beatlabs/delete-old-branches-action@v0.0.9 + uses: beatlabs/delete-old-branches-action@v0.0.10 with: repo_token: ${{ secrets.PAT }} date: '3 months ago' From 44755f3235676b4a23010820151ef146ea877743 Mon Sep 17 00:00:00 2001 From: devops-github-rudderstack <88187154+devops-github-rudderstack@users.noreply.github.com> Date: Fri, 15 Dec 2023 15:11:07 +0530 Subject: [PATCH 4/5] chore(release): pull hotfix-release/v1.52.2 into main (#2923) * fix: supportTransformerProxyV1 set to false (#2920) * fix: braze dedup for adding non-billable attributes (#2921) * fix: braze dedup for adding non-billable attributes * fix: braze dedup add test case for non billable attributes * fix: inclusion of right status-code & error details in proxy response (#2916) * fix: inclusion of right status-code & error details in proxy response Signed-off-by: Sai Sankeerth * fix: update status in response from errObj Signed-off-by: Sai Sankeerth --------- Signed-off-by: Sai Sankeerth Co-authored-by: Sai Sankeerth * chore(release): 1.52.2 --------- Signed-off-by: Sai Sankeerth Co-authored-by: AASHISH MALIK Co-authored-by: Utsab Chowdhury Co-authored-by: Sankeerth Co-authored-by: Sai Sankeerth Co-authored-by: GitHub Actions --- CHANGELOG.md | 9 ++++ package-lock.json | 4 +- package.json | 2 +- src/controllers/delivery.ts | 2 +- src/features.json | 2 +- src/services/destination/nativeIntegration.ts | 3 ++ .../destination/postTransformation.ts | 1 + src/v0/destinations/braze/braze.util.test.js | 53 +++++++++++++++++++ src/v0/destinations/braze/util.js | 8 +++ .../destinations/braze/dataDelivery/data.ts | 8 ++- 10 files changed, 85 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc9a32f4cd..59f270b984 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ 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) diff --git a/package-lock.json b/package-lock.json index 8b14350448..b34388460a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.52.1", + "version": "1.52.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.52.1", + "version": "1.52.2", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "^0.7.24", diff --git a/package.json b/package.json index 6e5ce2f9a6..0b9877ffd3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.52.1", + "version": "1.52.2", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { diff --git a/src/controllers/delivery.ts b/src/controllers/delivery.ts index 0cc5e12d78..eba24ccf58 100644 --- a/src/controllers/delivery.ts +++ b/src/controllers/delivery.ts @@ -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; diff --git a/src/features.json b/src/features.json index e0745c2246..a3d29bb325 100644 --- a/src/features.json +++ b/src/features.json @@ -66,5 +66,5 @@ "REDDIT": true }, "supportSourceTransformV1": true, - "supportTransformerProxyV1": true + "supportTransformerProxyV1": false } diff --git a/src/services/destination/nativeIntegration.ts b/src/services/destination/nativeIntegration.ts index c3b0237cdc..6b680e3f4a 100644 --- a/src/services/destination/nativeIntegration.ts +++ b/src/services/destination/nativeIntegration.ts @@ -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; diff --git a/src/services/destination/postTransformation.ts b/src/services/destination/postTransformation.ts index 3cec459f8b..eef4152b2b 100644 --- a/src/services/destination/postTransformation.ts +++ b/src/services/destination/postTransformation.ts @@ -188,6 +188,7 @@ export class DestinationPostTransformationService { statTags: errObj.statTags, authErrorCategory: errObj.authErrorCategory, message: errObj.message.toString(), + status: errObj.status, } as DeliveriesResponse; ErrorReportingService.reportError(error, metaTo.errorContext, resp); diff --git a/src/v0/destinations/braze/braze.util.test.js b/src/v0/destinations/braze/braze.util.test.js index 9859e16152..9e82a235f1 100644 --- a/src/v0/destinations/braze/braze.util.test.js +++ b/src/v0/destinations/braze/braze.util.test.js @@ -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, @@ -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'], }); }); diff --git a/src/v0/destinations/braze/util.js b/src/v0/destinations/braze/util.js index 3b0855b338..40b9a7eada 100644 --- a/src/v0/destinations/braze/util.js +++ b/src/v0/destinations/braze/util.js @@ -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); }, }; diff --git a/test/integrations/destinations/braze/dataDelivery/data.ts b/test/integrations/destinations/braze/dataDelivery/data.ts index 49a6d607e5..8162e75720 100644 --- a/test/integrations/destinations/braze/dataDelivery/data.ts +++ b/test/integrations/destinations/braze/dataDelivery/data.ts @@ -544,6 +544,7 @@ export const data = [ status: 200, body: { output: { + message: 'Request for braze Processed Successfully', response: [ { error: '{"aliases_processed":1,"message":"success"}', @@ -563,6 +564,7 @@ export const data = [ }, }, ], + status: 201, }, }, }, @@ -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"}', @@ -767,9 +770,10 @@ export const data = [ }, output: { response: { - status: 200, + status: 401, body: { output: { + status: 401, response: [ { error: From c875ad44c69dfca3fe9b673ab29f3c41bf9f9ece Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Mon, 18 Dec 2023 10:01:55 +0530 Subject: [PATCH 5/5] Update create-hotfix-branch.yml --- .github/workflows/create-hotfix-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-hotfix-branch.yml b/.github/workflows/create-hotfix-branch.yml index 03c79e0df1..a164c25bee 100644 --- a/.github/workflows/create-hotfix-branch.yml +++ b/.github/workflows/create-hotfix-branch.yml @@ -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/action-create-branch@v2.4.0