gitlab-org/gitlab
Fun facts
A grab-bag of things you'll only learn by spending time in this codebase.
- The first commit is from 2011-10-09. The repo has accumulated ~528,000 commits since.
- About 935 distinct authors committed in the last 90 days, including release bots that account for ~5% of commit volume.
db/structure.sqlweighs in around 24 MB. It's autogenerated from migrations.- There are ~591 pre-deploy migrations and ~946 post-deploy migrations. The split exists so deploys can be zero-downtime.
- ~463 active feature flags are defined under
config/feature_flags/. Each must declare a default, a feature category, and a milestone. - There are ~155 feature categories and ~75 bounded contexts — categories are operational metadata, contexts are namespaces in code.
- A "ghost user" exists at the database level to be the author/assignee of records whose creator was deleted. There's also a "support bot" and a "security bot" — about 15 user types in total.
- Some integrations ship as full STI subclasses of
Integration— there are ~70 of them (Slack, Mattermost, Jira, Telegram, etc.). - GitLab Duo has its own catalog of LLM features: prompt families live in
ee/lib/gitlab/llm/templates/and agent flows inee/lib/gitlab/duo/workflows/. The set is large enough that the abuse harness is itself a sub-feature. - The monorepo includes 26 in-tree gems under
gems/, loaded viapath:in the Gemfile so they ship with the monolith. - Hashed storage means a project's on-disk path is a sha256 of its ID, so renaming a group is zero-cost on disk. The legacy "named storage" path is gone.
- The Workhorse → Gitaly → Postgres path is the hottest in production. A Git push goes Workhorse → Rails (for the
pre-receivecheck) → Gitaly → object pool, all instrumented end-to-end viacorrelation_id. - Sidekiq's "dead set" is monitored as carefully as the queue itself. Repeated failures end up here, and a feature category with growing dead-set entries is a paged alert.
- The
config/vue3migration/directory tracks every component's Vue 3 readiness. The Vue 2 → Vue 3 migration is one component at a time. - Rails console in production is gated by audit and recorded — it's not a free-for-all.
- The CI catalog (
Ci::Catalog) is a feature-store-of-features: project owners publish reusable CI templates, others consume them by version. - EE prepend means there's a parallel set of files under
ee/that prepends behavior into FOSS classes. About half the controllers, models, and services have an EE counterpart. - The repo has its own markdown-renderer-as-pipeline (Banzai), and changes to it run a separate CI verification.
- Quick actions like
/assign @alicework in any comment box. There are ~30 of them, defined declaratively. - The CI configuration for this repo is itself huge —
.gitlab-ci.ymlis mostly a manifest of includes; the actual rules are spread across.gitlab/ci/and rule generators intooling/. - The Danger rules in
danger/enforce conventions like "PRs touchingdb/migrate/must include a database review" and "MRs adding feature flags must declare a rollout issue". - Lefthook runs as the local git hook, gated by
lefthook.yml. New contributors are gently nudged onto it. - The codebase contains 3 different "feature flag" concepts: instance-level Flipper toggles, per-licensed-feature flags, and frontend client-side flags. They've been unified mostly but not entirely.
- Reading
ee/app/models/ee/project.rbis a small adventure. It prepends toProjectand adds a few thousand lines of EE-only behavior. The discipline of usingextend ::Gitlab::Utils::Overrideon every method is what keeps refactors safe. - The Postgres extension layer uses pg_trgm, btree_gin, plpgsql, and (optionally) pgvector for vector search.
- Object pools for forks are stored as their own Gitaly repos. A fork "alternates" off the pool, deduplicating gigabytes for popular projects.
- The CommonMark renderer is custom-built atop
commonmarkerto integrate Banzai filters; the AsciiDoc renderer goes through Asciidoctor with a sandboxed extension set.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.