[JIRA] (JENKINS-56699) Provide formatter for messages that contain newlines

16 views
Skip to first unread message

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 23, 2019, 6:10:04 AM3/23/19
to jenkinsc...@googlegroups.com
Ulli Hafner created an issue
 
Jenkins / Improvement JENKINS-56699
Provide formatter for messages that contain newlines
Issue Type: Improvement Improvement
Assignee: Ulli Hafner
Components: warnings-ng-plugin
Created: 2019-03-23 10:09
Priority: Minor Minor
Reporter: Ulli Hafner

If a message contains newline characters then the message is not shown properly in the UI. I.e. the content should be reformatted using HTML tags.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 28, 2019, 6:34:05 AM3/28/19
to jenkinsc...@googlegroups.com

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 28, 2019, 6:43:02 AM3/28/19
to jenkinsc...@googlegroups.com
Ulli Hafner commented on Improvement JENKINS-56699
 
Re: Provide formatter for messages that contain newlines

Rendering of the warnings message and description is done in:

  • DetailsTableModel (see existing test DetailsTableModelTest)
  • SourcePrinter (see existing test SourcePrinterTest)

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 28, 2019, 6:57:02 AM3/28/19
to jenkinsc...@googlegroups.com
Ulli Hafner assigned an issue to Unassigned
 
Change By: Ulli Hafner
Assignee: Ulli Hafner

andipabst25@gmail.com (JIRA)

unread,
Apr 2, 2019, 7:17:03 AM4/2/19
to jenkinsc...@googlegroups.com

andipabst25@gmail.com (JIRA)

unread,
Apr 2, 2019, 8:36:03 AM4/2/19
to jenkinsc...@googlegroups.com
Andreas Pabst assigned an issue to Unassigned

ullrich.hafner@gmail.com (JIRA)

unread,
Sep 20, 2019, 2:09:01 PM9/20/19
to jenkinsc...@googlegroups.com
Ulli Hafner updated an issue
Change By: Ulli Hafner
Labels: help-wanted newbie-friendly
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

benjamin.c.cross@gmail.com (JIRA)

unread,
Mar 2, 2020, 12:26:03 PM3/2/20
to jenkinsc...@googlegroups.com
Benjamin Cross commented on Improvement JENKINS-56699
 
Re: Provide formatter for messages that contain newlines

So then can this issue be closed? What HTML tags should be added? Ulli Hafner

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 2, 2020, 1:18:02 PM3/2/20
to jenkinsc...@googlegroups.com

Hmm, I don't think that this has been fixed yet. Or what do you think?

benjamin.c.cross@gmail.com (JIRA)

unread,
Mar 2, 2020, 3:49:02 PM3/2/20
to jenkinsc...@googlegroups.com

Sorry, I'm very newbie and want to ensure I am understanding the improvement you are asking for. I see the SourcePrinter has a render method. When the message is rendered it uses the Sanitizer. Are you asking for a new method to put that message into html for the createTitle method?

benjamin.c.cross@gmail.com (JIRA)

unread,
Mar 2, 2020, 3:50:02 PM3/2/20
to jenkinsc...@googlegroups.com
Benjamin Cross edited a comment on Improvement JENKINS-56699
Sorry, I'm very newbie and want to ensure I am understanding the improvement you are asking for. I see the SourcePrinter has a render method. When the message is rendered it uses the Sanitizer. Are you asking for a new method to put that message into html for the createTitle method where each new line is considered a new <p></p> ?

benjamin.c.cross@gmail.com (JIRA)

unread,
Mar 2, 2020, 4:18:02 PM3/2/20
to jenkinsc...@googlegroups.com
Benjamin Cross edited a comment on Improvement JENKINS-56699
Sorry, I'm very newbie and want to ensure I am understanding the improvement you are asking for. I see the SourcePrinter has a render method. When the message is rendered it uses the Sanitizer. Are you asking for a new method to put that message into html for the createTitle method where each new line is considered a new <p></p> break ?

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 2, 2020, 4:49:02 PM3/2/20
to jenkinsc...@googlegroups.com

I see, you are looking for an newbie issue that you can fix?

Currently some parsers create multiline messages and descriptions (in plain text using newlines as separator). If these messages are shown in the UI, then the newlines are simply ignored since they have no meaning in HTML. So the fix would be to detect the newlines and show the information in a better way.

Example: Set a breakpoint in https://github.com/jenkinsci/warnings-ng-plugin/blob/master/src/test/java/io/jenkins/plugins/analysis/warnings/StepsITest.java#L275 and open the Jenkins under test (you need to suspend the test thread only). This parser creates a 2 line message. It has newlines in the issue.message property but in the UI it is shown in a single line. It would make sense to either put everything into a <pre>*</pre> or to insert <br/> after each line. (The same is true for the description if I remember correctly).

I'm not sure if such a change can be applied to all parsers or if we should have a property for parsers that already report messages or descriptions in HTML. But we can check this afterwards if the fix is working for some of the multi-line parsers...

benjamin.c.cross@gmail.com (JIRA)

unread,
Apr 10, 2020, 4:57:03 PM4/10/20
to jenkinsc...@googlegroups.com
Benjamin Cross edited a comment on Improvement JENKINS-56699
[~drulli] I made a PR [ # 438|[https://github.com/jenkinsci/warnings-ng-plugin/pull/438]] with what I think you are looking for. Let me know if you have any suggestions or changes.

benjamin.c.cross@gmail.com (JIRA)

unread,
Apr 10, 2020, 4:57:03 PM4/10/20
to jenkinsc...@googlegroups.com

Ulli Hafner I made a PR [#438|https://github.com/jenkinsci/warnings-ng-plugin/pull/438] with what I think you are looking for. Let me know if you have any suggestions or changes.

ullrich.hafner@gmail.com (JIRA)

unread,
Apr 21, 2020, 3:26:02 AM4/21/20
to jenkinsc...@googlegroups.com
Change By: Ulli Hafner
Status: Open Fixed but Unreleased
Resolution: Fixed
Reply all
Reply to author
Forward
0 new messages