Skip to content

Commit

Permalink
Merge branch 'develop' into chore/import-error-class-integrations-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauravudia authored Oct 31, 2023
2 parents 5356dc1 + c38f14f commit 8c76368
Show file tree
Hide file tree
Showing 17 changed files with 1,319 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/draft-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

# Only allow release stakeholders to initiate releases
if: (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/')) && (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.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')
if: (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/')) && (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 == 'yashasvibajpai' || github.actor == 'sanpj2292') && (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 == 'yashasvibajpai' || github.triggering_actor == 'sanpj2292')
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

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.47.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.46.5...v1.47.0) (2023-10-30)


### Features

* add custom utm parameters to mixpanel ([#2771](https://github.com/rudderlabs/rudder-transformer/issues/2771)) ([9c4fcd3](https://github.com/rudderlabs/rudder-transformer/commit/9c4fcd3595534a8b563df3467e23c94c580f08a6))
* add support filtering component tests by feature and index ([#2748](https://github.com/rudderlabs/rudder-transformer/issues/2748)) ([146f1c6](https://github.com/rudderlabs/rudder-transformer/commit/146f1c63db4e895c7d5ce2848a1b60e7c5bb9fb6))
* onboard destination ortto ([#2730](https://github.com/rudderlabs/rudder-transformer/issues/2730)) ([9be5740](https://github.com/rudderlabs/rudder-transformer/commit/9be5740d8670890b0318da3d37f258ddc5e35445))
* onboard facebook custom audience to transformer proxy ([#2769](https://github.com/rudderlabs/rudder-transformer/issues/2769)) ([14c5e40](https://github.com/rudderlabs/rudder-transformer/commit/14c5e40284af7df9e4f5b262ad226dd3afef226e))
* add custom event name support in pinterest v5 ([#2773](https://github.com/rudderlabs/rudder-transformer/pull/2773)) ([a586a92](https://github.com/rudderlabs/rudder-transformer/commit/a586a92bf410679d0f3aa7012d4d10f8e2f515d5))


### Bug Fixes

* bugsnag error for salesforce ([#2753](https://github.com/rudderlabs/rudder-transformer/issues/2753)) ([a2ccdad](https://github.com/rudderlabs/rudder-transformer/commit/a2ccdad52a1fb88f962745800cb45d605b5e0bf3))
* oom kill while stringifying large response json ([#2754](https://github.com/rudderlabs/rudder-transformer/issues/2754)) ([c8baf5b](https://github.com/rudderlabs/rudder-transformer/commit/c8baf5b2b6325d9e30200339055dcbefd780936c))
* salesforce: handle ECONNABORTED error ([#2732](https://github.com/rudderlabs/rudder-transformer/issues/2732)) ([6b23a9b](https://github.com/rudderlabs/rudder-transformer/commit/6b23a9b33acd28fdacaa2390c1970a1fa4415ffa))

### [1.46.5](https://github.com/rudderlabs/rudder-transformer/compare/v1.46.4...v1.46.5) (2023-10-23)


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.46.5",
"version": "1.47.0",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
6 changes: 2 additions & 4 deletions src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,8 @@ steps:
eventNames = $.convertToSnakeCase(eventNames);
eventNames.length === 0 ? eventNames = $.ecomEventMaps.(){eventInLowerCase in .src}.dest[] ?? [];
(eventNames.length === 0 && .destination.Config.sendAsCustomEvent) ? eventNames = ["custom"];
(eventNames.length === 0 && $.outputs.apiVersion === {{$.API_VERSION.v3}}) ? eventNames = [event];
$.assertConfig(eventNames.length > 0,
event + " is not mapped in UI. Make sure to map the event in UI or enable the 'send as custom event' setting")
eventNames
eventNames.length === 0 ? eventNames = [event];
eventNames;
- name: payload
template: |
Expand Down
6 changes: 6 additions & 0 deletions src/v0/destinations/fb_custom_audience/networkHandler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const { networkHandler, errorResponseHandler } = require('../../util/facebookUtils/networkHandler');

module.exports = {
networkHandler,
errorResponseHandler,
};
18 changes: 6 additions & 12 deletions src/v0/destinations/pinterest_tag/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const convertToSnakeCase = (eventName) =>
const deduceTrackScreenEventName = (message, Config) => {
let eventName;
const { event, name } = message;
const { apiVersion = API_VERSION.v3, eventsMapping, sendAsCustomEvent } = Config;
const { eventsMapping, sendAsCustomEvent } = Config;
const trackEventOrScreenName = event || name;
if (!trackEventOrScreenName) {
throw new InstrumentationError('event_name could not be mapped. Aborting');
Expand Down Expand Up @@ -209,17 +209,11 @@ const deduceTrackScreenEventName = (message, Config) => {
return ['custom'];
}

if (apiVersion === API_VERSION.v3) {
/*
Step 4: In case both of the above stated cases fail, will send the event name as it is.
This is going to be reflected as "unknown" event in conversion API dashboard.
*/
return [trackEventOrScreenName];
}

throw new ConfigurationError(
`${event} is not mapped in UI. Make sure to map the event in UI or enable the 'send as custom event' setting`,
);
/*
Step 4: In case all of the above stated cases failed, will send the event name as it is.
This is going to be reflected as "unknown" event in conversion API dashboard.
*/
return [trackEventOrScreenName];
};

/**
Expand Down
46 changes: 45 additions & 1 deletion src/v0/util/facebookUtils/networkHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const errorDetailsMap = {
33: new ErrorDetailsExtractorBuilder()
.setStatus(400)
.setMessage(
"Object with ID 'PIXEL_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation",
"Object with ID 'PIXEL_ID' / 'DATASET_ID' / 'AUDIENCE_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation",
)
.build(),
default: new ErrorDetailsExtractorBuilder()
Expand Down Expand Up @@ -151,6 +151,50 @@ const errorDetailsMap = {
.setMessage('API User Too Many Calls')
.build(),
},
// facebook custom audience related error codes
// ref:
// https://developers.facebook.com/docs/marketing-api/reference/custom-audience/#error-codes-4
// https://developers.facebook.com/docs/marketing-api/error-reference/
294: {
default: new ErrorDetailsExtractorBuilder()
.setStatus(400)
.setMessage(
'Missing permission. Please make sure you have ads_management permission and the application is included in the allowlist',
)
.build(),
},
1487301: {
default: new ErrorDetailsExtractorBuilder()
.setStatus(400)
.setMessage(
'Custom Audience Unavailable: The custom audience you are trying to use has not been shared with your ad account',
)
.build(),
},
1487366: {
default: new ErrorDetailsExtractorBuilder()
.setStatus(400)
.setMessage('Custom Audience Has Been Deleted')
.build(),
},
2650: {
default: new ErrorDetailsExtractorBuilder()
.setStatus(400)
.setMessage('Failed to update the custom audience')
.build(),
},
105: {
default: new ErrorDetailsExtractorBuilder()
.setStatus(400)
.setMessage('The number of parameters exceeded the maximum for this operation')
.build(),
},
80003: {
default: new ErrorDetailsExtractorBuilder()
.setStatus(429)
.setMessage('There have been too many calls to this ad-account.')
.build(),
},
};

const getErrorDetailsFromErrorMap = (error) => {
Expand Down
2 changes: 1 addition & 1 deletion test/__tests__/data/facebook_pixel_proxy_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
{
"output": {
"status": 400,
"message": "Object with ID 'PIXEL_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation",
"message": "Object with ID 'PIXEL_ID' / 'DATASET_ID' / 'AUDIENCE_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation",
"destinationResponse": {
"error": {
"message": "Unsupported post request. Object with ID '1234567891234569' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
Expand Down
2 changes: 1 addition & 1 deletion test/__tests__/data/fb_proxy_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
{
"output": {
"status": 400,
"message": "Object with ID 'PIXEL_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation",
"message": "Object with ID 'PIXEL_ID' / 'DATASET_ID' / 'AUDIENCE_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation",
"destinationResponse": {
"error": {
"message": "Unsupported post request. Object with ID '1234567891234569' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
Expand Down
65 changes: 59 additions & 6 deletions test/__tests__/data/pinterest_tag_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,12 @@
"advertiser_id": "123456",
"app_id": "429047995",
"custom_data": {
"contents": [{ "item_price": "undefined", "quantity": 1 }],
"contents": [
{
"item_price": "undefined",
"quantity": 1
}
],
"currency": "USD",
"num_items": 0,
"order_id": "50314b8e9bcf000000000000",
Expand All @@ -698,7 +703,9 @@
},
"endpoint": "https://ct.pinterest.com/events/v3",
"files": {},
"headers": { "Content-Type": "application/json" },
"headers": {
"Content-Type": "application/json"
},
"method": "POST",
"params": {},
"type": "REST",
Expand Down Expand Up @@ -906,8 +913,54 @@
"statusCode": 400,
"error": "Conversion Token not found. Aborting"
},
{
"statusCode": 400,
"error": "custom event is not mapped in UI. Make sure to map the event in UI or enable the 'send as custom event' setting"
}
[
{
"version": "1",
"type": "REST",
"method": "POST",
"endpoint": "https://api.pinterest.com/v5/ad_accounts/accountId123/events",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer conversionToken123"
},
"params": {},
"body": {
"JSON": {
"event_name": "custom event",
"event_time": 1597383030,
"action_source": "web",
"event_id": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9",
"app_id": "429047995",
"user_data": {
"em": ["48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08"],
"ph": ["d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b"],
"ln": ["dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251"],
"fn": ["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"],
"ct": ["6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85"],
"st": ["3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd"],
"zp": ["1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c"],
"country": ["582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf"],
"hashed_maids": ["6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090"],
"client_user_agent": "chrome"
},
"custom_data": {
"currency": "USD",
"value": "27.5",
"order_id": "50314b8e9bcf000000000000",
"num_items": 0,
"contents": [
{
"quantity": 1,
"item_price": "undefined"
}
]
}
},
"JSON_ARRAY": {},
"XML": {},
"FORM": {}
},
"files": {}
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export const data = [
output: {
status: 400,
message:
"Object with ID 'PIXEL_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation",
"Object with ID 'PIXEL_ID' / 'DATASET_ID' / 'AUDIENCE_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation",
destinationResponse: {
error: {
message:
Expand Down
2 changes: 1 addition & 1 deletion test/integrations/destinations/fb/dataDelivery/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ export const data = [
"body": {
"output": {
"status": 400,
"message": "Object with ID 'PIXEL_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation",
"message": "Object with ID 'PIXEL_ID' / 'DATASET_ID' / 'AUDIENCE_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation",
"destinationResponse": {
"error": {
"message": "Unsupported post request. Object with ID '1234567891234569' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
Expand Down
Loading

0 comments on commit 8c76368

Please sign in to comment.