My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 2514: Invalid regex in commentlink prevents change screen from being loaded
1 person starred this issue and may be notified of changes. Back to list
Status:  Released
Owner:  ----
Closed:  Mar 2014


Sign in to add a comment
 
Project Member Reported by david.pu...@sonymobile.com, Mar 4, 2014
************************************************************
***** NOTE: THIS BUG TRACKER IS FOR GERRIT CODE REVIEW *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, INTERNAL *****
***** ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.    *****
***** THOSE ISSUE BELONG IN DIFFERENT ISSUE TRACKERS!  *****
************************************************************

Affected Version: 2.8.2

What steps will reproduce the problem?

Add the following commentlink configuration in gerrit.config:

[commentlink "bug"]
	match = ((?<!https?://[^\\s]{1,2000})BUG\\d{8})
	html = <a title=\"View Issue\" target=\"_blank\" href=\"http://bugs.example.com/?q=$1\">$1</a>


What is the expected output? What do you see instead?

Expected:
Strings like "BUG1234567" in comments are replaced with a link.  Strings like "http://foo.com/BUG01234567" are only linkified without the replacement.

Actual:
Can't see if it actually works because the change screen fails to load.  Seems to be something going wrong in the GET of the "comments" endpoint on the changes REST API.

Please provide any additional information below.

I've tried to track it down in the debugger but not got very far.

The problem affects both the old and new change screens.

Mar 5, 2014
Project Member #2 david.pu...@sonymobile.com
(No comment was entered for this change.)
Status: ChangeUnderReview
Mar 5, 2014
Project Member #3 david.pu...@sonymobile.com
The commit message of that change says "when the 'commentlink.<subsection-name>.match' is configured wrongly".

Does that mean the configuration in my example is incorrect?
Mar 6, 2014
Project Member #4 david.pu...@sonymobile.com
The commentlink match must be a JavaScript regex.  Lookbehind is not supported in JavaScript regex.

Change 54984 catches the exception and displays an error message.
Summary: Invalid regex in commentlink prevents change screen from being loaded (was: Using negative lookbehind regex in commentlink prevents change screen from being loaded)
Status: Submitted
Labels: FixedIn-2.8.2
Mar 11, 2014
Project Member #5 david.pu...@sonymobile.com
(No comment was entered for this change.)
Status: Released
Sign in to add a comment

Powered by Google Project Hosting