---
title: "Repositories"
execute:
echo: false
warning: false
---
[](https://github.com/fs-ise/handbook/actions/workflows/update_repositories.yaml){target=_blank} [](https://github.com/organizations/fs-ise/repositories/new){target=_blank}
TODO: link to [new research repository](../research/repo_setup.html), [new teaching repository](...), etc. (showing pages explaining the use of templates instead of linking directly to new github repository)
::: callout-note
Labot checks are currently implemented for *active paper (research)* repositories only.
:::
::: self-service
To request access, click on the button next to the relevant repository.
To create a new repository, create an [issue](https://github.com/fs-ise/handbook/issues/new?assignees=geritwagner&labels=repo+creation&template=request-repository-creation.md&title=%5BRepository+Request%5D+Request+for+new+repository){target=_blank}.
:::
```{python}
import json
from pathlib import Path
# Adjust if this file lives elsewhere
data_path = Path("../assets/repos.json")
repos = json.loads(data_path.read_text(encoding="utf-8"))
def status_cell(repo, show_labot=False):
if repo.get("archived"):
status = '<span style="color: red;">🔒 Archived</span>'
elif repo.get("updated_recently", False):
status = '<span style="color: green;">🟢 Active</span>'
else:
status = '<span style="color: orange;">🟠 Inactive</span>'
if show_labot:
labot = repo.get("labot_workflow_status", "not-applicable")
if labot == "not-found":
status += " ❓"
elif labot not in ("success", "not-applicable"):
status += f' <a href="{repo["html_url"]}/actions/workflows/labot.yml" target="_blank">🚨</a>'
return status
def visibility_cell(repo):
if repo.get("visibility") == "Public":
return '<img src="https://img.shields.io/badge/Public-green" alt="Public">'
return ""
def collaborators_cell(repo):
collabs = repo.get("collaborators") or []
if not collabs:
return "None"
return ", ".join(
f'<a href="https://github.com/{c}" target="_blank">{c}</a>'
for c in collabs
)
def repo_link(repo, with_colrev_icon=False):
title = repo.get("title") or repo.get("name")
icon = ""
if with_colrev_icon and "colrev" in (repo.get("project_type") or []):
icon = " 📚"
return f'<a href="{repo["html_url"]}" target="_blank">{title}</a>{icon}'
def access_cell():
return (
'<a href="https://github.com/fs-ise/handbook/issues/new'
'?assignees=geritwagner&labels=access+request'
'&template=request-repo-access.md'
'&title=%5BAccess+Request%5D+Request+for+access+to+repository" target="_blank">'
'<img src="https://img.shields.io/badge/Request-Access-blue" alt="Request Access">'
'</a>'
)
def render_rows(filtered_repos,
show_labot=False,
require_active=None,
archived_only=None,
with_colrev_icon=False):
rows = []
for repo in filtered_repos:
if archived_only is True and not repo.get("archived"):
continue
if archived_only is False and repo.get("archived"):
continue
if require_active is True and not repo.get("updated_recently", False):
continue
if require_active is False and repo.get("updated_recently", False):
continue
rows.append(f"""<tr>
<td>{repo_link(repo, with_colrev_icon=with_colrev_icon)}</td>
<td>{status_cell(repo, show_labot=show_labot)}</td>
<td>{visibility_cell(repo)}</td>
<td>{collaborators_cell(repo)}</td>
<td>{access_cell()}</td>
</tr>""")
return "\\n".join(rows)
general_repos = [r for r in repos if r.get("area") not in ("research", "teaching")]
teaching_repos = [r for r in repos if r.get("area") == "teaching"]
research_repos = [r for r in repos if r.get("area") == "research"]
```
## General Repositories
```{python}
#| output: asis
html = f'''
<table>
<thead>
<tr>
<th style="width: 50%;">Repository</th>
<th style="width: 10%;">Status</th>
<th style="width: 10%;">Visibility</th>
<th style="width: 20%;">Collaborators</th>
<th style="width: 10%;">Access</th>
</tr>
</thead>
<tbody>
{render_rows(general_repos)}
</tbody>
</table>
'''
print(html)
```
## Teaching Repositories
```{python}
#| output: asis
html = f'''
<table>
<thead>
<tr>
<th style="width: 50%;">Repository</th>
<th style="width: 10%;">Status</th>
<th style="width: 10%;">Visibility</th>
<th style="width: 20%;">Collaborators</th>
<th style="width: 10%;">Access</th>
</tr>
</thead>
<tbody>
{render_rows(teaching_repos, show_labot=True)}
</tbody>
</table>
'''
print(html)
```
## Research Repositories
```{python}
#| output: asis
active_recent = render_rows(
research_repos,
show_labot=True,
archived_only=False,
require_active=True,
with_colrev_icon=True,
)
inactive = render_rows(
research_repos,
show_labot=False,
archived_only=False,
require_active=False,
with_colrev_icon=False,
)
archived = render_rows(
research_repos,
show_labot=False,
archived_only=True,
require_active=None,
with_colrev_icon=False,
)
html = f'''
<table>
<thead>
<tr>
<th style="width: 50%;">Repository</th>
<th style="width: 10%;">Status</th>
<th style="width: 10%;">Visibility</th>
<th style="width: 20%;">Collaborators</th>
<th style="width: 10%;">Access</th>
</tr>
</thead>
<tbody>
{active_recent}
{inactive}
{archived}
</tbody>
</table>
'''
print(html)
```