summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastian Blank <waldi@debian.org>2019-03-30 00:50:02 +0100
committerBastian Blank <waldi@debian.org>2019-04-03 21:02:11 +0200
commit5725be9508df7922c77cfab4a6c5501548e5e3ca (patch)
tree252c1c9c362ff9a913cf0c8824660cea962c7a3e
parentee72dc1b34d893662fe0cb7793a1a960312b1f48 (diff)
downloadgitlab-ce-5725be9508df7922c77cfab4a6c5501548e5e3ca.tar.gz
Display maximum artifact size from runtime config
The maximum artifact size was moved into runtime config some time ago. Update the instance configuration code to read this value.
-rw-r--r--app/models/instance_configuration.rb2
-rw-r--r--changelogs/unreleased/instance-configuration-artifact-size.yml5
-rw-r--r--spec/models/instance_configuration_spec.rb7
3 files changed, 13 insertions, 1 deletions
diff --git a/app/models/instance_configuration.rb b/app/models/instance_configuration.rb
index 11289887e00..a9b1962f24c 100644
--- a/app/models/instance_configuration.rb
+++ b/app/models/instance_configuration.rb
@@ -39,7 +39,7 @@ class InstanceConfiguration
def gitlab_ci
Settings.gitlab_ci
.to_h
- .merge(artifacts_max_size: { value: Settings.artifacts.max_size&.megabytes,
+ .merge(artifacts_max_size: { value: Gitlab::CurrentSettings.max_artifacts_size.megabytes,
default: 100.megabytes })
end
diff --git a/changelogs/unreleased/instance-configuration-artifact-size.yml b/changelogs/unreleased/instance-configuration-artifact-size.yml
new file mode 100644
index 00000000000..077f8631af5
--- /dev/null
+++ b/changelogs/unreleased/instance-configuration-artifact-size.yml
@@ -0,0 +1,5 @@
+---
+title: Display maximum artifact size from runtime config
+merge_request: 26784
+author: Bastian Blank
+type: fixed
diff --git a/spec/models/instance_configuration_spec.rb b/spec/models/instance_configuration_spec.rb
index e65f97df3c3..43954511858 100644
--- a/spec/models/instance_configuration_spec.rb
+++ b/spec/models/instance_configuration_spec.rb
@@ -82,6 +82,13 @@ describe InstanceConfiguration do
it 'returns the key artifacts_max_size' do
expect(gitlab_ci.keys).to include(:artifacts_max_size)
end
+
+ it 'returns the key artifacts_max_size with values' do
+ stub_application_setting(max_artifacts_size: 200)
+
+ expect(gitlab_ci[:artifacts_max_size][:default]).to eq(100.megabytes)
+ expect(gitlab_ci[:artifacts_max_size][:value]).to eq(200.megabytes)
+ end
end
end
end