Update QA_DEFAULT_BRANCH to main
What does this MR do and why?
A number of tests appear to fail when run in gitlab-org/gitlab-qa
with errors implying that a branch named master
is expected.
However in our E2E tests we set of default branch name of main
qa/qa/runtime/env.rb#L78 since https://gitlab.com/gitlab-org/gitlab/-/commit/dd3c531243b7925ddaf48d7e00ef39c49126f908
This mismatch appears to cause issues in some tests resulting git push errors src refspec master does not match any
The command HOME="/tmp/qa-netrc-credentials/39" git push http://root@gitlab-ce-5132dff5.test/relative/gitlab-qa-sandbox-group-4/qa-test-2022-10-12-03-38-55-9e5b464524a35139/repository-usage-65f4b568c82c8794-87469e68c04479fe.git master 2>&1 failed (1) with the following output:
error: src refspec master does not match any
error: failed to push some refs to 'http://gitlab-ce-5132dff5.test/relative/gitlab-qa-sandbox-group-4/qa-test-2022-10-12-03-38-55-9e5b464524a35139/repository-usage-65f4b568c82c8794-87469e68c04479fe.git'
To rectify this, we should use 'main' as a default branch name to avoid the mismatch in environments where QA_DEFAULT_BRANCH is not explicitly defined.
NB - I do not have access to verify whether QA_DEFAULT_BRANCH
is defined in gitlab-org/gitlab
or related pipelines nor in gitlab-org/gitlab-qa
.
When I have that information available that should help confirm/reject my assumption about the root cause of this issue.
Sample Pipelines
Prior to this change: https://gitlab.com/gitlab-org/gitlab-qa/-/pipelines/664430171
- There are a number of failures with error
error: src refspec master does not match any
With this change: https://gitlab.com/gitlab-org/gitlab-qa/-/pipelines/664430752
- All such failures are gone
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.