skip to content

GitLab

The all-in-one alternative: repository, merge requests, CI/CD, container and package registries, and security scanning inside one product. Interviews contrast it with GitHub and ask how the pieces meet: approval rules on the merge request, the job token that lets a pipeline reach the registry, and a scan finding that blocks the merge.

on this pageshow

explore

questions

page 1 of 2

In GitLab, where does a project's pipeline configuration come from, and what runs when the repository has no .gitlab-ci.yml?

level: juniorimportance: must knowfreq 46%

answer

  1. the repository root, by default
  2. one project setting can move it
  3. path@group/project or a .yml URL
  4. no file: Auto DevOps, maybe
  5. needs a Dockerfile or buildpack

basics

~20 s

GitLab reads .gitlab-ci.yml from the repository root unless the project's CI/CD configuration file setting names another path, another project's file or a .yml URL. With no file, only Auto DevOps can run, if enabled and it finds a Dockerfile or buildpack.

solid answer

~50 s

By default GitLab looks for `.gitlab-ci.yml` in the root of the repository at the commit being built. The project's **CI/CD configuration file** setting (under the general pipeline settings) can point elsewhere: a path relative to the root such as `ci/pipeline.yml`, a file in another project written `path@group/project` (read from that project's default branch unless you append `:refname`), or a full URL that ends in `.yml`. Jobs see the chosen path in `CI_CONFIG_PATH`. When the project has no configuration file at all, nothing runs unless Auto DevOps is on — through **Default to Auto DevOps pipeline** on the project, inherited from its group, or switched on for every project by an instance administrator — and Auto DevOps only runs automatically when it finds a `Dockerfile` or a matching buildpack. A real `.gitlab-ci.yml` always takes precedence over Auto DevOps.

go deeper

for a junior

Know that GitLab reads .gitlab-ci.yml from the repository root by default, and that a project can have no pipeline at all if that file is missing.

for a middle

Explain the three forms the CI/CD configuration file setting accepts, how CI_CONFIG_PATH reports the choice, and the exact conditions under which Auto DevOps runs instead.

for a senior

Show you can find where an inherited project's pipeline really comes from — moved file, another project, external URL, inherited Auto DevOps — and weigh the trust cost of each source.

for a principal

Discuss when separating pipeline ownership from code ownership is worth the friction, and why moving the file is not the same as enforcing jobs across an organisation.

