Commit bd0aae21 authored by Thong Kuah's avatar Thong Kuah

Be explicit about setting :masked

Only some values can be masked. Currently API defaults :masked to false
and browser defaults :masked to true - resolve this ambiguity by
requiring QA to be explicit about which value it requires for :masked.
parent 1ae718f2
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module QA module QA
module Resource module Resource
class CiVariable < Base class CiVariable < Base
attr_accessor :key, :value attr_accessor :key, :value, :masked
attribute :project do attribute :project do
Project.fabricate! do |resource| Project.fabricate! do |resource|
...@@ -49,7 +49,8 @@ module QA ...@@ -49,7 +49,8 @@ module QA
def api_post_body def api_post_body
{ {
key: key, key: key,
value: value value: value,
masked: masked
} }
end end
end end
......
...@@ -16,6 +16,7 @@ module QA ...@@ -16,6 +16,7 @@ module QA
resource.project = project resource.project = project
resource.key = 'VARIABLE_KEY' resource.key = 'VARIABLE_KEY'
resource.value = 'some_CI_variable' resource.value = 'some_CI_variable'
resource.masked = false
end end
project.visit! project.visit!
......
...@@ -60,6 +60,7 @@ module QA ...@@ -60,6 +60,7 @@ module QA
resource.project = @project resource.project = @project
resource.key = deploy_key_name resource.key = deploy_key_name
resource.value = key.private_key resource.value = key.private_key
resource.masked = false
end end
gitlab_ci = <<~YAML gitlab_ci = <<~YAML
......
...@@ -34,6 +34,7 @@ module QA ...@@ -34,6 +34,7 @@ module QA
resource.project = @project resource.project = @project
resource.key = 'CODE_QUALITY_DISABLED' resource.key = 'CODE_QUALITY_DISABLED'
resource.value = '1' resource.value = '1'
resource.masked = false
end end
# Set an application secret CI variable (prefixed with K8S_SECRET_) # Set an application secret CI variable (prefixed with K8S_SECRET_)
...@@ -41,6 +42,7 @@ module QA ...@@ -41,6 +42,7 @@ module QA
resource.project = @project resource.project = @project
resource.key = 'K8S_SECRET_OPTIONAL_MESSAGE' resource.key = 'K8S_SECRET_OPTIONAL_MESSAGE'
resource.value = 'you_can_see_this_variable' resource.value = 'you_can_see_this_variable'
resource.masked = false
end end
# Connect K8s cluster # Connect K8s cluster
......
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