Skip to content

Add FF to fetch contributions data from new CH tables

What does this MR do and why?

Summary of Changes

This merge request adds support for a new feature flag called fetch_contributions_data_from_new_tables that allows the system to query data from a new ClickHouse table structure populated by siphon contributions_new instead of the existing one contributions. The main changes include:

  1. Updating the traversal_path method to optionally include organization IDs when needed for the new table structure
  2. Modifying all analytics services to conditionally use the new table based on the feature flag status
  3. Adding logic to dynamically construct SQL queries that target either the old or new tables depending on the feature flag
  4. Updating tests to verify functionality works with both the old and new table structures

The changes primarily affect analytics features that track contributor data, code suggestions, and AI usage metrics.

References

Part of gitlab-org/analytics-section/siphon#96

Screenshots or screen recordings

Before After

How to set up and validate locally

For fetch_contributions_data_from_new_tables FF enabled

TBD - there is no way to test this without setting up Siphon locally. We can test this after data migration happens.

For fetch_contributions_data_from_new_tables FF disabled

  1. Check if AI impact dashboard, group contributions report, and GraphQL AiUsageData endpoint have normal behavior.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Felipe Cardozo

Merge request reports

Loading