diff --git a/modules/gerrit/files/patchset-created b/modules/gerrit/files/patchset-created new file mode 100755 index 0000000000..150a8ce531 --- /dev/null +++ b/modules/gerrit/files/patchset-created @@ -0,0 +1,3 @@ +#!/bin/sh + +python ~/openstack-ci/gerrit/update_blueprint.py patchset-created "$@" diff --git a/modules/gerrit/manifests/init.pp b/modules/gerrit/manifests/init.pp index dd79205e7f..6fd488d1db 100644 --- a/modules/gerrit/manifests/init.pp +++ b/modules/gerrit/manifests/init.pp @@ -2,9 +2,19 @@ class gerrit($canonicalweburl='', $openidssourl="https://login.launchpad.net/+openid", $email='', $github_projects = [], -$commentlinks = [ { name => 'launchpad', +$commentlinks = [ { name => 'changeid', + match => '(I[0-9a-f]{8,40})', + link => '#q,$1,n,z' }, + + { name => 'launchpad', match => '([Bb]ug|[Ll][Pp])\\s*[#:]?\\s*(\\d+)', - link => 'https://code.launchpad.net/bugs/$2' } ] + link => 'https://code.launchpad.net/bugs/$2' }, + + { name => 'blueprint', + match => '([Bb]lue[Pp]rint|[Bb][Pp])\\s*[#:]?\\s*(\\S+)', + link => 'https://blueprints.launchpad.net/openstack/?searchtext=$2' }, + + ] ) { package { "python-dev": @@ -77,6 +87,15 @@ $commentlinks = [ { name => 'launchpad', replace => 'true', } + file { '/home/gerrit2/review_site/hooks/patchset-created': + owner => 'root', + group => 'root', + mode => 555, + ensure => 'present', + source => 'puppet:///modules/gerrit/patchset-created', + replace => 'true', + } + } else { notice('Gerrit is not installed') }