This file provides guidance to AI coding agents (Claude Code, Cursor, Copilot, etc.) when working with code in this repository.
omnibus-gitlab builds full-stack Linux packages (DEB/RPM) that bundle all GitLab components into a single installable unit. It uses the Omnibus framework (Chef-based) to define software components, their build instructions, and post-install configuration via Chef cookbooks.
config/software/— ~108 software component definitions (gitaly, postgresql, nginx, redis, etc.). Each file defines how to fetch and compile a dependency.config/projects/— Top-level project definitions (gitlab CE/EE).files/gitlab-cookbooks/— Chef recipes that configure GitLab services at install time (run viagitlab-ctl reconfigure).files/gitlab-ctl-commands/— Ruby source forgitlab-ctlCLI subcommands.lib/gitlab/— Build automation: Rake tasks, version management, helpers for AWS/Docker/GCP.spec/chef/— RSpec + ChefSpec tests for cookbooks and ctl commands.
bundle install # Install dependencies
# Tests
bundle exec rspec # Run all tests
bundle exec rspec spec/chef/path/to/spec_file.rb # Single spec file
bundle exec rspec spec/chef/path/to/spec_file.rb -e "desc" # Single example
# Linting
bundle exec rubocop # Check style
bundle exec rubocop -a # Auto-correct
# Building packages (requires full build environment)
bundle exec rake build:project # Build omnibus packageThere are two distinct phases:
- Build time —
config/software/defines how to compile each component into/opt/gitlab. - Runtime configuration —
files/gitlab-cookbooks/Chef recipes run when users executegitlab-ctl reconfigure, writing config to/var/opt/gitlaband/etc/gitlab.
/opt/gitlab— bundled binaries and libraries/etc/gitlab/gitlab.rb— user-editable config/var/opt/gitlab— runtime data/var/log/gitlab— logs
Component versions are read from environment variables (e.g. GITLAB_VERSION, GITALY_SERVER_VERSION) or from VERSION files. .custom_sources.yml defines alternative source repos for components (used for security releases and forks).
files/gitlab-cookbooks/ contains one cookbook per service (e.g. gitlab, gitaly, patroni). Each cookbook follows standard Chef structure: recipes/, attributes/, libraries/, templates/. Tests live in spec/chef/ mirroring the cookbook structure.
files/gitlab-ctl-commands/ contains individual Ruby files, each implementing a gitlab-ctl subcommand. Shared library code lives in files/gitlab-ctl-commands/lib/gitlab_ctl/. Tests mirror the source layout in spec/chef/gitlab-ctl-commands/.
Use the Default MR template (.gitlab/merge_request_templates/Default.md) when creating MRs. It requires:
- A "What does this MR do?" section
- Related issues
- Checklist including pipeline status, labeling (
~"workflow::ready for review"), and UBT checks if applicable
The pipeline (.gitlab-ci.yml + gitlab-ci-config/) runs:
- Rubocop + RSpec tests
- Multi-OS package builds (Ubuntu, Debian, CentOS, RHEL, SLES, Amazon Linux) across AMD64/ARM64
- Docker image builds
- QA tests via
gitlab-qa
Package builds happen on dev.gitlab.org runners with full build toolchains; local development focuses on the Ruby/Chef layer tested via RSpec.