summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-12-20 17:11:43 +0000
committerDouwe Maan <douwe@gitlab.com>2018-12-20 17:11:43 +0000
commit03e66710b8b6c8483a384e0784cec4689c48176f (patch)
tree6394d2df9e4c78f1b144dba758c1c041affed385
parentd3a853ec18c347ff85810d44c562af8de9249e58 (diff)
parent482e981dc06fefa0239fecddd955727e8f75ec9d (diff)
downloadgitlab-shell-03e66710b8b6c8483a384e0784cec4689c48176f.tar.gz
Merge branch 'gitaly-transistion-helpers' into 'master'
Gitaly hook transistion changes See merge request gitlab-org/gitlab-shell!268
-rw-r--r--README.md2
-rw-r--r--lib/gitlab_init.rb6
-rw-r--r--lib/http_helper.rb3
3 files changed, 8 insertions, 3 deletions
diff --git a/README.md b/README.md
index 2de6549..55f7c61 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ Git hooks that allow GitLab to validate Git pushes (e.g. "is this user
allowed to push to this protected branch"). These hooks also trigger
events in GitLab (e.g. to start a CI pipeline after a push). In
GitLab's current architecture (Q4 2018) these hooks belong to Gitaly
-more than gitlab-shell. We [intend to move them to the Gitaly
+more than gitlab-shell. We [are moving them to the Gitaly
repository](https://gitlab.com/gitlab-org/gitaly/issues/1226).
## Code status
diff --git a/lib/gitlab_init.rb b/lib/gitlab_init.rb
index 2767a62..9bd4e8f 100644
--- a/lib/gitlab_init.rb
+++ b/lib/gitlab_init.rb
@@ -1,3 +1,7 @@
-ROOT_PATH = File.expand_path('..', __dir__)
+ROOT_PATH = ENV.fetch('GITLAB_SHELL_DIR', File.expand_path('..', __dir__))
+
+# We are transitioning parts of gitlab-shell into the gitaly project. In
+# gitaly, GITALY_EMBEDDED will be true.
+GITALY_EMBEDDED = false
require_relative 'gitlab_config'
diff --git a/lib/http_helper.rb b/lib/http_helper.rb
index c66df53..c6a4bb8 100644
--- a/lib/http_helper.rb
+++ b/lib/http_helper.rb
@@ -78,7 +78,8 @@ module HTTPHelper
$logger.warn('Failed to connect', method: method.to_s.upcase, url: url, error: e)
raise GitlabNet::ApiUnreachableError
ensure
- $logger.info('finished HTTP request', method: method.to_s.upcase, url: url, duration: Time.new - start_time)
+ fields = { method: method.to_s.upcase, url: url, duration: Time.new - start_time, gitaly_embedded: GITALY_EMBEDDED }
+ $logger.info('finished HTTP request', fields)
end
case response