Skip to content

Commit

Permalink
chore(release): pull main into develop post release v1.52.0 (#2908)
Browse files Browse the repository at this point in the history
  • Loading branch information
aashishmalik authored Dec 13, 2023
2 parents eb28f4a + 045f362 commit 6426b73
Show file tree
Hide file tree
Showing 16 changed files with 274 additions and 17 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@

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.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.51.1...v1.52.0) (2023-12-12)


### Features

* onboard msl changes for new record event ([#2644](https://github.com/rudderlabs/rudder-transformer/issues/2644)) ([36d3f25](https://github.com/rudderlabs/rudder-transformer/commit/36d3f258ed5ea4ba1899c8b2cae8203bf73d90ed)), closes [#2813](https://github.com/rudderlabs/rudder-transformer/issues/2813)
* onboard reddit cloud mode destination ([#2829](https://github.com/rudderlabs/rudder-transformer/issues/2829)) ([babb89a](https://github.com/rudderlabs/rudder-transformer/commit/babb89a5bf6d1b84d1319b967953c7c1b6de7c2c))
* tiktok_ads: add support for custom events ([#2891](https://github.com/rudderlabs/rudder-transformer/issues/2891)) ([091354c](https://github.com/rudderlabs/rudder-transformer/commit/091354c4427b33c9f8ac2678db3a4ab38b008e7d))


### Bug Fixes

* active_campaign error handler ([#2895](https://github.com/rudderlabs/rudder-transformer/issues/2895)) ([5a6d296](https://github.com/rudderlabs/rudder-transformer/commit/5a6d296b0ce83f3b6b4e215839fb65d4e0f2de41))
* add check to remove empty properties object from payload ([#2896](https://github.com/rudderlabs/rudder-transformer/issues/2896)) ([1a86a07](https://github.com/rudderlabs/rudder-transformer/commit/1a86a0723e3f5fb6fdf9cf1dc716a47c6da16745))
* adobe_analytics event field check ([#2890](https://github.com/rudderlabs/rudder-transformer/issues/2890)) ([bf39215](https://github.com/rudderlabs/rudder-transformer/commit/bf39215dd1bbed482665c837a2bfabfcb751c753))
* covert toString before toLowercase ([#2830](https://github.com/rudderlabs/rudder-transformer/issues/2830)) ([bed431e](https://github.com/rudderlabs/rudder-transformer/commit/bed431e1de94ab28df1ee592d083a1481b960b6d))
* **dm:** add workspaceId in common metadata to be returned to the callers ([#2868](https://github.com/rudderlabs/rudder-transformer/issues/2868)) ([b3437a3](https://github.com/rudderlabs/rudder-transformer/commit/b3437a34358d5fd5b1eb63f30a5a695f39aa84ff))
* **integrations:** onboard sprig destination ([#2857](https://github.com/rudderlabs/rudder-transformer/issues/2857)) ([ede22e3](https://github.com/rudderlabs/rudder-transformer/commit/ede22e3f8fb60a9e36e2a3f5a5e86260255c49ef))
* mailjet source transformation by adding email exists check ([#2889](https://github.com/rudderlabs/rudder-transformer/issues/2889)) ([4a7eaa0](https://github.com/rudderlabs/rudder-transformer/commit/4a7eaa09000bcb82eb7f217d500223939bd9b07b))
* missing null check in braze populateCustomAttributesWithOperation ([#2897](https://github.com/rudderlabs/rudder-transformer/issues/2897)) ([50e921d](https://github.com/rudderlabs/rudder-transformer/commit/50e921d1451bf7016e60b2e238b8f842d72b5b71))
* removed retry logic from v1 cm360, added adapter for v1 to v0 conversion ([#2860](https://github.com/rudderlabs/rudder-transformer/issues/2860)) ([776d2c4](https://github.com/rudderlabs/rudder-transformer/commit/776d2c4abe23cd279195064684b9ccc807d83afc))
* **dm:** use clones as false for tracking plan node cache ([#2899](https://github.com/rudderlabs/rudder-transformer/issues/2899)) ([8f47db8](https://github.com/rudderlabs/rudder-transformer/commit/8f47db8bcf581d1807cfa2aa823ef400a30a09e3))

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


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.51.1",
"version": "1.52.0",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion src/cdk/v2/destinations/reddit/procWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ steps:
template: |
let event = .message.event;
let eventInLowerCase = event.trim().toLowerCase();;
let eventNames = .destination.Config.eventsMapping.(){.from === event}.to[] ?? [];
let eventNames = .destination.Config.eventsMapping? .destination.Config.eventsMapping.(){.from === event}.to[] ?? []: [];
eventNames.length === 0 ? eventNames = $.ecomEventMaps.(){eventInLowerCase in .src}.dest[] ?? [];
const event_type = (eventNames.length === 0 || eventNames[0]==="") ? ({"tracking_type": "Custom", "custom_event_name": event}): ({tracking_type: eventNames[0]});
Expand Down
8 changes: 6 additions & 2 deletions src/services/destination/postTransformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { generateErrorObject } from '../../v0/util';
import { ErrorReportingService } from '../errorReporting';
import tags from '../../v0/util/tags';
import stats from '../../util/stats';
import { FixMe } from '../../util/types';

export class DestinationPostTransformationService {
public static handleProcessorTransformSucessEvents(
Expand Down Expand Up @@ -161,7 +162,7 @@ export class DestinationPostTransformationService {
}

public static handlevV1DeliveriesFailureEvents(
error: NonNullable<unknown>,
error: FixMe,
metaTo: MetaTransferObject,
): DeliveriesResponse {
const errObj = generateErrorObject(error, metaTo.errorDetails, false);
Expand All @@ -172,7 +173,10 @@ export class DestinationPostTransformationService {
}
const responses = metadataArray.map((metadata) => {
const resp = {
error: errObj.message || '[Delivery] Error occured while processing payload',
error:
JSON.stringify(error.destinationResponse?.response) ||
errObj.message ||
'[Delivery] Error occured while processing payload',
statusCode: errObj.status,
metadata,
} as DeliveryJobState;
Expand Down
2 changes: 1 addition & 1 deletion src/util/trackingPlan.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const logger = require('../logger');
const { responseStatusHandler } = require('./utils');
const stats = require('./stats');

const tpCache = new NodeCache();
const tpCache = new NodeCache({ useClones: false });
const CONFIG_BACKEND_URL = process.env.CONFIG_BACKEND_URL || 'https://api.rudderlabs.com';
const TRACKING_PLAN_URL = `${CONFIG_BACKEND_URL}/workspaces`;

Expand Down
3 changes: 3 additions & 0 deletions src/v0/destinations/adobe_analytics/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ function handleContextData(payload, destinationConfig, message) {
*/

function escapeToHTML(inputString) {
if (typeof inputString !== 'string') {
return inputString;
}
return inputString.replace(
/[&<>]/g,
(match) =>
Expand Down
2 changes: 1 addition & 1 deletion src/v0/destinations/marketo_static_list/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const processRouterDest = async (inputs, reqMetadata) => {
// use lodash.groupby to group the inputs based on message type
const transformedRecordEvent = [];
let transformedAudienceEvent = [];
const groupedInputs = lodash.groupBy(inputs, (input) => input.message.type);
const groupedInputs = lodash.groupBy(inputs, (input) => input.message.type?.toLowerCase());

const respList = [];
// process record events
Expand Down
2 changes: 1 addition & 1 deletion src/v0/util/errorTypes/filteredEventsError.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { BaseError } = require('./base');
const { BaseError } = require('@rudderstack/integrations-lib');
const { HTTP_STATUS_CODES } = require('../constant');

class FilteredEventsError extends BaseError {
Expand Down
2 changes: 1 addition & 1 deletion src/v0/util/errorTypes/transformerProxyError.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { BaseError } = require('@rudderstack/integrations-lib');
const tags = require('../tags');
const { BaseError } = require('./base');

const errorTypes = Object.values(tags.ERROR_TYPES);
const metaTypes = Object.values(tags.METADATA);
Expand Down
2 changes: 1 addition & 1 deletion src/v0/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const isPrimitive = (arg) => {
const isNewStatusCodesAccepted = (reqMetadata = {}) => {
if (reqMetadata && typeof reqMetadata === 'object' && !Array.isArray(reqMetadata)) {
const { features } = reqMetadata;
return !!(features && features[FEATURE_FILTER_CODE]);
return !!features?.[FEATURE_FILTER_CODE];
}
return false;
};
Expand Down
10 changes: 10 additions & 0 deletions src/v0/util/index.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { TAG_NAMES } = require('@rudderstack/integrations-lib');
const utilities = require('.');
const { getFuncTestData } = require('../../../test/testHelper');
const { FilteredEventsError } = require('./errorTypes');
const { hasCircularReference, flattenJson } = require('./index');

// Names of the utility functions to test
Expand Down Expand Up @@ -116,3 +118,11 @@ describe('flattenJson', () => {
);
});
});

describe('tests for generateErrorObject', () => {
test('test-0', () => {
const myErr = new FilteredEventsError('error-1');
const outputErrObj = utilities.generateErrorObject(myErr);
expect(outputErrObj.statTags).toEqual({});
});
});
4 changes: 1 addition & 3 deletions test/__tests__/data/braze_router.json
Original file line number Diff line number Diff line change
Expand Up @@ -841,9 +841,7 @@
},
{
"error": "[Braze Deduplication]: Duplicate user detected, the user is dropped",
"statTags": {
"errorCategory": "transformation"
},
"statTags": {},
"statusCode": 298,
"batched": false,
"metadata": [
Expand Down
177 changes: 176 additions & 1 deletion test/integrations/destinations/braze/dataDelivery/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ export const data = [
output: {
response: [
{
error: 'Request failed for braze with status: 401',
error: '{"code":400,"message":"Bad Req","status":"Fail Case"}',
statusCode: 401,
metadata: {
jobId: 2,
Expand Down Expand Up @@ -664,4 +664,179 @@ export const data = [
},
},
},
{
name: 'braze',
description:
'Test Transformer Proxy V1 input with v0 proxy handler Error returned Multiple metadata Track Event',
feature: 'dataDelivery',
module: 'destination',
version: 'v1',
input: {
request: {
body: {
type: 'REST',
endpoint: 'https://rest.iad-03.braze.com/users/track/testV1',
method: 'POST',
userId: 'gabi_userId_45',
headers: {
Accept: 'application/json',
Authorization: 'Bearer api_key',
'Content-Type': 'application/json',
},
body: {
FORM: {},
JSON: {
partner: 'RudderStack',
attributes: [
{
email: '[email protected]',
city: 'Disney',
country: 'USA',
firstname: 'Mickey',
external_id: '456345345',
},
{
email: '[email protected]',
city: 'Disney',
country: 'USA',
firstname: 'Mickey',
external_id: '456345345',
},
{
email: '[email protected]',
city: 'Disney',
country: 'USA',
firstname: 'Mickey',
external_id: '456345345',
},
],
},
JSON_ARRAY: {},
XML: {},
},
metadata: [
{
jobId: 2,
attemptNum: 0,
userId: '',
sourceId: '2Vsge2uWYdrLfG7pZb5Y82eo4lr',
destinationId: '2RHh08uOsXqE9KvCDg3hoaeuK2L',
workspaceId: '2Csl0lSTbuM3qyHdaOQB2GcDH8o',
secret: {
access_token: 'secret',
refresh_token: 'refresh',
developer_token: 'developer_Token',
},
},
{
jobId: 3,
attemptNum: 0,
userId: '',
sourceId: '2Vsge2uWYdrLfG7pZb5Y82eo4lr',
destinationId: '2RHh08uOsXqE9KvCDg3hoaeuK2L',
workspaceId: '2Csl0lSTbuM3qyHdaOQB2GcDH8o',
secret: {
access_token: 'secret',
refresh_token: 'refresh',
developer_token: 'developer_Token',
},
},
{
jobId: 4,
attemptNum: 0,
userId: '',
sourceId: '2Vsge2uWYdrLfG7pZb5Y82eo4lr',
destinationId: '2RHh08uOsXqE9KvCDg3hoaeuK2L',
workspaceId: '2Csl0lSTbuM3qyHdaOQB2GcDH8o',
secret: {
access_token: 'secret',
refresh_token: 'refresh',
developer_token: 'developer_Token',
},
},
],
files: {},
params: {
destination: 'braze',
},
},
method: 'POST',
},
},
output: {
response: {
status: 200,
body: {
output: {
response: [
{
error:
'{"message":"Valid data must be provided in the \'attributes\', \'events\', or \'purchases\' fields.","errors":[{"type":"The value provided for the \'email\' field is not a valid email.","input_array":"attributes","index":0},{"type":"The value provided for the \'email\' field is not a valid email.","input_array":"attributes","index":1}]}',
statusCode: 401,
metadata: {
jobId: 2,
attemptNum: 0,
userId: '',
sourceId: '2Vsge2uWYdrLfG7pZb5Y82eo4lr',
destinationId: '2RHh08uOsXqE9KvCDg3hoaeuK2L',
workspaceId: '2Csl0lSTbuM3qyHdaOQB2GcDH8o',
secret: {
access_token: 'secret',
refresh_token: 'refresh',
developer_token: 'developer_Token',
},
},
},
{
error:
'{"message":"Valid data must be provided in the \'attributes\', \'events\', or \'purchases\' fields.","errors":[{"type":"The value provided for the \'email\' field is not a valid email.","input_array":"attributes","index":0},{"type":"The value provided for the \'email\' field is not a valid email.","input_array":"attributes","index":1}]}',
statusCode: 401,
metadata: {
jobId: 3,
attemptNum: 0,
userId: '',
sourceId: '2Vsge2uWYdrLfG7pZb5Y82eo4lr',
destinationId: '2RHh08uOsXqE9KvCDg3hoaeuK2L',
workspaceId: '2Csl0lSTbuM3qyHdaOQB2GcDH8o',
secret: {
access_token: 'secret',
refresh_token: 'refresh',
developer_token: 'developer_Token',
},
},
},
{
error:
'{"message":"Valid data must be provided in the \'attributes\', \'events\', or \'purchases\' fields.","errors":[{"type":"The value provided for the \'email\' field is not a valid email.","input_array":"attributes","index":0},{"type":"The value provided for the \'email\' field is not a valid email.","input_array":"attributes","index":1}]}',
statusCode: 401,
metadata: {
jobId: 4,
attemptNum: 0,
userId: '',
sourceId: '2Vsge2uWYdrLfG7pZb5Y82eo4lr',
destinationId: '2RHh08uOsXqE9KvCDg3hoaeuK2L',
workspaceId: '2Csl0lSTbuM3qyHdaOQB2GcDH8o',
secret: {
access_token: 'secret',
refresh_token: 'refresh',
developer_token: 'developer_Token',
},
},
},
],
statTags: {
destType: 'BRAZE',
destinationId: '2RHh08uOsXqE9KvCDg3hoaeuK2L',
errorCategory: 'network',
errorType: 'aborted',
feature: 'dataDelivery',
implementation: 'native',
module: 'destination',
workspaceId: '2Csl0lSTbuM3qyHdaOQB2GcDH8o',
},
},
},
},
},
},
];
Loading

0 comments on commit 6426b73

Please sign in to comment.