Jenkins pipeline check for compiler warnings user parser blocked

I have a pipeline for scanning compiler warnings and recently noticed that the publish command cannot execute the groovy scripts defined in the "Managing Jenkins" section due to the script's security statement. Complaint against:

Groovy sandbox rejected a parsing script for the GHS MULTI No-Wrap parser: scripts are not allowed to use the java.util.regex.MatchResult group int method. You will need to manually approve the call in the approval UI script.

So, I approve of this, but it comes back with every build. This only affects my custom parsers.

Am I using a custom parser incorrectly, or will this be a script security issue?

Parser regex:

^"+(.*)".*line\s(\d*):.*(error|warning)\s*#(.*):\s*(.*)$

Parser script:

import hudson.plugins.warnings.parser.Warning
import hudson.plugins.analysis.util.model.Priority

String fileName = matcher.group(1)
String lineNumber = matcher.group(2)
String category = matcher.group(3)
String typeID    = matcher.group(4)
String message = matcher.group(5)

if(category == "warning"){
    return new Warning(fileName, Integer.parseInt(lineNumber), typeID, 
    category, message, Priority.NORMAL);
}
else if(category == "error"){
    return new Warning(fileName, Integer.parseInt(lineNumber), typeID, 
    category, message, Priority.HIGH);
}

: , , , -,

, , .

+4
1

, Warnings 4.62. , . 4.60 .

+4

Source: https://habr.com/ru/post/1675561/


All Articles