Lab system and other scripts for grading and course administration (Canvas and GitLab integration). Currently used by the CSE department at Chalmers and GU for several courses, including data structures and algorithms.
0
stars
0
forks
source link
Error creating projects when multiple students have the same name #20
GitLab doesn't allow two projects with different path to have the same name. In an individual lab, the name of each student project consists of the student's name. Therefore, when two students have the same name, project creation will fail for the second student.
Note that the lab system doesn't otherwise use the project names. They are purely for display.
The error is:
File "/home/lp1-data-structures/lab-system/group_project.py", line 754, in create
project = self.lab.official_project.get.forks.create({
File "/home/lp1-data-structures/.local/lib/python3.9/site-packages/gitlab/v4/objects/projects.py", line 1068, in create
return cast(ProjectFork, CreateMixin.create(self, data, path=path, **kwargs))
File "/home/lp1-data-structures/.local/lib/python3.9/site-packages/gitlab/exceptions.py", line 313, in wrapped_f
raise error(e.error_message, e.response_code, e.response_body) from e
gitlab.exceptions.GitlabCreateError: 409: ['Project namespace name has already been taken', 'Name has already been taken']
GitLab doesn't allow two projects with different path to have the same name. In an individual lab, the name of each student project consists of the student's name. Therefore, when two students have the same name, project creation will fail for the second student.
Note that the lab system doesn't otherwise use the project names. They are purely for display.
The error is:
The relevant log data:
Possible workaround: catch this exception (with matching error message) in
group_project.py
and retry with2
,3
, etc. appended to the name.EDIT: redacted student name and CID.