diff options
author | Nick Thomas <nick@gitlab.com> | 2018-08-14 00:22:46 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-08-14 00:22:46 +0100 |
commit | c8bf2e7d47c3b8f34cb79847edcd5dd50b8f280e (patch) | |
tree | cc22dc6c91f58ccaadd97fdd816159de6ec8a135 /lib/gitlab_post_receive.rb | |
parent | 764f6f47fa6a8698ae033532ae49875a87030518 (diff) | |
download | gitlab-shell-c8bf2e7d47c3b8f34cb79847edcd5dd50b8f280e.tar.gz |
Revert "Merge branch 'ash.mckenzie/srp-refactor' into 'master'"
This reverts commit 3aaf4751e09262c53544a1987f59b1308af9b6c1, reversing
changes made to c6577e0d75f51b017f2f332838b97c3ca5b497c0.
Diffstat (limited to 'lib/gitlab_post_receive.rb')
-rw-r--r-- | lib/gitlab_post_receive.rb | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/gitlab_post_receive.rb b/lib/gitlab_post_receive.rb index 9248582..cb9931d 100644 --- a/lib/gitlab_post_receive.rb +++ b/lib/gitlab_post_receive.rb @@ -8,18 +8,20 @@ require 'securerandom' class GitlabPostReceive include NamesHelper - def initialize(gl_repository, repo_path, gl_id, changes) + attr_reader :config, :gl_repository, :repo_path, :changes, :jid + + def initialize(gl_repository, repo_path, actor, changes) @config = GitlabConfig.new @gl_repository = gl_repository @repo_path = repo_path.strip - @gl_id = gl_id + @actor = actor @changes = changes @jid = SecureRandom.hex(12) end def exec response = GitlabMetrics.measure("post-receive") do - api.post_receive(gl_repository, actor, changes) + api.post_receive(gl_repository, @actor, changes) end return false unless response @@ -33,18 +35,12 @@ class GitlabPostReceive false end - private - - attr_reader :config, :gl_repository, :repo_path, :gl_id, :changes, :jid + protected def api @api ||= GitlabNet.new end - def actor - @actor ||= Actor.new_from(gl_id, audit_usernames: config.audit_usernames) - end - def print_merge_request_links(merge_request_urls) return if merge_request_urls.empty? puts @@ -104,6 +100,8 @@ class GitlabPostReceive puts "=" * total_width end + private + def parse_broadcast_msg(msg, text_length) msg ||= "" # just return msg if shorter than or equal to text length |