[users at bb.net] Help on custom hook

Shulhan m.shulhan at gmail.com
Thu Nov 2 06:52:18 UTC 2017


Hello all,

Current enviroments,

- buildbot version is 0.9.12.
- CentOS 7
- Python 2.7.5
- Twisted 17.9.0

I have a custom hook that triggered from Mattermost slash command,

  /change_hook/mattermost

Previously, using buildbot v0.9.0 my custom hook worked [1] flawlessly.
After upgrading to v0.9.12, I need to refactor my custom hook into this
script [2].

I copied the script to `/usr/lib/python2.7/site-packages/buildbot/www/hooks`
and restart buildmaster process.

When executing slash command from Mattermost, I got the following response,

  [2017/11/02 06:37:16 UTC] [EROR] /api/v4/commands/execute:command code=500 rid=dyxr58jez7ffpynkor74e4yi5e uid=7mz1mju7dbyu7n788w7pyswcmr ip=10.8.0.3 Command with a trigger of 'build' returned response 400 The dialect specified, 'mattermost', is not registered as a buildbot.webhook plugin [details: The dialect specified, 'mattermost', is not registered as a buildbot.webhook plugin]

Log from buildmaster,

  2017-11-02 06:37:16+0000 [_GenericHTTPChannelProtocol,0,172.32.1.208] The dialect specified, 'mattermost', is not registered as a buildbot.webhook plugin

My master.cfg contains,

c['www'] = {
        ...
	,	"change_hook_dialects":{
			"github": {
				"secret": "{{ buildmaster_github_secret }}"
			,	"strict": True
			}
		,	"mattermost": {
				"token": "{{ mattermost_token }}"
			,	"channel": "ci"
			,	"repo_base_url": "{{ repo_base_url }}"
			}
		}

What should I do?

[1] https://github.com/shuLhan/mattermost-integration/blob/master/buildbot/mattermost.py
[2] https://gist.github.com/shuLhan/0bdbe7e22c2df4bfc5b6d6c79ee282b6


More information about the users mailing list