feat(experimentation): add Experiment base model and CRUD endpoints#7591
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Docker builds report
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new experimentation framework, including the Experiment model, associated API endpoints, and audit logging. Key additions include status transition logic, permissions based on feature flags, and comprehensive unit tests. Review feedback suggests moving timestamp management to model lifecycle hooks for better consistency, optimizing environment lookups in permission classes by utilizing cached data, and updating the error response status code to 409 when an active experiment already exists to align with existing patterns and handle potential race conditions.
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Failed testsfirefox › tests/environment-permission-test.pw.ts › Environment Permission Tests › Environment-level permissions control access to features, identities, and segments @enterprise Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|
Visual Regression19 screenshots compared. See report for details. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7591 +/- ##
========================================
Coverage 98.51% 98.51%
========================================
Files 1436 1439 +3
Lines 54363 54690 +327
========================================
+ Hits 53553 53880 +327
Misses 810 810 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…nd use hooks to set timestamps
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Closes #7590
Adds the foundation
Experimentmodel and CRUD endpoints to theexperimentationapp, enough to wire up the frontend wizard's Step 1 (Setup) and the experiments list page.Model:
Experimentwith FK toEnvironmentandFeature, fields:name,hypothesis,status,created_at,updated_at,started_at,ended_atExperimentStatusenum:created,running,paused,completedUniqueConstrainton(feature, environment)excluding completed — one active experiment per flag per environmentSoftDeleteExportableModelEndpoints (nested under
/environments/{env_key}/experiments/):GET /— list, filterable by?status=POST /— create (multivariate flags only)GET /{id}/— retrievePATCH /{id}/— update name, hypothesis, statusValidations:
started_atauto-set on first transition torunning,ended_atauto-set oncompletedOther:
ExperimentPermissiongated behindexperimental_flagsfeature flag + environment adminRelatedObjectType.EXPERIMENTHow did you test this code?
New tests