pre-receive hooks: project information

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Proposal

We have some system-wide pre-receive hooks. Of course, every project has it's own needs. So we need an mechanism to customize some system-wide hooks here. The easiest way would to provide additional information as environment variables [1] to the hook.

Those information could be provided by labels like the "Project Topics" for us. So any project can define special topics and gitlab can provide a space separated variables like GL_REPOSITORY_TOPICS. So we can use those custom information in our pre-receive hook. It won't need any new WebUI and won't interfere with other stuff. Just provide that project information to the hook.

Of course the pre-receive hook could all the API to get those information. But it is really error-prone to call gitlab itself while it is in a pre-receive transaction.

[1] https://docs.gitlab.com/ee/administration/server_hooks.html#environment-variables-available-to-server-hooks

Edited by 🤖 GitLab Bot 🤖