Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cleanIdentityValue } from './transformerBase'

const SHARED_MEETING_ACCOUNT_EMAILS = new Set([
export const SHARED_MEETING_ACCOUNT_EMAILS = new Set([
'meeting1@seidengroup.com',
'meetings@dpdk.org',
'zoom-admin@nephio.org',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ describe('buildSourceQuery', () => {
},
)

it('keeps shared meeting host accounts out of the export', () => {
expect(buildSourceQuery()).toContain(
"AND LOWER(TRIM(t.INVITEE_EMAIL)) NOT IN ('meeting1@seidengroup.com', 'meetings@dpdk.org', 'zoom-admin@nephio.org', 'zoom0@hyperledger.org', 'zoom2@hyperledger.org', 'zoom2@lfai.foundation', 'zoom@hyperledger.org', 'zoom@longnowboston.org', 'zoom@openwallet.foundation')",
)
})

it('lets the LF SSO lookup fill in when the row itself carries a placeholder SSO', () => {
expect(buildSourceQuery()).toContain(
"CASE WHEN UPPER(TRIM(t.INVITEE_LF_SSO)) NOT IN ('', 'NONE', 'NULL', 'UNDEFINED', 'NA', 'N/A', '-') THEN t.INVITEE_LF_SSO END,\n sso.LF_SSO",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { IS_PROD_ENV } from '@crowd/common'

import { SHARED_MEETING_ACCOUNT_EMAILS } from '../../../core/personalEmail'

const CDP_MATCHED_SEGMENTS = `
cdp_matched_segments AS (
SELECT DISTINCT
Expand All @@ -24,6 +26,8 @@ const ORG_ACCOUNTS = `

const PLACEHOLDER_VALUES = `('', 'NONE', 'NULL', 'UNDEFINED', 'NA', 'N/A', '-')`

const SHARED_MEETING_ACCOUNT_EMAIL_VALUES = `(${[...SHARED_MEETING_ACCOUNT_EMAILS].map((email) => `'${email}'`).join(', ')})`

const LF_SSO_LOOKUP = `
lf_sso_lookup AS (
SELECT INVITEE_LF_USER_ID AS LF_USER_ID, MAX(INVITEE_LF_SSO) AS LF_SSO
Expand Down Expand Up @@ -73,7 +77,8 @@ export const buildSourceQuery = (sinceTimestamp?: string): string => {
LEFT JOIN org_accounts org
ON t.ACCOUNT_ID = org.account_id
WHERE (t.WAS_INVITED = TRUE OR t.INVITEE_ATTENDED = TRUE)
AND NULLIF(TRIM(t.INVITEE_EMAIL), '') IS NOT NULL`
AND NULLIF(TRIM(t.INVITEE_EMAIL), '') IS NOT NULL
AND LOWER(TRIM(t.INVITEE_EMAIL)) NOT IN ${SHARED_MEETING_ACCOUNT_EMAIL_VALUES}`

if (!IS_PROD_ENV) {
select += ` AND t.PROJECT_SLUG = 'cncf'`
Expand Down
Loading