Skip to content

Commit e285d8b

Browse files
Merge branch 'develop' into chore.redis.support.shopify.pixel
2 parents 4fa1c41 + 57fc4fe commit e285d8b

File tree

31 files changed

+5387
-2110
lines changed

31 files changed

+5387
-2110
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Allure Test Reporter
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
id-token: write
16+
contents: write # Required for gh-pages deployment
17+
18+
jobs:
19+
test_and_publish:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/[email protected]
25+
26+
- name: Setup Node
27+
uses: actions/[email protected]
28+
with:
29+
node-version-file: '.nvmrc'
30+
cache: 'npm'
31+
32+
- name: Install Dependencies
33+
run: npm ci
34+
35+
- name: Run Tests and Generate Report
36+
run: |
37+
npm run test:ts
38+
39+
- name: Load test report history
40+
uses: actions/checkout@v4
41+
if: always()
42+
continue-on-error: true
43+
with:
44+
ref: gh-pages
45+
path: gh-pages
46+
47+
- name: Generate Allure Report
48+
uses: simple-elf/allure-report-action@master
49+
if: always()
50+
with:
51+
gh_pages: gh-pages
52+
allure_results: allure-results
53+
allure_history: allure-history
54+
keep_reports: 20
55+
56+
- name: Publish to GitHub Pages
57+
uses: peaceiris/actions-gh-pages@v3
58+
id: deploy
59+
if: always()
60+
with:
61+
github_token: ${{ secrets.PAT }}
62+
publish_branch: gh-pages
63+
publish_dir: allure-history
64+
65+
- name: Get Report Number
66+
id: report-number
67+
if: always()
68+
run: |
69+
# Wait a moment for gh-pages to update
70+
sleep 10
71+
72+
# Create a temporary directory for gh-pages checkout
73+
mkdir temp_gh_pages
74+
cd temp_gh_pages
75+
76+
# Initialize git and fetch gh-pages
77+
git init
78+
git remote add origin https://github.com/rudderlabs/rudder-transformer.git
79+
git fetch origin gh-pages
80+
git checkout gh-pages
81+
82+
# Find the latest numbered directory
83+
LATEST_NUM=$(find . -maxdepth 1 -type d -name "[0-9]*" | sort -n | tail -1 | sed 's/\.\///')
84+
echo "number=${LATEST_NUM}" >> $GITHUB_OUTPUT
85+
86+
# Cleanup
87+
cd ..
88+
rm -rf temp_gh_pages
89+
90+
- name: Add Test Report Link as Comment on PR
91+
uses: actions/github-script@v7
92+
if: always()
93+
with:
94+
github-token: ${{ secrets.PAT }}
95+
script: |
96+
const { owner, repo } = context.repo;
97+
const prNumber = context.payload.pull_request.number;
98+
const reportNumber = '${{ steps.report-number.outputs.number }}';
99+
100+
const commentBody = `Allure Test reports for this run are available at:
101+
- Allure Report: https://rudderlabs.github.io/rudder-transformer/${reportNumber}/index.html`;
102+
103+
// Comment on the pull request
104+
await github.rest.issues.createComment({
105+
owner,
106+
repo,
107+
issue_number: prNumber,
108+
body: commentBody
109+
});

.github/workflows/component-test-report.yml

Lines changed: 0 additions & 81 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
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.
44

