Skip to content

Commit

Permalink
Merge branch 'develop' into test-refactor.fbPixel
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouti1507 authored Feb 26, 2024
2 parents 4c26c7f + 9fa5374 commit 7e80aa0
Show file tree
Hide file tree
Showing 71 changed files with 902 additions and 51 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 == '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 == 'sanpj2292')
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 == 'utsabc') && (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 == 'sanpj2292' || github.triggering_actor == 'utsabc')
steps:
- name: Create Branch
uses: peterjgrainger/[email protected]
Expand Down
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 == 'koladilip' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823' || github.actor == 'chandumlg' || github.actor == 'mihir-4116' || github.actor == 'yashasvibajpai' || github.actor == 'sanpj2292' || github.actor == 'ujjwal-ab') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'koladilip' || 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' || github.triggering_actor == 'ujjwal-ab')
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 == 'koladilip' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823' || github.actor == 'chandumlg' || github.actor == 'mihir-4116' || github.actor == 'yashasvibajpai' || github.actor == 'sanpj2292' || github.actor == 'utsabc') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'koladilip' || 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' || github.triggering_actor == 'utsabc')
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@

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.56.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.56.0...v1.56.1) (2024-02-21)


### Bug Fixes

* update proxy data type for response handler input ([#3030](https://github.com/rudderlabs/rudder-transformer/issues/3030)) ([457a18b](https://github.com/rudderlabs/rudder-transformer/commit/457a18b2aec03aa0dfafcadc611b5f7176e97beb))

## [1.56.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.55.0...v1.56.0) (2024-02-19)


### Features

* **hs:** chunking data based on batch limit ([#2907](https://github.com/rudderlabs/rudder-transformer/issues/2907)) ([a60694c](https://github.com/rudderlabs/rudder-transformer/commit/a60694cef1da31d27a5cf90264548cad793f556f))
* onboard bluecore integration ([#3061](https://github.com/rudderlabs/rudder-transformer/issues/3061)) ([aef5f8e](https://github.com/rudderlabs/rudder-transformer/commit/aef5f8e5f267262e0f9e10229f14f2bcc8ad29e2))
* tiktok_offline_events added support for all Standard events ([#3094](https://github.com/rudderlabs/rudder-transformer/issues/3094)) ([b5cdccb](https://github.com/rudderlabs/rudder-transformer/commit/b5cdccb75fe68150816140174087fddad677db10))


### Bug Fixes

* add support of placing properties at root in af ([#3082](https://github.com/rudderlabs/rudder-transformer/issues/3082)) ([0f01524](https://github.com/rudderlabs/rudder-transformer/commit/0f01524b6f4f2f82efc21f88f8c97cb6fdaf91ea))
* amplitude batch output metadata ([#3077](https://github.com/rudderlabs/rudder-transformer/issues/3077)) ([69c8348](https://github.com/rudderlabs/rudder-transformer/commit/69c83489c85486c9b2aed4a1292bd9f0aae9ca44))
* amplitude: Error handling for missing event type ([#3079](https://github.com/rudderlabs/rudder-transformer/issues/3079)) ([f7ec0a1](https://github.com/rudderlabs/rudder-transformer/commit/f7ec0a1244a7b97e6b40de5ed9881c63300866dc))
* custify user-regulation logic ([#3076](https://github.com/rudderlabs/rudder-transformer/issues/3076)) ([9683161](https://github.com/rudderlabs/rudder-transformer/commit/9683161612c7e3b9c2be95a2728f68ec7dcf69f4))
* error handling for auth0 source ([#3038](https://github.com/rudderlabs/rudder-transformer/issues/3038)) ([2a21274](https://github.com/rudderlabs/rudder-transformer/commit/2a21274333350c615991f7b56b81b766502d5bf4))
* **ga4:** failures not considered with 200 status in events tab ([#3089](https://github.com/rudderlabs/rudder-transformer/issues/3089)) ([6a364fb](https://github.com/rudderlabs/rudder-transformer/commit/6a364fba34c46b15c0fe4b06ecfa6f4b81b6f436))
* gaoc batching order ([#3064](https://github.com/rudderlabs/rudder-transformer/issues/3064)) ([a98cabd](https://github.com/rudderlabs/rudder-transformer/commit/a98cabdfe7781ada12baf742df4a3a439fc5fecd))
* resolve bugsnag issue caused due to undefined properties ([#3086](https://github.com/rudderlabs/rudder-transformer/issues/3086)) ([d522b35](https://github.com/rudderlabs/rudder-transformer/commit/d522b35c908a9f262ba3ba27dda0ea5d9ac5bc6b))
* tiktok ads v2 error handling ([#3084](https://github.com/rudderlabs/rudder-transformer/issues/3084)) ([b6edff4](https://github.com/rudderlabs/rudder-transformer/commit/b6edff46fa0e0e210e82206fea46a064e3fbe00f))

## [1.55.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.54.4...v1.55.0) (2024-02-05)


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.55.0",
"version": "1.56.1",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
6 changes: 6 additions & 0 deletions src/adapters/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,24 @@ const fireHTTPStats = (clientResponse, startTime, statTags) => {
const destType = statTags.destType ? statTags.destType : '';
const feature = statTags.feature ? statTags.feature : '';
const endpointPath = statTags.endpointPath ? statTags.endpointPath : '';
const requestMethod = statTags.requestMethod ? statTags.requestMethod : '';
const module = statTags.module ? statTags.module : '';
const statusCode = clientResponse.success ? clientResponse.response.status : '';
stats.timing('outgoing_request_latency', startTime, {
feature,
destType,
endpointPath,
requestMethod,
module
});
stats.counter('outgoing_request_count', 1, {
feature,
destType,
endpointPath,
success: clientResponse.success,
statusCode,
requestMethod,
module
});
};

Expand Down
38 changes: 28 additions & 10 deletions src/cdk/v2/destinations/intercom/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,20 @@ const searchContact = async (message, destination) => {
const headers = getHeaders(destination);
const baseEndPoint = getBaseEndpoint(destination);
const endpoint = `${baseEndPoint}/${SEARCH_CONTACT_ENDPOINT}`;
const response = await httpPOST(endpoint, data, {
headers,
destType: 'intercom',
feature: 'transformation',
});
const response = await httpPOST(
endpoint,
data,
{
headers,
},
{
destType: 'intercom',
feature: 'transformation',
endpointPath: '/contacts/search',
requestMethod: 'POST',
module: 'router',
},
);
const processedUserResponse = processAxiosResponse(response);
if (isHttpStatusSuccess(processedUserResponse.status)) {
return processedUserResponse.response?.data.length > 0
Expand Down Expand Up @@ -280,11 +289,20 @@ const createOrUpdateCompany = async (payload, destination) => {
const finalPayload = JSON.stringify(removeUndefinedAndNullValues(payload));
const baseEndPoint = getBaseEndpoint(destination);
const endpoint = `${baseEndPoint}/${CREATE_OR_UPDATE_COMPANY_ENDPOINT}`;
const response = await httpPOST(endpoint, finalPayload, {
headers,
destType: 'intercom',
feature: 'transformation',
});
const response = await httpPOST(
endpoint,
finalPayload,
{
headers,
},
{
destType: 'intercom',
feature: 'transformation',
endpointPath: '/companies',
requestMethod: 'POST',
module: 'router',
},
);

const processedResponse = processAxiosResponse(response);
if (isHttpStatusSuccess(processedResponse.status)) {
Expand Down
6 changes: 4 additions & 2 deletions src/cdk/v2/destinations/reddit/procWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ steps:
- name: customFields
condition: $.outputs.prepareTrackPayload.eventType.tracking_type === "Purchase"
reference: "https://ads-api.reddit.com/docs/v2/#tag/Conversions/paths/~1api~1v2.0~1conversions~1events~1%7Baccount_id%7D/post"
template: |
const revenue_in_cents = .message.properties.revenue ? Math.round(Number(.message.properties.revenue)*100)
const customFields = .message.().({
"currency": .properties.currency,
"value_decimal": .properties.revenue !== undefined ? Number(.properties.revenue) : undefined,
"value_decimal": revenue_in_cents ? revenue_in_cents / 100,
"item_count": (Array.isArray(.properties.products) && .properties.products.length) || (.properties.itemCount && Number(.properties.itemCount)),
"value": .properties.revenue !== undefined ? Number(.properties.revenue)*100 : undefined,
"value": revenue_in_cents,
"conversion_id": .properties.conversionId || .messageId,
});
$.removeUndefinedAndNullValues(customFields)
Expand Down
4 changes: 2 additions & 2 deletions src/util/prometheus.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ class Prometheus {
name: 'outgoing_request_count',
help: 'Outgoing HTTP requests count',
type: 'counter',
labelNames: ['feature', 'destType', 'endpointPath', 'success', 'statusCode'],
labelNames: ['feature', 'destType', 'endpointPath', 'success', 'statusCode', 'requestMethod' , 'module'],
},

// Gauges
Expand Down Expand Up @@ -573,7 +573,7 @@ class Prometheus {
name: 'outgoing_request_latency',
help: 'Outgoing HTTP requests duration in seconds',
type: 'histogram',
labelNames: ['feature', 'destType', 'endpointPath'],
labelNames: ['feature', 'destType', 'endpointPath', 'requestMethod', 'module'],
},
{
name: 'http_request_duration',
Expand Down
12 changes: 12 additions & 0 deletions src/v0/destinations/active_campaign/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ const syncContact = async (contactPayload, category, destination) => {
destType: 'active_campaign',
feature: 'transformation',
endpointPath: endPoint,
requestMethod: 'POST',
module: 'router',
});
if (res.success === false) {
errorHandler(res, 'Failed to create new contact');
Expand Down Expand Up @@ -129,6 +131,8 @@ const customTagProcessor = async (message, category, destination, contactId) =>
destType: 'active_campaign',
feature: 'transformation',
endpointPath: `/api/3/tags`,
requestMethod: 'GET',
module: 'router',
});
promises.push(resp);
}
Expand Down Expand Up @@ -253,6 +257,8 @@ const customFieldProcessor = async (message, category, destination) => {
destType: 'active_campaign',
feature: 'transformation',
endpointPath: `/api/3/fields`,
requestMethod: 'GET',
module: 'router',
});
promises.push(resp);
}
Expand Down Expand Up @@ -351,6 +357,8 @@ const customListProcessor = async (message, category, destination, contactId) =>
destType: 'active_campaign',
feature: 'transformation',
endpointPath: mergeListWithContactUrl,
requestMethod: 'POST',
module: 'router',
});
promises.push(res);
}
Expand Down Expand Up @@ -409,6 +417,8 @@ const screenRequestHandler = async (message, category, destination) => {
destType: 'active_campaign',
feature: 'transformation',
endpointPath: `/api/3/eventTrackingEvents`,
requestMethod: 'GET',
module: 'router',
});
if (res.success === false) {
errorHandler(res, 'Failed to retrieve events');
Expand Down Expand Up @@ -473,6 +483,8 @@ const trackRequestHandler = async (message, category, destination) => {
destType: 'active_campaign',
feature: 'transformation',
endpointPath: `/api/3/eventTrackingEvents`,
requestMethod: 'GET',
module: 'router',
});

if (res.success === false) {
Expand Down
3 changes: 3 additions & 0 deletions src/v0/destinations/af/deleteUsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const deleteUser = async (config, endpoint, body, identityType, identityValue) =
destType: 'af',
feature: 'deleteUsers',
endpointPath: `appsflyer.com/api/gdpr/v1/opendsr_requests`,
requestMethod: 'POST',
module: 'deletion',
},
);
const handledDelResponse = processAxiosResponse(response);
Expand All @@ -48,6 +50,7 @@ const deleteUser = async (config, endpoint, body, identityType, identityValue) =
handledDelResponse.status,
{
[tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(handledDelResponse.status),
[tags.TAG_NAMES.STATUS]: handledDelResponse.status,
},
handledDelResponse,
);
Expand Down
3 changes: 3 additions & 0 deletions src/v0/destinations/am/deleteUsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const userDeletionHandler = async (userAttributes, config) => {
destType: 'am',
feature: 'deleteUsers',
endpointPath,
requestMethod: 'POST',
module: 'deletion',
});
const handledDelResponse = processAxiosResponse(resp);
if (!isHttpStatusSuccess(handledDelResponse.status)) {
Expand All @@ -51,6 +53,7 @@ const userDeletionHandler = async (userAttributes, config) => {
handledDelResponse.status,
{
[tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(handledDelResponse.status),
[tags.TAG_NAMES.STATUS]: handledDelResponse.status,
},
handledDelResponse,
);
Expand Down
9 changes: 8 additions & 1 deletion src/v0/destinations/braze/braze.util.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,14 @@ describe('dedup utility tests', () => {
},
timeout: 10000,
},
{ destType: 'braze', feature: 'transformation' },
{
destType: 'braze',
feature: 'transformation',
endpointPath: '/users/export/ids',
feature: 'transformation',
module: 'router',
requestMethod: 'POST',
},
);
});

Expand Down
5 changes: 4 additions & 1 deletion src/v0/destinations/braze/deleteUsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const userDeletionHandler = async (userAttributes, config) => {
// Endpoints different for different data centers.
// DOC: https://www.braze.com/docs/user_guide/administrative/access_braze/braze_instances/
let endPoint;
const endpointPath = '/users/delete'; // TODO: to handle for destinations dynamically by extracting from endpoint
const endpointPath = '/users/delete';
const dataCenterArr = dataCenter.trim().split('-');
if (dataCenterArr[0].toLowerCase() === 'eu') {
endPoint = 'https://rest.fra-01.braze.eu/users/delete';
Expand All @@ -46,6 +46,8 @@ const userDeletionHandler = async (userAttributes, config) => {
destType: 'braze',
feature: 'deleteUsers',
endpointPath,
requestMethod: 'POST',
module: 'deletion',
});
const handledDelResponse = processAxiosResponse(resp);
if (!isHttpStatusSuccess(handledDelResponse.status) && handledDelResponse.status !== 404) {
Expand All @@ -54,6 +56,7 @@ const userDeletionHandler = async (userAttributes, config) => {
handledDelResponse.status,
{
[tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(handledDelResponse.status),
[tags.TAG_NAMES.STATUS]: handledDelResponse.status,
},
handledDelResponse,
);
Expand Down
3 changes: 3 additions & 0 deletions src/v0/destinations/braze/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ async function processIdentify(message, destination) {
{
destType: 'braze',
feature: 'transformation',
requestMethod: 'POST',
module: 'router',
endpointPath: '/users/identify',
},
);
if (!isHttpStatusSuccess(brazeIdentifyResp.status)) {
Expand Down
3 changes: 3 additions & 0 deletions src/v0/destinations/braze/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ const BrazeDedupUtility = {
{
destType: 'braze',
feature: 'transformation',
requestMethod: 'POST',
module: 'router',
endpointPath: '/users/export/ids',
},
);
stats.counter('braze_lookup_failure_count', 1, {
Expand Down
2 changes: 2 additions & 0 deletions src/v0/destinations/canny/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ const retrieveUserId = async (apiKey, message) => {
destType: 'canny',
feature: 'transformation',
endpointPath: `/v1/users/retrieve`,
requestMethod: 'POST',
module: 'processor',
},
);
logger.debug(response);
Expand Down
3 changes: 3 additions & 0 deletions src/v0/destinations/clevertap/deleteUsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ const userDeletionHandler = async (userAttributes, config) => {
destType: 'clevertap',
feature: 'deleteUsers',
endpointPath,
requestMethod: 'POST',
module: 'deletion',
},
);
const handledDelResponse = processAxiosResponse(deletionResponse);
Expand All @@ -62,6 +64,7 @@ const userDeletionHandler = async (userAttributes, config) => {
handledDelResponse.status,
{
[tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(handledDelResponse.status),
[tags.TAG_NAMES.STATUS]: handledDelResponse.status,
},
handledDelResponse,
);
Expand Down
9 changes: 7 additions & 2 deletions src/v0/destinations/clevertap/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,21 @@ const responseWrapper = (payload, destination) => {
}
*
}
* This function stringify the payload attributes if it's an array or objects.
* This function stringify the payload attributes if it's an array or objects. The keys that are not stringified are present in the `stringifyExcludeList` array.
* @param {*} payload
* @returns
* return the final payload after converting to the relevant data-types.
*/
const convertObjectAndArrayToString = (payload, event) => {
const finalPayload = {};
const stringifyExcludeList = ['category-unsubscribe', 'category-resubscribe'];
if (payload) {
Object.keys(payload).forEach((key) => {
if (payload[key] && (Array.isArray(payload[key]) || typeof payload[key] === 'object')) {
if (
payload[key] &&
(Array.isArray(payload[key]) || typeof payload[key] === 'object') &&
!stringifyExcludeList.includes(key)
) {
finalPayload[key] = JSON.stringify(payload[key]);
} else {
finalPayload[key] = payload[key];
Expand Down
Loading

0 comments on commit 7e80aa0

Please sign in to comment.