You've already forked jenkins-lib
forked from jenkins/jenkins-lib
Возможность удалять результаты edt для файлов на поддержке
This commit is contained in:
@@ -31,5 +31,9 @@
|
||||
"-CheckUseSynchronousCalls",
|
||||
"-DistributiveModules"
|
||||
]
|
||||
},
|
||||
"resultsTransform": {
|
||||
"removeSupport": false,
|
||||
"supportLevel": 0
|
||||
}
|
||||
}
|
||||
|
@@ -84,6 +84,21 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"resultsTransform" : {
|
||||
"type" : "object",
|
||||
"id" : "urn:jsonschema:ru:pulsar:jenkins:library:configuration:ResultsTransformOptions",
|
||||
"description" : "Настройки трансформации результатов анализа",
|
||||
"properties" : {
|
||||
"removeSupport" : {
|
||||
"type" : "boolean",
|
||||
"description" : "Фильтровать замечания по уровню поддержки модуля"
|
||||
},
|
||||
"supportLevel" : {
|
||||
"type" : "integer",
|
||||
"description" : "Настройка фильтрации замечаний по уровню поддержки.\n 0 - удалить файлы на замке;\n 1 - удалить файлы на замке и на поддержке;\n 2 - удалить файлы на замке, на поддержке и снятые с поддержки.\n "
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -42,7 +42,8 @@ class ConfigurationReader implements Serializable {
|
||||
"secrets",
|
||||
"stageFlags",
|
||||
"sonarQubeOptions",
|
||||
"syntaxCheckOptions"
|
||||
"syntaxCheckOptions",
|
||||
"resultsTransformOptions"
|
||||
).toSet()
|
||||
|
||||
mergeObjects(baseConfiguration, configurationToMerge, nonMergeableSettings)
|
||||
|
@@ -25,6 +25,10 @@ class JobConfiguration implements Serializable {
|
||||
@JsonPropertyDescription("Настройки синтаксического контроля")
|
||||
SyntaxCheckOptions syntaxCheckOptions;
|
||||
|
||||
@JsonProperty("resultsTransform")
|
||||
@JsonPropertyDescription("Настройки трансформации результатов анализа")
|
||||
ResultsTransformOptions resultsTransformOptions;
|
||||
|
||||
@Override
|
||||
@NonCPS
|
||||
String toString() {
|
||||
@@ -34,6 +38,7 @@ class JobConfiguration implements Serializable {
|
||||
", secrets=" + secrets +
|
||||
", sonarQubeOptions=" + sonarQubeOptions +
|
||||
", syntaxCheckOptions=" + syntaxCheckOptions +
|
||||
", resultsTransformOptions=" + resultsTransformOptions +
|
||||
'}';
|
||||
}
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
package ru.pulsar.jenkins.library.configuration
|
||||
|
||||
import com.cloudbees.groovy.cps.NonCPS
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyDescription
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
class ResultsTransformOptions implements Serializable {
|
||||
|
||||
@JsonPropertyDescription("Фильтровать замечания по уровню поддержки модуля")
|
||||
boolean removeSupport
|
||||
|
||||
@JsonPropertyDescription("""Настройка фильтрации замечаний по уровню поддержки.
|
||||
0 - удалить файлы на замке;
|
||||
1 - удалить файлы на замке и на поддержке;
|
||||
2 - удалить файлы на замке, на поддержке и снятые с поддержки.
|
||||
""")
|
||||
int supportLevel
|
||||
|
||||
@Override
|
||||
@NonCPS
|
||||
String toString() {
|
||||
return "ResultsTransformOptions{" +
|
||||
"removeSupport=" + removeSupport +
|
||||
", supportLevel=" + supportLevel +
|
||||
'}';
|
||||
}
|
||||
}
|
@@ -45,6 +45,11 @@ class ResultsTransformer implements Serializable {
|
||||
|
||||
steps.cmd("stebi convert $edtValidateFile $genericIssueFile $EdtTransform.WORKSPACE")
|
||||
|
||||
if (config.resultsTransformOptions.removeSupport) {
|
||||
def supportLevel = config.resultsTransformOptions.supportLevel
|
||||
steps.cmd("stebi transform --remove_support $supportLevel --src $EdtTransform.WORKSPACE $genericIssueFile")
|
||||
}
|
||||
|
||||
steps.archiveArtifacts(RESULT_FILE)
|
||||
steps.stash(RESULT_STASH, RESULT_FILE)
|
||||
}
|
||||
|
@@ -37,6 +37,8 @@ class ConfigurationReaderTest {
|
||||
.hasFieldOrPropertyWithValue("storagePath", "UNKNOWN_ID")
|
||||
;
|
||||
assertThat(jobConfiguration.getSyntaxCheckOptions().getCheckModes()).hasSize(1);
|
||||
assertThat(jobConfiguration.getResultsTransformOptions().isRemoveSupport()).isTrue();
|
||||
assertThat(jobConfiguration.getResultsTransformOptions().getSupportLevel()).isEqualTo(0);
|
||||
}
|
||||
|
||||
}
|
@@ -8,5 +8,8 @@
|
||||
},
|
||||
"syntaxCheck": {
|
||||
"checkModes": ["-ThinClient"]
|
||||
},
|
||||
"resultsTransform": {
|
||||
"removeSupport": true
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user