Conversation
services/apps/snowflake_connectors/src/integrations/tnc/courses/transformer.ts
Outdated
Show resolved
Hide resolved
services/apps/snowflake_connectors/src/integrations/tnc/certificates/transformer.ts
Outdated
Show resolved
Hide resolved
services/apps/snowflake_connectors/src/integrations/tnc/courses/buildSourceQuery.ts
Show resolved
Hide resolved
services/apps/snowflake_connectors/src/integrations/tnc/certificates/buildSourceQuery.ts
Show resolved
Hide resolved
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.
| ${LFID_COALESCE} AS LFID | ||
| FROM analytics.silver_fact.certificates c | ||
| INNER JOIN cdp_matched_segments cms | ||
| ON cms.sourceId = c.project_id |
There was a problem hiding this comment.
Certificates segment join missing slug condition
High Severity
The certificates query joins cdp_matched_segments on only cms.sourceId = c.project_id, while the enrollments and courses queries both join on two conditions (cms.slug = e.project_slug AND cms.sourceId = e.project_id). Since the cdp_matched_segments CTE uses SELECT DISTINCT sourceId, slug, a single sourceId can map to multiple slugs. This means a certificate may fan out to multiple segment rows, and the QUALIFY ROW_NUMBER() would arbitrarily pick one, potentially assigning the certificate to the wrong segment via cms.slug AS PROJECT_SLUG.


This pull request adds support for the TNC platform in the Snowflake connectors integration. It introduces new activity types, data sources, SQL queries, and transformers to ingest and process TNC certification, enrollment, and course action data. The changes include both backend database updates and significant additions to the data ingestion pipeline.
Key changes:
1. TNC Platform Integration:
2. Data Source Query Builders:
buildSourceQueryfunctions for TNC certificates, enrollments, and course actions, providing SQL logic to extract and join relevant data from Snowflake, including handling environment-specific filters and incremental syncs. [1] [2] [3]3. Data Transformation Logic:
4. Database Schema Update:
activityTypestable to support tracking of certification enrollments, training enrollments, issued certifications, and course/exam attempts.These changes lay the groundwork for ingesting and processing TNC data, enabling richer analytics and reporting for certification and training activities.
Note
Medium Risk
Adds a new ingestion pipeline and Snowflake SQL queries/transformers that can affect data volume and activity attribution if joins or type mapping are incorrect; core auth/security is untouched.
Overview
Adds TNC as a supported platform in
snowflake_connectors, registering three new Snowflake data sources (enrollments, certificates, and course actions) with corresponding query builders and transformers that map rows into Crowd activities, including member identity resolution (email/LFID), segment routing, and organization extraction.Introduces new TNC activity types/scoring (
TncActivityType+TNC_GRID) and a DB migration to seed these activity types inactivityTypes, plus extends org enums (OrganizationSource/OrganizationAttributeSource) to includetnc.Improves transformer error logging by emitting error message/stack and row key metadata when a row fails to transform.
Written by Cursor Bugbot for commit 34dcd63. This will update automatically on new commits. Configure here.