• Stan Hu's avatar
    Fix consolidated storage settings · e7d9434e
    Stan Hu authored
    https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52750 broke
    consolidated storage settings because it was scanning storage-specific
    settings. For example, let's say you had:
    
    ```yaml
    object_store:
        enabled: true
        objects:
            artifacts:
                enabled: false
    
    artifacts:
        enabled: true
    ```
    
    In `1_settings.rb`, `ObjectStoreSettings#legacy_parse!` will
    automatically add default `object_store` settings to the
    storage-specific settings:
    
    ```yaml
    artifacts:
        enabled: true
        object_store:
            enabled: false
            ...
    ```
    
    As seen above, `artifacts.object_store.enabled` defaults to `false`, so
    the check introduced in
    https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52750 would mean
    that object storage would never be enabled unless storage-specific
    settings were also enabled.
    
    The right fix: skip parsing of consolidated settings only if the object
    type has explicitly disabled it in the consolidated settings. In the
    example above, this means we check the parameter in
    `object_store.objects.artifacts.enabled`, which overrides the default
    consolidated settings.
    
    This should fix https://gitlab.com/gitlab-org/gitlab/-/issues/233826.
    e7d9434e
object_store_settings_spec.rb 7.27 KB