Issue #289: [wait-for-feedback] Do not execute hook mercurial repository on version 0.3.3
Reported by: | maxvinokuroff |
State: | closed |
Created on: | 2017-08-02 21:26 |
Updated on: | 2018-05-06 09:12 |
Description
Text hgrc
[hooks] changegroup = /srv/kallithea/repos/puppet/maxhope/.hg/sync_maxhope_to_pm1.sh
Text sync_maxhope_to_pm1.sh
#!/bin/sh server_git="repo:5000" server1="pm1" #server2="pm2" server_dir1="/etc/puppet/environments/production" server_dir2="/etc/puppet/environments/testing" server_user="root" group_repo="puppet" repo="maxhope" BRANCH=$(hg log --template '{branch}' -r $HG_NODE) #BRANCH=testing case "$BRANCH" in "production") /usr/bin/ssh $server_user@$server1 "cd $server_dir1; /usr/bin/hg pull -u -f -b $BRANCH http://$server_git/$group_repo/$repo" ;; "testing") /usr/bin/ssh $server_user@$server1 "cd $server_dir2; /usr/bin/hg pull -u -f -b $BRANCH http://$server_git/$group_repo/$repo" ;; esac
This hook executed on version 0.3.2 very well, but not execute on version 0.3.3.
Attachments
Comments
Comment by Andrej Shadura, on 2017-08-02 21:39
I'm not sure hgrc hooks were ever really supported. @kiilerix, @domruf? The only change which touched something near that was cce5a8388cde… but it is not clear to me how that could affect hooks.
Comment by maxvinokuroff, on 2017-08-02 21:47
I am downgrade to 0.3.2 and now all work. And more that's worked about two years. Git hooks worked too, but I don't checking for version 0.3.3.
Comment by Andrej Shadura, on 2017-08-02 22:18
Thanks for that observation, but working and being supported are two different things. However, let's wait for Dominik and Mads to respond.
Comment by domruf, on 2017-08-03 06:29
I'm writing this from my mobile, so I can't check it right now. But I guess the used mercurial version may play a role in this.
Comment by maxvinokuroff, on 2017-08-03 08:35
repo ~ # uname -a Linux repo.hid.maxhope.in.ua 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u1 (2017-06-18) x86_64 GNU/Linux repo ~ # dpkg -l | grep mercurial ii mercurial 3.1.2-2+deb8u3 amd64 easy-to-use, scalable distributed version control system ii mercurial-common 3.1.2-2+deb8u3 all easy-to-use, scalable distributed version control system (common files)
I use Debian 8 old-stable, version mercurial from main repository. All time since 2015 made two security update. Link Text I think version mercurial in this case don't make sense.
Comment by domruf, on 2017-08-03 17:40
I now tried to reproduce the problem on windows and on ubuntu 17.04. But on both systems changegroup and prechangegroup hooks got executed when configured in hgrc file. So I'm afraid I need more information.
How did you install and run Kallithea?
Did you use virtualenv?
Did you upgrade from an old Kallithea version or was this a new installation?
Are there any other differences between the 0.3.3 and the 0.3.2 installation?
Can you try it with the following, very simple hook?
[hooks] prechangegroup = (>&2 echo "my message") && /bin/false
Comment by maxvinokuroff, on 2017-08-03 18:44
I install Kallithea use puppet module
"name": "rauch-kallithea", "version": "0.3.0", "author": "Robert Rauch (GNS Systems)", "summary": "Manage Kallithea, a free source code management system", "license": "Apache-2.0", "source": "https://github.com/rauchrob/puppet-kallithea",
That module create virtualenv in home directory user kallithea path /srv/kallithea. Create site.pp next parameters:
class { 'kallithea': version => '0.3.2', admin_mail => 'kallithea@exempla.org', admin_pass => 'admin_passwd', manage_git => true, seed_db => true, config_hash => { 'DEFAULT' => { 'debug' => false, 'app_email_from' => 'Kallithea <kallithea@exempla.org>', 'smtp_server' => 'smtp.exempla.org', 'smtp_username' => 'kallithea@exempla.org', 'smtp_password' => 'passwd_smtp', 'smtp_port' => '25', 'smtp_auth' => 'PLAIN', }, 'server:main' => { 'host' => '172.16.30.3', 'port' => '5000', }, 'app:main' => { 'force_https' => true, 'use_htsts' => true, #'lang' => 'ru', 'sqlalchemy.db1.url' => 'postgresql://user_db:passw_db@ip_db/name_db', }, } }
With this module you can exactly replicate my environment. Install the puppet. Create directory 'modules' copy the module in that directory and run about this command
puppet apply site.pp --modulepath=./modules
Comment by maxvinokuroff, on 2017-08-03 18:53
I may create test node with version 0.3.3 and give access. Give me yours pub key for ssh.
Comment by domruf, on 2017-08-03 20:27
@kiilerix @andrew_shadura I have no clue about puppet. Can one of you take a look at this?
@maxvinokuroff what about my other questions?
Comment by domruf, on 2017-08-03 20:56
I still can't reproduce your problem.
I did the following on my ubuntu system:
puppet module install rauch/kallithea
- create
kallithea.pp
like above but I used a sqlite database, used version 0.3.3 and host 0.0.0.0 sudo puppet apply kallithea.pp --modulepath=./.puppet/etc/code/modules/
There were some warnings and an error but I continuedcd /srv/kallithea/
. venv/bin/activate
- since I have no ssl I changed
force_https = false
inkallithea.ini
paster serve kallithea.ini
- create a repository
- create /srv/kallithea/repos/myrepo/.hg/hgrc with
[hooks] prechangegroup = (>&2 echo "my message") && /bin/false
Now when trying to push something to the repository it correctly fails because of the hook.
Comment by maxvinokuroff, on 2017-08-03 20:58
How did you install and run Kallithea? I install in clean new lxc container with Puppet deployment instruments.
Did you use virtualenv? Yes, this module create virtualenv.
Did you upgrade from an old Kallithea version or was this a new installation? No, I install new instance.
Are there any other differences between the 0.3.3 and the 0.3.2 installation? I will install two node, and make diff.
Comment by Thomas De Schampheleire, on 2018-01-20 20:42
@maxvinokuroff Have you been able to solve this issue?
Comment by Thomas De Schampheleire, on 2018-01-20 20:42
Comment by Thomas De Schampheleire, on 2018-05-06 09:12
Closed due to no response from submitter.