-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
r10k, invoked by r10k::webhook, does not update the module code #496
Comments
If you name the git repository in form of For instance, given a module named "data", if we name the repository
and the module is updated as expected. This has to do with how the module name is parsed off of the repository name. The module_name parsing expects something in the form of If the Alternatively, there could be a check to see if the |
@0x6d617474, you are absolutely right. |
So I understand this clearly, is the issue the name set in the |
Given a module named
When those values are parsed by the webhook, it checks to see if If instead the git repo is named The regex for |
The result of the current version – https://regex101.com/r/tl7Kzc/2 Slightly modified version – https://regex101.com/r/2ulz1X/2 What do you think? |
I like it, but we should note the change in behavior for cases where there are multiple dashes in the URL, as it has the possibility to break existing deployments due to the change in behavior. |
Current regex truncates everything till the last dash in the
This version truncates everything till the first dash, otherwise — till the (last) slash ( Once more modified version — https://regex101.com/r/erVwT6/2
P.S.:
Could you give an example of such cases? That would help a lot when writing the right expression. Thanks. |
I meant |
Affected software versions/distributions
Manifest for deploying r10k
How to reproduce
Environment already deployed
root@puppet ~ # cat /etc/puppetlabs/code/environments/feature_sysctl/Puppetfile
Module deployed too
root@puppet ~ # git --git-dir=/etc/puppetlabs/code/environments/feature_sysctl/modules/sysctl/.git/ status HEAD
Push some changes to module repository
user@laptop ~/puppet/sysctl/ $ git log --pretty=format:'%h' -n 1
88b2039
user@laptop ~/puppet/sysctl/ $ date > test ; git commit -am "some changes" ; git push
Module code not changed/updated
root@puppet ~ # git --git-dir=/etc/puppetlabs/code/environments/feature_sysctl/modules/sysctl/.git/ status HEAD
What behaviour did you expect instead
Module code must be updated
root@puppet ~ # git --git-dir=/etc/puppetlabs/code/environments/feature_sysctl/modules/sysctl/.git/ status HEAD
Output log
root@puppet ~ # tail -fn0 /var/log/webhook/access.log
Any additional information you'd like to impart
Request/response details (Gitea webhook)
Request
Headers
Content
Response [202]
Headers
Body
Manual run r10k
The command is the same as in the webhook's log:
root@puppet ~ # r10k deploy module puppet/sysctl --verbose=debug2
output
By specifying the module name "sysctl" instead of "puppet/sysctl", the result is correct: the module code will be updated.
The text was updated successfully, but these errors were encountered: