Skip to content

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:

  • 0 if the check passes (no message is shown)
  • 1 if the check fails (message is 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 roulette suggestion 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 message explains what it means when this check does not pass
  • The workaround_url provides 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_changes tag (xx being the major release version for the change)
    • The workaround_url goes to the entry on the https://docs.gitlab.com/update/deprecations/ page
    • The ref_url goes to the deprecation issue linked from that entry
    • The title is the same as that entry
    • The version_started is equal to the announcement_milestone of the deprecation
    • The version_fixed is equal to the removal_milestone of the deprecation
Edited by Anton Smith

Merge request reports

Loading