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

create mooclet when a mooclet experiment is imported #2205

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

bcb37
Copy link
Collaborator

@bcb37 bcb37 commented Feb 7, 2025

No description provided.

@bcb37 bcb37 linked an issue Feb 7, 2025 that may be closed by this pull request
@@ -509,6 +509,16 @@ export class ExperimentService {
user: UserDTO,
logger: UpgradeLogger
): Promise<ValidatedExperimentError[]> {
const { experiments, validatedExperiments } = await this.verifyExperiments(experimentFiles, logger);
Copy link
Collaborator

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(
Copy link
Collaborator

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);
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mooclet import
3 participants