Skip to content

Commit bdc9da9

Browse files
committed
fix: activity timestamp and use cncf for staging tests
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
1 parent 5f5e903 commit bdc9da9

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

services/apps/snowflake_connectors/src/integrations/committees/committees/buildSourceQuery.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export const buildSourceQuery = (sinceTimestamp?: string): string => {
3838
c.ROLE__C,
3939
c.CREATEDDATE::TIMESTAMP_NTZ AS CREATEDDATE,
4040
c.LASTMODIFIEDDATE::TIMESTAMP_NTZ AS LASTMODIFIEDDATE,
41+
c._FIVETRAN_SYNCED::TIMESTAMP_NTZ AS FIVETRAN_SYNCED,
4142
cm.COMMITTEE_ID,
4243
cm.COMMITTEE_NAME,
4344
cm.PROJECT_ID,
@@ -71,7 +72,7 @@ export const buildSourceQuery = (sinceTimestamp?: string): string => {
7172

7273
// Limit to a single project in non-prod to avoid exporting all project data
7374
if (!IS_PROD_ENV) {
74-
select += ` AND cm.PROJECT_SLUG = 'ccc'`
75+
select += ` AND cm.PROJECT_SLUG = 'cncf'`
7576
}
7677

7778
const dedup = `

services/apps/snowflake_connectors/src/integrations/committees/committees/transformer.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,15 @@ export class CommitteesCommitteesTransformer extends TransformerBase {
8181
})
8282
}
8383

84+
const activityTimestamp =
85+
type === CommitteesActivityType.ADDED_TO_COMMITTEE
86+
? (row.CREATEDDATE as string | null) || null
87+
: (row.FIVETRAN_SYNCED as string | null) || null
88+
8489
const activity: IActivityData = {
8590
type,
8691
platform: PlatformType.COMMITTEES,
87-
timestamp: (row.LASTMODIFIEDDATE as string | null) || null,
92+
timestamp: activityTimestamp,
8893
score: COMMITTEES_GRID[type].score,
8994
sourceId: committeeId,
9095
sourceParentId: null,
@@ -113,7 +118,7 @@ export class CommitteesCommitteesTransformer extends TransformerBase {
113118
lastName: (row.BU_LAST_NAME as string | null) || null,
114119
email: (row.BU_EMAIL as string | null) || null,
115120
},
116-
activityDate: (row.CREATEDDATE as string | null) || null,
121+
activityDate: activityTimestamp,
117122
},
118123
}
119124

@@ -131,7 +136,9 @@ export class CommitteesCommitteesTransformer extends TransformerBase {
131136
return { activity, segment: { slug: segmentSlug, sourceId: segmentSourceId } }
132137
}
133138

134-
private buildOrganizations(row: Record<string, unknown>): IActivityData['member']['organizations'] {
139+
private buildOrganizations(
140+
row: Record<string, unknown>,
141+
): IActivityData['member']['organizations'] {
135142
const website = (row.ORG_WEBSITE as string | null)?.trim() || null
136143
const domainAliases = (row.ORG_DOMAIN_ALIASES as string | null)?.trim() || null
137144

0 commit comments

Comments
 (0)