Skip to content

feat: tnc connectors implementation [CM-1010]#3894

Open
mbani01 wants to merge 7 commits intomainfrom
feat/tnc_implementation
Open

feat: tnc connectors implementation [CM-1010]#3894
mbani01 wants to merge 7 commits intomainfrom
feat/tnc_implementation

Conversation

@mbani01
Copy link
Contributor

@mbani01 mbani01 commented Mar 4, 2026

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:

  • Added TNC as a supported platform in the Snowflake connectors, registering three new data sources: enrollments, certificates, and course actions, each with their own query builders and transformers. [1] [2] [3]

2. Data Source Query Builders:

  • Implemented buildSourceQuery functions 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:

  • Added transformer classes for TNC certificates, enrollments, and course actions, mapping raw query results into the unified activity schema, resolving member identities, organizations, and attributes, and handling special cases or missing data. [1] [2] [3]

4. Database Schema Update:

  • Inserted new TNC-related activity types into the activityTypes table 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 in activityTypes, plus extends org enums (OrganizationSource/OrganizationAttributeSource) to include tnc.

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.

@mbani01 mbani01 self-assigned this Mar 4, 2026
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conventional Commits FTW!

@mbani01 mbani01 changed the title feat: TNC connectors implementation [CM-1010] feat: tnc connectors implementation [CM-1010] Mar 5, 2026
@mbani01 mbani01 marked this pull request as ready for review March 5, 2026 15:40
@mbani01 mbani01 requested a review from joanagmaia March 5, 2026 15:40
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant