Subgit SVN > Gitlab Hook are not working

We are experimenting with Subgit and successfully translated a SVN repository to Gitlab. Subsequent SVN commits are also translated without problem.

However we cannot seem to get the Hook’s working to trigger the gitlab-ci. Subgit installs the custom_hooks folder which contains the post-receive hook. The daemon tries to run a hook which doesn’t exist though (customs_hooks/user-post-receive).

What we tried was triggering the post-receive hook manually(with the correct input). I’ve also renamed the post-receive hook to user-post-receive. In both instances it says: Running Java post-receive hook. And as far as the output is concerned, works. However we see nothing in the gitlab rails/sidekiq log that indicates any connection has been made.

I feel like we are missing something obvious in the config. I’ve run through the documentation multiple times and I’ve done everything as described. I’ve also googled my ass of and although some people seem to have similar problems. None of the described fixes appear to work.

At this point we are considering creating a script that curls the gitlab-ci API of this particular repo and let subgit call that instead. However this is not ideal and I’m hoping someone can help me figure out what I’m doing wrong.

Hello Sebastian,

I’m afraid I don’t follow you completely here. SubGit indeed places its hooks in custom_hooks directory in GitLab environment and there is no user-post-receive by default as this hook is supposed to be created by a user if it’s needed. So everything looks as is should be in this part.
As for the CI – do I understand correctly the problem is that CI pipelines are not being triggered when changes come from SVN? The reason for this is that GitLab has migrated their hooks to Gitaly since some of the recent versions while SubGit does not support Gitaly, so it cannot trigger pipelines, indeed. A possible workaround is that you mentioned – to add an API call into some of the hooks (preferably to the user-post-receive) and thus trigger pipelines. Note, that to use this hook you would need to set the svn.triggerSvnPostReceive configuration setting to true:

[svn]
    …
    triggerSvnPostReceive = true

Please provide more details on the problem if I understand it not correctly.

Dear Ildar,

Thank you, that answers my question! We didn’t see anywhere in the documentation that Gitaly isnt supported and thus the gitlab-ci trigger is not working.

We will customize the hook so it will trigger the gitlab-ci :)

Best regards,

Sebastian

P.S. triggerSvnPostReceive was already configured to true.