Skip to content
Snippets Groups Projects
Commit 9e75273d authored by michael.minelli's avatar michael.minelli
Browse files

Sonar => Resolve issues

parent ce495680
Branches
Tags
No related merge requests found
...@@ -21,28 +21,28 @@ class ClientsSharedConfig { ...@@ -21,28 +21,28 @@ class ClientsSharedConfig {
constructor() { constructor() {
this.apiURL = process.env.API_URL || ''; this.apiURL = process.env.API_URL ?? '';
this.assignment = { this.assignment = {
filename : process.env.ASSIGNMENT_FILENAME || '', filename : process.env.ASSIGNMENT_FILENAME ?? '',
neededFiles: JSON.parse(process.env.EXERCISE_NEEDED_FILES || '[]') neededFiles: JSON.parse(process.env.EXERCISE_NEEDED_FILES ?? '[]')
}; };
this.gitlab = { this.gitlab = {
dojoAccount: { dojoAccount: {
id : Number(process.env.GITLAB_DOJO_ACCOUNT_ID) || -1, id : Number(process.env.GITLAB_DOJO_ACCOUNT_ID ?? -1),
username: process.env.GITLAB_DOJO_ACCOUNT_USERNAME || '' username: process.env.GITLAB_DOJO_ACCOUNT_USERNAME ?? ''
} }
}; };
this.dockerCompose = { this.dockerCompose = {
projectName: process.env.DOCKER_COMPOSE_PROJECT_NAME || '' projectName: process.env.DOCKER_COMPOSE_PROJECT_NAME ?? ''
}; };
this.exerciseResultsFolderMaxSizeInBytes = Number(process.env.EXERCISE_RESULTS_FOLDER_MAX_SIZE_IN_BYTES || 0); this.exerciseResultsFolderMaxSizeInBytes = Number(process.env.EXERCISE_RESULTS_FOLDER_MAX_SIZE_IN_BYTES ?? 0);
this.filenames = { this.filenames = {
results: process.env.EXERCISE_RESULTS_FILENAME || '' results: process.env.EXERCISE_RESULTS_FILENAME ?? ''
}; };
} }
} }
......
...@@ -196,7 +196,7 @@ class AssignmentValidator { ...@@ -196,7 +196,7 @@ class AssignmentValidator {
}); });
dockerComposeValidation.on('exit', code => { dockerComposeValidation.on('exit', code => {
code !== null && code === 0 ? resolve() : reject(); code !== null && code === 0 ? resolve() : reject(code);
}); });
}); });
} catch ( error ) { } catch ( error ) {
...@@ -271,7 +271,7 @@ class AssignmentValidator { ...@@ -271,7 +271,7 @@ class AssignmentValidator {
}); });
exerciseDockerCompose.events.on('finished', (_success: boolean, exitCode: number) => { exerciseDockerCompose.events.on('finished', (_success: boolean, exitCode: number) => {
exitCode !== 0 ? resolve() : reject(); exitCode !== 0 ? resolve() : reject(exitCode);
}); });
exerciseDockerCompose.run(this.doDown); exerciseDockerCompose.run(this.doDown);
......
import GitlabRepository from '../../shared/types/Gitlab/GitlabRepository'; import GitlabRepository from '../../shared/types/Gitlab/GitlabRepository';
import { CommitSchema } from '@gitbeaker/rest'; import * as Gitlab from '@gitbeaker/rest';
import User from './User'; import User from './User';
import Assignment from './Assignment'; import Assignment from './Assignment';
...@@ -18,7 +18,7 @@ interface Exercise { ...@@ -18,7 +18,7 @@ interface Exercise {
assignment: Assignment | undefined; assignment: Assignment | undefined;
isCorrection: boolean; isCorrection: boolean;
correctionCommit: CommitSchema | undefined; correctionCommit: Gitlab.CommitSchema | undefined;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment