Documentation 40

Guide · GitLab

How do I test a GitLab integration without a real group?

You do not need one. Point your client at a read-only GitLab replica that already holds the olympus-labs data set, and your code runs unchanged.

01 / The one change

Swap the base URL. Nothing else.

Your client talks to gitlab.com. Point it at gl.sandboxapis.dev instead: same paths, same JSON, same headers, same status codes. No group to create, no seed script.

For CI, use a pinned host. This page uses gl-v4-g12.snap.sandboxapis.dev, the newest pin for GitLab, which answers the same bytes on every run, so an assertion written today still holds next month.

The live host, gl.sandboxapis.dev, re-rolls daily and can carry a newer generation of the data set than gl-v4-g12.snap.sandboxapis.dev; every answer on this page is for gl-v4-g12.snap.sandboxapis.dev.

02 / Run it now

One request, no account.

request.sh
curl -s "https://gl-v4-g12.snap.sandboxapis.dev/api/v4/projects/olympus-labs%2Fparthenon"

It answers with the parthenon project in the olympus-labs group, with its full path, its default branch and its topics, in GitLab's own project JSON.

With a real client, the verified quickstart for python-gitlab runs against the live host on every check. It prints the project's full path and description, then the five most recently merged merge requests. For CI, change its base URL to https://gl-v4-g12.snap.sandboxapis.dev.

python
# pip install python-gitlab==6.5.0

import gitlab

gl = gitlab.Gitlab(
    "https://gl.sandboxapis.dev",   # the only line that changes
    private_token="any-token",      # any token is accepted
)

project = gl.projects.get("olympus-labs/parthenon")
mrs = project.mergerequests.list(state="merged", per_page=5, get_all=False)

print(project.path_with_namespace, "-", project.description)
print(len(mrs), "merged MRs, newest:", mrs[0].title)

What it prints always contains olympus-labs/parthenon and merged MRs, newest:.

03 / Writes

A write gets GitLab's own error shape.

Every host is read-only. A write answers 403 with GitLab's own error body, naming what you tried, so your client's existing error handling meets a shape it knows.

403 · application/json
curl -s -X POST "https://gl-v4-g12.snap.sandboxapis.dev/api/v4/projects/olympus-labs%2Fparthenon/issues" -H 'content-type: application/json' -d '{"title":"test"}'

{"message":"This universe is read-only. See what's covered at https://sandboxapis.dev/coverage. (You tried to POST /api/v4/projects/olympus-labs%2Fparthenon/issues.) Tell us what you needed to write: https://sandboxapis.dev/feedback"}

04 / Where it stops

Coverage is counted, not claimed.

452 of 755 GitLab read surfaces are served and verified against GitLab's own published spec. A call to one that is not covered returns a 404 with an X-SandboxAPIs-Coverage header, never invented data. The row-by-row list is on the GitLab reference and the coverage page.

Next: read the GitLab quickstart, or run the four-hop walk to watch one incident cross four services.

What this is not

Read this before you rely on it.

SandboxAPIs is read-only: a write returns the provider's own error unless your key has opted in to scratch writes, and those never reach anybody else. Coverage is bounded, and the manifest that says exactly where it stops is public. The data is a simulated company, not yours and not a copy of anybody's. And it reproduces what each vendor documents and publishes, not the vendor's undocumented behaviour, so keep one test against the real service for that.