gitaly: Deprecate git_data_dirs
What does this MR do?
git_data_dirs.<storage>.path
was deprecated at the beginning of %17.0. This MR implements the deprecation while also deprecating the entire git_data_dirs
key.
Test plan
We're mainly interested in making sure that the generated /var/opt/gitlab/gitaly/config.toml
and /var/opt/gitlab/gitlab-rails/etc/gitlab.yml
are correct, and that any newly declared local storage locations are created on-disk.
-
Download the .deb
package created by the EE package job onto an x86 VM running Ubuntu 24.04, i.e.curl -o gitlab.deb --location --header "PRIVATE-TOKEN: <REDACTED>" "https://gitlab.com/api/v4/projects/gitlab-org%2Fomnibus-gitlab/jobs/7959105859/artifacts/pkg/ubuntu-jammy/gitlab-ee_17.4.1+rfbranch.1476203899.f7ce4173-0_amd64.deb"
-
Install the package: sudo EXTERNAL_URL="http://localhost" apt install ./gitlab.deb
-
Log in and verify that a project/repository can be created. -
Review /var/opt/gitlab/gitlab-rails/etc/gitlab.yml
and ensure the following block is present.
repositories:
# Paths where repositories can be stored. Give the canonicalized absolute pathname.
# NOTE: REPOS PATHS MUST NOT CONTAIN ANY SYMLINK!!!
storages: {"default":{"gitaly_address":"unix:/var/opt/gitlab/gitaly/gitaly.socket"}}
-
Review /var/opt/gitlab/gitaly/config.toml
and ensure the following block is present.
[[storage]]
name = "default"
path = "/var/opt/gitlab/new-git-data/repositories"
- Modify
/etc/gitlab/gitlab.rb
by adding the following block. This tests that the existing local storage can be reconfigured properly, and that the new storage location is created on-disk with the correct permissions by Omnibus:
gitaly['configuration'] = {
storage: [
{
name: 'default',
path: '/var/opt/gitlab/new-git-data/repositories'
}
]
}
-
Run sudo gitlab-ctl reconfigure
. -
Verify that the previously created project/repository is no longer accessible. -
Create a new project/repository and verify this succeeds. -
Verify the on-disk path /var/opt/gitlab/new-git-data/repositories
exists and contains subdirectories. -
Repeat step 4 in the same way. -
Repeat step 5, but this time check that path = "/var/opt/gitlab/new-git-data/repositories"
-
Modify /etc/gitlab/gitlab.rb
by settinggit_data_dirs
such that we now point to the internal Gitaly server via a TCP address.
gitaly['configuration'] = {
storage: [
{
name: 'default',
path: '/var/opt/gitlab/new-git-data/repositories'
}
],
listen_addr: '0.0.0.0:8075',
}
git_data_dirs({
"default" => {
"gitaly_address" => "tcp://localhost:8075"
}
})
-
Run sudo gitlab-ctl reconfigure
. -
Verify that the project/repository created in step 9 is still accessible. -
Repeat step 12. -
Repeat step 11, but this time check for the following block. This confirms that Rails is using the TCP address to communicate with the local Gitaly server.
repositories:
# Paths where repositories can be stored. Give the canonicalized absolute pathname.
# NOTE: REPOS PATHS MUST NOT CONTAIN ANY SYMLINK!!!
storages: {"default":{"gitaly_address":"tcp://localhost:8075"}}
Related issues
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion.
Required
-
MR title and description are up to date, accurate, and descriptive. -
MR targeting the appropriate branch. -
Latest Merge Result pipeline is green. -
When ready for review, MR is labeled workflowready for review per the Distribution MR workflow.
For GitLab team members
If you don't have access to this, the reviewer should trigger these jobs for you during the review process.
-
The manual Trigger:ee-package
jobs have a green pipeline running against latest commit. -
If config/software
orconfig/patches
directories are changed, make sure thebuild-package-on-all-os
job within theTrigger:ee-package
downstream pipeline succeeded. -
If you are changing anything SSL related, then the Trigger:package:fips
manual job within theTrigger:ee-package
downstream pipeline must succeed. -
If CI configuration is changed, the branch must be pushed to dev.gitlab.org
to confirm regular branch builds aren't broken.
Expected (please provide an explanation if not completing)
-
Test plan indicating conditions for success has been posted and passes. -
Documentation created/updated. -
Tests added. -
Integration tests added to GitLab QA. -
Equivalent MR/issue for the GitLab Chart opened. -
Validate potential values for new configuration settings. Formats such as integer 10
, duration10s
, URIscheme://user:passwd@host:port
may require quotation or other special handling when rendered in a template and written to a configuration file.
Edited by James Liu