Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #695 from SELab-2/development
Browse files Browse the repository at this point in the history
Milestone 3
  • Loading branch information
KoenDesplenter authored May 21, 2022
2 parents 74a7b25 + 87f9fcf commit 12c0190
Show file tree
Hide file tree
Showing 395 changed files with 101,952 additions and 14,178 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
"env": {
"jest": true
},
"ignorePatterns": ["**/docs/*"],
"ignorePatterns": ["**/docs/*", "backend/tests/jest_sequencer.js"],
"rules": {
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-explicit-any": [
"error",
{ "fixToUnknown": true }
Expand Down
81 changes: 42 additions & 39 deletions .github/workflows/backendCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,53 @@ on:

# Should run all tests and upload the codecoverage on main
push:
branches: [main]
branches: [ main ]

jobs:
ci:
runs-on: ubuntu-latest

services:
postgres: # this is for the integration testing of the orm functions
image: postgres:14.2
env:
POSTGRES_USER: prisma
POSTGRES_PASSWORD: prisma
POSTGRES_DB: tests
ports:
- 5433:5432
options:
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres: # this is for the integration testing of the orm functions
image: postgres:14.2
env:
POSTGRES_USER: prisma
POSTGRES_PASSWORD: prisma
POSTGRES_DB: tests
ports:
- 5433:5432
options:
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v3
- name: Create Prisma Env File
run: |
touch backend/prisma/.env
echo DATABASE_URL="postgresql://osoc2:password@db:5432/osoc2?connect_timeout=30&pool_timeout=30" >> backend/prisma/.env
cat backend/prisma/.env
- name: Use Node.js 17.x
uses: actions/setup-node@v3
with:
node-version: 17.x

- run: npm install
working-directory: backend

# push the db scheme to the db container
- name: Push schema to docker file
run: npx dotenv -e prisma/.env.test -- npx prisma db push
working-directory: backend

- name: Coverage Report
uses: ArtiomTr/jest-coverage-report-action@v2
with:
- uses: actions/checkout@v3
- name: Create Prisma Env File
run: |
touch backend/prisma/.env
echo DATABASE_URL="postgresql://osoc2:password@db:5432/osoc2?connect_timeout=30&pool_timeout=30" >> backend/prisma/.env
cat backend/prisma/.env
- name: Use Node.js 17.x
uses: actions/setup-node@v3
with:
node-version: 17.x

- run: npm install
working-directory: backend

# push the db scheme to the db container
- name: Push schema to docker file
run: npx dotenv -e prisma/.env.test -- npx prisma db push
working-directory: backend
skip-step: install
annotations: failed-tests

- name: Setup environment
run: echo 'NODE_OPTIONS="--max-old-space-size=4096"' >> $GITHUB_ENV

- name: Coverage Report
uses: ArtiomTr/jest-coverage-report-action@v2
with:
working-directory: backend
skip-step: install
annotations: failed-tests
14 changes: 10 additions & 4 deletions .github/workflows/frontendCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

# Should run all tests and upload the codecoverage on main
push:
branches: [main]
branches: [ main ]

jobs:
ci:
Expand All @@ -23,7 +23,13 @@ jobs:

- run: npm install
working-directory: frontend
- run: npm run build --if-present
working-directory: frontend
- run: npm test --if-present
- run: npm run build
working-directory: frontend

- name: Coverage Report
uses: ArtiomTr/jest-coverage-report-action@v2
with:
test-script: npm test
working-directory: frontend
skip-step: install
annotations: failed-tests
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.0.0
FROM node:18.2.0

# Create app directory
WORKDIR /app
Expand Down
22 changes: 19 additions & 3 deletions backend/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"port": 4096,

"apiErrors": {
"invalidID": {
"http": 204,
Expand Down Expand Up @@ -76,6 +74,18 @@
"http": 400,
"reason": "Failed to update your password. Perhaps you used an invalid key?"
}
},
"studentSuggestion": {
"insufficientRights": {
"http": 403,
"reason": "Failed to create suggestion. Can only create suggestions for the most recent osoc edition."
}
},
"modifyProject": {
"insufficientRights": {
"http": 403,
"reason": "Failed to modify project. Can only modify projects of the most recent osoc edition."
}
}
},

Expand All @@ -85,11 +95,17 @@
],
"preferred": "/api-osoc",
"authScheme": "auth/osoc2",
"defaultUserId": 3
"defaultUserId": 3,
"port": 4096,
"pageSize": 10
},

"email": {
"from": "'OSOC2 Account Recovery' <[email protected]>",
"header": "OSOC2 Recovery Code"
},

