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 #492 from SELab-2/development
Browse files Browse the repository at this point in the history
The Big Merge 2.0
  • Loading branch information
jay-tux authored Apr 28, 2022
2 parents 0aa07ed + 3232e40 commit f4df4ea
Show file tree
Hide file tree
Showing 282 changed files with 43,204 additions and 7,275 deletions.
9 changes: 5 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,28 @@
"extends": [
"eslint:recommended",
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended"
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"settings": {
"next": {
"rootDir": "frontend"
}
},
"parser": "@typescript-eslint/parser",
"plugins": ["jest", "@typescript-eslint"],
"plugins": ["jest", "@typescript-eslint", "prettier"],
"env": {
"jest": true
},
"ignorePatterns": ["**/docs/*"],
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": [
"error",
{ "fixToUnknown": true }
]
],
"prettier/prettier": ["error", {"tabWidth": 4}]
}
}
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
23 changes: 7 additions & 16 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ updates:
# Set the target branch to `development` instead of default `main`
target-branch: "development"
assignees:
- "BramDevlaminck"
- "Jonathan-Vanbrabant"
- "SELab-2/osoc-team2"
commit-message:
prefix: "npm-root"
include: "scope"
Expand All @@ -39,8 +38,7 @@ updates:
# Set the target branch to `development` instead of default `main`
target-branch: "development"
assignees:
- "BramDevlaminck"
- "Jonathan-Vanbrabant"
- "SELab-2/osoc-team2"
commit-message:
prefix: "npm-frontend"
include: "scope"
Expand All @@ -61,8 +59,7 @@ updates:
# Set the target branch to `development` instead of default `main`
target-branch: "development"
assignees:
- "BramDevlaminck"
- "Jonathan-Vanbrabant"
- "SELab-2/osoc-team2"
commit-message:
prefix: "npm-backend"
include: "scope"
Expand All @@ -83,8 +80,7 @@ updates:
# Set the target branch to `development` instead of default `main`
target-branch: "development"
assignees:
- "BramDevlaminck"
- "Jonathan-Vanbrabant"
- "SELab-2/osoc-team2"
commit-message:
prefix: "docker-backend"
include: "scope"
Expand All @@ -105,8 +101,7 @@ updates:
# Set the target branch to `development` instead of default `main`
target-branch: "development"
assignees:
- "BramDevlaminck"
- "Jonathan-Vanbrabant"
- "SELab-2/osoc-team2"
commit-message:
prefix: "docker-database"
include: "scope"
Expand All @@ -127,8 +122,7 @@ updates:
# Set the target branch to `development` instead of default `main`
target-branch: "development"
assignees:
- "BramDevlaminck"
- "Jonathan-Vanbrabant"
- "SELab-2/osoc-team2"
commit-message:
prefix: "docker-frontend"
include: "scope"
Expand All @@ -150,12 +144,9 @@ updates:
# Set the target branch to `development` instead of default `main`
target-branch: "development"
assignees:
- "BramDevlaminck"
- "Jonathan-Vanbrabant"
- "HuanYu-Tan"
- "SELab-2/osoc-team2"
commit-message:
prefix: "github-actions"
include: "scope"
labels:
- "CI/CD"

15 changes: 6 additions & 9 deletions .github/workflows/backendCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,17 @@

name: BackendCI
on:
# Run on every open pull request
# Run on every open pull request, default types are [opened, edited, reopened]
pull_request:
types: [opened, edited, reopened, synchronize]

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

jobs:
ci:
runs-on: self-hosted
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
services:
postgres: # this is for the integration testing of the orm functions
image: postgres:14.2
Expand All @@ -40,21 +36,22 @@ jobs:
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 ${{ matrix.node-version }}
- name: Use Node.js 17.x
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
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 migrate dev --name postgres-init
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:
working-directory: backend
skip-step: install
annotations: failed-tests
16 changes: 5 additions & 11 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,21 @@
name: ESLint

on:
# Run on every open pull request
# Run on every open pull request, default types are [opened, edited, reopened]
pull_request:
types: [opened, edited, reopened, synchronize]

# Should run on every push to main
push:
branches: [main]

jobs:
ci:
runs-on: self-hosted

strategy:
matrix:
node-version: [16.x]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js 17.x
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: 17.x
- run: npm install
- run: eslint . --ext .js,.jsx,.ts,.tsx
- run: npm run eslint
15 changes: 4 additions & 11 deletions .github/workflows/frontendCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,22 @@
name: FrontendCI

