feat: gracefully deprecate BigQuery viewership endpoints#214
Merged
Conversation
When --disable-bigquery is set, viewership endpoints now return empty/zero data (HTTP 200) instead of 501 errors. This allows consumers to keep their integrations working while we phase out BigQuery-backed viewership. - Add noopBigQuery implementing the BigQuery interface with empty returns - Add DisableBigQuery option to views.ClientOptions - Update provisionDataAnalytics to always create views/usage clients, passing the flag through instead of returning nil Made-with: Cursor
Member
Author
Testing SummaryRan locally with Results
ClickHouse-backed endpoints (unaffected)Usage endpoints ( |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #214 +/- ##
===================================================
- Coverage 29.55145% 28.86598% -0.68547%
===================================================
Files 5 5
Lines 379 388 +9
===================================================
Hits 112 112
- Misses 252 261 +9
Partials 15 15
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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
noopBigQuerystub that implements theBigQueryinterface with empty/nil returns, so viewership endpoints return HTTP 200 with empty/zero data instead of 501 errors when BigQuery is disabledDisableBigQueryoption toviews.ClientOptionsto conditionally swap in the stubprovisionDataAnalyticsto always create views and usage clients (instead of returning nil when--disable-bigqueryis set), passing the flag through to the views clientBehavior change
--disable-bigquery)--disable-bigquery)GET /views/query/total/{playbackId}{"playbackId":"...","viewCount":0}GET /views/query[]GET /views/query/creator[]GET /views/{assetId}/totalGET /views/now(ClickHouse)GET /views/internal/timeSeries(ClickHouse)Test plan
--disable-bigqueryand verify viewership endpoints return 200 with empty data/views/now,/usage/query/*) still return real data--disable-bigqueryflag, BigQuery viewership still works as beforeMade with Cursor