Open-Source Wikis

/

GitLab

/

Lore

gitlab-org/gitlab

Lore

GitLab is fourteen years old and has rewritten or grown out of many subsystems. Pieces of older eras still surface in the codebase. The summaries below are best-effort and pieced together from in-tree artifacts (commit history, code comments, deprecation files, schema), so dates are approximate.

Era 1: Sinatra → Rails (2011–2013)

GitLab started as gitlabhq, a small Sinatra-ish app over gitolite for SSH access. By 2012 it was a Rails 3 app. Echoes today:

  • gitlab-shell (separate repo) is the descendant of the gitolite-replacement layer.
  • The users.username is unique because gitolite required it; the constraint persists.

Era 2: GitLab CI as a separate app (2014–2015)

GitLab CI was originally a separate Rails application with its own URL and database. The merger ("integrated CI") around 2015 folded the schema into the main app. Echoes today:

  • ci_builds is named "builds", not "jobs", because that was the original CI vocabulary.
  • The ci decomposed database has historical roots; it's "rejoining" what was once "separated".

Era 3: Hashed storage migration (2018–2021)

For years, projects on disk were stored at <namespace>/<project>.git. Renaming a group meant moving directories. The hashed-storage migration moved everyone to @hashed/<sha>/<sha>.git. The migration ran for years; the legacy code path is finally gone.

Era 4: Decomposition (2020–ongoing)

The single Postgres database split:

  • 2021: ci decomposed into its own database.
  • 2022: sec decomposed.
  • 2024+: per-organization isolation (cells) starts.

The decomposition required inventing "loose foreign keys" (cleanup workers replacing real FKs), updating load balancing to know about multiple DBs, and changing every cross-DB query to pre-fetch IDs.

Era 5: Vue 2 → Vue 3 (2023–ongoing)

Vue 2 reached EOL in late 2023; the migration is per-component. config/vue3migration/ tracks status. The team stayed pragmatic: components that work on Vue 3 use it; the rest stay on Vue 2 + @vue/compat until rewritten.

Era 6: GraphQL ascends (2018–ongoing)

GraphQL was added in 2018 next to REST. New features ship to GraphQL first; REST gets a wrapper for backward compatibility. The GraphQL schema is now sizable — 80 type namespaces, 30 mutation namespaces. The persisted-queries pattern landed to keep serialized payloads small.

Era 7: Work items (2022–ongoing)

The work items framework unifies issues, MRs, epics, requirements, test cases, and OKRs into a single WorkItem with attached widgets. Each old type is migrating in place. Code from the issue era still uses Issue-typed associations and gradually moves to work-item-typed APIs.

Era 8: AI / Duo (2023–ongoing)

GitLab Duo introduced an AI-aware codebase: the Cloud Connector boundary, the AI Gateway as a separate service, the catalog of agentic flows (ai/agents/), the catalog of prompts, the abuse-detection harness, and the migration from per-feature LLM clients to centralized routing. Duo is the most active area of the codebase right now.

Era 9: Cells (2023–ongoing)

The codebase is becoming organization-scoped: every controller learns to be aware of the current organization, every URL gets an organization prefix option, every query is checked by the data-isolation gem. The end-state is per-organization sharding across cells.

Deprecations on the way out

  • The legacy "issue weight" UI on Free tier (EE-only now).
  • The legacy Notes API in favor of GraphQL.
  • AsciiDoc-style wiki sidebars (replaced by per-format equivalents).
  • Several legacy importers (Trello, FogBugz are deprecated).
  • Old "external diffs" storage strategies.

Subsystems extracted out

  • Gitaly (extracted 2017–2018; now a separate repo).
  • Workhorse (in-tree but conceptually separate; can be split if needed).
  • KAS (built as a separate repo from the start).
  • AI Gateway (extracted 2023).
  • Spamcheck (extracted).
  • Suggested Reviewers (extracted).
  • Container Registry (Docker registry fork, separate repo).

Names that no longer mean what they say

  • Service (the model) → renamed to Integration. Old references linger.
  • Builds → "jobs" in user-facing language; ci_builds table remains.
  • Note → could be a comment, a system note, a synthetic discussion.
  • Project → has accumulated 2,500+ methods over the years (if you include all concerns).
  • Snippet → originally a paste; now a full Git repo.

Why this matters

When you find code that looks weird, the explanation is usually historical. The "why" lives in git blame, in comments at the top of large files, and in migration notes scattered across db/post_migrate/.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Lore – GitLab wiki | Factory