Implement the skeleton models for experimentation
Description
Minimal Experiment model and CRUD endpoints in the experimentation app. Just enough to wire up the frontend wizard's Step 1 (Setup) and the experiments list page. Audience, metrics, and launch logic come in follow-up issues.
Model
class ExperimentStatus(TextChoices):
CREATED = "created"
RUNNING = "running"
PAUSED = "paused"
COMPLETED = "completed"
class Experiment:
environment: FK → Environment
feature: FK → Feature # only multivariate flags
name: CharField(255) # required
hypothesis: TextField # required
status: CharField (default=CREATED)
created_at: DateTimeField(auto_now_add)
updated_at: DateTimeField(auto_now)
started_at: DateTimeField(null)
ended_at: DateTimeField(null)
- FK to Feature a flag can have past completed experiments, but only one active (created/running/paused) per flag+environment.
- UniqueConstraint: (feature, environment) where status NOT IN (completed).
Endpoints — nested under environment like warehouse connections:
/environments/<env_key>/experiments/
- GET — list (filterable by status)
- POST — create
- GET /:id — retrieve
- PATCH /:id — update (name, hypothesis, status)
- DELETE /:id — soft delete
Not in scope: audience conditions, sample %, variation weights, metrics, launch validation.
Implement the skeleton models for experimentation
Description
Minimal Experiment model and CRUD endpoints in the experimentation app. Just enough to wire up the frontend wizard's Step 1 (Setup) and the experiments list page. Audience, metrics, and launch logic come in follow-up issues.
Model
Endpoints — nested under environment like warehouse connections:
Not in scope: audience conditions, sample %, variation weights, metrics, launch validation.