From 48e8f7e93739bf6ce50e9087c8085a80c76dcdf1 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 21 Apr 2016 13:53:23 +1000 Subject: [PATCH] Fix URL detection in testresult match This regex dates from the original commit (Idb4ad8e6079165d681271987a92cab5d8b7c81be) where I think the negative matches are intended to stop matching between groups. I don't think this is necessary. In particular, the negative match on the last group ($4) means that it will not match if there is a URL in the free-form text portion. I've simplified this and also added some comments to make it clear what it is looking for. Change-Id: I863d88e9a7ed2fd41924b8fc4a12dbea3ee2b205 --- modules/openstack_project/manifests/gerrit.pp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/openstack_project/manifests/gerrit.pp b/modules/openstack_project/manifests/gerrit.pp index 75af9bf12d..aa1d9f0ccd 100644 --- a/modules/openstack_project/manifests/gerrit.pp +++ b/modules/openstack_project/manifests/gerrit.pp @@ -162,8 +162,16 @@ class openstack_project::gerrit ( link => 'https://blueprints.launchpad.net/openstack/?searchtext=$2', }, { + # This matches comments from Zuul / 3rd party CI which should + # be in a raw format of: + # + # ( 1 ) ( 2 ) ( 3 ) ( 4 ) + # - test-name http://link.to/test : [PASSED|FAILURE] Some text about the change + # + # Gerrit will convert that to the
  • element + # that we match & rewrite with styles below name => 'testresult', - match => '
  • ([^ ]+) ([^<]+) : ([^ ]+)([^<]*)
  • ', + match => '
  • (.+) (.+) : (\\w+) (.*)
  • ', html => '
  • $1 $3$4
  • ', }, {