Repository navigation
Description
What you are trying to do
This follows up #1303, where we agreed GitLab would get its own issue. Several of the repositories I work with are private projects on gitlab.com. I'd like a base to follow them the way github_repo (#1325) and github_issues follow GitHub: the markdown files at the head of the default branch, and the issues and merge requests with their history.
What would help
Two PRs, files first, in the shape agreed in #1303: gitlab.com with a token, marked "not verified against self-managed".
1. gitlab_repo, the same shape as github_repo. Each path is one document, keyed by path and dated by the last commit that touched it. Unchanged files aren't fetched again, and identical files go in once. It has the same include and exclude globs and size cap. I checked the API against gitlab.com, and three things differ from GitHub:
- The tree is paged.
GET /projects/:id/repository/tree?recursive=true&pagination=keysetreturns up to 100 entries per page instead of one call, and there's notruncatedflag. A page cap would make the round truncated, and a truncated round marks nothing "Not in source", as for GitHub. - Tree entries have the blob SHA (
id) but no size. The unchanged check works as it does for GitHub. For a new or changed file,HEAD /projects/:id/repository/files/:path?ref=…returnsX-Gitlab-Sizebefore anything is downloaded, so the size cap holds. - So a new or changed file costs three calls instead of two: the
HEAD, thenGET /projects/:id/repository/commits?path=…&per_page=1for the date (committed_date), thenGET /projects/:id/repository/blobs/:sha/rawfor the bytes.committed_datecarries milliseconds (2026-10-05T14:30:00.000+00:00), which would be cut to the second, as ADR 0013 asks.
The token is a personal, project or group access token with read_api. GitLab accepts it as Authorization: Bearer … (checked with a personal access token), so it can reuse auth_header, which is already sealed through SOURCE_SECRET_KEYS.
2. gitlab_issues: issues and merge requests. Each issue or merge request becomes one document, with its notes and its state, label and milestone events in the body. This would be the third tracker, the point at which ADR 0013 says to reconsider the issue-provider shape. GitLab fits the GitHub shape rather than Jira's: updated_after works like since, and events are fetched per ticket, like /issues/{n}/events. Before writing it, I'd like to settle here whether that third tracker justifies a shared shape, or whether it stays a third reader like the other two.
My own projects are private, so I've set up a public project for the tests: https://gitlab.com/QuintinBotes/utopia-gitlab-fixture. Every file in it is a test case, across two commits with different dates:
- markdown in nested folders;
- an identical copy of one file;
- an empty file;
- a 3,368-byte file to test against a small size cap;
- a hidden folder,
node_modulesandvendor; - a symlink;
- a non-markdown file.
Tests would use responses recorded from it, so they can be re-recorded whenever the API changes. For the second PR, I'd add an issue and a merge request with comments and label and state changes there too.
What you do today instead
A script on my machine reads each project's clone, takes the markdown at the default branch, and pushes it through an api source, keyed by path and dated with git log -1 per file. Issues and merge requests don't come in at all.
Activity
WaylandYang commentedon Oct 22, 2026
Please go ahead with
gitlab_repoas described; a new source kind in thegithub_reposhape needs no record. Forgitlab_issues, 0013 says a third tracker is where we reconsider a shared issue-provider shape, so before that PR write the answer down as a revision of 0013 (or a short new record) and we will agree it here. #1303 is closed in favour of this one.QuintinBotes commentedon Oct 22, 2026
Thanks. I'll build
gitlab_repoin thegithub_reposhape first. Before anygitlab_issuesPR I'll write the shared issue-provider answer as a revision of 0013 and post it here to agree.Three issue trackers share one ticket document and keep their own fet…
Write out the ticket fields, the update-time checkpoint and opt-in me…
Three issue trackers share one ticket document and keep their own fet…
Merge pull request #26 from re-cinq/sync/upstream-dev-2026-10-22c
A base can follow a gitlab.com project's markdown files, fetching onl…
GitHub and Jira tickets render through one Ticket document, byte for …
A base can follow a gitlab.com project's issues and, when switched on…
WaylandYang commentedon Nov 16, 2026
Done in #1508 (with #1365, #1367, #1378 earlier).