I did a review of the repository attributes we used for Codeberg and GitLab:
| GitHub (Attribute) |
Codeberg |
GitLab |
name |
✅ |
✅ |
full_name |
✅ |
name_with_namespace |
fork |
✅ |
❌ (No clear indicator) |
forks_count |
✅ |
✅ |
created_at |
✅ |
✅ |
updated_at |
✅ |
✅ |
topics |
✅ |
✅ |
archived |
✅ |
✅ |
description |
✅ |
✅ |
html_url |
✅ |
web_url |
stargazers_count |
stars_count |
star_count |
Codeberg repo attributes and GitLab project attributes.
We can then do stars: repo.stargazers_count || repo.stars_count || repo.star_count and similar in other locations where the attributes differ. It looks like we could potentially check forked_from_project for GitLab (I think it would be existence of this key indicating it's a fork).
Key distinctions in API calls:
Discussed with @thompsonmj, and it seems simplest for an end-user to have a single PLATFORM key in the config file, then define the URLs based on the designated platform ('github', 'codeberg', or 'gitlab'). We'd set 'github' as the default. The URL definitions are needed in main.js and the two scripts (export-tags.js and fetch-releases.js, which would need some other platform-specific modifications). Then index.html needs the platform for the Ribbon: title and SVG vector path definition. This would also avoid concerns about trailing slashes because we will be constructing URLs.
I did a review of the repository attributes we used for Codeberg and GitLab:
namefull_namename_with_namespaceforkforks_countcreated_atupdated_attopicsarchiveddescriptionhtml_urlweb_urlstargazers_countstars_countstar_countCodeberg repo attributes and GitLab project attributes.
We can then do
stars: repo.stargazers_count || repo.stars_count || repo.star_countand similar in other locations where the attributes differ. It looks like we could potentially checkforked_from_projectfor GitLab (I think it would be existence of this key indicating it's a fork).Key distinctions in API calls:
Discussed with @thompsonmj, and it seems simplest for an end-user to have a single
PLATFORMkey in the config file, then define the URLs based on the designated platform ('github', 'codeberg', or 'gitlab'). We'd set 'github' as the default. The URL definitions are needed inmain.jsand the two scripts (export-tags.jsandfetch-releases.js, which would need some other platform-specific modifications). Thenindex.htmlneeds the platform for the Ribbon: title and SVG vector path definition. This would also avoid concerns about trailing slashes because we will be constructing URLs.Footnotes
For GitLab, it emphasizes URL-encoded NAMESPACE/PROJECT_PATH or the project id can be used (this is relevant for the
ADDITIONAL_REPOSconfig; regular repo info fetch usesfull_name). ↩