Skip to content

feat: add shared Insights Snowflake routing foundation - #211

Merged
santhosh-apphelix-2u merged 1 commit into
masterfrom
lp-1002-insights-snowflake-shared-foundation
Sep 2, 2026
Merged

feat: add shared Insights Snowflake routing foundation#211
santhosh-apphelix-2u merged 1 commit into
masterfrom
lp-1002-insights-snowflake-shared-foundation

Conversation

@santhosh-apphelix-2u

Copy link
Copy Markdown

Summary

  • Add a global insights_snowflake_enabled Waffle flag helper for the remaining Insights Snowflake migration.
  • Keep the existing course activity flag working, while allowing the new global flag to also route activity through Snowflake.
  • Add a shared response header helper for X-Insights-Data-Source.
  • Update course activity to use the shared helper instead of keeping header logic inside the view.
  • Add focused unit coverage for the new flag and response header behavior.

Notes

This PR is foundation only. It does not migrate additional Insights APIs yet.

@santhosh-apphelix-2u
santhosh-apphelix-2u marked this pull request as ready for review September 2, 2026 08:15
Copilot AI lite review requested due to automatic review settings September 2, 2026 08:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are cohesive, maintain backward compatibility for the course activity flag, and include targeted unit coverage for the new shared behaviors.

Pull request overview

This PR lays the groundwork for routing Insights APIs to Snowflake by introducing a global Waffle flag helper and a shared response-header mixin, then wiring the existing course activity endpoint to use those shared utilities while preserving current endpoint-specific flag behavior.

Changes:

  • Added insights_snowflake_enabled global toggle helper and updated course-activity routing to allow either the global or endpoint flag to enable Snowflake.
  • Introduced InsightsDataSourceResponseMixin to consistently set X-Insights-Data-Source and updated course activity to use it.
  • Added unit tests covering the new global flag helper, combined-flag behavior, and response-header mixin behavior.
File summaries
File Description
analytics_data_api/v0/views/courses.py Adopts the shared response-header mixin and uses shared setters for data-source attribution.
analytics_data_api/tests/test_insights_snowflake.py Adds focused unit coverage for the new mixin and global flag behavior.
analytics_data_api/insights_snowflake/toggles.py Introduces the global Snowflake enablement flag and composes it with the course-activity flag.
analytics_data_api/insights_snowflake/response_headers.py Adds shared constants + mixin for setting X-Insights-Data-Source consistently.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  analytics_data_api/insights_snowflake
  response_headers.py
  toggles.py
  analytics_data_api/tests
  test_insights_snowflake.py
  analytics_data_api/v0/views
  courses.py
Project Total  

This report was generated by python-coverage-comment-action

@santhosh-apphelix-2u
santhosh-apphelix-2u merged commit 045a25f into master Sep 2, 2026
6 checks passed
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