Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: shopify: ecom fix and enhancement #2842

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
493650e
feat: shopify: ecom fix and enhancement
anantjain45823 Nov 21, 2023
3ab819b
chore: add date mock to fix timestamp validation in tests (#2844)
sandeepdsvs Nov 21, 2023
e8710a6
feat: mixpanel set once feature onboard (#2820)
shrouti1507 Nov 23, 2023
19b803d
Update src/v1/sources/shopify/commonUtils.js
anantjain45823 Nov 30, 2023
4e72ea3
Update src/v1/sources/shopify/identityResolutionLayer.js
anantjain45823 Nov 30, 2023
f199da0
Update src/v1/sources/shopify/enrichmentLayer.js
anantjain45823 Nov 30, 2023
f373c65
chore: comments addressed
anantjain45823 Nov 30, 2023
fb8cca5
fix: address review comments
Gauravudia Nov 30, 2023
f61e2e2
chore: add testcases
Gauravudia Nov 30, 2023
68bfc9c
chore: comments addressed and added test cases
anantjain45823 Nov 30, 2023
601b596
chore: reolved sonar cloud
anantjain45823 Nov 30, 2023
4f2c5e3
fix: unhandled error code in facebook_custom_audience (#2853)
sanpj2292 Nov 28, 2023
055fe21
fix: sfmc bug fix for track event validations (#2852)
utsabc Nov 29, 2023
81c53e0
fix: remove errorCategory for braze dedup error (#2850)
sanpj2292 Nov 29, 2023
f4c6a50
feat: update facebook destinations API version to v18.0 (#2828)
sandeepdsvs Nov 29, 2023
28af1f0
fix: bugsnag issue in moengage identify event (#2845)
sanpj2292 Nov 29, 2023
8ea9a72
feat: cm360 transformerproxy V1 flag (#2848)
aashishmalik Nov 30, 2023
dac7613
fix: encode &, < and > to html counterparts in adobe analytics (#2854)
yashasvibajpai Nov 30, 2023
02b47fe
feat: cm360 router batching (#2836)
aashishmalik Nov 30, 2023
c03947f
chore: fixed test cases
anantjain45823 Nov 30, 2023
409dc9d
Update src/v1/sources/shopify/identityResolutionLayer.js
anantjain45823 Nov 30, 2023
0234c74
Update src/v1/sources/shopify/identityResolutionLayer.js
anantjain45823 Nov 30, 2023
730b8d1
Update identityResolutionLayer.js
anantjain45823 Nov 30, 2023
0cda8d1
chore: added test cases
anantjain45823 Dec 1, 2023
f6725d8
chore: merge develop
anantjain45823 Dec 1, 2023
9b51a55
chore: small fix
anantjain45823 Dec 1, 2023
739c244
Merge branch 'develop' into feat.shopifyEcom
anantjain45823 Dec 2, 2023
c15210d
chore: small fix for products events
anantjain45823 Dec 4, 2023
df8a315
fix: add line items to products mapping for all events
Gauravudia Dec 4, 2023
e2937bd
feat: add checkout tokenn mapping
Gauravudia Dec 4, 2023
78259dd
feat: add order token mapping
Gauravudia Dec 4, 2023
0e18a2f
chore: remove null values and convert price fields to number
anantjain45823 Dec 5, 2023
45829d4
feat: add cart_token to cart_id mapping
Gauravudia Dec 6, 2023
d35f7e4
chore: temp commit for fetching some metrics
anantjain45823 Dec 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions src/util/prometheus.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,13 +449,13 @@ class Prometheus {
name: 'shopify_client_side_identifier_event',
help: 'shopify_client_side_identifier_event',
type: 'counter',
labelNames: ['writeKey', 'timestamp'],
labelNames: ['writeKey', 'timestamp', 'sourceId'],
},
{
name: 'shopify_server_side_identifier_event',
help: 'shopify_server_side_identifier_event',
type: 'counter',
labelNames: ['writeKey', 'timestamp'],
labelNames: ['writeKey', 'timestamp', 'sourceId'],
},
{
name: 'fb_pixel_timestamp_error',
Expand Down Expand Up @@ -485,19 +485,19 @@ class Prometheus {
name: 'shopify_redis_failures',
help: 'shopify_redis_failures',
type: 'counter',
labelNames: ['type', 'writeKey', 'source'],
labelNames: ['type', 'writeKey', 'source', 'sourceId'],
},
{
name: 'shopify_redis_calls',
help: 'shopify_redis_calls',
type: 'counter',
labelNames: ['type', 'writeKey', 'source', 'field'],
labelNames: ['type', 'writeKey', 'source', 'field', 'sourceId'],
},
{
name: 'shopify_redis_no_val',
help: 'shopify_redis_no_val',
type: 'counter',
labelNames: ['writeKey', 'source'],
labelNames: ['writeKey', 'source', 'sourceId'],
},
{
name: 'get_transformation_code',
Expand All @@ -515,7 +515,7 @@ class Prometheus {
name: 'invalid_shopify_event',
help: 'invalid_shopify_event',
type: 'counter',
labelNames: ['writeKey', 'source', 'shopifyTopic'],
labelNames: ['writeKey', 'source', 'shopifyTopic', 'sourceId'],
},
{
name: 'outgoing_request_count',
Expand Down Expand Up @@ -563,6 +563,18 @@ class Prometheus {
type: 'histogram',
labelNames: ['feature', 'destType', 'endpointPath'],
},
{
name: 'shopify_store_data_latency',
help: 'shopify_store_data_latency',
type: 'histogram',
labelNames: ['writeKey', 'sourceId', 'source'],
},
{
name: 'shopify_fetch_data_latency',
help: 'shopify_fetch_data_latency',
type: 'histogram',
labelNames: ['writeKey', 'sourceId', 'source'],
},
{
name: 'http_request_duration',
help: 'Incoming HTTP requests duration in seconds',
Expand Down Expand Up @@ -918,7 +930,7 @@ class Prometheus {
'errored',
'statusCode',
'transformationId',
'workspaceId'
'workspaceId',
],
},
{
Expand All @@ -934,9 +946,9 @@ class Prometheus {
'errored',
'statusCode',
'transformationId',
'workspaceId'
'workspaceId',
],
}
},
];

metrics.forEach((metric) => {
Expand Down
17 changes: 10 additions & 7 deletions src/util/redis/redisConnector.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const fs = require('fs');
const path = require('path');
const version = 'v0';
const { RedisDB } = require('./redisConnector');
jest.mock('ioredis', () => require('../../../test/__mocks__/redis'));
const sourcesList = ['shopify'];
const sourcesList = [
{ fileName: 'shopify', name: 'shopify', sourceEndpointVersion: 'v0' },
{ fileName: 'shopify_v1', name: 'shopify', sourceEndpointVersion: 'v1' },
];
process.env.USE_REDIS_DB = 'true';

const timeoutPromise = () =>
Expand Down Expand Up @@ -43,16 +45,17 @@ describe('checkAndConnectConnection', () => {
expect(RedisDB.client.status).toBe('ready');
});
});

describe(`Source Tests`, () => {
sourcesList.forEach((source) => {
const testDataFile = fs.readFileSync(
path.resolve(__dirname, `./testData/${source}_source.json`),
path.resolve(__dirname, `./testData/${source.fileName}_source.json`),
);
const data = JSON.parse(testDataFile);
const transformer = require(`../../${version}/sources/${source}/transform`);
const transformer = require(`../../${source.sourceEndpointVersion}/sources/${source.name}/transform`);

data.forEach((dataPoint, index) => {
it(`${index}. ${source} - ${dataPoint.description}`, async () => {
it(`${index}. ${source.fileName} - ${dataPoint.description}`, async () => {
try {
const output = await transformer.process(dataPoint.input);
expect(output).toEqual(dataPoint.output);
Expand All @@ -70,7 +73,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);
anantjain45823 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -111,4 +114,4 @@ describe(`Redis Disconnect`, () => {
await RedisDB.disconnect();
expect(result).toEqual('OK');
});
});
});
Loading
Loading