Skip to content

Remove setting Redis config file path via env var

Gregorius Marco requested to merge mg-remove-redis-config-via-env-var into master

What does this MR do and why?

Resolves #388255 (closed)

Remove setting Redis config file path via env var

Setting environment variable like GITLAB_REDIS_CACHE_CONFIG_FILE and the global GITLAB_REDIS_CONFIG_FILE for Redis config file path is no longer supported.

Changelog: removed

How to set up and validate locally

  1. Copy the existing config/redis.cache.yml to a new file:

    cp config/redis.cache.yml config/from_env_var.yml
  2. Edit config/from_env_var.yml to use another db name, e.g.:

    cat config/from_env_var.yml
    ---
    development: unix:/Users/gregoriusmarco/Documents/workspace/gdk-10-22/redis/redis.socket?db=1
    test: unix:/Users/gregoriusmarco/Documents/workspace/gdk-10-22/redis/redis.socket?db=12
  3. Start Rails console with the environment variable pointing to the file path:

    GITLAB_REDIS_CACHE_CONFIG_FILE=/Users/gregoriusmarco/Documents/workspace/gdk-10-22/gitlab/config/from_env_var.yml gdk rails c
  4. Check that Gitlab::Redis::Cache is still pointing to the config file derived from the name:

    [1] pry(main)> Gitlab::Redis::Cache.config_file_name
    => "/Users/gregoriusmarco/Documents/workspace/gdk-10-22/gitlab/config/redis.cache.yml"
    [2] pry(main)> Gitlab::Redis::Cache.url
    => "unix:/Users/gregoriusmarco/Documents/workspace/gdk-10-22/redis/redis.socket?db=2"

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Gregorius Marco

Merge request reports