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
This commit is contained in:
Ian Wienand 2016-04-21 13:53:23 +10:00 committed by Andreas Jaeger
parent b53c69cfb2
commit 48e8f7e937

View File

@ -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 <li> element
# that we match & rewrite with styles below
name => 'testresult',
match => '<li>([^ ]+) <a href=\"[^\"]+\" target=\"_blank\">([^<]+)</a> : ([^ ]+)([^<]*)</li>',
match => '<li>(.+) <a href=\".+\" target=\"_blank\">(.+)</a> : (\\w+) (.*)</li>',
html => '<li class=\"comment_test\"><span class=\"comment_test_name\"><a href=\"$2\">$1</a></span> <span class=\"comment_test_result\"><span class=\"result_$3\">$3</span>$4</span></li>',
},
{