-
-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Hashed repository storage type #322
Comments
We are using the following patch as a workaround. I am not proposing this patch as a merge request, because, I guess, legacy repositories storage should also be supported until deprecation or at least until end of support:
|
between HA and storage pools (which come online when you turn on hashed storage), it could make our hooks feature nearly impossible to continue to support. |
I looked at using the
The only issue I see with this is each time the command is run takes 40-60 seconds on my machine which could substantially increase the puppet run time. Thoughts on that approach? |
Gitlab has changed the storage path mechanism again - hashed paths are only for repos created before Gitlab 15.3. There is now a command line to create hooks - need to investigate that further: https://docs.gitlab.com/ee/administration/server_hooks.html#server-hooks-on-a-gitaly-cluster |
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
Try creating a custom hook when the repository storage type is set to "hashed" which is recommended by default for Gitlab now.
What are you seeing
Module is trying to create a "custom_hooks" directory under /var/opt/gitlab/git-data/repositories/<namespace>/<repository_name> directory
What behavior did you expect instead
Since for this test project the "project ID" happens to be 3778, I'd like the directory "custom_hooks" to be created under
/var/opt/gitlab/git-data/repositories/@hashed/54/50/5450f0a658b52a4b3ecc517d84581bdffb2df2d5245de45bb9c8e78c4418f675.git/
because
echo -n 3778 | sha256sum
yilds 5450f0a658b52a4b3ecc517d84581bdffb2df2d5245de45bb9c8e78c4418f675Output log
Error: Cannot create /var/opt/gitlab/git-data/repositories/seriv/csweb.git/custom_hooks; parent directory /var/opt/gitlab/git-data/repositories/seriv/csweb.git does not exist
Any additional information you'd like to impart
Per Gitlab "Storage Types" the way module behaves rely on using "legacy" storage types, while the default is not supported. To fix this issue module should query Gitlab getting Project ID and then create sha256sum of it for using as a hashed path instead of legacy <namespace>/<repo_name>
The text was updated successfully, but these errors were encountered: