Conversation
|
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. |
services/apps/snowflake_connectors/src/integrations/cvent/transformer.ts
Outdated
Show resolved
Hide resolved
services/apps/snowflake_connectors/src/integrations/cvent/transformer.ts
Show resolved
Hide resolved
backend/src/database/migrations/V1771344764__addSnowflakeExportTable.sql
Show resolved
Hide resolved
services/apps/snowflake_connectors/src/integrations/cvent/transformer.ts
Show resolved
Hide resolved
| ('registered-event', 'cvent', false, false, 'Registered for a Cvent event', 'Registered for an event'), | ||
| ('attended-event', 'cvent', false, false, 'Attended a Cvent event', 'Attended an event'); |
There was a problem hiding this comment.
Let's make these descriptions more aligned with Nirav's triggered description:
- registered-event: User registers to an event.
- attended-event: User attends an event.
| const orgAccounts = ` | ||
| org_accounts AS ( | ||
| SELECT account_id, website, domain_aliases | ||
| FROM analytics.bronze_fivetran_salesforce.accounts | ||
| WHERE website IS NOT NULL | ||
| UNION ALL | ||
| SELECT account_id, website, domain_aliases | ||
| FROM analytics.bronze_fivetran_salesforce_b2b.accounts | ||
| WHERE website IS NOT NULL | ||
| )` |
There was a problem hiding this comment.
I noticed that there is a domain column in the event_registration source. Can we check if the domain we get there is the same as we are getting from the slakesforce tables? If so, we could simply use the domain, and avoid this additional join
There was a problem hiding this comment.
The domain is extracted from the email, and only accurate if a work email is used, but it's not the case for most records I checked
| readonly platform = PlatformType.CVENT | ||
|
|
||
| transformRow(row: Record<string, unknown>): TransformedActivity | null { | ||
| const userName = (row.USERNAME as string | null)?.trim() || null |
There was a problem hiding this comment.
I believe it should be USER_NAME instead?
services/apps/snowflake_connectors/src/integrations/cvent/transformer.ts
Show resolved
Hide resolved
| member: { | ||
| displayName, | ||
| identities, | ||
| organizations: this.buildOrganizations(row), | ||
| }, |
There was a problem hiding this comment.
Add missing attributes to both member and organizations -> In the document
| identities.push({ | ||
| platform: PlatformType.CVENT, | ||
| value: accountName, | ||
| type: OrganizationIdentityType.USERNAME, | ||
| verified: false, | ||
| }) |
There was a problem hiding this comment.
atm we only support a fixed set of platforms for organization "usernames". It's linkedin, crunchbase, facebook and twitter.
Let's not add this identity from cvent
services/apps/snowflake_connectors/src/integrations/cvent/buildSourceQuery.ts
Outdated
Show resolved
Hide resolved
|
@mbani01 please check and resolve also cursor bot comments. |
@themarolt I’ve addressed the relevant ones |
| const displayName = | ||
| fullName || | ||
| (firstName && lastName ? `${firstName} ${lastName}` : firstName || lastName) || | ||
| userName |
There was a problem hiding this comment.
Member displayName can be null despite available LFID
Medium Severity
The displayName fallback chain uses fullName, firstName/lastName, and userName, but never lfUsername. The SQL query guarantees LFID IS NOT NULL (via the WHERE clause on the COALESCE), and lfUsername is extracted from the row, yet it's omitted from the displayName computation. When LFID originates from the joined mu.user_name or u.lf_username tables (rather than er.user_name), all event-registration name fields can be null, resulting in a null displayName for the member despite a valid username being available.


This pull request introduces a new "snowflake connectors" service for exporting data to Snowflake and managing export jobs. It adds the necessary database schema, service configuration, Docker setup, and initial implementation for export activities and scheduling. The main themes are the creation of the Snowflake export infrastructure, integration with the job scheduler, and updates to the monorepo's dependency management.
Snowflake Export Infrastructure
integration."snowflakeExportJobs"to track Snowflake export jobs, including fields for platform, S3 path, timestamps, and error handling, along with relevant indexes.s3_pathcolumn to prevent duplicate export entries.exportStartedAttimestamp and ametricsJSONB column, while removing thetotalRowsandtotalBytescolumns to support more flexible export metrics. [1] [2]exportActivity.ts, which performs the Snowflake export and writes job metadata. [1] [2]Service and Job Scheduling
@crowd/snowflake-connectorswith its own dependencies, scripts, and Docker configuration. [1] [2] [3] [4]Monorepo Dependency and Lockfile Updates
pnpm-lock.yamlto include the newsnowflake_connectorsapp and its dependencies, and adjusted AWS SDK dependency resolutions for compatibility. [1] [2] [3] [4] [5] [6] [7] [8] [9]Other Platform/Activity Updates
activityTypestable for event registration and attendance.@joanagmaia you can help reviewing the export SQL and transformation
Note
Medium Risk
Introduces a new Temporal worker + polling consumer that creates integrations and processes exported data into activities, plus a new DB table and scheduled workflow; failures or misconfiguration could lead to missed/duplicated processing and new writes to core tables.
Overview
Adds a new
snowflake_connectorsservice that schedules a daily Temporal workflow to export Snowflake data to S3 in Parquet batches, recording each batch in a newintegration."snowflakeExportJobs"table (with locking/indices, metrics, and error tracking) for downstream processing.The service also introduces a long-running consumer that claims pending export jobs, downloads/reads Parquet from S3, transforms rows into activities (initially for Cvent), resolves/creates matching
integrationsfor segments (with Redis caching + distributed lock), and emits activity results for ingestion.Separately, adds Cvent activity type definitions and scoring, introduces
OrganizationSource/OrganizationAttributeSource=cventand raises its attribute source priority, and adds Docker/compose + lockfile entries to build/run the new worker.Written by Cursor Bugbot for commit 94adbd1. This will update automatically on new commits. Configure here.