Conversation
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
1 similar comment
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| platform: PlatformType.COMMITTEES, | ||
| timestamp: (row.LASTMODIFIEDDATE as string | null) || null, | ||
| score: COMMITTEES_GRID[type].score, | ||
| sourceId: committeeId, |
There was a problem hiding this comment.
Activity sourceId uses committeeId causing uniqueness collisions
High Severity
The sourceId on the activity is set to committeeId (from row.COMMITTEE_ID), which identifies the committee itself, not the individual membership record. The database has a unique index on (tenantId, platform, type, sourceId, segmentId, channel), so multiple members added to the same committee in the same segment will collide, causing all but one membership activity to be lost. Every other transformer uses a per-record unique ID (e.g., registrationId, enrollmentId, certificateId). The row's SFID (Salesforce record ID), which is already selected and used for dedup in the SQL query, is the correct unique identifier here.
Additional Locations (1)
There was a problem hiding this comment.
@mbani01 I think you were right, same committee will result in deduplication to fail.... because everything else will be different.
Also channel is missing which I think is required. Let's add committeeName to channel and for sourceId.... perhaps we can go with your suggestion commiteId + unique identifier.
There was a problem hiding this comment.
Pull request overview
Adds “committees” as a first-class platform across the pipeline (types/config, Snowflake connector extraction+transform, and DB activity type registration) so committee membership events can be exported and represented as activities.
Changes:
- Added
committeesto platform/org source enums and organization attribute source priority. - Implemented Snowflake connector source query + transformer for committee membership events.
- Added DB migration to register new committee membership activity types.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| services/libs/types/src/enums/platforms.ts | Adds PlatformType.COMMITTEES. |
| services/libs/types/src/enums/organizations.ts | Adds COMMITTEES to org source enums. |
| services/libs/integrations/src/integrations/index.ts | Re-exports committees integration types. |
| services/libs/integrations/src/integrations/committees/types.ts | Defines committee activity types + scoring grid. |
| services/libs/data-access-layer/src/organizations/attributesConfig.ts | Adds committees to org attribute source priority list. |
| services/apps/snowflake_connectors/src/integrations/types.ts | Adds committees datasource name. |
| services/apps/snowflake_connectors/src/integrations/index.ts | Registers committees platform and datasource. |
| services/apps/snowflake_connectors/src/integrations/committees/committees/buildSourceQuery.ts | Adds Snowflake query for committee membership export. |
| services/apps/snowflake_connectors/src/integrations/committees/committees/transformer.ts | Transforms exported rows into committee membership activities. |
| backend/src/database/migrations/V1775064222__addCommitteesActivityTypes.sql | Inserts committees activity types into activityTypes. |
| backend/src/database/migrations/U1775064222__addCommitteesActivityTypes.sql | Undo migration placeholder (empty). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const activity: IActivityData = { | ||
| type, | ||
| platform: PlatformType.COMMITTEES, | ||
| timestamp: (row.LASTMODIFIEDDATE as string | null) || null, | ||
| score: COMMITTEES_GRID[type].score, | ||
| sourceId: committeeId, | ||
| sourceParentId: null, | ||
| member: { |
There was a problem hiding this comment.
activity.sourceId is set to committeeId (COMMITTEE_ID). That value is shared by many rows/members, so activities will collide on the unique key (tenant/platform/type/sourceId/segmentId) and later rows can overwrite or fail to insert. Use a per-membership unique identifier like row.SFID for sourceId (and keep COMMITTEE_ID as an attribute and/or sourceParentId).
| return null | ||
| } | ||
|
|
||
| const committeeId = (row.COMMITTEE_ID as string).trim() |
There was a problem hiding this comment.
committeeId is computed via (row.COMMITTEE_ID as string).trim() without null/undefined protection. If COMMITTEE_ID is missing or not a string for any row, this will throw and safeTransformRow will skip the row. Consider using optional chaining + explicit skip/log when COMMITTEE_ID is not present.
| const committeeId = (row.COMMITTEE_ID as string).trim() | |
| const rawCommitteeId = row.COMMITTEE_ID | |
| const committeeId = | |
| typeof rawCommitteeId === 'string' && rawCommitteeId.trim().length > 0 | |
| ? rawCommitteeId.trim() | |
| : null | |
| if (!committeeId) { | |
| log.warn( | |
| { sfid: row.SFID, rawCommitteeId: row.COMMITTEE_ID, email }, | |
| 'Skipping row: missing or invalid committeeId', | |
| ) | |
| return null | |
| } |
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
|
| identities.push({ | ||
| platform: PlatformType.COMMITTEES, | ||
| value: email, | ||
| type: MemberIdentityType.USERNAME, | ||
| verified: true, | ||
| verifiedBy: PlatformType.COMMITTEES, |
There was a problem hiding this comment.
We should also add type email on this case no?
| platform: PlatformType.COMMITTEES, | ||
| timestamp: (row.LASTMODIFIEDDATE as string | null) || null, | ||
| score: COMMITTEES_GRID[type].score, | ||
| sourceId: committeeId, |
There was a problem hiding this comment.
@mbani01 I think you were right, same committee will result in deduplication to fail.... because everything else will be different.
Also channel is missing which I think is required. Let's add committeeName to channel and for sourceId.... perhaps we can go with your suggestion commiteId + unique identifier.
| const activity: IActivityData = { | ||
| type, | ||
| platform: PlatformType.COMMITTEES, | ||
| timestamp: (row.LASTMODIFIEDDATE as string | null) || null, | ||
| score: COMMITTEES_GRID[type].score, | ||
| sourceId: committeeId, | ||
| sourceParentId: null, | ||
| member: { |


This pull request introduces support for "committees" as a new platform throughout the data pipeline, including database, integrations, and attribute configuration. The main changes add new activity types for committee membership, implement the data extraction and transformation logic for committee events, and update the type system and configuration to recognize "committees" as a first-class source.
Support for "committees" platform and data pipeline:
added-to-committeeandremoved-from-committee, to theactivityTypestable for tracking committee membership events.Type system and configuration updates:
PlatformType,OrganizationSource, andOrganizationAttributeSourceenums, and included it in the organization attribute source priority list, ensuring proper handling and prioritization. [1] [2] [3] [4]Note
Medium Risk
Introduces a new Snowflake ingestion path and DB activity types for committee membership events, which can affect exported data volume and downstream identity/org attribution. Risk is moderate due to new joins/timestamps/dedup logic and new enum values being used across services.
Overview
Adds first-class
committeesplatform support end-to-end: newPlatformType.COMMITTEES,OrganizationSource/OrganizationAttributeSource.COMMITTEES, and priority ordering so committee-derived org attributes can be applied.Extends the data pipeline with a new Snowflake connector source (
DataSourceName.COMMITTEES_COMMITTEES) including a multi-join source query (with incremental export support and non-prod limiting) and a transformer that emitsadded-to-committee/removed-from-committeeactivities, builds member identities (email/LF username), and derives organization domain identities.Adds a DB migration inserting the two new committee membership
activityTypes, plus an integrations-libraryCommitteesActivityType+ scoring grid export used by the transformer.Written by Cursor Bugbot for commit cb61fdd. This will update automatically on new commits. Configure here.