GL_REPOSITORY not set when merging merge requests from the web UI
Summary
The GL_REPOSITORY
variable is not available to custom hooks when merging merge requests from the UI.
Steps to reproduce
Add a custom update hook in a repo:
cat > custom_hooks/update <<EOF
#!/usr/bin/env bash
set | grep ^GL
exit 2
EOF
chmod +x custom_hooks/update
Create a merge request, and then merge it.
The following error message is shown:
GL_ID=user-33<br>GL_USERNAME=georgi.georgiev1<br>.
What is the current bug behavior?
GL_REPOSITORY
variable is not populated.
What is the expected correct behavior?
GL_REPOSITORY
variable is populated.
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
$ sudo gitlab-rake gitlab:env:info
System information System: CentOS 7.4.1708 Current User: git Using RVM: no Ruby Version: 2.3.5p376 Gem Version: 2.6.13 Bundler Version:1.13.7 Rake Version: 12.3.0 Redis Version: 3.2.11 Git Version: 2.14.3 Sidekiq Version:5.0.4 Go Version: unknown
GitLab information Version: 10.3.3 Revision: 888cf31 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql ... Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 5.10.2 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
$ sudo gitlab-rake gitlab:check SANITIZE=true...
378/3766 ... yes 378/3767 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.3.5) Git version >= 2.7.3 ? ... yes (2.14.3) Git user has default SSH configuration? ... yes Active users: ... 383
Checking GitLab ... Finished
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)