"encryption": {
"encryptionRounds": 8
}
}
2 changes: 1 addition & 1 deletion backend/docs/assets/search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion backend/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ <h2>Team 2:</h2>
<li>Jonathan Vanbrabant</li>
<li>Maurice Van Wassenhove</li>
</ul>
</div></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class="current"><a href="modules.html">Modules</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_applied_role.html">orm_<wbr/>functions/applied_<wbr/>role</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_attachment.html">orm_<wbr/>functions/attachment</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_contract.html">orm_<wbr/>functions/contract</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_evaluation.html">orm_<wbr/>functions/evaluation</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_general_purpose.html">orm_<wbr/>functions/general_<wbr/>purpose</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_job_application.html">orm_<wbr/>functions/job_<wbr/>application</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_job_application_skill.html">orm_<wbr/>functions/job_<wbr/>application_<wbr/>skill</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_language.html">orm_<wbr/>functions/language</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_login_user.html">orm_<wbr/>functions/login_<wbr/>user</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_orm_types.html">orm_<wbr/>functions/orm_<wbr/>types</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_osoc.html">orm_<wbr/>functions/osoc</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_password_reset.html">orm_<wbr/>functions/password_<wbr/>reset</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_person.html">orm_<wbr/>functions/person</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_project.html">orm_<wbr/>functions/project</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_project_role.html">orm_<wbr/>functions/project_<wbr/>role</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_project_user.html">orm_<wbr/>functions/project_<wbr/>user</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_role.html">orm_<wbr/>functions/role</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_session_key.html">orm_<wbr/>functions/session_<wbr/>key</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_student.html">orm_<wbr/>functions/student</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_template.html">orm_<wbr/>functions/template</a></li><li class=" tsd-kind-module"><a href="modules/routes_admin.html">routes/admin</a></li><li class=" tsd-kind-module"><a href="modules/routes_coach.html">routes/coach</a></li><li class=" tsd-kind-module"><a href="modules/routes_followup.html">routes/followup</a></li><li class=" tsd-kind-module"><a href="modules/routes_form.html">routes/form</a></li><li class=" tsd-kind-module"><a href="modules/routes_form_keys_json.html">routes/form_<wbr/>keys.json</a></li><li class=" tsd-kind-module"><a href="modules/routes_github.html">routes/github</a></li><li class=" tsd-kind-module"><a href="modules/routes_login.html">routes/login</a></li><li class=" tsd-kind-module"><a href="modules/routes_project.html">routes/project</a></li><li class=" tsd-kind-module"><a href="modules/routes_reset.html">routes/reset</a></li><li class=" tsd-kind-module"><a href="modules/routes_role.html">routes/role</a></li><li class=" tsd-kind-module"><a href="modules/routes_session_key_json.html">routes/session_<wbr/>key.json</a></li><li class=" tsd-kind-module"><a href="modules/routes_student.html">routes/student</a></li><li class=" tsd-kind-module"><a href="modules/routes_template.html">routes/template</a></li><li class=" tsd-kind-module"><a href="modules/routes_user.html">routes/user</a></li><li class=" tsd-kind-module"><a href="modules/routes_verify.html">routes/verify</a></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li><li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li><li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="assets/main.js"></script></body></html>
</div></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class="current"><a href="modules.html">Modules</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_applied_role.html">orm_<wbr/>functions/applied_<wbr/>role</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_attachment.html">orm_<wbr/>functions/attachment</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_contract.html">orm_<wbr/>functions/contract</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_evaluation.html">orm_<wbr/>functions/evaluation</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_general_purpose.html">orm_<wbr/>functions/general_<wbr/>purpose</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_job_application.html">orm_<wbr/>functions/job_<wbr/>application</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_job_application_skill.html">orm_<wbr/>functions/job_<wbr/>application_<wbr/>skill</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_language.html">orm_<wbr/>functions/language</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_login_user.html">orm_<wbr/>functions/login_<wbr/>user</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_login_user_osoc.html">orm_<wbr/>functions/login_<wbr/>user_<wbr/>osoc</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_orm_types.html">orm_<wbr/>functions/orm_<wbr/>types</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_osoc.html">orm_<wbr/>functions/osoc</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_password_reset.html">orm_<wbr/>functions/password_<wbr/>reset</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_person.html">orm_<wbr/>functions/person</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_project.html">orm_<wbr/>functions/project</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_project_role.html">orm_<wbr/>functions/project_<wbr/>role</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_project_user.html">orm_<wbr/>functions/project_<wbr/>user</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_role.html">orm_<wbr/>functions/role</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_session_key.html">orm_<wbr/>functions/session_<wbr/>key</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_student.html">orm_<wbr/>functions/student</a></li><li class=" tsd-kind-module"><a href="modules/orm_functions_template.html">orm_<wbr/>functions/template</a></li><li class=" tsd-kind-module"><a href="modules/routes_admin.html">routes/admin</a></li><li class=" tsd-kind-module"><a href="modules/routes_coach.html">routes/coach</a></li><li class=" tsd-kind-module"><a href="modules/routes_followup.html">routes/followup</a></li><li class=" tsd-kind-module"><a href="modules/routes_form.html">routes/form</a></li><li class=" tsd-kind-module"><a href="modules/routes_github.html">routes/github</a></li><li class=" tsd-kind-module"><a href="modules/routes_login.html">routes/login</a></li><li class=" tsd-kind-module"><a href="modules/routes_osoc.html">routes/osoc</a></li><li class=" tsd-kind-module"><a href="modules/routes_project.html">routes/project</a></li><li class=" tsd-kind-module"><a href="modules/routes_reset.html">routes/reset</a></li><li class=" tsd-kind-module"><a href="modules/routes_role.html">routes/role</a></li><li class=" tsd-kind-module"><a href="modules/routes_student.html">routes/student</a></li><li class=" tsd-kind-module"><a href="modules/routes_template.html">routes/template</a></li><li class=" tsd-kind-module"><a href="modules/routes_user.html">routes/user</a></li><li class=" tsd-kind-module"><a href="modules/routes_verify.html">routes/verify</a></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li><li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li><li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="assets/main.js"></script></body></html>
Loading

2 comments on commit 12c0190

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report for frontend

St.❔
Category Percentage Covered / Total
🟑 Statements 70.15% 1133/1615
πŸ”΄ Branches 54.38% 391/719
🟑 Functions 61.02% 180/295
🟑 Lines 69.34% 1063/1533

Test suite run success

36 tests passing in 7 suites.

Report generated by πŸ§ͺjest coverage report action from 12c0190

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report for backend

St.❔
Category Percentage Covered / Total
🟒 Statements 99.14% 2523/2545
🟒 Branches 97.41% 677/695
🟒 Functions 98.16% 694/707
🟒 Lines 99.24% 2480/2499

Test suite run success

3887 tests passing in 87 suites.

Report generated by πŸ§ͺjest coverage report action from 12c0190

Please sign in to comment.