[JIRA] (JENKINS-52237) being able to configure a new parser with groovy script directly from the job configuration

10 views
Skip to first unread message

armandooooo@hotmail.com (JIRA)

unread,
Jun 28, 2018, 5:41:01 AM6/28/18
to jenkinsc...@googlegroups.com
iostrym created an issue
 
Jenkins / Improvement JENKINS-52237
being able to configure a new parser with groovy script directly from the job configuration
Issue Type: Improvement Improvement
Assignee: Ulli Hafner
Components: warnings-plugin
Created: 2018-06-28 09:40
Environment: jenkins : 1.504
plug-in warning : 4.35
Priority: Major Major
Reporter: iostrym

we have several users and one admin.

admin guy (myself) create some parser.

it would be great if it could be possible for a user to choose a parser and being able to modify it (locally for its job). or even create a new one.

because it is annoying to provide administrative right to users only for the parser creation.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

ullrich.hafner@gmail.com (JIRA)

unread,
Sep 24, 2018, 12:29:02 PM9/24/18
to jenkinsc...@googlegroups.com
Ulli Hafner commented on Improvement JENKINS-52237
 
Re: being able to configure a new parser with groovy script directly from the job configuration

It is in the admin section due to security reasons: the script can basically do anything on your system so it is only safe to be checked by an admin.

I think we found a secure workaround for this: I will prohibit Groovy parsers to scan the console log. They are permitted only to scan files on the agent. Then only an agent might be compromised by a not well behaving script.

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

ullrich.hafner@gmail.com (JIRA)

unread,
Nov 7, 2018, 8:27:01 AM11/7/18
to jenkinsc...@googlegroups.com
Ulli Hafner updated an issue
 
Change By: Ulli Hafner
Component/s: warnings-ng-plugin
Component/s: warnings-plugin

medianick@gmail.com (JIRA)

unread,
Feb 25, 2019, 10:39:51 AM2/25/19
to jenkinsc...@googlegroups.com
Nick Jones commented on Improvement JENKINS-52237
 
Re: being able to configure a new parser with groovy script directly from the job configuration

The older Warnings plugin is the only way to define a custom console parser given this restriction – so this is a regression in functionality, blocking us from fully moving over to Warnings NG. Since the system-level parsers are able to be defined only by Jenkins administrators, how about allowing those parsers to access the console log while allowing job-level custom parsers to access only files in the workspace?

ernst@ernstdehaan.com (JIRA)

unread,
Mar 11, 2019, 7:12:02 AM3/11/19
to jenkinsc...@googlegroups.com

It would be nice if the parser would be configurable in a declarative manner. Then the security concerns would be alleviated and any job can just provide the configuration in a file.

christopher.fenner@sap.com (JIRA)

unread,
Jul 2, 2019, 8:37:03 AM7/2/19
to jenkinsc...@googlegroups.com

We need to parse the whole job log, so using tee is not an option for us. This is really blocking us from moving forward to warnings-ng plugin.

christopher.fenner@sap.com (JIRA)

unread,
Jul 5, 2019, 9:00:04 AM7/5/19
to jenkinsc...@googlegroups.com

For the old warnings plugin I could add a parser with 

Jenkins.instance.getExtensionList(hudson.plugins.warnings.WarningsDescriptor.class).get(0).addGroovyParser(new hudson.plugins.warnings.GroovyParser(...))

How can this be done for the new warnings-ng plugin?

 

christopher.fenner@sap.com (JIRA)

unread,
Jul 5, 2019, 9:02:01 AM7/5/19
to jenkinsc...@googlegroups.com
Christopher Fenner edited a comment on Improvement JENKINS-52237
We need to parse the whole job log, so using tee is not an option for us. - This is really blocking us from moving forward to warnings-ng plugin. - This I can do now by fetching the log from the _currentBuild_ and writing it to a file.

ullrich.hafner@gmail.com (JIRA)

unread,
Jul 5, 2019, 4:55:03 PM7/5/19
to jenkinsc...@googlegroups.com

christopher.fenner@sap.com (JIRA)

unread,
Jul 8, 2019, 3:26:03 AM7/8/19
to jenkinsc...@googlegroups.com

CaaC was a good hint, I now use this to add a parser on the fly:

def config = io.jenkins.plugins.analysis.warnings.groovy.ParserConfiguration.getInstance()
config.setParsers(
  config.getParsers().plus(
    new io.jenkins.plugins.analysis.warnings.groovy.GroovyParser(id, name, regex, script, example)
  )
)

ullrich.hafner@gmail.com (JIRA)

unread,
Jul 8, 2019, 5:17:03 AM7/8/19
to jenkinsc...@googlegroups.com

Good to see. Where or how do you execute that script? Are you interested in adding a small section for this approach in the documentation?

christopher.fenner@sap.com (JIRA)

unread,
Jul 10, 2019, 8:03:02 AM7/10/19
to jenkinsc...@googlegroups.com

We use this to position warnings/errors produced by pipeline shared library steps in pipeline runs more prominent on the job run by parsing with a custom message pattern.

Sure, I'll have a look a the respective docs page.

Reply all
Reply to author
Forward
0 new messages