Add check for Gitaly new configuration structure change
Adding a new check
Closes #119
This check looks for the existence of gitaly['configuration'] and looks specifically at storage.path.
If storage.path does not have /repositories appended to the end of it, the check fails.
See https://docs.gitlab.com/update/versions/gitlab_16_changes/#gitaly-configuration-structure-change for more details.
Verification steps for review
To interpret the test results - the spot commands will show:
-
0if the check passes (nomessageis shown) -
1if the check fails (messageis shown)
Test 1 - don't specify gitaly['configuration'] at all
❯ spot -p all_playbook.yml -n "20250606_4467 - run check" --dbg | grep "Run the check and store result" | grep message | wc -l
0
Test 2 - add a valid storage path
gitaly['configuration'] = {
socket_path: '/var/opt/gitlab/gitaly/gitaly.socket',
runtime_dir: '/var/opt/gitlab/gitaly/run',
listen_addr: 'localhost:8075',
prometheus_listen_addr: 'localhost:9236',
tls_listen_addr: 'localhost:9075',
storage: [
{
name: 'default',
path: '/var/opt/gitlab/git-data/repositories',
},
],
}
❯ spot -p all_playbook.yml -n "20250606_4467 - run check" --dbg | grep "Run the check and store result" | grep message | wc -l
0
Test 3 - add one storage with a path missing /repositories
gitaly['configuration'] = {
socket_path: '/var/opt/gitlab/gitaly/gitaly.socket',
runtime_dir: '/var/opt/gitlab/gitaly/run',
listen_addr: 'localhost:8075',
prometheus_listen_addr: 'localhost:9236',
tls_listen_addr: 'localhost:9075',
storage: [
{
name: 'default',
path: '/var/opt/gitlab/git-data',
},
],
}
❯ spot -p all_playbook.yml -n "20250606_4467 - run check" --dbg | grep "Run the check and store result" | grep message | wc -l
1
Test 4 - add two storages, one missing /repositories
gitaly['configuration'] = {
socket_path: '/var/opt/gitlab/gitaly/gitaly.socket',
runtime_dir: '/var/opt/gitlab/gitaly/run',
listen_addr: 'localhost:8075',
prometheus_listen_addr: 'localhost:9236',
tls_listen_addr: 'localhost:9075',
storage: [
{
name: 'default',
path: '/var/opt/gitlab/git-data/repositories',
},
{
name: 'another-one',
path: '/mnt/gitlab/git-data',
},
],
}
❯ spot -p all_playbook.yml -n "20250606_4467 - run check" --dbg | grep "Run the check and store result" | grep message | wc -l
1
Author checklist
- After opening the MR:
-
Set it to the current milestone -
Ask the Maintainer from the Reviewer roulettesuggestion for review
-
Reviewer checklist
-
I followed the verification steps and confirm the functionality of the new check -
I executed the check as presented in this MR by running the generated playbook with spot - In case of unexpected/odd behavior here, verify the generated playbook to account for potential YAML parsing issues
-
-
This check does only perform read operations -
This check does not output more than necessary on stdout for the check to function -
The messageexplains what it means when this check does not pass -
The workaround_urlprovides actionable information/steps for affected users- Consider if a Knowledge Base article should exist to serve as the ideal workaround URL
-
This check is not using the Rails console/runner, or has Maintainer approval for doing so -
If this is a breaking change check: -
It has the corresponding xx_breaking_changestag (xx being the major release version for the change) -
The workaround_urlgoes to the entry on the https://docs.gitlab.com/update/deprecations/ page -
The ref_urlgoes to the deprecation issue linked from that entry -
The titleis the same as that entry -
The version_startedis equal to theannouncement_milestoneof the deprecation -
The version_fixedis equal to theremoval_milestoneof the deprecation
-
Edited by Anton Smith