Repository navigation
fix: keep placeholder ids and shared meeting accounts from snowflake out of member identities #5043
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cfa97ca
fix: treat placeholder lf user ids from the meetings source as missing
joanagmaia 1d3439a
fix: treat placeholder identity values from all snowflake connectors …
joanagmaia 76f223a
fix: skip shared, list and automation emails in snowflake connectors
joanagmaia 8ba9653
fix: soft delete known shared and placeholder snowflake member identi…
joanagmaia e83a8e7
fix: let the lf sso lookup fill in when a meetings row has a placehol…
joanagmaia 0f5592f
fix: limit the snowflake email blocklist to shared meeting accounts f…
joanagmaia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
backend/src/database/migrations/V1792492400__soft-delete-shared-snowflake-identities.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| with deleted as ( | ||
| update "memberIdentities" | ||
| set "deletedAt" = now(), | ||
| "updatedAt" = now() | ||
| where "deletedAt" is null | ||
| and ( | ||
| ( | ||
| platform = 'meetings' | ||
| and type in ('email', 'username') | ||
| and lower(value) 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' | ||
| ) | ||
| ) | ||
| or (platform = 'cvent' and type = 'username' and lower(value) in ('na', 'none', 'null')) | ||
| or (platform = 'lfid' and type = 'username' and lower(value) = 'undefined') | ||
| ) | ||
| returning "memberId" | ||
| ) | ||
| update members | ||
| set "updatedAt" = now() | ||
| where id in (select "memberId" from deleted); |
36 changes: 36 additions & 0 deletions
36
services/apps/snowflake_connectors/src/core/personalEmail.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import { describe, expect, it } from 'vitest' | ||
|
|
||
| import { cleanPersonalEmail, isSharedMeetingAccountEmail } from './personalEmail' | ||
|
|
||
| describe('isSharedMeetingAccountEmail', () => { | ||
| it.each(['zoom@hyperledger.org', 'Zoom2@LFAI.foundation', 'meetings@dpdk.org'])( | ||
| 'flags the known shared meeting host account %s', | ||
| (email) => { | ||
| expect(isSharedMeetingAccountEmail(email)).toBe(true) | ||
| }, | ||
| ) | ||
|
|
||
| it.each([ | ||
| 'zoom3@hyperledger.org', | ||
| 'zoom@antonpalmqvist.com', | ||
| 'james.wang@zoom.us', | ||
| 'noreply@github.com', | ||
| 'mail@jkroepke.de', | ||
| ])('does not flag %s, which is not on the known list', (email) => { | ||
| expect(isSharedMeetingAccountEmail(email)).toBe(false) | ||
| }) | ||
| }) | ||
|
|
||
| describe('cleanPersonalEmail', () => { | ||
| it('trims and keeps a personal email', () => { | ||
| expect(cleanPersonalEmail(' ada@lovelace.dev ')).toBe('ada@lovelace.dev') | ||
| }) | ||
|
|
||
| it('drops a known shared meeting host account', () => { | ||
| expect(cleanPersonalEmail(' zoom@openwallet.foundation ')).toBeNull() | ||
| }) | ||
|
|
||
| it('drops a placeholder email value', () => { | ||
| expect(cleanPersonalEmail('NONE')).toBeNull() | ||
| }) | ||
| }) |
22 changes: 22 additions & 0 deletions
22
services/apps/snowflake_connectors/src/core/personalEmail.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { cleanIdentityValue } from './transformerBase' | ||
|
|
||
| const SHARED_MEETING_ACCOUNT_EMAILS = new Set([ | ||
| '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', | ||
| ]) | ||
|
|
||
| export function isSharedMeetingAccountEmail(email: string): boolean { | ||
| return SHARED_MEETING_ACCOUNT_EMAILS.has(email.toLowerCase()) | ||
| } | ||
|
|
||
| export function cleanPersonalEmail(raw: unknown): string | null { | ||
| const email = cleanIdentityValue(raw) | ||
| return email && !isSharedMeetingAccountEmail(email) ? email : null | ||
| } |
28 changes: 28 additions & 0 deletions
28
services/apps/snowflake_connectors/src/core/transformerBase.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import { describe, expect, it } from 'vitest' | ||
|
|
||
| import { cleanIdentityValue } from './transformerBase' | ||
|
|
||
| describe('cleanIdentityValue', () => { | ||
| it.each(['NONE', 'none', ' None ', 'NULL', 'undefined', 'NA', 'n/a', '-'])( | ||
| 'treats the placeholder %j as missing', | ||
| (placeholder) => { | ||
| expect(cleanIdentityValue(placeholder)).toBeNull() | ||
| }, | ||
| ) | ||
|
|
||
| it.each([null, undefined, '', ' '])('treats %j as missing', (empty) => { | ||
| expect(cleanIdentityValue(empty)).toBeNull() | ||
| }) | ||
|
|
||
| it('trims a real LF user id', () => { | ||
| expect(cleanIdentityValue(' 0031T00003abcDE ')).toBe('0031T00003abcDE') | ||
| }) | ||
|
|
||
| it('keeps usernames that only contain a placeholder word', () => { | ||
| expect(cleanIdentityValue('nonesuch')).toBe('nonesuch') | ||
| }) | ||
|
|
||
| it('stringifies a numeric user id', () => { | ||
| expect(cleanIdentityValue(12345)).toBe('12345') | ||
| }) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...nowflake_connectors/src/integrations/meetings/meeting-attendance/buildSourceQuery.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { describe, expect, it } from 'vitest' | ||
|
|
||
| import { buildSourceQuery } from './buildSourceQuery' | ||
|
|
||
| describe('buildSourceQuery', () => { | ||
| it.each([undefined, '2026-10-19 00:00:00'])( | ||
| 'keeps placeholder LF user ids out of the LF SSO lookup (since %j)', | ||
| (sinceTimestamp) => { | ||
| const query = buildSourceQuery(sinceTimestamp) | ||
|
|
||
| expect(query).toContain( | ||
| "UPPER(TRIM(INVITEE_LF_USER_ID)) NOT IN ('', 'NONE', 'NULL', 'UNDEFINED', 'NA', 'N/A', '-')", | ||
| ) | ||
| expect(query).toContain( | ||
| "UPPER(TRIM(INVITEE_LF_SSO)) NOT IN ('', 'NONE', 'NULL', 'UNDEFINED', 'NA', 'N/A', '-')", | ||
| ) | ||
| }, | ||
| ) | ||
|
|
||
| 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", | ||
| ) | ||
| }) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.