Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • Dojo_Project_Nguyen/backend/dojobackendapi
  • dojo_project/projects/backend/dojobackendapi
2 results
Select Git revision
Show changes
Showing
with 5307 additions and 3064 deletions
...@@ -20,7 +20,7 @@ dojo: ...@@ -20,7 +20,7 @@ dojo:
services: services:
- docker:24.0.6-dind - docker:24.0.6-dind
image: image:
name: dojohesso/dojo_assignment_checker:latest name: {{DOCKERHUB_REPO_ASSIGNMENT_CHECKER}}:latest
script: script:
- dojo_assignment_checker - dojo_assignment_checker
allow_failure: false allow_failure: false
\ No newline at end of file
...@@ -20,7 +20,7 @@ dojo: ...@@ -20,7 +20,7 @@ dojo:
services: services:
- docker:24.0.6-dind - docker:24.0.6-dind
image: image:
name: dojohesso/dojo_exercise_checker:latest name: {{DOCKERHUB_REPO_EXERCISE_CHECKER}}:latest
script: script:
- dojo_exercise_checker - dojo_exercise_checker
artifacts: artifacts:
......
########################### Server env vars
API_PORT=30993
LOGS_FOLDER=logs
########################### Requests env vars
REQUEST_CLIENT_VALIDATION="{
'version': {
'DojoCLI': '>=5.0.0',
'DojoExerciseChecker': '>=5.0.0',
'DojoAssignmentChecker': '>=5.0.0'
}
}"
########################### DojoCLI env vars
DOJO_CLI_VERSION_UPDATE_PERIOD_MS=7200000
DOJO_CLI_GITLAB_REPOSITORY_ID=12972
########################### Session env vars
SESSION_TIMEOUT=0
LOGIN_SERVER_PORT=30992
LOGIN_SERVER_ROUTE=login
LOGIN_GITLAB_URL_REDIRECT=http://localhost:${LOGIN_SERVER_PORT}/${LOGIN_SERVER_ROUTE}
LOGIN_GITLAB_URL_TOKEN=${GITLAB_URL}/oauth/token
########################### Gitlab env vars
GITLAB_API_URL=${GITLAB_URL}/api/v4
GITLAB_REPOSITORY_CREATION_TIMEOUT=5000
GITLAB_BADGE_PIPELINE_LINK=${GITLAB_URL}/%{project_path}/-/pipelines
GITLAB_BADGE_PIPELINE_IMAGE_URL=${GITLAB_URL}/%{project_path}/badges/%{default_branch}/pipeline.svg
########################### Assignment env vars
ASSIGNMENT_DEFAULT_DESCRIPTION="Dojo assignment repository.\n\nName of the assignment: {{ASSIGNMENT_NAME}}"
ASSIGNMENT_DEFAULT_INIT_README=false
ASSIGNMENT_DEFAULT_SHARED_RUNNERS_ENABLED=true
ASSIGNMENT_DEFAULT_VISIBILITY=private
ASSIGNMENT_DEFAULT_WIKI_ENABLED=false
ASSIGNMENT_FILENAME=dojo_assignment.json
ASSIGNMENT_BASE_FILES='["${ASSIGNMENT_FILENAME}", "README.md", "docker-compose.yml"]'
ASSIGNMENT_DEFAULT_TEMPLATE=https://{{USERNAME}}:{{TOKEN}}@${GITLAB_DOMAIN}/dojo/template/empty_template.git
########################### Exercise env vars
EXERCISE_DEFAULT_DESCRIPTION="Dojo exercise repository based on the the assignment: {{ASSIGNMENT_NAME}}"
EXERCISE_DEFAULT_VISIBILITY=private
EXERCISE_MAX_PER_ASSIGNMENT=2
EXERCISE_MAX_SAME_NAME=10
EXERCISE_PIPELINE_RESULTS_FOLDER=\$CI_PROJECT_DIR/Results_of_exercise_\$DOJO_EXERCISE_ID
EXERCISE_RESULTS_FOLDER=/dojoFiles/results/
\ No newline at end of file
// @ts-check
// @formatter:off
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
export default tseslint.config({
ignores: [ 'dist/*', 'node_modules/*', 'logs/*', 'prisma/*', 'eslint.config.mjs' ]
}, eslint.configs.recommended, ...tseslint.configs.recommendedTypeChecked, {
languageOptions: {
parserOptions: {
project: true, tsconfigRootDir: import.meta.dirname
}
}
}, {
plugins: {
'@typescript-eslint': tseslint.plugin
}, rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-floating-promises': 'off',
}
});
\ No newline at end of file
...@@ -9,5 +9,5 @@ ...@@ -9,5 +9,5 @@
"verbose": true, "verbose": true,
"ext" : ".ts,.js", "ext" : ".ts,.js",
"ignore" : [], "ignore" : [],
"exec" : "npm run lint; npm run build:openapi; ts-node --files ./src/app.ts" "exec" : "npm run lint; npm run build:openapi; tsc --noEmit && npx tsx src/app.ts"
} }
This diff is collapsed.
{ {
"name" : "dojo_backend_api", "name" : "dojo_backend_api",
"description" : "Backend API of the Dojo project", "description" : "Backend API of the Dojo project",
"version" : "3.5.3", "version" : "6.0.0",
"license" : "AGPLv3", "license" : "AGPLv3",
"author" : "Michaël Minelli <dojo@minelli.me>", "author" : "Michaël Minelli <dojo@minelli.me>",
"main" : "dist/src/app.js", "main" : "dist/src/app.js",
"scripts" : { "scripts" : {
"clean" : "rm -R dist/*", "clean" : "rm -R dist/*",
"dotenv:build" : "npx dotenv-vault local build", "dotenv:build" : "npx dotenvx encrypt",
"lint" : "npx eslint .", "lint" : "npx eslint .",
"genversion" : "npx genversion -s -e src/config/Version.ts", "genversion" : "npx genversion -s -e src/config/Version.ts",
"build:openapi" : "sed -i -r \"1,20 s/^\\([ ]*version:\\).*$/\\1 $(jq -r .version package.json)/\" assets/OpenAPI/OpenAPI.yaml; npx @redocly/cli build-docs assets/OpenAPI/OpenAPI.yaml --output=assets/OpenAPI/redoc.html", "build:openapi" : "sed -i -r \"1,20 s/^\\([ ]*version:\\).*$/\\1 $(jq -r .version package.json)/\" assets/OpenAPI/OpenAPI.yaml; npx @redocly/cli build-docs assets/OpenAPI/OpenAPI.yaml --output=assets/OpenAPI/redoc.html",
...@@ -28,56 +28,54 @@ ...@@ -28,56 +28,54 @@
"seed": "node dist/prisma/seed" "seed": "node dist/prisma/seed"
}, },
"dependencies" : { "dependencies" : {
"@gitbeaker/rest" : "^39.34.2", "@dotenvx/dotenvx" : "^0.45.0",
"@prisma/client" : "^5.9.1", "@gitbeaker/rest" : "^42.1.0",
"axios" : "^1.6.7", "@prisma/client" : "^6.4.1",
"compression" : "^1.7.4", "axios" : "^1.8.1",
"compression" : "^1.8.0",
"cors" : "^2.8.5", "cors" : "^2.8.5",
"dotenv" : "^16.4.1", "express" : "^4.21.2",
"dotenv-expand" : "^10.0.0", "express-validator" : "^7.2.1",
"express" : "^4.18.2", "form-data" : "^4.0.2",
"express-validator" : "^7.0.1", "helmet" : "^8.0.0",
"form-data" : "^4.0.0",
"helmet" : "^7.1.0",
"http-status-codes" : "^2.3.0", "http-status-codes" : "^2.3.0",
"json5" : "^2.2.3", "json5" : "^2.2.3",
"jsonwebtoken" : "^9.0.2", "jsonwebtoken" : "^9.0.2",
"morgan" : "^1.10.0", "morgan" : "^1.10.0",
"multer" : "^1.4.5-lts.1", "multer" : "^1.4.5-lts.1",
"mysql" : "^2.18.1", "mysql" : "^2.18.1",
"node" : "^20.11.0", "node" : "^20.15.0",
"parse-link-header" : "^2.0.0", "parse-link-header" : "^2.0.0",
"semver" : "^7.6.0", "semver" : "^7.7.1",
"swagger-ui-express" : "^5.0.0", "swagger-ui-express" : "^5.0.1",
"tar-stream" : "^3.1.7", "tar-stream" : "^3.1.7",
"uuid" : "^9.0.1", "uuid" : "^11.1.0",
"winston" : "^3.11.0", "winston" : "^3.17.0",
"zod" : "^3.22.4", "zod" : "^3.24.2",
"zod-validation-error": "^3.0.0" "zod-validation-error": "^3.4.0"
}, },
"devDependencies": { "devDependencies": {
"@redocly/cli" : "^1.8.2", "@eslint/js" : "^9.21.0",
"@types/compression" : "^1.7.5", "@redocly/cli" : "^1.31.2",
"@types/cors" : "^2.8.17", "@types/compression" : "^1.7.5",
"@types/express" : "^4.17.21", "@types/cors" : "^2.8.17",
"@types/jsonwebtoken" : "^9.0.5", "@types/express" : "^4.17.21",
"@types/morgan" : "^1.9.9", "@types/jsonwebtoken" : "^9.0.9",
"@types/multer" : "^1.4.11", "@types/morgan" : "^1.9.9",
"@types/node" : "^20.11.17", "@types/multer" : "^1.4.12",
"@types/parse-link-header" : "^2.0.3", "@types/node" : "^22.13.5",
"@types/semver" : "^7.5.6", "@types/parse-link-header" : "^2.0.3",
"@types/swagger-ui-express" : "^4.1.6", "@types/semver" : "^7.5.8",
"@types/tar-stream" : "^3.1.3", "@types/swagger-ui-express": "^4.1.8",
"@types/uuid" : "^9.0.8", "@types/tar-stream" : "^3.1.3",
"@typescript-eslint/eslint-plugin": "^6.21.0", "@types/uuid" : "^10.0.0",
"@typescript-eslint/parser" : "^6.21.0", "dotenv-cli" : "^8.0.0",
"dotenv-cli" : "^7.3.0", "genversion" : "^3.2.0",
"dotenv-vault" : "^1.26.0", "nodemon" : "^3.1.9",
"genversion" : "^3.2.0", "npm" : "^11.1.0",
"nodemon" : "^3.0.3", "prisma" : "^6.4.1",
"npm" : "^10.4.0", "tsx" : "^4.19.3",
"prisma" : "^5.9.1", "typescript" : "~5.5.4",
"ts-node" : "^10.9.2", "typescript-eslint" : "^7.18.0"
"typescript" : "^5.3.3"
} }
} }
-- CreateTable
CREATE TABLE `Tag` (
`name` CHAR(36) NOT NULL,
`type` ENUM('LANGUAGE', 'FRAMEWORK', 'THEME', 'USERDEFINED') NOT NULL,
PRIMARY KEY (`name`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `_AssignmentToTag` (
`A` VARCHAR(191) NOT NULL,
`B` CHAR(36) NOT NULL,
UNIQUE INDEX `_AssignmentToTag_AB_unique`(`A`, `B`),
INDEX `_AssignmentToTag_B_index`(`B`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `_ExerciseToTag` (
`A` CHAR(36) NOT NULL,
`B` CHAR(36) NOT NULL,
UNIQUE INDEX `_ExerciseToTag_AB_unique`(`A`, `B`),
INDEX `_ExerciseToTag_B_index`(`B`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
ALTER TABLE `_AssignmentToTag` ADD CONSTRAINT `_AssignmentToTag_A_fkey` FOREIGN KEY (`A`) REFERENCES `Assignment`(`name`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `_AssignmentToTag` ADD CONSTRAINT `_AssignmentToTag_B_fkey` FOREIGN KEY (`B`) REFERENCES `Tag`(`name`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `_ExerciseToTag` ADD CONSTRAINT `_ExerciseToTag_A_fkey` FOREIGN KEY (`A`) REFERENCES `Exercise`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `_ExerciseToTag` ADD CONSTRAINT `_ExerciseToTag_B_fkey` FOREIGN KEY (`B`) REFERENCES `Tag`(`name`) ON DELETE CASCADE ON UPDATE CASCADE;
-- CreateTable
CREATE TABLE `SubmissionTag` (
`name` CHAR(36) NOT NULL,
`type` ENUM('LANGUAGE', 'FRAMEWORK', 'THEME', 'USERDEFINED') NOT NULL,
`state` VARCHAR(191) NOT NULL,
PRIMARY KEY (`name`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AlterTable
ALTER TABLE `Assignment` ADD COLUMN `useSonar` BOOLEAN NOT NULL DEFAULT false;
-- AlterTable
ALTER TABLE `Assignment` ADD COLUMN `language` ENUM('abap', 'ada', 'asm', 'bash', 'bqn', 'c', 'caml', 'cloudformation', 'cpp', 'csharp', 'css', 'cuda', 'dart', 'delphi', 'docker', 'erlang', 'f', 'fsharp', 'flex', 'fortran', 'futhark', 'go', 'groovy', 'haskell', 'hepial', 'json', 'jsp', 'java', 'js', 'julia', 'kotlin', 'kubernetes', 'latex', 'lisp', 'lua', 'matlab', 'objc', 'ocaml', 'pascal', 'pearl', 'perl', 'php', 'postscript', 'powershell', 'prolog', 'promela', 'python', 'r', 'ruby', 'rust', 'scala', 'sql', 'smalltalk', 'swift', 'terraform', 'text', 'ts', 'tsql', 'typst', 'vba', 'vbnet', 'web', 'xml', 'yaml', 'other') NOT NULL DEFAULT 'other';
-- AlterTable
ALTER TABLE `Assignment` ADD COLUMN `sonarCreationInfo` JSON NULL,
ADD COLUMN `sonarKey` VARCHAR(191) NULL;
-- AlterTable
ALTER TABLE `Exercise` ADD COLUMN `sonarCreationInfo` JSON NULL,
ADD COLUMN `sonarKey` VARCHAR(191) NULL;
-- AlterTable
ALTER TABLE `Assignment` ADD COLUMN `secret` CHAR(36) NULL;
UPDATE `Assignment` SET `secret` = uuid();
\ No newline at end of file
/*
Warnings:
- A unique constraint covering the columns `[secret]` on the table `Assignment` will be added. If there are existing duplicate values, this will fail.
- Made the column `secret` on table `Assignment` required. This step will fail if there are existing NULL values in that column.
*/
-- AlterTable
ALTER TABLE `Assignment` MODIFY `secret` CHAR(36) NOT NULL;
-- CreateIndex
CREATE UNIQUE INDEX `Assignment_secret_key` ON `Assignment`(`secret`);
-- AlterTable
ALTER TABLE `Assignment` ADD COLUMN `sonarGate` VARCHAR(191) NULL,
ADD COLUMN `sonarProfiles` JSON NULL;
-- AlterTable
ALTER TABLE `Exercise` ADD COLUMN `correctionDescription` VARCHAR(80) NULL;
-- AlterTable
ALTER TABLE `Exercise` ADD COLUMN `deleted` BOOLEAN NOT NULL DEFAULT false;
/*
Warnings:
- You are about to drop the `SubmissionTag` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
DROP TABLE `SubmissionTag`;
-- CreateTable
CREATE TABLE `TagProposal` (
`name` CHAR(36) NOT NULL,
`type` ENUM('LANGUAGE', 'FRAMEWORK', 'THEME', 'USERDEFINED') NOT NULL,
`state` VARCHAR(191) NOT NULL,
PRIMARY KEY (`name`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AlterTable
ALTER TABLE `TagProposal` MODIFY `state` VARCHAR(191) NOT NULL DEFAULT 'PendingApproval';
-- AlterTable
ALTER TABLE `TagProposal` ADD COLUMN `details` VARCHAR(191) NULL;
-- AlterTable
ALTER TABLE `Result` ADD COLUMN `sonarGatePass` BOOLEAN NULL;