Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST API - Allow updating in-progress conversion, attribution model, and stats engine for experiment settings #2435

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions packages/back-end/generated/spec.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ properties:
type: string
excludeFromPayload:
type: boolean
inProgressConversions:
type: string
enum:
- loose
- strict
attributionModel:
type: string
enum:
- firstExposure
- experimentDuration
statsEngine:
type: string
enum:
- bayesian
- frequentist
variations:
type: array
minItems: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@ properties:
type: string
excludeFromPayload:
type: boolean
inProgressConversions:
type: string
enum:
- loose
- strict
attributionModel:
type: string
enum:
- firstExposure
- experimentDuration
statsEngine:
type: string
enum:
- bayesian
- frequentist
variations:
type: array
minItems: 2
Expand Down
13 changes: 11 additions & 2 deletions packages/back-end/src/services/experiments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1799,8 +1799,9 @@ export function postExperimentApiPayloadToInterface(
activationMetric: "",
segment: "",
queryFilter: "",
skipPartialData: false,
attributionModel: "firstExposure",
skipPartialData: payload.inProgressConversions === "strict",
attributionModel: payload.attributionModel || "firstExposure",
...(payload.statsEngine ? { statsEngine: payload.statsEngine } : {}),
variations:
payload.variations.map((v) => ({
...v,
Expand Down Expand Up @@ -1853,6 +1854,9 @@ export function updateExperimentApiPayloadToInterface(
variations,
releasedVariationId,
excludeFromPayload,
inProgressConversions,
attributionModel,
statsEngine,
} = payload;
return {
...(trackingKey ? { trackingKey } : {}),
Expand All @@ -1871,6 +1875,11 @@ export function updateExperimentApiPayloadToInterface(
...(status ? { status } : {}),
...(releasedVariationId !== undefined ? { releasedVariationId } : {}),
...(excludeFromPayload !== undefined ? { excludeFromPayload } : {}),
...(inProgressConversions !== undefined
? { skipPartialData: inProgressConversions === "strict" }
: {}),
...(attributionModel !== undefined ? { attributionModel } : {}),
...(statsEngine !== undefined ? { statsEngine } : {}),
...(variations
? {
variations: variations?.map((v) => ({
Expand Down
4 changes: 2 additions & 2 deletions packages/back-end/src/validators/openapi.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions packages/back-end/types/openapi.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading