Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-02-27 17:41:16 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2019-02-27 17:41:16 +0300
commitb6e5fcb4aa114d917f025ffed09f0e5f6fb9f8ab (patch)
treef74d8e8584f6a8482728e3926a736a7437df75f0 /lib
parent2ebd0d2d03f5ebdd8d309ed762e2ef8ccbe508a2 (diff)
parent316889cb4789e8a4a43bf0c79a4269643a97c336 (diff)
Merge branch '10014-ee-spec-models-ci-build_spec-rb-ee-spec-requests-api-runner_spec-rb-and-ee-spec-services-ci-process_pipeline_service_spec-rb-are-all-failing-ce' into 'master'
Revert "Merge branch 'revert-8baf9e5f' into 'master'" See merge request gitlab-org/gitlab-ce!25584
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/variables/collection/item.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/gitlab/ci/variables/collection/item.rb b/lib/gitlab/ci/variables/collection/item.rb
index e3e4e62cc02..833aa75adb5 100644
--- a/lib/gitlab/ci/variables/collection/item.rb
+++ b/lib/gitlab/ci/variables/collection/item.rb
@@ -5,12 +5,12 @@ module Gitlab
module Variables
class Collection
class Item
- def initialize(key:, value:, public: true, file: false)
+ def initialize(key:, value:, public: true, file: false, masked: false)
raise ArgumentError, "`#{key}` must be of type String or nil value, while it was: #{value.class}" unless
value.is_a?(String) || value.nil?
@variable = {
- key: key, value: value, public: public, file: file
+ key: key, value: value, public: public, file: file, masked: masked
}
end
@@ -27,9 +27,13 @@ module Gitlab
# don't expose `file` attribute at all (stems from what the runner
# expects).
#
+ # If the `variable_masking` feature is enabled we expose the `masked`
+ # attribute, otherwise it's not exposed.
+ #
def to_runner_variable
@variable.reject do |hash_key, hash_value|
- hash_key == :file && hash_value == false
+ (hash_key == :file && hash_value == false) ||
+ (hash_key == :masked && !Feature.enabled?(:variable_masking))
end
end