Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: switch to new parameter name #4968

Merged
merged 7 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion documentation/docs/extensibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def call(Map parameters) {
goals: ['checkstyle:checkstyle'],
)

recordIssues blameDisabled: true,
recordIssues skipBlames: true,
enabledForFailure: true,
aggregatingResults: false,
tool: checkStyle()
Expand Down
2 changes: 1 addition & 1 deletion resources/default_pipeline_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ steps:
parserPattern: '\[(INFO|WARNING|ERROR)\] (.*) \(([^) ]*)\/([^) ]*)\)'
parserScript: 'return builder.guessSeverity(matcher.group(1)).setMessage(matcher.group(2)).setModuleName(matcher.group(3)).setType(matcher.group(4)).buildOptional()'
recordIssuesSettings:
blameDisabled: true
skipBlames: true
enabledForFailure: true
seleniumExecuteTests:
buildTool: 'npm'
Expand Down
2 changes: 1 addition & 1 deletion test/groovy/PiperPublishWarningsTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class PiperPublishWarningsTest extends BasePiperTest {
assertThat(warningsParserSettings, hasKey('script'))
assertThat(warningsPluginOptions, allOf(
hasEntry('enabledForFailure', true),
hasEntry('blameDisabled', true)
hasEntry('skipBlames', true)
))
assertThat(warningsPluginOptions, hasKey('tools'))

Expand Down
11 changes: 8 additions & 3 deletions vars/checksPublishResults.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,13 @@ void call(Map parameters = [:]) {
def report(tool, settings, doArchive){
def options = createOptions(settings).plus([tools: [tool]])
echo "recordIssues OPTIONS: ${options}"
// publish
recordIssues(options)
try {
// publish
recordIssues(options)
} catch (e) {
echo "recordIssues has failed. Possibly due to an outdated version of the warnings-ng plugin."
e.printStackTrace()
}
// archive check results
archiveResults(doArchive && settings.get('archive'), settings.get('pattern'), true)
}
Expand All @@ -149,7 +154,7 @@ def archiveResults(archive, pattern, allowEmpty){
@NonCPS
def createOptions(settings){
Map result = [:]
result.put('blameDisabled', true)
result.put('skipBlames', true)
result.put('enabledForFailure', true)
result.put('aggregatingResults', false)

Expand Down
25 changes: 15 additions & 10 deletions vars/hadolintExecute.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,21 @@ def issuesWrapper(Map parameters = [:], Script script, Closure body){
try {
body()
} finally {
recordIssues(
blameDisabled: true,
enabledForFailure: true,
aggregatingResults: false,
qualityGates: config.qualityGates,
tool: checkStyle(
id: config.reportName,
name: config.reportName,
pattern: config.reportFile
try {
recordIssues(
skipBlames: true,
enabledForFailure: true,
aggregatingResults: false,
qualityGates: config.qualityGates,
tool: checkStyle(
id: config.reportName,
name: config.reportName,
pattern: config.reportFile
)
)
)
} catch (e) {
echo "recordIssues has failed. Possibly due to an outdated version of the warnings-ng plugin."
e.printStackTrace()
}
}
}
27 changes: 18 additions & 9 deletions vars/mavenExecuteStaticCodeChecks.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,27 @@ private showIssues(Script script) {
Map configuration = ConfigurationLoader.stepConfiguration(script, STEP_NAME)
// Every check is executed by default. Only if configured with `false` the check won't be executed
if (!(configuration.spotBugs == false)) {
recordIssues(blameDisabled: true,
enabledForFailure: true,
aggregatingResults: false,
tool: spotBugs(pattern: '**/target/spotbugsXml.xml'))

try {
recordIssues(skipBlames: true,
enabledForFailure: true,
aggregatingResults: false,
tool: spotBugs(pattern: '**/target/spotbugsXml.xml'))
} catch (e) {
echo "recordIssues has failed. Possibly due to an outdated version of the warnings-ng plugin."
e.printStackTrace()
}
ReportAggregator.instance.reportStaticCodeExecution(QualityCheck.FindbugsCheck)
}
if (!(configuration.pmd == false)) {
recordIssues(blameDisabled: true,
enabledForFailure: true,
aggregatingResults: false,
tool: pmdParser(pattern: '**/target/pmd.xml'))
try {
recordIssues(skipBlames: true,
enabledForFailure: true,
aggregatingResults: false,
tool: pmdParser(pattern: '**/target/pmd.xml'))
} catch (e) {
echo "recordIssues has failed. Possibly due to an outdated version of the warnings-ng plugin."
e.printStackTrace()
}
ReportAggregator.instance.reportStaticCodeExecution(QualityCheck.PmdCheck)
}
}
13 changes: 9 additions & 4 deletions vars/npmExecuteLint.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ void call(Map parameters = [:]) {
}

private visualizeLintingResults(Script script) {
recordIssues blameDisabled: true,
enabledForFailure: true,
aggregatingResults: false,
tool: script.checkStyle(id: "lint", name: "Lint", pattern: "*lint.xml")
try {
recordIssues skipBlames: true,
enabledForFailure: true,
aggregatingResults: false,
tool: script.checkStyle(id: "lint", name: "Lint", pattern: "*lint.xml")
} catch (e) {
echo "recordIssues has failed. Possibly due to an outdated version of the warnings-ng plugin."
e.printStackTrace()
}
}
Loading