Skip to content

Commit

Permalink
REST API - Allow updating in-progress conversion, attribution model, …
Browse files Browse the repository at this point in the history
…and stats engine for experiment settings
  • Loading branch information
bttf committed Apr 26, 2024
1 parent 75ca41b commit ac7c58e
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
15 changes: 15 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 @@ -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
8 changes: 8 additions & 0 deletions packages/back-end/src/services/experiments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1853,6 +1853,9 @@ export function updateExperimentApiPayloadToInterface(
variations,
releasedVariationId,
excludeFromPayload,
inProgressConversions,
attributionModel,
statsEngine,
} = payload;
return {
...(trackingKey ? { trackingKey } : {}),
Expand All @@ -1871,6 +1874,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
2 changes: 1 addition & 1 deletion packages/back-end/src/validators/openapi.ts

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

6 changes: 6 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.

0 comments on commit ac7c58e

Please sign in to comment.