Skip to content

Use separate http settings config object

John Cai requested to merge jc-fetch-http-settings-separately into master

We want to fall back to the legacy config if we find any empty values in the http_settings. This is to guard against a partially empty config value getting passed from gitaly, which has empty fields in the http settings. This could happen as we transition from using the legacy shell config yml to the gitaly config toml.

in !2097 (merged), we passed the gitlab shell part of the gitaly config through to gitlab shell ruby. The http_settings was non-empty because the json contained keys with zero values eg:

{
  "http_settings":{"user":"", "password":"", "ca_file":"", "ca_path":"", "self_signed_cert":false},
}

so gitlab_config.rb decided that http_settings was non empty. The rest of the ruby code then accessed this http_settings with empty values.

What we really want is to fall back on the legacy config in an eager way so that if any http_settings value is nil or empty, then we try to fetch it from the legacy config.

This change creates a new class for http settings to do that.

NOTE: if we were to add omitempty tags on the Go side, that would fix things as well, but I think it's safer to guard against this on the ruby side too.

Merge request reports