summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2017-06-27 18:05:43 -0400
committerAlejandro Rodríguez <alejorro70@gmail.com>2017-06-27 18:05:43 -0400
commitf7a0fe1dfca85cf03b90400e089b19fbe6199f4a (patch)
treee29b6ba198b947bf82dcc7a275c4a2938f58754c
parent6ab588665c786a187b47cce8097325d22613cdb3 (diff)
downloadgitlab-ce-gitaly-client-spec-fix.tar.gz
Output to debug gitaly_client testgitaly-client-spec-fix
-rw-r--r--lib/gitlab/gitaly_client.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb
index f605c06dfc3..dc43ef2cbd8 100644
--- a/lib/gitlab/gitaly_client.rb
+++ b/lib/gitlab/gitaly_client.rb
@@ -57,7 +57,7 @@ module Gitlab
metadata = yield(metadata) if block_given?
stub(service, storage).send(rpc, request, metadata)
end
-
+
def self.request_metadata(storage)
encoded_token = Base64.strict_encode64(token(storage).to_s)
{ metadata: { 'authorization' => "Bearer #{encoded_token}" } }
@@ -75,18 +75,24 @@ module Gitlab
end
def self.feature_enabled?(feature, status: MigrationStatus::OPT_IN)
+ puts
+ puts "feature_enabled?(#{feature},#{status})"
+ puts "enabled? = '#{enabled?}'"
return false if !enabled? || status == MigrationStatus::DISABLED
feature = Feature.get("gitaly_#{feature}")
# If the feature hasn't been set, turn it on if it's opt-out
+ puts "Feature.persisted?(#{feature}) = '#{Feature.persisted?(feature)}'"
return status == MigrationStatus::OPT_OUT unless Feature.persisted?(feature)
if feature.percentage_of_time_value > 0
# Probabilistically enable this feature
+ puts "Returning random based on '#{feature.percentage_of_time_value}'"
return Random.rand() * 100 < feature.percentage_of_time_value
end
+ puts "feature.enabled? = '#{feature.enabled?}'"
feature.enabled?
end