Skip to content

Commit

Permalink
Deployment (#326)
Browse files Browse the repository at this point in the history
* test: cleanup type test structure

* test: student type

* test: teacher type

* test: user test]

* test: course type

* test: faculty type

* test: group type

* test: project type

* test: response type

* test: structureCheck type

* test: submissionStatus type

* test: submission type

* Cleanups (#307)

* chore: better namings

* chore: fix create user services

* chore: better file names

* fix: Project imports

* fix: linting errors

* feat: make course cards clickable (#303)

* Run extra checks (#309)

* chore: celery #206

* chore: Support partial update for project

* chore: support patch for project 2

* refactor!: rework checks and submissions

* chore: template run checks

* chore: for now set state to success

* chore: exclude 'polymorphic_ctype'

* chore: redirect from dashboard, prevent authentication error

* chore: login page styling fix

* feat: endpoint for eagerly fetching all projects for students/teachers/assistants

* chore: linting

* fix: tests

* Run actions on GitHub servers (#314)

* build: use github action runners

* build: should fix backend linting

* build: flake8 with poetry

* build: execute poetry commands in backend folder

* build: only run actions for dev or main

* chore: try making fixtures and load them

* chore: make fixtures a extra arg to development.sh

* chore: fix loading isues

* chore: fix loading isues with sleep

* chore: improved loading by redirecting output to dev null

* fixed sleep

* chore: commit to make me able to restore in case of errors

* chore: added create fixture script

* chore: fixed fixtures

* chore: complete merge

* chore: fixed some concerns of vincent

* chore: re added enviroment line to development.yml backend container otherwise i always got small

* chore: made fixtures that work (some extra need to be made for submissions)

* chore: use sed

* chore: change data option functionality

* chore: add seeder support

* docs: Added comments

* chore: remove old seeder file

* chore: start

* Revert "chore: start"

This reverts commit 484c68d.

* chore: remove env variables

* chore: add fixturew

* chore: fixed small errors and updated frontend tests

* Run extra checks (#312)

* chore: celery #206

* chore: support patch for project 2

* refactor!: rework checks and submissions

* chore: move is_valid to submission

* chore: hook structure checks

* chore: merge migrations

* Run extra checks (#320)

* chore: celery #206

* chore: support patch for project 2

* refactor!: rework checks and submissions

* chore: move is_valid to submission

* chore: hook structure checks

* chore: new fixtures

* chore: linting

---------

Co-authored-by: EwoutV <[email protected]>

* Single course view (#315)

* chore: start update course view + based on roles

* chore: clone button + skip project creation dialog if only one course

* chore: init cloning course

* chore: clone logic

* chore: link faculty to cloned course

* chore: make assistant + tooltip component

* chore: assistants + teacher display on course

* chore: init course users search

* chore: start user pagination

* chore: filter teachers

* chore: working teacher filtering

* chore: include assistants + join button

* fix: no course selection on detail view

* chore: add/remove teacher/assitant course

* chore: update course state when adding/removing assistant/teacher

* chore: display add/remove possibility depending on role

* fix: loading state when searching

* chore: leave button on course for student

* fix: dialog for editting users

* fix: permission search

* fix: backend permission + linting

* Run extra checks (#309)

* chore: celery #206

* chore: Support partial update for project

* chore: support patch for project 2

* refactor!: rework checks and submissions

* chore: template run checks

* chore: for now set state to success

* chore: exclude 'polymorphic_ctype'

* fix: print

* fix: backend tests

* fix: fixes pr

* fix: remove roles from backend search

* fix: backend permission

* chore: updated project list props

* chore: linting

---------

Co-authored-by: francis <[email protected]>
Co-authored-by: Vincent Vallaeys <[email protected]>
Co-authored-by: EwoutV <[email protected]>

* Seeder improvements (#324)

* fix: filling database

* fix: seeding

* chore: replace fixtures

* chore: redirect errors to dev/null

* build(deps): bump gunicorn from 21.2.0 to 22.0.0 in /backend (#325)

Bumps [gunicorn](https://github.com/benoitc/gunicorn) from 21.2.0 to 22.0.0.
- [Release notes](https://github.com/benoitc/gunicorn/releases)
- [Commits](benoitc/gunicorn@21.2.0...22.0.0)

---
updated-dependencies:
- dependency-name: gunicorn
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Admin panel (#321)

* chore: add user service file #198

* chore: add user service file content #198

* chore: add endpoint for users in endpoint file #198

* chore: add admin header #198

* chore: add admin side bar #198

* chore: add admin layout #198

* chore: make base and admin directories to differentiate #198

* chore: update router.ts #198

* chore: add AdminView #198

* chore: add UsersView and update router #198

* chore: backend update for pagination + filtering of users #198

* chore: add import user_view #198

* chore: user filter #198

* chore: make all Role possibilities available as a list #198

* chore: blankUser function #198

* chore: update paginate and filter for UsersView #198

* chore: package-lock #198

* chore: update filters and pagination callbacks #198

* chore: english translations #198

* chore: dutch translations admin page #198

* chore: role updating remotely works properly #198

* chore: add beginning of admin patch endpoint #198

* chore: url update #198

* chore: removal of roles + creation activates again if already existing #198

* chore: remove unnecessary sidebar options #198

* chore: admin status can be switched on and off #198

* chore: add admin side bar #198

* chore: add admin layout #198

* chore: user filter #198

* chore: update paginate and filter for UsersView #198

* chore: update filters and pagination callbacks #198

* chore: filter for roles in admin panel #198

* chore: remove unnecessary sidebar options #198

* chore: remove debug prints + fix rebase mistake #198

* chore: remove debug prints + lint fixing #198

* chore: adjust search translations #198

* chore: lint fix #198

* chore: handler update to fix tests (tests failing wasn't my fault) #198

* chore: lint fixes test files I previously altered #198

* chore: revert overwrite of creation of roles in backend #198

* Project editor (#319)

* feat: endpoint for eagerly fetching all projects for students/teachers/assistants

* feat: editor for course description and editor, better project overview list

* chore: improved project progressbar, linting

* improvement: skeleton loaders for project list

* chore: better display of HTML description

---------

Co-authored-by: francis <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: francis <[email protected]>
Co-authored-by: Francis Vauterin <[email protected]>
Co-authored-by: Vincent Vallaeys <[email protected]>
Co-authored-by: tyboro2002 <[email protected]>
Co-authored-by: Tybo Verslype <[email protected]>
Co-authored-by: Bram Meir <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Brent Silkyn <[email protected]>
  • Loading branch information
9 people authored Apr 18, 2024
1 parent b2120e1 commit d64bbe8
Show file tree
Hide file tree
Showing 165 changed files with 4,390 additions and 2,126 deletions.
14 changes: 7 additions & 7 deletions .dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ REDIS_IP=192.168.90.10
REDIS_PORT=6379

# Django
DJANGO_SECRET_KEY="" # Set to a random string
DJANGO_DEBUG=True # Django debug mode
DJANGO_DOMAIN_NAME=localhost # Domain name for the Django server
DJANGO_CAS_URL_PREFIX="" # URL prefix for the CAS server. Should be empty for development
DJANGO_CAS_PORT=8080 # Port for the CAS server. Should be 8080 if DJANGO_DOMAIN_NAME is localhost
DJANGO_DB_ENGINE=django.db.backends.sqlite3 # Database engine
DJANGO_REDIS_HOST=${REDIS_IP} # Redis configuration
DJANGO_SECRET_KEY=""
DJANGO_DEBUG=True
DJANGO_DOMAIN_NAME=localhost
DJANGO_CAS_URL_PREFIX=""
DJANGO_CAS_PORT=8080
DJANGO_DB_ENGINE="django.db.backends.sqlite3"
DJANGO_REDIS_HOST=${REDIS_IP}
DJANGO_REDIS_PORT=${REDIS_PORT}
9 changes: 4 additions & 5 deletions .github/workflows/backend-linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@ on:

jobs:
test:
runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- name: Add permission to remove contents of previous action script
run: echo ${{ secrets.SUDO }} | sudo -S chown -R $USER:$USER /home/selab2/actions-runner/_work/UGent-7/
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
cd backend
python -m pip install --upgrade pip
pip install poetry
poetry install --directory=./backend
poetry install
- name: Execute linting checks
run: flake8 --config ./backend/.flake8 ./backend
run: cd backend; poetry run flake8 --config .flake8
6 changes: 2 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ on:

jobs:
test:
runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- name: Add permission to remove contents of previous action script
run: echo ${{ secrets.SUDO }} | sudo -S chown -R $USER:$USER /home/selab2/actions-runner/_work/UGent-7/
- uses: actions/checkout@v4
- name: Run tests
run: echo ${{ secrets.SUDO }} | sudo -S ./test.sh -c
run: ./test.sh -c
16 changes: 8 additions & 8 deletions .prod.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ POSTGRES_IP=192.168.90.9
POSTGRES_PORT=5432
POSTGRES_DB=selab
POSTGRES_USER=selab_user
POSTGRES_PASSWORD="" # Set to desired password
POSTGRES_PASSWORD=""

# Redis
REDIS_IP=192.168.90.10
REDIS_PORT=6379

# Django
DJANGO_SECRET_KEY="" # Set to a random string
DJANGO_DEBUG=False # Django debug mode
DJANGO_DOMAIN_NAME="" # Domain name for the Django server
DJANGO_CAS_URL_PREFIX="" # URL prefix for the CAS server
DJANGO_CAS_PORT="" # Port for the CAS server
DJANGO_DB_ENGINE=django.db.backends.postgresql # Database engine configuration
DJANGO_SECRET_KEY=""
DJANGO_DEBUG=False
DJANGO_DOMAIN_NAME=""
DJANGO_CAS_URL_PREFIX=""
DJANGO_CAS_PORT=""
DJANGO_DB_ENGINE=django.db.backends.postgresql
DJANGO_DB_NAME=${POSTGRES_DB}
DJANGO_DB_USER=${POSTGRES_USER}
DJANGO_DB_PASSWORD=${POSTGRES_PASSWORD}
DJANGO_DB_HOST=${POSTGRES_IP}
DJANGO_DB_PORT=${POSTGRES_PORT}
DJANGO_REDIS_HOST=${REDIS_IP} # Redis configuration
DJANGO_REDIS_HOST=${REDIS_IP}
DJANGO_REDIS_PORT=${REDIS_PORT}
10 changes: 0 additions & 10 deletions backend/api/fixtures/assistants.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions backend/api/fixtures/checks.yaml

This file was deleted.

87 changes: 0 additions & 87 deletions backend/api/fixtures/courses.yaml

This file was deleted.

46 changes: 0 additions & 46 deletions backend/api/fixtures/groups.yaml

This file was deleted.

1 change: 1 addition & 0 deletions backend/api/fixtures/large/large.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions backend/api/fixtures/medium/medium.json

Large diffs are not rendered by default.

37 changes: 0 additions & 37 deletions backend/api/fixtures/projects.yaml

This file was deleted.

1 change: 1 addition & 0 deletions backend/api/fixtures/small/small.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"model": "api.dockerimage", "pk": 1, "fields": {"name": "far.gif", "file": "/population/huge/other/identify", "owner": "15", "public": true}}, {"model": "api.dockerimage", "pk": 2, "fields": {"name": "heart.gif", "file": "/treat/enjoy", "owner": "4", "public": true}}, {"model": "api.dockerimage", "pk": 3, "fields": {"name": "price.tiff", "file": "/thus/teacher/heart", "owner": "15", "public": true}}, {"model": "api.dockerimage", "pk": 4, "fields": {"name": "strategy.jpg", "file": "/always/a/born/wonder/yes", "owner": "12", "public": true}}, {"model": "api.dockerimage", "pk": 5, "fields": {"name": "religious.bmp", "file": "/every/great/whom", "owner": "10", "public": true}}, {"model": "api.fileextension", "pk": 1, "fields": {"extension": "bmp"}}, {"model": "api.fileextension", "pk": 2, "fields": {"extension": "gif"}}, {"model": "api.fileextension", "pk": 3, "fields": {"extension": "xls"}}, {"model": "api.fileextension", "pk": 4, "fields": {"extension": "mp4"}}, {"model": "api.fileextension", "pk": 5, "fields": {"extension": "wav"}}, {"model": "api.course", "pk": 1, "fields": {"name": "Stand-alone incremental function", "academic_startyear": 2024, "description": "Perform draw exactly they. Learn fact find read lay include.", "faculty": "Ingenieurswetenschappen_Architectuur", "parent_course": null}}, {"model": "api.course", "pk": 2, "fields": {"name": "Universal client-driven architecture", "academic_startyear": 2025, "description": "Peace sound shake ever current give.", "faculty": "Letteren_Wijsbegeerte", "parent_course": null}}, {"model": "api.course", "pk": 3, "fields": {"name": "Adaptive system-worthy instruction set", "academic_startyear": 2023, "description": "Wait specific new consider. Get natural early step their third there. A resource green follow mother.", "faculty": "Bio-ingenieurswetenschappen", "parent_course": null}}, {"model": "api.project", "pk": 1, "fields": {"name": "Organized grid-enabled analyzer", "description": "Process leave character improve almost something western. Character cut remain energy prepare political.", "visible": true, "archived": false, "locked_groups": false, "start_date": "2024-03-12T21:31:28.243Z", "deadline": "2024-05-22T21:31:28.243Z", "max_score": 72, "score_visible": false, "group_size": 15, "course": 1}}, {"model": "api.project", "pk": 2, "fields": {"name": "Front-line system-worthy database", "description": "Every stand memory machine culture expect reduce record. Actually because happy again admit. Serious feel property accept century up.", "visible": true, "archived": false, "locked_groups": true, "start_date": "2024-01-18T21:31:28.243Z", "deadline": "2024-06-22T21:31:28.243Z", "max_score": 47, "score_visible": true, "group_size": 9, "course": 3}}, {"model": "api.project", "pk": 3, "fields": {"name": "Integrated encompassing utilization", "description": "Area detail ahead win. Civil according she peace something front that lot. None food none structure want will.", "visible": true, "archived": false, "locked_groups": false, "start_date": "2024-01-19T21:31:28.243Z", "deadline": "2024-07-06T21:31:28.243Z", "max_score": 75, "score_visible": true, "group_size": 3, "course": 1}}, {"model": "api.project", "pk": 4, "fields": {"name": "De-engineered interactive info-mediaries", "description": "Central pull boy address feel recognize eat. Couple radio glass special free. Ago present air doctor husband worker beat attention. Like fight data lose south same summer population.", "visible": true, "archived": false, "locked_groups": false, "start_date": "2024-05-25T21:31:28.243Z", "deadline": "2024-06-22T21:31:28.243Z", "max_score": 50, "score_visible": false, "group_size": 13, "course": 2}}, {"model": "api.structurecheck", "pk": 0, "fields": {"name": "/go/hear/believe/role/alone/determine", "project": 3, "obligated_extensions": [2, 3, 4], "blocked_extensions": [4]}}, {"model": "api.structurecheck", "pk": 1, "fields": {"name": "/enough/model/station", "project": 3, "obligated_extensions": [3], "blocked_extensions": [2, 3, 5]}}, {"model": "api.extracheck", "pk": 1, "fields": {"project": 4, "docker_image": 1, "file": "/concern/energy/trouble/kitchen/suggest", "timeout": 276, "show_log": true}}, {"model": "api.student", "pk": "0", "fields": {"is_active": true, "student_id": "0", "courses": [1]}}, {"model": "api.student", "pk": "1", "fields": {"is_active": true, "student_id": "1", "courses": [1]}}, {"model": "api.student", "pk": "2", "fields": {"is_active": true, "student_id": "2", "courses": [1]}}, {"model": "api.student", "pk": "3", "fields": {"is_active": true, "student_id": "3", "courses": [1]}}, {"model": "api.student", "pk": "4", "fields": {"is_active": true, "student_id": "4", "courses": [1]}}, {"model": "api.student", "pk": "5", "fields": {"is_active": true, "student_id": "5", "courses": [1]}}, {"model": "api.student", "pk": "6", "fields": {"is_active": true, "student_id": "6", "courses": [1]}}, {"model": "api.student", "pk": "7", "fields": {"is_active": true, "student_id": "7", "courses": [1]}}, {"model": "api.student", "pk": "8", "fields": {"is_active": true, "student_id": "8", "courses": [1]}}, {"model": "api.student", "pk": "9", "fields": {"is_active": true, "student_id": "9", "courses": [1]}}, {"model": "api.group", "pk": 1, "fields": {"project": 3, "score": 50.0, "students": []}}, {"model": "api.group", "pk": 2, "fields": {"project": 1, "score": 8.0, "students": ["0", "1", "4", "5"]}}, {"model": "api.group", "pk": 3, "fields": {"project": 1, "score": 7.0, "students": ["2", "3", "6", "7"]}}, {"model": "api.group", "pk": 4, "fields": {"project": 2, "score": 5.0, "students": []}}, {"model": "api.group", "pk": 5, "fields": {"project": 3, "score": 18.0, "students": []}}, {"model": "api.group", "pk": 6, "fields": {"project": 1, "score": 66.0, "students": []}}, {"model": "api.group", "pk": 7, "fields": {"project": 1, "score": 34.0, "students": ["8", "9"]}}, {"model": "api.submission", "pk": 1, "fields": {"group": 1, "submission_number": null, "submission_time": "2024-04-03T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 2, "fields": {"group": 5, "submission_number": null, "submission_time": "2024-04-06T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 3, "fields": {"group": 6, "submission_number": null, "submission_time": "2024-04-15T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 4, "fields": {"group": 1, "submission_number": null, "submission_time": "2024-04-11T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 5, "fields": {"group": 7, "submission_number": null, "submission_time": "2024-04-09T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 6, "fields": {"group": 6, "submission_number": null, "submission_time": "2024-04-07T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 7, "fields": {"group": 3, "submission_number": null, "submission_time": "2024-04-12T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 8, "fields": {"group": 4, "submission_number": null, "submission_time": "2024-04-05T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 9, "fields": {"group": 5, "submission_number": null, "submission_time": "2024-04-09T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 10, "fields": {"group": 6, "submission_number": null, "submission_time": "2024-04-04T00:00:00Z", "is_valid": true}}, {"model": "api.submissionfile", "pk": 1, "fields": {"submission": 10, "file": "/unit/political/training/control.jpg"}}, {"model": "api.checkresult", "pk": 289528, "fields": {"polymorphic_ctype": null, "submission": 9, "result": "FAILED", "error_message": "OBLIGATED_EXTENSION_NOT_FOUND"}}, {"model": "api.checkresult", "pk": 331891, "fields": {"polymorphic_ctype": null, "submission": 4, "result": "QUEUED", "error_message": null}}, {"model": "api.checkresult", "pk": 482730, "fields": {"polymorphic_ctype": null, "submission": 2, "result": "RUNNING", "error_message": null}}, {"model": "api.checkresult", "pk": 753267, "fields": {"polymorphic_ctype": null, "submission": 1, "result": "SUCCESS", "error_message": null}}, {"model": "api.checkresult", "pk": 762341, "fields": {"polymorphic_ctype": null, "submission": 2, "result": "FAILED", "error_message": "BLOCKED_EXTENSION"}}, {"model": "api.checkresult", "pk": 879866, "fields": {"polymorphic_ctype": null, "submission": 4, "result": "RUNNING", "error_message": null}}, {"model": "api.checkresult", "pk": 899073, "fields": {"polymorphic_ctype": null, "submission": 9, "result": "SUCCESS", "error_message": null}}, {"model": "api.checkresult", "pk": 906214, "fields": {"polymorphic_ctype": null, "submission": 1, "result": "QUEUED", "error_message": null}}, {"model": "api.structurecheckresult", "pk": 289528, "fields": {"structure_check": 1}}, {"model": "api.structurecheckresult", "pk": 331891, "fields": {"structure_check": 0}}, {"model": "api.structurecheckresult", "pk": 482730, "fields": {"structure_check": 0}}, {"model": "api.structurecheckresult", "pk": 753267, "fields": {"structure_check": 0}}, {"model": "api.structurecheckresult", "pk": 762341, "fields": {"structure_check": 1}}, {"model": "api.structurecheckresult", "pk": 879866, "fields": {"structure_check": 1}}, {"model": "api.structurecheckresult", "pk": 899073, "fields": {"structure_check": 0}}, {"model": "api.structurecheckresult", "pk": 906214, "fields": {"structure_check": 1}}, {"model": "api.assistant", "pk": "10", "fields": {"is_active": true, "courses": [2]}}, {"model": "api.assistant", "pk": "11", "fields": {"is_active": true, "courses": [2]}}, {"model": "api.assistant", "pk": "12", "fields": {"is_active": true, "courses": [1]}}, {"model": "api.assistant", "pk": "13", "fields": {"is_active": true, "courses": [1]}}, {"model": "api.assistant", "pk": "14", "fields": {"is_active": true, "courses": [1]}}, {"model": "api.teacher", "pk": "15", "fields": {"is_active": true, "courses": [1]}}, {"model": "api.teacher", "pk": "16", "fields": {"is_active": true, "courses": [1]}}, {"model": "api.teacher", "pk": "17", "fields": {"is_active": true, "courses": [2]}}]
18 changes: 0 additions & 18 deletions backend/api/fixtures/students.yaml

This file was deleted.

35 changes: 0 additions & 35 deletions backend/api/fixtures/submissions.yaml

This file was deleted.

Loading

0 comments on commit d64bbe8

Please sign in to comment.