## The default: a file in the repository A GitLab **pipeline** is created from a **CI/CD configuration file**, a YAML document that lists the jobs to run. Unless someone changes a setting, GitLab looks for a file named `.gitlab-ci.yml` in the **root directory** of the repository, at the exact commit the pipeline is for. That has two useful consequences: - The configuration is **versioned with the code**: a branch that changes the build also changes the pipeline that tests it. - A branch can change its own pipeline, and the change is tested on that branch before it reaches the default branch. The predefined variable `CI_CONFIG_PATH` tells a running job which path was used; it defaults to `.gitlab-ci.yml`. What the file may contain (jobs, stages, `include:` of other files and so on) is a separate subject, covered with the GitLab CI keywords; this answer is about where GitLab reads it from. ## Moving the file: the CI/CD configuration file setting Each project has a **CI/CD configuration file** field in its general pipeline settings. It accepts three forms: | Form | Example | Read from | |---|---|---| | Path in this repository | `my/path/.my-custom-file.yml` | this project, relative to the root | | File in another project | `.gitlab-ci.yml@acme/ci-config` | that project's default branch, or `...@acme/ci-config:refname` | | External file | `https://config.example.com/generate/ci/config.yml` | the URL, which must end in `.yml` | Teams usually move the file for one of two reasons: 1. **A tidier repository** — the configuration lives under a `ci/` folder with its helpers. 2. **Separating who may edit the pipeline from who may edit the code** — the file sits in a separate project where only a few people have write access, while other projects can read it but not change it. The second pattern has costs. The project's **pipeline editor** cannot edit a configuration file that lives in another project or on an external site, so changes go through the other project's own review. An external URL means the pipeline definition is fetched from outside GitLab at pipeline creation, so whoever controls that URL controls what your jobs run. And the setting itself belongs to the project: it moves the file, it does not on its own stop the project from being pointed elsewhere. Forcing jobs into every project's pipeline is a different mechanism, covered with GitLab CI templates and policies. ## When there is no file: Auto DevOps **Auto DevOps** is GitLab's ready-made pipeline that detects the language, builds, tests, scans and can deploy. It only matters when a project has **no** configuration file: - It is switched on with **Default to Auto DevOps pipeline**, per project (Maintainer or Owner), per group (Owner; subgroups and projects inherit it and can opt out), or for every project on an instance with **Default to Auto DevOps pipeline for all projects** (an administrator setting). - It **runs automatically only if** the repository has a `Dockerfile` or code that matches a buildpack. - If a `.gitlab-ci.yml` exists, **your configuration takes precedence** and the Auto DevOps pipeline does not run. - Without deployment preparation (a base domain and a deployment target), it can build and test but cannot deploy. - GitLab can **switch Auto DevOps off** for a project on its own. The documented causes are that the setting was only inherited from a group or the instance rather than enabled in the project, that the project has no successful Auto DevOps pipelines, and that an Auto DevOps pipeline failed. Enabling it in the project itself and fixing the failing pipeline is the remedy. A project that wants Auto DevOps plus its own jobs writes a `.gitlab-ci.yml` that includes the Auto DevOps template; at that point it is an ordinary configuration file and the setting no longer decides anything. ## When nothing runs at all Two situations leave a project with no pipelines: - **No configuration file and no Auto DevOps** (or Auto DevOps on but nothing it can detect). - **CI/CD turned off** for the project in its visibility and feature settings. The CI/CD menu, the pipelines and jobs pages disappear; existing pipelines are hidden, not deleted, and come back if CI/CD is turned on again. ## Reading a project you have just inherited When you take over a set of projects, the quickest audit is: does each one have a root `.gitlab-ci.yml`, does its **CI/CD configuration file** setting point somewhere else, and is Auto DevOps enabled on the project, a parent group or the instance? A pipeline nobody can find in the repository usually comes from one of the last two.

  • In GitLab, what changes for a project's developers when its CI/CD configuration file lives in a separate project?
    They can no longer change the pipeline from their own repository or its pipeline editor; edits go through the configuration project, with its own write permissions and review. GitLab reads the file from that project's default branch unless the setting appends `:refname`, so a change there affects every pipeline that points at it from then on.
  • In GitLab, can a project use Auto DevOps and its own .gitlab-ci.yml together?
    Yes, but only by making Auto DevOps part of its own file: the project's `.gitlab-ci.yml` includes the `Auto-DevOps.gitlab-ci.yml` template and adds or overrides jobs. The **Default to Auto DevOps pipeline** setting only decides what happens when there is no configuration file, so once the file exists the setting has no effect.

  • GitLab runs any YAML file it finds anywhere in the repository.
  • The configuration file must always be .gitlab-ci.yml in the repository root.
  • Auto DevOps runs alongside a project's own .gitlab-ci.yml pipeline.
  • Auto DevOps builds any project, even with no Dockerfile or matching buildpack.
  • Turning off CI/CD for a project deletes its existing pipelines.
open as a page

In GitLab, when a CI/CD job pushes an image to its project's container registry, which predefined variables supply the address and the credentials?

level: juniorimportance: must knowfreq 50%

basics

~10 s

CI_REGISTRY is the registry host, CI_REGISTRY_IMAGE is the project's image path under it, and CI_REGISTRY_USER with CI_REGISTRY_PASSWORD log the job in; that password equals CI_JOB_TOKEN and is valid only while the job runs.

open as a page

On GitLab.com, where does an untagged CI job run by default, and what is left of its machine when the next job starts?

level: juniorimportance: must knowfreq 44%

basics

~20 s

On GitLab.com an untagged job runs on the GitLab-hosted small Linux x86-64 runner, in a newly provisioned VM dedicated to that job and deleted when it ends, so nothing on that machine reaches the next job.

open as a page

In a GitLab merge request, what does the security scan report show, and why is a vulnerability already on main missing from it?

level: juniorimportance: must knowfreq 46%

basics

~20 s

It shows what merging would change: findings the source branch adds and findings it fixes, compared against the target branch's security reports. A vulnerability present on both branches is unchanged by the merge, so the report leaves it out.

open as a page

In GitLab, how do GitLab.com, Self-Managed and Dedicated differ, and which fits code that must stay in your own data centre?

level: juniorimportance: must knowfreq 44%

basics

~20 s

GitLab.com is GitLab's shared multi-tenant SaaS, GitLab Dedicated is a single-tenant instance GitLab hosts and runs for you, and GitLab Self-Managed is the same product you install and operate. Only Self-Managed can sit in your own data centre.

open as a page

In GitLab, a job in one project gets 404 Not Found using CI_JOB_TOKEN against another private project; what decides whether that call is allowed?

level: middleimportance: must knowfreq 36%

basics

~20 s

A CI_JOB_TOKEN call into another GitLab project succeeds only if the target project's job token allowlist names the calling project or its group, the user who started the job has enough access in the target, and the endpoint accepts job tokens.

open as a page

In GitLab, why can a Developer still push directly to a protected main branch, and which protected-branch settings stop it?

level: middleimportance: must knowfreq 52%

basics

~20 s

A Developer pushes to a protected GitLab branch when any matching rule lists Developers in Allowed to push and merge. Fix it by setting that permission to No one on every matching rule, leaving Allowed to merge for merge requests.

