feat(experiments): add configurable baseline variant#20
Open
lordspline wants to merge 3 commits into
Open
Conversation
…ontrol Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.
This PR introduces configurable baseline variants for experiments, allowing users to select any variant as the baseline instead of assuming
control. The change is backward compatible and updates calculations, validation, and UI labels across the experiment stack.Backend
products/experiments/backend/hogql_queries/experiment_trends_query_runner.py: Readbaseline_variant_keyfromstats_configand use it to determine baseline instead of hardcodedCONTROL_VARIANT_KEYproducts/experiments/backend/hogql_queries/experiment_funnels_query_runner.py: Same baseline configuration logic for funnel metricsproducts/experiments/backend/hogql_queries/utils.py: Updated error messages to reference the configured baseline keyproducts/experiments/backend/hogql_queries/test/test_stats_config.py: Added tests for legacy query runners respectingbaseline_variant_keyFrontend
frontend/src/scenes/experiments/MetricsView/shared/ErrorChecklist.tsx: Dynamic error messages usingbaseline_variant_keyfrom stats_configfrontend/src/scenes/experiments/legacy/metricsView/LegacyErrorChecklist.tsx: Same baseline-aware error messagingfrontend/src/scenes/experiments/constants.ts: Updated conclusion descriptions to use "baseline" instead of "control"frontend/src/scenes/experiments/stories/ExperimentFrequentistFiveVariants.stories.tsx: Renamed story toExperimentFrequentistFiveVariantsCustomBaselineto demonstrate the featureFixtures
frontend/src/mocks/fixtures/api/experiments/experiment_frequentist_five_variants.json: Addedbaseline_variant_key: "test-2"to stats_configfrontend/src/mocks/fixtures/api/experiments/experiment_frequentist_five_variants_*_metric_result.json: Updated mock results to reflecttest-2as the baseline with other variants as test variantsExisting experiments remain compatible because
baseline_variant_keydefaults tocontrolwhen not set.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.