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

Cannot pass parserId to analysisParser

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • warnings-ng-plugin
    • None
    • Jenkins:2.332.1
      Warnings Next Generation Plugin (warnings-ng): 9.11.1

      When attempting to use a pipeline step with a generic symbol (as documented in `Documentation.md`, it is not possible to pass `parserId`, in the use-case when using a custom parser (eg: groovyScript parser).

       

      It would allow for much more streamlined pipeline code if it were possible to pass `parserId` to `analysisParser`.

      Example of non-working scripted pipeline code:

      scanForIssues tool: analysisParser(
          analysisModelId: 'groovy',
          id: 'my-id',
          name: 'Custom issues',
          pattern: '*.log',
          parserId: 'custom-parser'
      )

      Output from above code:

      WARNING: Unknown parameter(s) found for class type 'io.jenkins.plugins.analysis.warnings.RegisteredParser': parserId
      java.lang.IllegalArgumentException: Could not instantiate {tool=@analysisParser(analysisModelId=groovy,id=my-id,name='Custom issues',pattern=.log,parserId=custom-parser)} for io.jenkins.plugins.analysis.core.steps.ScanForIssuesStep: java.lang.IllegalArgumentException: Could not instantiate {analysisModelId=groovy, id=my-id, name='Custom issues', pattern=.log, parserId=custom-parser} for io.jenkins.plugins.analysis.warnings.RegisteredParser: java.lang.reflect.InvocationTargetException
       

      Working code:

      scanForIssues tool: groovyScript(
          id: 'my-id',
          name: 'Custom issues',
          pattern: '*.log',
          parserId: 'custom-parser'
      )

            drulli Ulli Hafner
            fschwartz Matthew Durand
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: