feat: add shared Insights Snowflake routing foundation - #211
Merged
santhosh-apphelix-2u merged 1 commit intoSep 2, 2026
Merged
Conversation
There was a problem hiding this comment.
🟢 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_enabledglobal toggle helper and updated course-activity routing to allow either the global or endpoint flag to enable Snowflake. - Introduced
InsightsDataSourceResponseMixinto consistently setX-Insights-Data-Sourceand 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.
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
abhalsod-sonata
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
insights_snowflake_enabledWaffle flag helper for the remaining Insights Snowflake migration.X-Insights-Data-Source.Notes
This PR is foundation only. It does not migrate additional Insights APIs yet.