on:
# Run on every open pull request
# Run on every open pull request, default types are [opened, edited, reopened]
pull_request:
types: [opened, edited, reopened, synchronize]

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

jobs:
ci:

runs-on: self-hosted

strategy:
matrix:
node-version: [16.x]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js 17.x
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: 17.x

- run: npm install
working-directory: frontend
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,12 @@ backend/.idea
.env
frontend/.env.development
frontend/.env.production
backend/prisma/.env
backend/.env.development
backend/.env.production
# just in case a file get's copy pasted without the . in the beginning (discord removes this)
frontend/env.development
frontend/env.production
backend/prisma/env
backend/env.development
backend/env.production
10 changes: 0 additions & 10 deletions .lintstagedrc.js

This file was deleted.

3 changes: 0 additions & 3 deletions backend/.gitignore

This file was deleted.

4 changes: 2 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:17.8.0
FROM node:18.0.0

# Create app directory
WORKDIR /app
Expand All @@ -22,4 +22,4 @@ RUN npx prisma generate

EXPOSE 4096

CMD ["nodemon", "--legacy-watch", "index.ts"]
CMD ["npm", "run", "prod"]
58 changes: 54 additions & 4 deletions backend/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,76 @@
},
"nonExistent": {
"http": 404,
"reason": "The endpoint requested ($url) does not exist."
"reason": "The endpoint requested (~url) does not exist."
},
"invalidVerb": {
"http": 405,
"reason": "This HTTP verb ($verb) is not supported for this endpoint ($url)"
"reason": "This HTTP verb (~verb) is not supported for this endpoint (~url)"
},
"nonJSONRequest": {
"http": 406,
"reason": "All endpoints only support JSON ($mime requested)."
"reason": "All endpoints only support JSON (~mime requested)."
},
"serverError": {
"http": 500,
"reason": "Something went wrong while trying to execute your request."
},
"noDataError": {
"http": 412,
"reason": "The data you requested does not exist (yet)."
},
"lockedRequest": {
"http": 423,
"reason": "Your account was deactivated. Please contact the webmaster."
},
"pendingAccount": {
"http": 424,
"reason": "Your account hasn't been activated yet. Please try again later."
},
"github": {
"argumentMissing": {
"http": 409,
"reason": "Something went wrong while authenticating with GitHub."
},
"illegalState": {
"http": 409,
"reason": "GitHub authentication endpoints are meant for GitHub authentication only. Thank you very much."
},
"other": {
"reason": "GitHub data requests failed. Please try again later."
}
},
"reset": {
"sendEmail": {
"http": 503,
"reason": "Failed to send the email. If you're certain that your email address is correct, then please contact the admin."
},
"invalidEmail": {
"http": 400,
"reason": "No such email is present. Please check your email."
},
"generateFailed": {
"http": 500,
"reason": "Failed to generate a reset key. Please try again later."
},
"resetFailed": {
"http": 400,
"reason": "Failed to update your password. Perhaps you used an invalid key?"
}
}
},

"global": {
"homes": [
"", "/api-osoc"
],
"preferred": "/api-osoc"
"preferred": "/api-osoc",
"authScheme": "auth/osoc2",
"defaultUserId": 3
},

"email": {
"from": "'OSOC2 Account Recovery' <[email protected]>",
"header": "OSOC2 Recovery Code"
}
}
4 changes: 2 additions & 2 deletions backend/docs/assets/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion backend/docs/assets/search.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions backend/docs/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -766,12 +766,13 @@ footer .tsd-legend {

.tsd-flag {
display: inline-block;
padding: 1px 5px;
padding: 0.25em 0.4em;
border-radius: 4px;
color: var(--color-comment-tag-text);
background-color: var(--color-comment-tag);
text-indent: 0;
font-size: 14px;
font-size: 75%;
line-height: 1;
font-weight: normal;
}

Expand Down
Loading

1 comment on commit f4df4ea

@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 59.81% 963/1610
🔴 Branches 18.63% 125/671
🟡 Functions 73.88% 345/467
🔴 Lines 59.61% 943/1582

Test suite run success

353 tests passing in 40 suites.

Report generated by 🧪jest coverage report action from f4df4ea

Please sign in to comment.