Bug 1392509 - Color syntax in log is not handling url inside quotes
Summary: Color syntax in log is not handling url inside quotes
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Management Console
Version: 3.x
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: ---
Assignee: Samuel Padgett
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-07 15:52 UTC by Aurélien Pupier
Modified: 2016-12-09 21:51 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-09 21:51:31 UTC
Target Upstream Version:


Attachments (Terms of Use)
log with the issue (356.30 KB, image/png)
2016-11-07 15:52 UTC, Aurélien Pupier
no flags Details

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.


Note You need to log in before you can comment on or make changes to this bug.