Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Learn Renku
Teaching on Renku
Advanced teaching automation
Commits
9c6f8037
Commit
9c6f8037
authored
Mar 14, 2022
by
Cyril Matthey-Doret
Browse files
add visibility in collect_forks response
parent
61df3849
Pipeline
#328137
passed with stage
in 2 minutes and 25 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
9c6f8037
...
...
@@ -40,7 +40,7 @@ One way to achieve this is to have the teacher create all private student groups
script:
[
teach_utils/moodle_to_student_groups.py
](
teach_utils/moodle_to_student_groups.py
)
usage:
`python moo
t
le_to_student_groups.py] students_moodle.csv`
usage:
`python moo
d
le_to_student_groups.py] students_moodle.csv`
### Gathering all forks of a project
...
...
teach_utils/collect_forks.py
View file @
9c6f8037
...
...
@@ -77,10 +77,15 @@ def get_last_commit_hash(
# Commits are sorted in reverse chronological order by default
# Assumes we're in UTC
utc
=
pytz
.
UTC
loc_deadline
=
utc
.
localize
(
datetime
.
fromisoformat
(
deadline
))
if
deadline
is
None
:
before_deadline
=
True
else
:
loc_deadline
=
utc
.
localize
(
datetime
.
fromisoformat
(
deadline
))
for
commit
in
commits
:
commit_date
=
datetime
.
fromisoformat
(
commit
[
"authored_date"
])
if
(
deadline
is
None
)
or
(
commit_date
<=
loc_deadline
):
if
deadline
is
not
None
:
commit_date
=
datetime
.
fromisoformat
(
commit
[
"authored_date"
])
before_deadline
=
commit_date
<=
loc_deadline
if
before_deadline
:
return
commit
[
"id"
]
return
None
...
...
@@ -90,10 +95,11 @@ def format_fork_metadata(
)
->
Dict
:
"""Format and add fields to a fork's metadata. The
resulting metadata will have the following fields:
id, http_url_to_repo, autostart_url, commit, members, group"""
id, http_url_to_repo, autostart_url, commit, members,
visibility,
group"""
meta
=
{
"id"
:
fork
[
"id"
],
"url"
:
fork
[
"http_url_to_repo"
],
"visibility"
:
fork
[
"visibility"
],
"group"
:
fork
[
"namespace"
][
"full_path"
],
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment