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
beanbean9339
left a comment
There was a problem hiding this comment.
Reviewed the PR across the implementation, configuration, tests, and documentation. The platform-specific behavior for GitHub, GitLab, and Codeberg looks consistent, and the updated validation tests provide good coverage for the platform-specific organization name rules. I also checked the API/platform helper changes and pagination-related test coverage and didn't find any issues that need to be addressed. Approving!
* Update documentation to reflect increased code platform options * ensure no private repos leak * Use platform-specific token auth in release fetch script * Move build-time helper functions to scripts utility * Make org name testing more robust based on platform differences * make build script requests more efficient and respectful * Include projects from subgroups, but exclude shared projects for GitLab consistent with the stated goal of the catalog and the way in which GitLab presents a group's projects
Pulled from Imageomics catalog [PR 134](Imageomics/catalog#134) cherry-pick commit: c5ce9487905f266448c33398025f678ea75ab825 * Update documentation to reflect increased code platform options * ensure no private repos leak * Use platform-specific token auth in release fetch script * Move build-time helper functions to scripts utility * Make org name testing more robust based on platform differences * make build script requests more efficient and respectful * Include projects from subgroups, but exclude shared projects for GitLab consistent with the stated goal of the catalog and the way in which GitLab presents a group's projects
* Set tests to run on 'dev' branch in workflow Pull from Imagomics catalog [PR 109](Imageomics/catalog#109) Excluded agent md updates from the original commits. dev will now be used before main (cherry picked from commit 9a4b28089fe1711521e0f736603d5de74b5f1a5f) * Allow for HF org with different name from code platform org Pull from Imageomics catalog [PR 110](Imageomics/catalog#110) Excluded agents md updates from the original commits. * Allow for HF org with different name from codebase platform * Add terminal rendered error message in case of missing/incorrect config keys at Vite start * Improve validation (cherry picked from commit: 2f1f18541e2e769f7ada5f45ee4dcb4beb42a314) * Modularize the codebase Pulled from Imageomics catalog [PR 115](Imageomics/catalog#115) Excluded agents md updates from the original commit. * Move type/platform-based repo fetching to dedicated api modules * Check releases are loaded before fetching code repos * Move rendering, URL management, and UI logic to external modules * Move tag lookup creation to tag-related utils file to reduce parameter passing internal variable only required for normalizing tags * Restructure repo to accommodate larger number of source files arrange by purpose * Update AGENTS repository layout description to reflect changes initial description updates generated with Gemini 3.1 Pro in a modularization discussion thread updated paths for test list * Add tests for new API fetch modules and URL management Tests constructed with aid of Gemini 3.1 Pro and Thinking Switch to jsdom testing strategy, copilot suggestion * Move HF default tag filtering to normalizeTag utility consolidates tag processing, creating single location for potential personalization of tags cherry-picked from commit: 76a1f4a16cdc1ba2e74d237d92e4ebc66c0b709c * Update packages to remove vulnerabilities Pulled from Imageomics catalog cherry-picked from commit: 939bfeb4f5b750fb74e9acfb08fa4c03673a3253 use named imports, error with jsyaml, standardize fs use * Update public/config.yaml add `ORGANIZATION_NAME` field in `public/config.yaml` and set value as "ABC-Center" Co-authored-by: Elizabeth Campolongo <38985481+egrace479@users.noreply.github.com> * Add Codeberg as a code platform option Pulled from Imageomics catalog [PR 121](Imageomics/catalog#121) cherry-pick commit: 8315b22a4ad8106b93473d3c5c748fdac0697c97 * Switch to local SVG use for code platform logo Codeberg logo is too complex for simple svg path definition * Check release not undefined for ribbon, as with stars and forks, there may not be a release * Generalize tests for code fetching to cycle platforms Add profile repo key, Codeberg uses .profile like GitHub has .github * Struct/platform keys Pulled from Imageomics catalog [PR 126](Imageomics/catalog#126) cherry-pick commit: 1a5e7bad2f362acdcaee06802ba7e541ff909354 * Consolidate platform-specific non-ui value fetches in dedicated file Reduces platform-specific edits required to token-handling in scripts * Remove duplicated key from return fallback defined at UI render * Revise data mapping test * Clarify demo (HF space) jargon Pulled from Imageomics catalog [PR 132](Imageomics/catalog#132) cherry-pick commit: 7fb4eff9172509f30056ce0c8076560bb9a02a96 * Update terminology to be more general (use 'demos' instead of 'spaces') * Update documentation where relevant to match * removed contribution file & agent file, preserved ABC customization while changing "space" to "demo" * Add GitLab as a code repository platform option Pulled from Imageomics catalog [PR 134](Imageomics/catalog#134) cherry-pick commit: c5ce9487905f266448c33398025f678ea75ab825 * Update documentation to reflect increased code platform options * ensure no private repos leak * Use platform-specific token auth in release fetch script * Move build-time helper functions to scripts utility * Make org name testing more robust based on platform differences * make build script requests more efficient and respectful * Include projects from subgroups, but exclude shared projects for GitLab consistent with the stated goal of the catalog and the way in which GitLab presents a group's projects * Add number of results display near search bar Pulled from Imageomics catalog [PR 135](Imageomics/catalog#135) cherry-pick commit: 6933942875119ea87a1624cd80647032ceda30f0 * feat: display result count next to search bar, adjusts with all filters Co-authored-by: egrace479 <38985481+egrace479@users.noreply.github.com> * match formatting standard * Add polite screen-reader notice of result count --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: egrace479 <38985481+egrace479@users.noreply.github.com> * Use config platform name for logging process Pulled from Imageomics catalog [PR 139](Imageomics/catalog#139) cherry-pick commit: 51800ecaa94cd7698b57b6e5f6d0f1629581b219 Hugging Face fetch is hard-coded as 'HF', and pulling from display is incompatible with the SVG use in a Node environment * Apply batched suggestions from code review Co-authored-by: Elizabeth Campolongo <38985481+egrace479@users.noreply.github.com> --------- Co-authored-by: Elizabeth Campolongo <38985481+egrace479@users.noreply.github.com> Co-authored-by: egrace479 <e.campolongo479@gmail.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
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.