open as a page

On GitLab.com, how are compute minutes calculated for jobs on hosted runners, and why can a pipeline use more minutes than it took?

level: middleimportance: must knowfreq 33%

basics

~20 s

Each job's usage is its run time in minutes multiplied by the runner type's cost factor, charged to the top-level namespace. Pipelines add up all their jobs, so parallel jobs make usage exceed the pipeline's wall-clock time.

open as a page

On GitLab Free, which built-in security scanners can a project run, and what does moving to Ultimate add?

level: middleimportance: must knowfreq 40%

basics

~20 s

Free runs SAST (Semgrep-based), pipeline secret detection, container scanning (built on Trivy) and IaC scanning, with results only as JSON job artifacts. Ultimate adds dependency scanning, DAST, secret push protection, merge request reports, the vulnerability report and security policies.

open as a page

In GitLab Self-Managed, how do the Linux package, the GitLab Helm chart and cloud native hybrid differ in where PostgreSQL, Redis and Gitaly run?

level: middleimportance: must knowfreq 30%

basics

~20 s

The Linux package installs GitLab with PostgreSQL, Redis and Gitaly on virtual machines. The Helm chart runs GitLab in Kubernetes but needs PostgreSQL, Redis and object storage outside the cluster; cloud native hybrid also keeps Gitaly on virtual machines.

open as a page

In GitLab Premium, how would you guarantee that nothing reaches main without two approvals, one from a code owner, while developers can still merge their own approved merge requests?

level: seniorimportance: must knowfreq 45%

basics

~20 s

Protect main with Allowed to merge: Developers + Maintainers, Allowed to push and merge: No one and Require approval from code owners; add a two-approval rule targeting main; then lock self-approval and per-merge-request rule edits in the approval settings.

open as a page

In GitLab, what does marking a merge request as a draft do, and how do you mark it and later make it ready?

level: juniorimportance: should knowfreq 38%

basics

~20 s

A GitLab draft merge request cannot merge until its Draft flag is removed, even when every other check passes. Set it with a Draft: title prefix, Mark as draft or /draft; clear it with Mark as ready or /ready.

open as a page

In GitLab, Auto-cancel redundant pipelines is enabled, yet older pipelines on a busy branch keep running after new pushes; why?

level: middleimportance: should knowfreq 29%

basics

~20 s

The setting cancels older pipelines when a newer commit's pipeline starts on the same branch, but by default a running pipeline is spared once any job not marked interruptible has started. Jobs default to non-interruptible, so most running pipelines survive.

open as a page

In GitLab, why does a nightly pipeline schedule turn Inactive after its owner leaves the project, and what does Take ownership change?

level: middleimportance: should knowfreq 27%

basics

~20 s

A GitLab pipeline schedule runs with its owner's permissions, so when the owner is blocked or removed from the project it turns Inactive. A Maintainer or Owner who selects Take ownership reactivates it, and it then runs with their permissions.

open as a page

In GitLab, how does the dependency proxy stop CI jobs from hitting Docker Hub pull rate limits, and what changes in each job's image reference?

level: middleimportance: should knowfreq 36%

basics

~10 s

The group-level dependency proxy caches Docker Hub manifests and blobs and checks freshness with uncounted HEAD requests. Jobs prefix images with CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX (or the DIRECT variant), and the runner signs in automatically.

open as a page

In GitLab, which deploy token scopes does a production cluster need to pull a project's images, and why not reuse CI_JOB_TOKEN or a personal token?

level: middleimportance: should knowfreq 32%

basics

~20 s

A deploy token with read_registry is enough to pull; pushing needs read_registry and write_registry, and packages use read_package_registry. The job token dies with its job and a personal token is tied to one person, so neither suits a long-lived consumer.

open as a page

In GitLab's package registry, why must npm, Maven and PyPI packages publish to a project, even when consumers install from group or instance endpoints?

level: middleimportance: should knowfreq 28%

basics

~20 s

Every package is stored in, and permissioned by, one project, so npm, Maven and PyPI publish only to the project endpoint. Group and instance endpoints are read views that aggregate those projects, with naming rules for the instance level.

open as a page

In GitLab, what does Set to auto-merge wait for, and what cancels it or keeps the merge request blocked?

level: middleimportance: should knowfreq 30%

basics

~20 s

GitLab's Set to auto-merge, formerly Merge when pipeline succeeds, merges once every merge check passes: approvals, a successful pipeline, resolved threads, not a draft, no conflicts. New commits on the source branch cancel it so they get reviewed.

open as a page

In GitLab, how do the Merge commit, Merge commit with semi-linear history and Fast-forward merge methods differ, and how does squashing combine with each?

level: middleimportance: should knowfreq 40%

basics

~20 s

