I’m attempting to extract and validate commit messages during a pre-push hook. I’m using the extract_pre_commit helper file to get the commit messages and get an error:
My results of kwargs[‘commit_ids’]:
[{u’ref’: u’filler_data’,
u’type’: u’filler_data’,
u’old_rev’: u’filler_data’,
u’name’: u’filler_data’,
u’new_rev’: u’filler_data’}]
I assume I’m missing [‘git_env’] due to my rhodecode version. Is this correct? When I remove all git_env variables I’m only able to get the commits within the remote repo.
2024-09-12 10:59:46.127 [3047] ERROR [rhodecode.lib.hooks_daemon] Exception when handling hook <function pre_push at 0x7f8e8eb19230>
Traceback (most recent call last):
File “/opt/rhodecode/store/p9vr3b65srfrkr4gbag23mpcdkk0xy6w-python2.7-rhodecode-enterprise-ce-4.12.4/lib/python2.7/site-packages/rhodecode/lib/hooks_daemon.py”, line 288, in _call_hook
result = hook(extras)
File “/opt/rhodecode/store/p9vr3b65srfrkr4gbag23mpcdkk0xy6w-python2.7-rhodecode-enterprise-ce-4.12.4/lib/python2.7/site-packages/rhodecode/lib/hooks_base.py”, line 115, in pre_push
pre_push_extension(repo_store_path=Repository.base_path(), **extras)
File “/opt/rhodecode/store/p9vr3b65srfrkr4gbag23mpcdkk0xy6w-python2.7-rhodecode-enterprise-ce-4.12.4/lib/python2.7/site-packages/rhodecode/lib/hooks_base.py”, line 291, in call
return callback(**kwargs_to_pass)
File “/home/rhodecode/.rccontrol/community-1/rcextensions/init.py”, line 183, in wrapper
return func(*args, **kwargs)
File “/home/rhodecode/.rccontrol/community-1/rcextensions/init.py”, line 165, in wrapper
return func(*args, **kwargs)
File “/home/rhodecode/.rccontrol/community-1/rcextensions/init.py”, line 450, in _pre_push_hook
commit_list = extra_pre_commits.run(*args, **kwargs)
File “/home/rhodecode/.rccontrol/community-1/rcextensions/extra_pre_commits.py”, line 164, in run
new_environ = dict((k, v) for k, v in rev_data[‘git_env’])
KeyError: ‘git_env’
Thank you for reaching out! This effort/upgrade is currently paused. We are determining the priority within our company and will reach out if issues arise in the future.