Skip to content

Commit c90db5d

Browse files
Merge pull request #311 from TU-Wien-dataLAB/release-0.9.1
Releases: 0.9.0, 0.9.1 & 0.9.2 - merge into `main`
2 parents c5a98c9 + 7cb7688 commit c90db5d

File tree

154 files changed

+5541
-1674
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+5541
-1674
lines changed

.github/workflows/action_main.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,33 @@ jobs:
3030
id: changeDirsStep
3131
uses: tj-actions/changed-files@v46
3232
with:
33-
dir_names: true
33+
dir_names: true # this only outputs directory names
3434
files: |
3535
**/*
3636
*
37+
38+
- name: Check if Dockerfile changed
39+
id: changeDockerfileStep
40+
uses: tj-actions/changed-files@v46
41+
with:
42+
files: Dockerfile
43+
44+
3745
- id: outputStep
38-
run: echo "::set-output name=changeDirs::${{ steps.changeDirsStep.outputs.all_changed_files }}"
46+
run: |
47+
{
48+
echo "changeDirs=${{ steps.changeDirsStep.outputs.all_changed_files }}";
49+
echo "changeDockerfile=${{ steps.changeDockerfileStep.outputs.any_changed }}"
50+
} >> "$GITHUB_OUTPUT"
3951
4052
# ON CHANGED FILES
4153
build_grader-service:
4254
uses: ./.github/workflows/build.yml
4355
needs: init
44-
if: contains(needs.init.outputs.changeDirs, 'grader_service') || contains(needs.init.outputs.changeDirs, '.github/workflows') || contains(needs.init.outputs.changeDirs, 'Dockerfile')
56+
if: |
57+
contains(needs.init.outputs.changeDirs, 'grader_service') ||
58+
contains(needs.init.outputs.changeDirs, '.github/workflows') ||
59+
needs.init.outputs.changeDockerfile == 'true'
4560
4661
dockerize_grader-service:
4762
needs: build_grader-service

.github/workflows/build.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@ permissions:
1717
jobs:
1818
build:
1919
runs-on: ubuntu-latest
20+
env:
21+
TESTCONTAINER_DOCKER_NETWORK: postgresql-testcontainers
22+
DOCKER_BUILDKIT: 1
2023
steps:
21-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v4
2225

2326
# BUILD
2427
- name: Set up Python
25-
uses: actions/setup-python@v3
28+
uses: actions/setup-python@v4
2629
with:
2730
python-version: '3.12'
2831
- name: Install dependencies
@@ -55,9 +58,15 @@ jobs:
5558
source venv/bin/activate
5659
pip install .
5760
pip install -r ./requirements-test.txt
61+
62+
- name: Create Docker network for running Testcontainers
63+
run: docker network create ${{ env.TESTCONTAINER_DOCKER_NETWORK }}
64+
5865
- name: Run tests
5966
run: |
6067
source venv/bin/activate
68+
git config --global user.name "Grader Test"
69+
git config --global user.email "[email protected]"
6170
pytest ./grader_service/tests
6271
6372
# Upload Artifacts
@@ -68,4 +77,4 @@ jobs:
6877
retention-days: 1
6978
path: |
7079
./dist
71-
!./dist/**/*.md
80+
!./dist/**/*.md

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# Edit at https://www.toptal.com/developers/gitignore?templates=python,node,vscode,pycharm,macos,windows,linux
44

55
jupyter_hub_config*.py
6-
grader_service*_config.py
76
grader_labextension/grader/grader_labextension/labextension/*
87
grader_labextension/grader/grader_labextension/labextension
98
grader_labextension/grader/grader_labextension/labextension/build_log.json
@@ -504,8 +503,6 @@ Chart.lock
504503
#Sqlite database
505504
*.db
506505
grader_labextension/grader/grader_labextension/labextension/build_log.json
507-
grader_service_config.py
508-
509506

510507
#OpenAPI
511508
grader_labextension/.openapi-generator

.gitlab-ci.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ To automatically add the groups for the grader service from the LTI authenticato
169169
if user_model is None:
170170
user_model = orm.User()
171171
user_model.name = user_name
172+
user_model.display_name = user_name
172173
db.add(user_model)
173174
db.commit()
174175

charts/grader-service-all-in-one/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.8.2
18+
version: 0.9.2
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "0.8.2"
24+
appVersion: "0.9.2"
2525

2626
dependencies:
2727
- name: jupyterhub
2828
version: 4.2.0
2929
repository: https://jupyterhub.github.io/helm-chart
3030
- name: grader-service
31-
version: 0.8.2
31+
version: 0.9.2
3232
repository: https://tu-wien-datalab.github.io/grader-service/

charts/grader-service-all-in-one/values.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ grader-service:
9797
groups: list[str] = authentication["groups"]
9898
9999
username = authentication["name"]
100-
user_model: User = session.query(User).get(username)
100+
user_model: User = session.query(User).filter(User.name == username).one_or_none()
101101
if user_model is None:
102102
user_model = User()
103103
user_model.name = username
@@ -122,21 +122,19 @@ grader-service:
122122
session.add(lecture)
123123
session.commit()
124124
125-
role = session.query(Role).filter(Role.username == username, Role.lectid == lecture.id).one_or_none()
125+
role = session.query(Role).filter(Role.user_id == user.id, Role.lectid == lecture.id).one_or_none()
126126
if role is None:
127127
log.info(f'No role for user {username} in lecture {lecture_code}... creating role')
128-
role = Role(username=username, lectid=lecture.id, role=scope)
128+
role = Role(user_id=user.id, lectid=lecture.id, role=scope)
129129
session.add(role)
130130
session.commit()
131131
else:
132-
log.info(f'Found role {role.role.name} for user {username} in lecture {lecture_code}... updating role to {scope.name}')
132+
log.info(f'Found role {role.role.name} for user {username} in lecture {lecture_code}... updating role to {scope.name}')
133133
role.role = scope
134134
session.commit()
135135
else:
136-
log.info("Found group that doesn't match schema. Ignoring " + group)
136+
log.info("Found group that doesn't match schema. Ignoring %s", group)
137137
138138
return authentication
139139
140140
c.Authenticator.post_auth_hook = post_auth_hook
141-
142-

charts/grader-service/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.8.2
18+
version: 0.9.2
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "0.8.2"
24+
appVersion: "0.9.2"

charts/grader-service/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
github_url = "https://github.com/TU-Wien-dataLAB/grader-service"
44

55
[tool.tbump.version]
6-
current = "0.8.2"
6+
current = "0.9.2"
77

88
# Example of a semver regexp.
99
# Make sure this matches current_version before

docs/source/_static/openapi/grader_api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ info:
44
description: The REST API for the grader service
55
license:
66
name: BSD-3-Clause
7-
version: '0.8.2'
7+
version: '0.9.2'
88
servers:
99
- url: /api
1010
description: relative path to mock

0 commit comments

Comments
 (0)