Commit 9804e191 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Merge branch 'sh-fix-usage-ping-consolidated-store' into 'master'

Fix usage ping misreporting consolidated object storage settings

See merge request gitlab-org/gitlab!60526
parents ac7502ad 9863ad25
---
title: Fix usage ping misreporting consolidated object storage settings
merge_request: 60526
author:
type: fixed
......@@ -144,6 +144,11 @@ class ObjectStoreSettings
target_config['remote_directory'] = target_config.delete('bucket')
target_config['consolidated_settings'] = true
section['object_store'] = target_config
# Settingslogic internally stores data as a Hash, but it also
# creates a Settings object for every key. To avoid confusion, we should
# update both so that Settings.artifacts and Settings['artifacts'] return
# the same result.
settings[store_type]['object_store'] = target_config
end
settings
......
......@@ -74,6 +74,7 @@ RSpec.describe ObjectStoreSettings do
expect(settings.artifacts['object_store']['proxy_download']).to be false
expect(settings.artifacts['object_store']['remote_directory']).to eq('artifacts')
expect(settings.artifacts['object_store']['consolidated_settings']).to be true
expect(settings.artifacts).to eq(settings['artifacts'])
expect(settings.lfs['enabled']).to be true
expect(settings.lfs['object_store']['enabled']).to be true
......@@ -83,15 +84,18 @@ RSpec.describe ObjectStoreSettings do
expect(settings.lfs['object_store']['proxy_download']).to be true
expect(settings.lfs['object_store']['remote_directory']).to eq('lfs-objects')
expect(settings.lfs['object_store']['consolidated_settings']).to be true
expect(settings.lfs).to eq(settings['lfs'])
expect(settings.pages['enabled']).to be true
expect(settings.pages['object_store']['enabled']).to be true
expect(settings.pages['object_store']['connection']).to eq(connection)
expect(settings.pages['object_store']['remote_directory']).to eq('pages')
expect(settings.pages['object_store']['consolidated_settings']).to be true
expect(settings.pages).to eq(settings['pages'])
expect(settings.external_diffs['enabled']).to be false
expect(settings.external_diffs['object_store']).to be_nil
expect(settings.external_diffs).to eq(settings['external_diffs'])
end
it 'raises an error when a bucket is missing' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment