Use underscores instead of hyphens for settings - Phase II

Currently, we maintain the settings as Chef attributes with hyphens in their names - node['gitlab']['gitlab-rails'], node['gitlab']['gitlab-shell'], node['monitoring']['node-exporter'] etc. I believe we do this to match the project names. However, because gitlab.rb is eavluated as a Ruby script and because Ruby doesn't support hyphens in variable names, we use underscores there - gitlab_rails[*], gitlab_shell[*], node_exporter[*] etc. Then we do the extra work of converting these top-level keys with underscores to the hyphenated ones when we create node attributes so that Chef can automatically merge user-provided values and default values for them.

I think this is unnecessary, messy, and just causes confusion to everyone - especially external contributors.

Proposal

  1. Get rid of hyphens in top level keys - just use underscores everywhere. This should not have any (hopefully) user impact because the user facing gitlab.rb already uses the underscore format.
  2. Get rid of hyphens in all keys. This will have user impact, and will need proper deprecation/removal process.
  3. Ensure we don't add hyphenated keys back in. Maybe a Rubocop rule.

For scheduling purposes, let's split this to multiple phases

  • Phase 0 and I are tracked in #6873 (closed)
  • Phase II (This issue)
    • GitLab KAS
    • GitLab Workhorse
    • GitLab Rails
    • Service specific NGINX confguration
    • Geo Services
      • Geo PostgreSQL
      • Geo Secondary
      • Geo Logcursor
    • Other Miscellaneous keys
      • Attributes
        • external_url
        • gitlab_kas_external_url
        • mattermost_external_url
        • pages_external_url
        • registry_external_url
        • git_data_dir
        • gitlab_ci
        • high_availability
        • manage_accounts
        • manage_storage_directories
        • omnibus_gitconfig
        • prometheus_monitoring
        • runtime_dir
        • storage_check
        • web_server
      • Roles
Edited by Balasankar 'Balu' C