5+
### [1.87.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.87.0...v1.87.1) (2025-01-06)
6+
7+
8+
### Bug Fixes
9+
10+
* added missing eu url in delete flow for amplitude destination ([#3952](https://github.com/rudderlabs/rudder-transformer/issues/3952)) ([ac673fc](https://github.com/rudderlabs/rudder-transformer/commit/ac673fc22094d5567691ceaf13adca15442ea896))
11+
* adding transformer proxy for iterable ([#3878](https://github.com/rudderlabs/rudder-transformer/issues/3878)) ([c47488d](https://github.com/rudderlabs/rudder-transformer/commit/c47488decf8e79b9a2e0277bd85a8e895ffecc56)), closes [#3918](https://github.com/rudderlabs/rudder-transformer/issues/3918)
12+
* **airship:** resolved minor bugsnag error ([#3942](https://github.com/rudderlabs/rudder-transformer/issues/3942)) ([1d8532e](https://github.com/rudderlabs/rudder-transformer/commit/1d8532e743aad1e27efbe2975551ed174cf6ae6c))
13+
* property and event name mappings in shopify v2 ([#3941](https://github.com/rudderlabs/rudder-transformer/issues/3941)) ([0dedaa2](https://github.com/rudderlabs/rudder-transformer/commit/0dedaa2983b25ab529a5bc5b34ab70ebbf94fb3e))
14+
* use correct endpoint for custom events ([#3954](https://github.com/rudderlabs/rudder-transformer/issues/3954)) ([49eb591](https://github.com/rudderlabs/rudder-transformer/commit/49eb59180581b34252b601101ce2450e639c0850))
15+
* user order ([#3944](https://github.com/rudderlabs/rudder-transformer/issues/3944)) ([43abf9c](https://github.com/rudderlabs/rudder-transformer/commit/43abf9ca193a9d16a9eddc28cc6117beadd76b41)), closes [#3914](https://github.com/rudderlabs/rudder-transformer/issues/3914)
16+
517
## [1.87.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.86.0...v1.87.0) (2024-12-13)
618

719

package-lock.json

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rudder-transformer",
3-
"version": "1.87.0",
3+
"version": "1.87.1",
44
"description": "",
55
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
66
"bugs": {
@@ -72,7 +72,7 @@
7272
"ajv-draft-04": "^1.0.0",
7373
"ajv-formats": "^2.1.1",
7474
"amazon-dsp-formatter": "^1.0.2",
75-
"axios": "^1.7.3",
75+
"axios": "^1.7.9",
7676
"btoa": "^1.2.1",
7777
"component-each": "^0.2.6",
7878
"crypto-js": "^4.2.0",

src/routes/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ import { isNotEmpty } from '../v0/util';
1616

1717
dotenv.config();
1818

19-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
20-
const enableSwagger = process.env.ENABLE_SWAGGER === 'true';
21-
2219
export function applicationRoutes(app: Koa<any, object>) {
2320
app.use(proxyRoutes);
2421
app.use(destinationRoutes);

src/v0/destinations/adobe_analytics/transform.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,9 @@ const processTrackEvent = (message, adobeEventName, destinationConfig, extras =
340340
return {
341341
...extras,
342342
events: overrideEventString || adobeEventArr.join(','),
343-
products: overrideProductString || (Array.isArray(prodString) && prodString.length > 0 ? prodString : undefined),
343+
products:
344+
overrideProductString ||
345+
(Array.isArray(prodString) && prodString.length > 0 ? prodString : undefined),
344346
};
345347
};
346348

src/v0/destinations/branch/data/eventMapping.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const CommerceEventConfig = {
4040
'Spend Credits': 'SPEND_CREDITS',
4141
'Promotion Viewed': 'VIEW_AD',
4242
'Promotion Clicked': 'CLICK_AD',
43+
Purchase: 'PURCHASE',
4344
Reserve: 'RESERVE',
4445
},
4546
event_data: ['transaction_id', 'currency', 'revenue', 'shipping', 'tax', 'coupon', 'description'],

src/v0/destinations/branch/transform.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,16 @@ function getCategoryAndName(rudderEventName) {
4646
let requiredName = null;
4747
let requiredCategory = null;
4848
// eslint-disable-next-line array-callback-return, sonarjs/no-ignored-return
49-
Object.keys(category.name).find((branchKey) => {
49+
Object.keys(category.name).forEach((branchKey) => {
5050
if (
5151
typeof branchKey === 'string' &&
5252
typeof rudderEventName === 'string' &&
53-
branchKey.toLowerCase() === rudderEventName.toLowerCase()
53+
(branchKey.toLowerCase() === rudderEventName.toLowerCase() ||
54+
category.name[branchKey].toLowerCase() === rudderEventName.toLowerCase())
5455
) {
5556
requiredName = category.name[branchKey];
5657
requiredCategory = category;
57-
return true;
5858
}
59-
return false;
6059
});
6160
if (requiredName != null && requiredCategory != null) {
6261
return { evName: requiredName, category: requiredCategory };
@@ -116,14 +115,12 @@ function mapPayload(category, rudderProperty, rudderPropertiesObj) {
116115
let valFound = false;
117116
if (category.content_items) {
118117
// eslint-disable-next-line sonarjs/no-ignored-return
119-
Object.keys(category.content_items).find((branchMappingProperty) => {
118+
Object.keys(category.content_items).forEach((branchMappingProperty) => {
120119
if (branchMappingProperty === rudderProperty) {
121120
const tmpKeyName = category.content_items[branchMappingProperty];
122121
contentItems[tmpKeyName] = rudderPropertiesObj[rudderProperty];
123122
valFound = true;
124-
return true;
125123
}
126-
return false;
127124
});
128125
}
129126

@@ -217,16 +214,17 @@ function getCommonPayload(message, category, evName) {
217214
function processMessage(message, destination) {
218215
let evName;
219216
let category;
217+
let updatedEventName = message.event;
220218
switch (message.type) {
221219
case EventType.TRACK: {
222220
if (!message.event) {
223221
throw new InstrumentationError('Event name is required');
224222
}
225-
({ evName, category } = getCategoryAndName(message.event));
226223
const eventNameFromConfig = getMappedEventNameFromConfig(message, destination);
227224
if (eventNameFromConfig) {
228-
evName = eventNameFromConfig;
225+
updatedEventName = eventNameFromConfig;
229226
}
227+
({ evName, category } = getCategoryAndName(updatedEventName));
230228
break;
231229
}
232230
case EventType.IDENTIFY:

src/v0/destinations/iterable/config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,39 @@ const constructEndpoint = (dataCenter, category) => {
7676
return `${baseUrl}${category.endpoint}`;
7777
};
7878

79+
const BULK_ENDPOINTS = ['/api/users/bulkUpdate', '/api/events/trackBulk'];
80+
7981
const IDENTIFY_MAX_BATCH_SIZE = 1000;
8082
const IDENTIFY_MAX_BODY_SIZE_IN_BYTES = 4000000;
8183

8284
const TRACK_MAX_BATCH_SIZE = 8000;
8385

86+
const ITERABLE_RESPONSE_USER_ID_PATHS = [
87+
'invalidUserIds',
88+
'failedUpdates.invalidUserIds',
89+
'failedUpdates.notFoundUserIds',
90+
'failedUpdates.forgottenUserIds',
91+
'failedUpdates.conflictUserIds',
92+
'failedUpdates.invalidDataUserIds',
93+
];
94+
95+
const ITERABLE_RESPONSE_EMAIL_PATHS = [
96+
'invalidEmails',
97+
'failedUpdates.invalidEmails',
98+
'failedUpdates.notFoundEmails',
99+
'failedUpdates.forgottenEmails',
100+
'failedUpdates.conflictEmails',
101+
'failedUpdates.invalidDataEmails',
102+
];
103+
84104
module.exports = {
85105
mappingConfig,
86106
ConfigCategory,
87107
constructEndpoint,
88108
TRACK_MAX_BATCH_SIZE,
89109
IDENTIFY_MAX_BATCH_SIZE,
90110
IDENTIFY_MAX_BODY_SIZE_IN_BYTES,
111+
ITERABLE_RESPONSE_USER_ID_PATHS,
112+
ITERABLE_RESPONSE_EMAIL_PATHS,
113+
BULK_ENDPOINTS,
91114
};

0 commit comments

Comments
 (0)