Skip to content

GitLab QA suite depends on default branch named master

We need to change the default branch name from master to main for all new projects created on GitLab.com, see gitlab-com/gl-infra/delivery#1356 (closed) .

As part of the change gitlab-com/gl-infra/production#3065 (closed) , we enabled this setting on staging, but unfortunately the number of QA tests failed https://ops.gitlab.net/gitlab-org/quality/staging/-/pipelines/350764/failures .

Before we are able to continue with this change, QA pipelines need to support different default branch name.

The QA framework will use the project or instance-wide default branch name, if it is set. I.e., if we set main as an instance-wide default, the QA framework should detect it. If it is not set, the QA framework will use master as the default, which matches the current default for a fresh GitLab instance.

A QA_DEFAULT_BRANCH environment variable can be set to override the default until the framework is updated. That is, if we change the source code so that main is the default, we'll need to update the QA framework, but until that QA framework update is merged, QA_DEFAULT_BRANCH can be set to main so that the tests will work.

Edited by Mark Lapierre