Skip to content

Add GitLab as a code repository platform option - #134

Merged
egrace479 merged 19 commits into
devfrom
feat/gitlab
Aug 14, 2026
Merged

Add GitLab as a code repository platform option#134
egrace479 merged 19 commits into
devfrom
feat/gitlab

Conversation

@egrace479

@egrace479 egrace479 commented Aug 11, 2026

Copy link
Copy Markdown
Member

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.
Screenshot of a Fake GitLab.com catalog, shows repos from the organization with a highlighted ribbon (tags, stars, and forks enumerated) linking to one of the GitLab repos used as the dummy catalog

Closes #96.

@egrace479
egrace479 requested a lite review from Copilot August 11, 2026 00:13
@egrace479 egrace479 added documentation Improvements or additions to documentation enhancement New feature or request javascript Pull requests that update javascript code labels Aug 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/api/fetchStats.js Outdated
Comment thread src/utils/definePlatformVals.js Outdated
Comment thread src/utils/definePlatformVals.js
Comment thread scripts/fetch-releases.js Outdated
Comment thread scripts/export-tags.js Outdated
Comment thread docs/personalization.md Outdated
Comment thread docs/personalization.md Outdated
Comment thread src/validateConfig.js Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_namespace is the right GitLab identity key, but org repo IDs are later interpolated unchanged into ${REPO_API_URL}${id}/... in scripts/fetch-releases.js:61,68. GitLab requires group/project to 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 provide web_url; their browser-facing release URL is under _links.self. Consequently releases.json stores an undefined URL and rendered new-release badges link to null. 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..., so errors.includes('PLATFORM') is false. Organization validation then falls through to the GitLab/Codeberg regex with an empty validPlatform, potentially producing the malformed message invalid for API calls. Guard on validPlatform directly.
    } else if (!errors.includes('PLATFORM')) {

Comment thread scripts/fetch-releases.js Outdated
Co-authored-by: egrace479 <38985481+egrace479@users.noreply.github.com>
@egrace479
egrace479 requested a balanced review from Copilot August 12, 2026 16:11
@egrace479
egrace479 requested a review from beanbean9339 August 12, 2026 16:48
@egrace479 egrace479 linked an issue Aug 12, 2026 that may be closed by this pull request
@egrace479

Copy link
Copy Markdown
Member Author

Releases for GitLab and Codeberg do also populate after build with the test configs.

@egrace479
egrace479 requested a balanced review from Copilot and removed request for Copilot August 12, 2026 17:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. Using gitlab-profile here 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

  • urlKey is also used by fetch-releases.js to read the release link, but GitLab release responses do not have a top-level web_url; the browser link is in _links.self. As a result, recent GitLab releases produce url: undefined, and the rendered release badge links to undefined. Separate the project URL mapping from the release URL extraction (for example, add a GitLab-specific release URL accessor for _links.self and use it in fetch-releases.js).
        urlKey: 'web_url',
        releasePublishedAtKey: 'released_at',

scripts/export-tags.js:50

  • This removes the existing GH_TOKEN fallback, 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=true and with_shared=false so 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.self points 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.all dispatches 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 as null, 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_center cases 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');

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Comment thread src/utils/definePlatformVals.js Outdated
consistent with the stated goal of the catalog and the way in which GitLab presents a group's projects

@beanbean9339 beanbean9339 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@egrace479
egrace479 merged commit 67c72ad into dev Aug 14, 2026
1 check passed
@egrace479
egrace479 deleted the feat/gitlab branch August 14, 2026 20:44
egrace479 added a commit that referenced this pull request Aug 18, 2026
* 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
NetZissou pushed a commit to ABC-Center/catalog that referenced this pull request Aug 28, 2026
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
NetZissou added a commit to ABC-Center/catalog that referenced this pull request Sep 1, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Codeberg and GitLab for Code Repositories

4 participants