Bug 1392509

Summary: Color syntax in log is not handling url inside quotes
Product: OKD Reporter: Aurélien Pupier <apupier>
Component: Management ConsoleAssignee: Samuel Padgett <spadgett>
Status: CLOSED CURRENTRELEASE QA Contact: Yadan Pei <yapei>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.xCC: aos-bugs, jforrest, mmccomas, spadgett, yanpzhan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-09 21:51:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
log with the issue none

Description Aurélien Pupier 2016-11-07 15:52:54 UTC
Created attachment 1218087 [details]
log with the issue

Description of problem:

Color syntax in log is not handling url inside quotes

Version-Release number of selected component (if applicable):

OpenShift Master:
    v3.3.0.32
Kubernetes Master:
    v1.3.0+52492b4 


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:

see attachment, there are extra letters highlighted in blue

Expected results:


Additional info:

Comment 1 Jessica Forrester 2016-11-07 16:16:35 UTC
We are using the linkify filter coming from Angular which is following the RFC for what is considered a valid URL. URL paths can include quote characters.

That said we have considered rolling our own version that ignores quotes because this is such a common occurrence in log output.

Comment 2 Samuel Padgett 2016-11-07 16:58:42 UTC
We use the Angular filter in most places, but for the logs specifically, we're using ansi_up linkify. Looking at the source, I think we can do better. The regex matches any non-whitespace character after the start of the URL.

https://github.com/drudru/ansi_up/blob/master/ansi_up.js#L93-L97

Comment 3 Samuel Padgett 2016-11-07 17:02:23 UTC
Here's the Angular implementation:

https://github.com/angular/angular.js/blob/master/src/ngSanitize/filter/linky.js#L131-L132

It's a lot more sophisticated, although the filter will encode HTML, which we don't want here.

Comment 5 Aurélien Pupier 2016-11-08 07:56:29 UTC
@Samuel thanks for the fast fix!

Comment 6 Yanping Zhang 2016-11-18 04:28:27 UTC
Checked on openshift v1.4.0-alpha.1+63e3797-264, now the color of url in quota shows well. The bug has been fixed, so move it to Verified.