Skip to content

A base could follow a GitLab project: its markdown files, then its issues and merge requests #1327

Closed

Description

@QuintinBotes

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=keyset returns up to 100 entries per page instead of one call, and there's no truncated flag. 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=… returns X-Gitlab-Size before anything is downloaded, so the size cap holds.
  • So a new or changed file costs three calls instead of two: the HEAD, then GET /projects/:id/repository/commits?path=…&per_page=1 for the date (committed_date), then GET /projects/:id/repository/blobs/:sha/raw for the bytes. committed_date carries 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_modules and vendor;
  • 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

  1. added
    enhancement
    on Oct 22, 2026
  2. WaylandYang commented on Oct 22, 2026

    @WaylandYang
    Contributor

    Please go ahead with gitlab_repo as described; a new source kind in the github_repo shape needs no record. For gitlab_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.

  3. QuintinBotes commented on Oct 22, 2026

    @QuintinBotes
    ContributorAuthor

    Thanks. I'll build gitlab_repo in the github_repo shape first. Before any gitlab_issues PR I'll write the shared issue-provider answer as a revision of 0013 and post it here to agree.

  4. added a commit that references this issue on Oct 22, 2026
  5. WaylandYang commented on Nov 16, 2026

    @WaylandYang
    Contributor

    Done in #1508 (with #1365, #1367, #1378 earlier).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions