Skip to content

Adds Learn AI tutor as a feedback source - #2698

Open
rachellougee wants to merge 4 commits into
mainfrom
feat/feedback-learn-ai-tutor-source
Open

rachellougee wants to merge 4 commits into
mainfrom
feat/feedback-learn-ai-tutor-source

Conversation

@rachellougee

Copy link
Copy Markdown
Contributor

What are the relevant tickets?

#2534

Description (What does it do?)

Adds Learn AI tutor as a second source of the feedback system, so it flows through the rest of the feedback pipeline

  • A new dbt model int__feedback__learn_ai_tutor
  • Adds the chatbot data to int__feedback__unioned

How can this be tested?

Run dbt build --target dev_production --select int__feedback__learn_ai_tutor int__feedback__unioned

Additional Context

Copilot AI balanced review requested due to automatic review settings September 16, 2026 17:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Downstream facts currently drop or incompletely resolve Learn AI records, and the selected business key is not migration-stable.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds Learn AI tutor messages as a second feedback source in the dbt pipeline.

Changes:

  • Adds and documents the Learn AI feedback adapter.
  • Unions tutor messages with Zendesk feedback.
  • Adds cross-database support for nullable varchar arrays.
File summaries
File Description
src/ol_dbt/seeds/feedback_sources.csv Registers Learn AI Tutor.
src/ol_dbt/models/intermediate/feedback/int__feedback__unioned.sql Adds tutor feedback to the common stream.
src/ol_dbt/models/intermediate/feedback/int__feedback__learn_ai_tutor.sql Maps chatbot messages to the feedback contract.
src/ol_dbt/models/intermediate/feedback/_feedback_models.yml Documents and tests the new model.
src/ol_dbt/macros/cross_db_functions.sql Adds portable nullable varchar-array casts.
Review details

Suppressed comments (4)

src/ol_dbt/models/intermediate/feedback/int__feedback__learn_ai_tutor.sql:33

  • This uses the Postgres row PK as the feedback business key, but the feedback contract explicitly specifies Learn AI's stable checkpoint_id. Because feedback_pk is derived from this value, a later source swap/backfill will mint different keys for the same turns. Select and use checkpoint_id here (including any namespace/thread qualification needed by its uniqueness contract), and retain djangocheckpoint_id only as an ordering tie-breaker.
    , cast(human_turns.djangocheckpoint_id as varchar) as source_record_ref

src/ol_dbt/models/intermediate/feedback/int__feedback__learn_ai_tutor.sql:48

  • CanvasSyllabusBot is a documented value emitted by int__learn_ai__chatbot (_learn_ai__models.yml.yml:64-66), but it falls through this case to null. Since tfact_feedback.subject_type has a not_null test, any such conversation will fail the downstream build. Map it to the same course subject type as SyllabusBot.
    , case human_turns.chatsession_agent
        when 'TutorBot' then 'courseware_block'
        when 'VideoGPTBot' then 'courseware_block'
        when 'SyllabusBot' then 'course'
        when 'ResourceRecommendationBot' then 'resource'

src/ol_dbt/models/intermediate/feedback/int__feedback__learn_ai_tutor.sql:39

  • This correctly emits a global user ID, but tfact_feedback currently resolves every subject_user_ref only against lower(dim_user.email) (tfact_feedback.sql:74-75). Authenticated Learn AI turns will therefore get a null user_fk unless the UUID happens to equal an email. Add source-aware identity resolution against dim_user.user_global_id, including the incremental re-key comparison.
    , human_turns.user_global_id as subject_user_ref

src/ol_dbt/models/intermediate/feedback/int__feedback__learn_ai_tutor.sql:43

  • The seed marks this source as course-scoped and this adapter emits a course-run ID, but platform is always null and tfact_feedback still hardcodes both courserun_fk and platform_fk to null (tfact_feedback.sql:43-46). Consequently these rows cannot support the instructor/course filtering this source is meant to add. Populate the platform and resolve the conformed course/platform FKs downstream.
    , human_turns.courserun_readable_id
    , cast(null as varchar) as platform
  • Files reviewed: 5/5 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/ol_dbt/models/intermediate/feedback/int__feedback__unioned.sql
Comment thread src/ol_dbt/models/intermediate/feedback/int__feedback__unioned.sql
@github-actions

Copy link
Copy Markdown

🔎 ol-dbt impact — column-level blast radius

0 breaking, 0 surrogate-key regeneration, 1 warning, 1 info across 2 changed model(s).

Details
  • ⚠️ macro: cross_db_functions.sql → 79 downstream model(s)
  • ℹ️ int__feedback__learn_ai_tutorchannel_slug, conversation_ref, courserun_readable_id, created_at, explicit_rating, is_conversation_opening, occurred_at, platform, source_metadata, source_record_ref, source_slug, source_url, subject_ref, subject_type, subject_url, subject_user_ref, text, title, turn_index, updated_at → 0 downstream model(s)

Posted by ol-dbt impact (annotate-only — does not block merge).

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.

3 participants