Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-52237

being able to configure a new parser with groovy script directly from the job configuration

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: warnings-ng-plugin
    • Labels:
      None
    • Environment:
      jenkins : 1.504
      plug-in warning : 4.35
    • Similar Issues:

      Description

      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.

        Attachments

          Activity

          Hide
          ennef Christopher Fenner added a comment -

          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?

           

          Show
          ennef Christopher Fenner added a comment - 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?  
          Hide
          drulli Ulli Hafner added a comment -

          This is not possible. Can't you add parsers using JCasC?

          Show
          drulli Ulli Hafner added a comment - This is not possible. Can't you add parsers using JCasC?
          Hide
          ennef Christopher Fenner added a comment -

          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)
            )
          )
          
          Show
          ennef Christopher Fenner added a comment - 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) ) )
          Hide
          drulli Ulli Hafner added a comment -

          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?

          Show
          drulli Ulli Hafner added a comment - 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 ?
          Hide
          ennef Christopher Fenner added a comment -

          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.

          Show
          ennef Christopher Fenner added a comment - 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.

            People

            Assignee:
            drulli Ulli Hafner
            Reporter:
            iostrym iostrym
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated: