Add GitLab as a code repository platform option - #134
Conversation
There was a problem hiding this comment.
Pull request overview
Adds GitLab as a supported code repository platform option in this catalog template by expanding platform validation, platform-specific UI/ribbon metadata (including a GitLab SVG), and updating documentation/config guidance to reference GitHub/GitLab/Codeberg support.
Changes:
- Extend supported platform lists (tests + config validation) to include
gitlab. - Add GitLab platform mappings for ribbon display and platform value definitions (API URLs + repo key mappings).
- Update docs/config to document GitLab usage and include sample non-GitHub configs; adjust catalog stats fetching to recognize GitLab star fields and URL-encode owner/repo for GitLab API calls.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/api/fetchCodeRepos.test.js | Adds gitlab to the platform matrix test coverage. |
| src/validateConfig.js | Allows gitlab as a valid PLATFORM. |
| src/utils/defineRibbonVals.js | Adds GitLab ribbon display values and imports GitLab SVG. |
| src/utils/definePlatformVals.js | Adds GitLab key mappings and GitLab API URL definitions. |
| src/assets/gitlab-logo-700-rgb.svg | Adds GitLab SVG asset for the ribbon icon. |
| src/api/fetchStats.js | Adds GitLab-aware owner/repo encoding and supports GitLab star counts. |
| src/api/fetchCodeRepos.js | Updates JSDoc to reflect gitlab support. |
| scripts/fetch-releases.js | Updates comments for non-GitHub platform setup (plus a small typo fix suggested). |
| scripts/export-tags.js | Updates comments for non-GitHub platform setup (plus a small typo fix suggested). |
| README.md | Updates overview to mention GitLab/Codeberg support. |
| public/config.yaml | Documents gitlab as a supported platform and notes GitLab ADDITIONAL_REPOS encoding. |
| docs/personalization.md | Adds non-GitHub setup section and sample configs including GitLab; updates PLATFORM docs. |
| AGENTS.md | Updates agent-facing documentation to reflect multi-platform support. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.
Suppressed comments (3)
src/utils/definePlatformVals.js:26
path_with_namespaceis the right GitLab identity key, but org repo IDs are later interpolated unchanged into${REPO_API_URL}${id}/...inscripts/fetch-releases.js:61,68. GitLab requiresgroup/projectto be one URL-encoded project-ID segment, so release requests for every discovered org project use/projects/group/project/...and return 404. Keep this value unencoded as the catalog/release-map key, but encode it when constructing GitLab project API URLs.
fullNameKey: 'path_with_namespace',
src/utils/definePlatformVals.js:28
- This key is also used for release records in
scripts/fetch-releases.js:73, but GitLab release responses do not provideweb_url; their browser-facing release URL is under_links.self. Consequentlyreleases.jsonstores an undefined URL and rendered new-release badges link tonull. Use separate project and release URL accessors for GitLab.
urlKey: 'web_url',
src/validateConfig.js:44
- An unrecognized platform adds a descriptive error such as
PLATFORM must be one of..., soerrors.includes('PLATFORM')is false. Organization validation then falls through to the GitLab/Codeberg regex with an emptyvalidPlatform, potentially producing the malformed messageinvalid for API calls. Guard onvalidPlatformdirectly.
} else if (!errors.includes('PLATFORM')) {
Co-authored-by: egrace479 <38985481+egrace479@users.noreply.github.com>
GitLab uses last_activity_at; their updated_at is even more sensitive to group changes and decidedly not used
|
Releases for GitLab and Codeberg do also populate after build with the test configs. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 14 changed files in this pull request and generated no new comments.
Suppressed comments (4)
src/utils/definePlatformVals.js:27
- GitLab’s profile README project is named
.gitlab-profile. Usinggitlab-profilehere leaves the actual profile project in catalog results and incorrectly excludes an unrelated project with the unprefixed name. Please use the canonical dotted name.
profileRepo: 'gitlab-profile',
src/utils/definePlatformVals.js:32
urlKeyis also used byfetch-releases.jsto read the release link, but GitLab release responses do not have a top-levelweb_url; the browser link is in_links.self. As a result, recent GitLab releases produceurl: undefined, and the rendered release badge links toundefined. Separate the project URL mapping from the release URL extraction (for example, add a GitLab-specific release URL accessor for_links.selfand use it infetch-releases.js).
urlKey: 'web_url',
releasePublishedAtKey: 'released_at',
scripts/export-tags.js:50
- This removes the existing
GH_TOKENfallback, so local/tag-export runs that use the standard GitHub CLI environment variable silently become unauthenticated and can hit the much lower API rate limit. Preserve the fallback while adding platform-specific tokens.
token: process.env.GITHUB_TOKEN,
docs/personalization.md:94
- This setup guidance is now stale: both scripts added in this PR already select platform-specific tokens and authorization schemes, so users should not modify their header definitions. It also implies workflow token changes are needed only when hosting outside GitHub, although a GitHub-hosted catalog using GitLab/Codeberg must expose the corresponding token if authenticated requests are desired. Document the environment variables/workflow wiring instead of directing template users to edit source code.
The default code repository platform for this catalog is GitHub. If you wish to use another supported platform (Codeberg or GitLab), please note that the [tag export](../scripts/export-tags.js) and [fetch release](../scripts/fetch-releases.js) scripts require header definition modifications to function properly. Notes are provided at the relevant lines (under "Update this section as needed for non-GitHub code platforms"). Workflows would also require token and other platform-specific updates if running from a non-GitHub repository. Otherwise, this app is set up to be able to run from Codeberg or GitLab to fetch and display repositories from the respective platform.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated no new comments.
Suppressed comments (4)
src/utils/definePlatformVals.js:70
- GitLab's group-projects API defaults to excluding subgroup projects and including projects merely shared into the group. For a root organization this can therefore omit owned repositories and add repositories from other namespaces. Set
include_subgroups=trueandwith_shared=falseso the catalog represents the group's public project tree.
org: `https://gitlab.com/api/v4/groups/${organizationName}/projects?visibility=public&per_page=100`,
scripts/platformScriptHelpers.js:21
- GitLab's release
_links.selfpoints to the REST API resource rather than the browser release page, while the fallback is a relative URL containing an encoded project separator. As a result, release badges open JSON or a broken local URL. Construct the GitLab web URL explicitly and encode only the tag.
getReleaseUrl: (data, encodedRepoId) => data._links?.self || `${encodedRepoId}/-/releases/${data.tag_name}`, // GitLab response can be inconsistent, so we provide a fallback URL if _links.self is not present
scripts/fetch-releases.js:64
Promise.alldispatches one release request per repository without a concurrency limit. Large organizations can exceed platform secondary/concurrent request limits, after which non-OK responses are silently recorded asnull, so builds lose release badges. Keep the previous sequential behavior or use a small bounded worker pool.
const releaseEntries = await Promise.all(
repoIds.map(async (id) => {
tests/validateConfig.test.js:71
- These invalid values contain spaces, so they are rejected by every platform regex and do not verify the newly introduced underscore support. Add positive
abc_centercases for GitLab and Codeberg; otherwise reverting both to the GitHub regex would still leave these tests green.
const config = { ...VALID_CONFIG, PLATFORM: 'gitlab', ORGANIZATION_NAME: 'abc center' };
expect(validateConfig(config)).toContain('ORGANIZATION_NAME (abc center) is invalid for gitlab API calls, only letters, numbers, hyphens, and underscores are allowed');
fix GitLab release tag URL
consistent with the stated goal of the catalog and the way in which GitLab presents a group's projects
This PR adds GitLab as an option for the coding platform and updates the documentation accordingly. I also updated the scripts for use with Codeberg and GitLab (assuming environment tokens named for the platforms), though I don't have tokens to test the functionality, the un-authenticated builds did include releases. I included the platform-specific dummy configs I used for testing each platform in the personalization docs.
I used https://gitlab.com/gitlab-com for testing.

Closes #96.