Merge commit always adds a merge commit; semi-linear history adds one but only merges a source that is up to date with the target; fast-forward merge adds none and needs an up-to-date source. Squashing adds one squash commit in each method.

open as a page

In GitLab, how does secret push protection differ from pipeline secret detection, and why would a team run both?

level: middleimportance: should knowfreq 30%

basics

~20 s

Secret push protection (Ultimate) checks a push's changes before GitLab accepts them and rejects a push containing a secret. Pipeline secret detection (every tier) scans commits in a CI job after they land, catching what push protection missed.

open as a page

In GitLab's vulnerability report, what do Needs triage, Confirmed, Dismissed and Resolved mean, and why does a fixed vulnerability stay open?

level: middleimportance: should knowfreq 24%

basics

~20 s

Needs triage is a new vulnerability's starting status; Confirmed means verified; Dismissed means judged not worth fixing, with a reason; Resolved means fixed. A fix only logs No longer detected; a person or a vulnerability management policy must set Resolved.

open as a page

In a GitLab Linux package installation, why does editing /etc/gitlab/gitlab.rb change nothing, and which settings belong there rather than in the Admin area?

level: middleimportance: should knowfreq 22%

basics

~20 s

In the Linux package, gitlab.rb is a declaration: nothing changes until sudo gitlab-ctl reconfigure renders it into each service's configuration. Node wiring such as external_url lives there; instance-wide policy lives in the Admin area, stored in the database.

open as a page

In GitLab, why can two merge requests that each passed a merged results pipeline still break main, and how does a merge train prevent that?

level: seniorimportance: should knowfreq 15%

basics

~20 s

A merged results pipeline tests one merge request combined with the current target branch, not with others merging at the same time. A merge train queues merge requests and tests each against the target plus every request ahead, merging in order.

open as a page

In GitLab, a container registry cleanup policy is on, yet old tags survive and storage barely drops; how do keep_n, older_than, name_regex and name_regex_keep decide what gets deleted?

level: seniorimportance: should knowfreq 20%

basics

~20 s

The policy starts from every tag, spares latest, keeps only name_regex matches, drops name_regex_keep matches, spares the keep_n newest, spares tags younger than older_than, skips protected and immutable tags, and deletes the rest; layers go later, by garbage collection.

open as a page

In GitLab Premium, which merge request approval settings stop authors and committers from approving their own changes, and where do they still leak?

level: seniorimportance: should knowfreq 22%

basics

~20 s

GitLab Premium's Prevent approval by merge request creator, Prevent approvals by users who add commits and Prevent editing approval rules in merge requests close self-approval. It still leaks through rebases by others, per-merge-request rule overrides and unsatisfiable rules marked Auto approved.

open as a page

On GitLab.com, a group's jobs on hosted runners stop mid-month while its own group runners keep working; what happened, and what becomes of pending and running jobs?

level: seniorimportance: should knowfreq 22%

basics

~20 s

The top-level namespace used up its compute quota. Instance runners stop taking its new jobs, pending and retried ones are dropped, running jobs continue until usage is 1,000 minutes over quota, and the group's own runners carry on.

open as a page

In GitLab, what makes a runner stale rather than offline, and how do you find and clean up stale runners across a fleet?

level: seniorimportance: should knowfreq 16%

basics

~20 s

A GitLab runner is offline after more than 2 hours without contacting GitLab and stale after more than 7 days (since GitLab 17.1). Spot them in the instance or group runner list, then delete them or, on Ultimate, enable group stale runner cleanup.

open as a page

In GitLab Ultimate, how do scan execution policies and merge request approval policies work together so that a new critical finding needs a security approver?

level: seniorimportance: should knowfreq 27%

basics

~20 s

A scan execution policy forces scanners into every in-scope pipeline, overriding project configuration. A merge request approval policy reads the resulting reports and requires named approvers when a new critical appears. One guarantees the evidence; the other gates on it.

open as a page

In GitLab Self-Managed, how does Gitaly Cluster (Praefect) differ from sharded Gitaly, and why does Gitaly on Kubernetes run unclustered?

level: seniorimportance: should knowfreq 11%

basics

~20 s

Sharded Gitaly stores each repository on exactly one Gitaly node, a single point of failure. Gitaly Cluster puts Praefect in front of several Gitaly nodes, replicating writes and failing over automatically; on Kubernetes it is beta, so production Gitaly pods run sharded.

open as a page

A bank's GitLab Self-Managed must go from 18.6 to 19.4 with minimal downtime: which versions must it stop at, and what decides whether zero downtime is possible?

level: seniorimportance: should knowfreq 14%

basics

~20 s

The path is 18.8, 18.11, 19.2, then 19.4, each at its latest patch, with background migrations finished before every hop. Zero downtime needs a multi-node Linux package install with high availability, upgraded one minor release at a time.

open as a page

showing 1–30 of 34