Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code for student un-readable #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions gitlab/3_installKeysAndHooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,12 @@ def sync(access, organization, roster, assignment, student_readable=False):
print(">", "Students can already see", reponame)
else:
print(">", "Adding students permission to read", reponame)
repo.share(student_group.id, gitlab.REPORTER_ACCESS)
repo.share(student_group.id, gitlab.const.AccessLevel.REPORTER)
print(">", "Students can now read", reponame)
else:
if repo.path in [ projects.path for projects in student_group.projects.list(all=True) ]:
print("> Students can read the repo, removing their access")
repo.unshare(student_group.id)

if 'codegrade-key' not in [ key.title for key in repo.keys.list() ]:
print('>','Adding deploy key for', group['name'])
Expand Down Expand Up @@ -173,14 +177,14 @@ def main():
}
},
organization={
'codegrade-id': 3811,
'gitlab-group': 'geoscripting-2023-january',
'codegrade-id': 7816,
'gitlab-group': 'geoscripting-2024',
'subgroup-staff': 'staff',
'subgroup-students': 'students'
},
roster='webhooks.csv',
assignment={
'codegrade-id': 26394,
'codegrade-id': 116843,
'gitlab-name': 'Project_Starter',
'subgroup': 'project'
},
Expand Down