Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:rudderlabs/rudder-transformer in…
Browse files Browse the repository at this point in the history
…to chore.adobe.analytics.proxy.tests
  • Loading branch information
yashasvibajpai committed Mar 12, 2024
2 parents b153041 + 1ef20d6 commit 0307d83
Show file tree
Hide file tree
Showing 49 changed files with 4,619 additions and 368 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/prepare-for-prod-dt-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,39 @@ jobs:
git push -u origin hosted-transformer-$TAG_NAME
gh pr create --fill
- name: Update helm charts and raise pull request for enterprise customers on dedicated transformers
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
run: |
cd rudder-devops
git checkout -b dedicated-transformer-$TAG_NAME
cd customer-objects
declare -a enabled_ut_customers=()
declare -a sub_directories=('enterprise-us' 'enterprise-eu')
# identify the customers enabled in sub-directories
for directory in "${sub_directories[@]}"; do
for f in "./$directory"/*; do
[[ -f $f ]] || continue
enabled="$(yq e '.spec.user_transformer.enabled' $f)"
if [ $enabled == "true" ]; then
enabled_ut_customers+=( $f )
fi
done
done
# bump up the customers version and repository information
for customer in "${enabled_ut_customers[@]}"; do
yq eval -i ".spec.user_transformer.image.version=\"$TAG_NAME\"" $customer
yq eval -i ".spec.user_transformer.image.repository=\"$TF_IMAGE_REPOSITORY\"" $customer
git add $customer
done
git commit -m "chore: upgrade dedicated transformers to $TAG_NAME"
git push -u origin dedicated-transformer-$TAG_NAME
gh pr create --fill
40 changes: 39 additions & 1 deletion .github/workflows/prepare-for-prod-rollback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ jobs:
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
- name: Clone Devops Repo
run: |
git clone https://${{secrets.PAT}}@github.com/rudderlabs/rudder-devops.git
- name: Update Helm Charts and Raise Pull Request
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
run: |
git clone https://${{secrets.PAT}}@github.com/rudderlabs/rudder-devops.git
cd rudder-devops
git checkout -b shared-transformer-rollback-${{ steps.target-version.outputs.tag_name }}
Expand All @@ -57,3 +60,38 @@ jobs:
git push -u origin shared-transformer-rollback-${{ steps.target-version.outputs.tag_name }}
gh pr create --fill
- name: Update helm charts and raise pull request for enterprise customers on dedicated transformers
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
run: |
cd rudder-devops
git checkout -b dedicated-transformer-rollback-${{ steps.target-version.outputs.tag_name }}
cd customer-objects
declare -a enabled_ut_customers=()
declare -a sub_directories=('enterprise-us' 'enterprise-eu')
# identify the customers enabled in sub-directories
for directory in "${sub_directories[@]}"; do
for f in "./$directory"/*; do
[[ -f $f ]] || continue
enabled="$(yq e '.spec.user_transformer.enabled' $f)"
if [ $enabled == "true" ]; then
enabled_ut_customers+=( $f )
fi
done
done
# bump up the customers version and repository information
for customer in "${enabled_ut_customers[@]}"; do
yq eval -i ".spec.user_transformer.image.version=\"${{ steps.target-version.outputs.tag_name }}\"" $customer
git add $customer
done
git commit -m "chore: rollback dedicated transformers to ${{ steps.target-version.outputs.tag_name }}"
git push -u origin dedicated-transformer-rollback-${{ steps.target-version.outputs.tag_name }}
gh pr create --fill
2 changes: 1 addition & 1 deletion .github/workflows/prepare-for-staging-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
cd rudder-devops
BRANCH_NAME="shared-transformer-$TAG_NAME"
echo $BRANCH_NAME
if [ -n `git ls-remote --heads origin $BRANCH_NAME 2>/dev/null` ]
if [ -n "$(git ls-remote --heads origin $BRANCH_NAME 2>/dev/null)" ]
then
echo "Staging deployment branch already exists!"
else
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,5 @@ dist
.idea

# component test report
test_reports/
test_reports/
temp/
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.19.0
18.19.1
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

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.58.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.57.1...v1.58.0) (2024-03-04)


### Features

* add support for interaction events in sfmc ([#3109](https://github.com/rudderlabs/rudder-transformer/issues/3109)) ([0486049](https://github.com/rudderlabs/rudder-transformer/commit/0486049ba2ad96b50d8f29e96b46b96a8a5c9f76))
* add support of custom page/screen event name in mixpanel ([#3098](https://github.com/rudderlabs/rudder-transformer/issues/3098)) ([0eb2393](https://github.com/rudderlabs/rudder-transformer/commit/0eb2393939fba2452ef7f07a1d149d87f18290c3))
* consent mode support for google adwords remarketing list ([#3143](https://github.com/rudderlabs/rudder-transformer/issues/3143)) ([7532c90](https://github.com/rudderlabs/rudder-transformer/commit/7532c90d7e1feac00f12961c56da18757010f44a))
* **facebook:** update content_type mapping logic for fb pixel and fb conversions ([#3113](https://github.com/rudderlabs/rudder-transformer/issues/3113)) ([aea417c](https://github.com/rudderlabs/rudder-transformer/commit/aea417cd2691547399010c034cadbc5db6b0c6ee))
* klaviyo profile mapping ([#3105](https://github.com/rudderlabs/rudder-transformer/issues/3105)) ([2761786](https://github.com/rudderlabs/rudder-transformer/commit/2761786ff3fc99ed6d4d3b7a6c2400226b1cfb12))
* onboard new destination ninetailed ([#3106](https://github.com/rudderlabs/rudder-transformer/issues/3106)) ([0e2588e](https://github.com/rudderlabs/rudder-transformer/commit/0e2588ecd87f3b2c6877a099aa1cbf2d5325966c))


### Bug Fixes

* add error handling for tiktok ads ([#3144](https://github.com/rudderlabs/rudder-transformer/issues/3144)) ([e93e47f](https://github.com/rudderlabs/rudder-transformer/commit/e93e47f33e098104fb532916932fe38bbfeaa4a1))
* **algolia:** added check for objectIds or filters to be non empty ([#3126](https://github.com/rudderlabs/rudder-transformer/issues/3126)) ([d619c97](https://github.com/rudderlabs/rudder-transformer/commit/d619c9769cd270cb2d16dad0865683ff4beb2d19))
* clevertap remove stringification of array object properties ([#3048](https://github.com/rudderlabs/rudder-transformer/issues/3048)) ([69e43b6](https://github.com/rudderlabs/rudder-transformer/commit/69e43b6ffadeaec87b7440da34a341890ceba252))
* convert to string from null in hs ([#3136](https://github.com/rudderlabs/rudder-transformer/issues/3136)) ([75e9f46](https://github.com/rudderlabs/rudder-transformer/commit/75e9f462b0ff9b9a8abab3c78dc7d147926e9e5e))
* event fix and added utility ([#3142](https://github.com/rudderlabs/rudder-transformer/issues/3142)) ([9b705b7](https://github.com/rudderlabs/rudder-transformer/commit/9b705b71a9d3a595ea0fbf532602c3941b0a18db))
* metadata structure correction ([#3119](https://github.com/rudderlabs/rudder-transformer/issues/3119)) ([8351b5c](https://github.com/rudderlabs/rudder-transformer/commit/8351b5cbbf81bbc14b2f884feaae4ad3ca59a39a))
* one_signal: Encode external_id in endpoint ([#3140](https://github.com/rudderlabs/rudder-transformer/issues/3140)) ([8a20886](https://github.com/rudderlabs/rudder-transformer/commit/8a2088608d6da4b35bbb506db2fc3df1e4d41f3b))
* rakuten: sync property mapping sourcekeys to rudderstack standard spec ([#3129](https://github.com/rudderlabs/rudder-transformer/issues/3129)) ([2ebff95](https://github.com/rudderlabs/rudder-transformer/commit/2ebff956ff2aa74b008a8de832a31d8774d2d47e))
* reddit revenue mapping for floating point values ([#3118](https://github.com/rudderlabs/rudder-transformer/issues/3118)) ([41f4078](https://github.com/rudderlabs/rudder-transformer/commit/41f4078011ef54334bb9ecc11a7b2ccc8831a4aa))
* version deprecation failure false positive ([#3104](https://github.com/rudderlabs/rudder-transformer/issues/3104)) ([657b780](https://github.com/rudderlabs/rudder-transformer/commit/657b7805eb01da25a007d978198d5debf03917fd))

### [1.57.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.57.0...v1.57.1) (2024-03-04)


Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.4
FROM node:18.19.0-alpine3.18 AS base
FROM node:18.19.1-alpine3.18 AS base
ENV HUSKY 0

RUN apk update
Expand Down
5 changes: 5 additions & 0 deletions github-release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
gitRawCommitsOpts: {
merges: null,
},
};
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.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rudder-transformer",
"version": "1.57.1",
"version": "1.58.0",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down Expand Up @@ -49,7 +49,7 @@
"commit-msg": "commitlint --edit",
"prepare": "node ./scripts/skipPrepareScript.js || husky install",
"release": "npx standard-version",
"release:github": "DEBUG=conventional-github-releaser npx conventional-github-releaser -p angular -v",
"release:github": "DEBUG=conventional-github-releaser npx conventional-github-releaser -p angular --config github-release.config.js",
"clean:node": "modclean",
"check:lint": "eslint . -f json -o reports/eslint.json || exit 0"
},
Expand Down
65 changes: 65 additions & 0 deletions src/cdk/v2/destinations/koala/procWorkflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
bindings:
- name: EventType
path: ../../../../constants
- path: ../../bindings/jsontemplate
- name: defaultRequestConfig
path: ../../../../v0/util

steps:
- name: validateInput
template: |
$.assert(.message.type, "message Type is not present. Aborting message");
$.assert(.message.type in {{$.EventType.([.IDENTIFY, .TRACK])}},
"message type " + .message.type + " is not supported");
$.assertConfig(.destination.Config.publicKey, "publicKey is not present. Aborting message");
$.context.email = .message.().({{{{$.getGenericPaths("emailOnly")}}}});
$.context.ko_profile_id = .message.traits.ko_profile_id ?? .message.context.traits.ko_profile_id ?? .message.properties.ko_profile_id;
$.assert($.context.email || $.context.ko_profile_id, "Neither email or ko_profile_id are present on traits. Aborting message");
- name: setMessageType
template: |
$.context.messageType = .message.type.toLowerCase();
- name: preparePayloadForIdentify
condition: $.context.messageType === {{$.EventType.IDENTIFY}}
template: |
const traits = .message.traits ?? .message.context.traits ?? {};
const koTraits = traits{~['ko_profile_id']}
const basePayload = {
email: $.context.email,
profile_id: $.context.ko_profile_id,
identifies: [{
type: $.context.messageType,
sent_at: .message.().({{{{$.getGenericPaths("timestamp")}}}}),
traits: koTraits
}]
};
$.context.payload = basePayload
- name: preparePayloadForTrack
condition: $.context.messageType === {{$.EventType.TRACK}}
template: |
const properties = .message.properties ?? {};
const koProperties = properties{~['ko_profile_id']}
const basePayload = {
ip: .message.context.ip ?? .message.request_ip,
email: $.context.email,
profile_id: $.context.ko_profile_id,
events: [{
type: $.context.messageType,
event: .message.event,
message_id: .message.messageId,
sent_at: .message.().({{{{$.getGenericPaths("timestamp")}}}}),
properties: koProperties,
context: .message.context
}]
};
$.context.payload = basePayload
- name: buildResponseForProcessTransformation
template: |
const response = $.defaultRequestConfig();
response.body.JSON = $.context.payload;
response.endpoint = "https://api2.getkoala.com/web/projects/" + .destination.Config.publicKey + "/batch";
response.headers = {
"content-type": "application/json"
};
response
31 changes: 31 additions & 0 deletions src/cdk/v2/destinations/koala/rtWorkflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
bindings:
- name: handleRtTfSingleEventError
path: ../../../../v0/util/index

steps:
- name: validateInput
template: |
$.assert(Array.isArray(^) && ^.length > 0, "Invalid event array")
- name: transform
externalWorkflow:
path: ./procWorkflow.yaml
loopOverInput: true

- name: successfulEvents
template: |
$.outputs.transform#idx.output.({
"batchedRequest": .,
"batched": false,
"destination": ^[idx].destination,
"metadata": ^[idx].metadata[],
"statusCode": 200
})[]
- name: failedEvents
template: |
$.outputs.transform#idx.error.(
$.handleRtTfSingleEventError(^[idx], .originalError ?? ., {})
)[]
- name: finalPayload
template: |
[...$.outputs.failedEvents, ...$.outputs.successfulEvents]
1 change: 1 addition & 0 deletions src/constants/destinationCanonicalNames.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ const DestCanonicalNames = {
'the trade desk',
],
INTERCOM: ['INTERCOM', 'intercom', 'Intercom'],
koala: ['Koala', 'koala', 'KOALA'],
};

module.exports = { DestHandlerMap, DestCanonicalNames };
3 changes: 2 additions & 1 deletion src/features.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
"REDDIT": true,
"THE_TRADE_DESK": true,
"INTERCOM": true,
"NINETAILED": true
"NINETAILED": true,
"KOALA": true
},
"regulations": [
"BRAZE",
Expand Down
2 changes: 1 addition & 1 deletion src/util/prometheus.js
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ class Prometheus {
name: 'get_libraries_code_time',
help: 'get_libraries_code_time',
type: 'histogram',
labelNames: ['libraryVersionId', 'versionId', 'type'],
labelNames: ['libraryVersionId', 'versionId', 'type', 'version'],
},
{
name: 'isolate_cpu_time',
Expand Down
2 changes: 1 addition & 1 deletion src/util/redis/redisConnector.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe(`Redis Class Get Tests`, () => {
data.forEach((dataPoint, index) => {
it(`${index}. Redis Get- ${dataPoint.description}`, async () => {
try {
const output = await RedisDB.getVal(dataPoint.input.value, (isObjExpected = false));
const output = await RedisDB.getVal(dataPoint.input.value, false);
expect(output).toEqual(dataPoint.output);
} catch (error) {
expect(error.message).toEqual(dataPoint.output.error);
Expand Down
15 changes: 10 additions & 5 deletions src/util/redis/testData/shopify_source.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"user_id": "rudder01",
"id": "shopify_test_get_items_fail",
"query_parameters": {
"topic": ["carts_update"]
"topic": ["carts_update"],
"writeKey": ["wr"]
},
"token": "shopify_test_get_items_fail",
"email": "[email protected]",
Expand Down Expand Up @@ -115,7 +116,8 @@
"input": {
"cart_token": "shopifyGetAnonymousId",
"query_parameters": {
"topic": ["checkouts_delete"]
"topic": ["checkouts_delete"],
"writeKey": ["wr"]
},
"line_items": [],
"note": null,
Expand Down Expand Up @@ -154,7 +156,8 @@
"input": {
"id": "shopify_test3",
"query_parameters": {
"topic": ["carts_update"]
"topic": ["carts_update"],
"writeKey": ["wr"]
},
"token": "shopify_test3",
"line_items": [],
Expand Down Expand Up @@ -252,7 +255,8 @@
"user_id": "rudder01",
"id": "shopify_test_cart",
"query_parameters": {
"topic": ["carts_update"]
"topic": ["carts_update"],
"writeKey": ["wr"]
},
"token": "shopify_test_cart",
"email": "[email protected]",
Expand Down Expand Up @@ -1256,7 +1260,8 @@
"input": {
"id": "shopify_test4",
"query_parameters": {
"topic": ["carts_update"]
"topic": ["carts_update"],
"writeKey": ["wr"]
},
"token": "shopify_test4",
"line_items": [],
Expand Down
1 change: 0 additions & 1 deletion src/v0/destinations/am/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ const getDefaultResponseData = (message, rawPayload, evType, groupInfo) => {
return { groups, rawPayload };
};


const getResponseData = (evType, destination, rawPayload, message, groupInfo) => {
let groups;

Expand Down
3 changes: 1 addition & 2 deletions src/v0/destinations/am/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ const validateEventType = (evType) => {
}
};


const userPropertiesPostProcess = (rawPayload) => {
const operationList = [
'$setOnce',
Expand Down Expand Up @@ -187,5 +186,5 @@ module.exports = {
getEventId,
getUnsetObj,
validateEventType,
userPropertiesPostProcess
userPropertiesPostProcess,
};
Loading

0 comments on commit 0307d83

Please sign in to comment.