-
Notifications
You must be signed in to change notification settings - Fork 14
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
create mooclet when a mooclet experiment is imported #2205
base: dev
Are you sure you want to change the base?
Conversation
@@ -509,6 +509,16 @@ export class ExperimentService { | |||
user: UserDTO, | |||
logger: UpgradeLogger | |||
): Promise<ValidatedExperimentError[]> { | |||
const { experiments, validatedExperiments } = await this.verifyExperiments(experimentFiles, logger); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is no longer needed.
try { | ||
if ('moocletPolicyParameters' in experiment) { | ||
if (!env.mooclets?.enabled) { | ||
throw new BadRequestError( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we throw an error, even valid experiments will not created.
This should be part of the verifyExperiment
and the experiment should be skipped.
Users should see this problem before the actual import.
@@ -1270,7 +1270,7 @@ export class ExperimentController { | |||
@CurrentUser() currentUser: UserDTO, | |||
@Req() request: AppRequest | |||
): Promise<ValidatedExperimentError[]> { | |||
return this.experimentService.importExperiment(experiments, currentUser, request.logger); | |||
return this.moocletExperimentService.syncImportExperiment(experiments, currentUser, request.logger); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moocletExperimentService
is the entrypoint for all imports? That feels a little funny, is there something that makes experimentService.importExperiment
unable to accommodate delegating control to moocletExperimentService
for mooclet imports only, while remaining the same for existing imports?
No description provided.