Class PublishIssuesStep
java.lang.Object
hudson.model.AbstractDescribableImpl<org.jenkinsci.plugins.workflow.steps.Step>
org.jenkinsci.plugins.workflow.steps.Step
io.jenkins.plugins.analysis.core.steps.PublishIssuesStep
- All Implemented Interfaces:
ExtensionPoint,Describable<org.jenkinsci.plugins.workflow.steps.Step>,Serializable
public class PublishIssuesStep
extends org.jenkinsci.plugins.workflow.steps.Step
implements Serializable
Publish issues created by a static analysis build. The recorded issues are stored as a
ResultAction in the
associated Jenkins build. If the issues report has a unique ID, then the created action will use this ID as well.
Otherwise, a default ID is used to publish the results. In any case, the computed ID can be overwritten by specifying
an ID as step parameter.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDescriptor for this step: defines the context and the UI labels.Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
ConstructorsConstructorDescriptionPublishIssuesStep(List<AnnotatedReport> issues) Creates a new instance ofPublishIssuesStep. -
Method Summary
Modifier and TypeMethodDescriptionio.jenkins.plugins.analysis.core.steps.WarningChecksPublisher.ChecksAnnotationScopebooleanintgetIcon()getId()booleanedu.hm.hafner.analysis.SeveritygetName()getScm()intbooleanDeprecated.booleanisQuiet()booleanReturns whether the SCM delta calculation for the new issue detection should be disabled.booleanReturns whether publishing checks should be skipped.voidsetChecksAnnotationScope(io.jenkins.plugins.analysis.core.steps.WarningChecksPublisher.ChecksAnnotationScope checksAnnotationScope) Sets the scope of the annotations that should be published to SCM checks.voidsetFailOnError(boolean failOnError) Determines whether to fail the step on errors during the step of recording issues.voidsetHealthy(int healthy) Sets the healthy threshold, i.e., the number of issues when health is reported as 100%.voidDefines the custom icon of the results.voidDefines the ID of the results.voidsetIgnoreQualityGate(boolean ignoreQualityGate) Iftrue, then the result of the quality gate is ignored when selecting a reference build.voidsetMinimumSeverity(String minimumSeverity) Sets the minimum severity to consider when computing the health report.voidDefines the name of the results.voidsetPublishAllIssues(boolean publishAllIssues) Deprecated.usesetChecksAnnotationScope(ChecksAnnotationScope)insteadvoidsetQualityGates(List<WarningsQualityGate> qualityGates) Defines the optional list of quality gates.voidsetQuiet(boolean quiet) Iftrue, then logger content is muted Iffalse, then logger content goes to loghandler output.voidSets the SCM that should be used to find the reference build for.voidsetSkipDeltaCalculation(boolean skipDeltaCalculation) voidsetSkipPublishingChecks(boolean skipPublishingChecks) voidsetSourceCodeEncoding(String sourceCodeEncoding) Sets the encoding to use to read source files.voidsetTrendChartType(TrendChartType trendChartType) Sets the type of the trend chart that should be shown on the job page.voidsetUnhealthy(int unhealthy) Sets the healthy threshold, i.e., the number of issues when health is reported as 0%.org.jenkinsci.plugins.workflow.steps.StepExecutionstart(org.jenkinsci.plugins.workflow.steps.StepContext stepContext) Methods inherited from class org.jenkinsci.plugins.workflow.steps.Step
getDescriptor
-
Constructor Details
-
PublishIssuesStep
Creates a new instance ofPublishIssuesStep.- Parameters:
issues- the reports to publish asActionin theJob.- Throws:
IllegalArgumentException- if the array of issues isnullor empty
-
-
Method Details
-
getIssues
-
setId
Defines the ID of the results. The ID is used as URL of the results and as name in UI elements. If no ID is given, then the ID of the associated result object is used.- Parameters:
id- the ID of the results
-
getId
-
setName
Defines the name of the results. The name is used for all labels in the UI. If no name is given, then the name of the associatedStaticAnalysisLabelProvideris used.- Parameters:
name- the name of the results
-
getName
-
setIcon
Defines the custom icon of the results. If no icon is given, then the default icon of the associatedStaticAnalysisLabelProvideris used.- Parameters:
icon- the icon of the results
-
getIcon
-
setScm
Sets the SCM that should be used to find the reference build for. The reference recorder will select the SCM based on a substring comparison, there is no need to specify the full name.- Parameters:
scm- the ID of the SCM to use (a substring of the full ID)
-
getScm
-
setFailOnError
@DataBoundSetter public void setFailOnError(boolean failOnError) Determines whether to fail the step on errors during the step of recording issues.- Parameters:
failOnError- iftruethen the build will be failed on errors,falsethen errors are only reported in the UI
-
getFailOnError
public boolean getFailOnError() -
isSkipDeltaCalculation
public boolean isSkipDeltaCalculation()Returns whether the SCM delta calculation for the new issue detection should be disabled.- Returns:
trueif the SCM delta calculation for the new issue detection should be disabled.
-
setSkipDeltaCalculation
@DataBoundSetter public void setSkipDeltaCalculation(boolean skipDeltaCalculation) -
isSkipPublishingChecks
public boolean isSkipPublishingChecks()Returns whether publishing checks should be skipped.- Returns:
trueif publishing checks should be skipped,falseotherwise
-
setSkipPublishingChecks
@DataBoundSetter public void setSkipPublishingChecks(boolean skipPublishingChecks) -
setChecksAnnotationScope
@DataBoundSetter public void setChecksAnnotationScope(io.jenkins.plugins.analysis.core.steps.WarningChecksPublisher.ChecksAnnotationScope checksAnnotationScope) Sets the scope of the annotations that should be published to SCM checks.- Parameters:
checksAnnotationScope- the scope to use
-
getChecksAnnotationScope
public io.jenkins.plugins.analysis.core.steps.WarningChecksPublisher.ChecksAnnotationScope getChecksAnnotationScope() -
isPublishAllIssues
Deprecated.usegetChecksAnnotationScope()insteadReturns whether all issues should be published using the Checks API. If set tofalseonly new issues will be published.- Returns:
trueif all issues should be published,falseif only new issues should be published
-
setPublishAllIssues
Deprecated.usesetChecksAnnotationScope(ChecksAnnotationScope)insteadReturns whether all issues should be published to SCM checks.- Parameters:
publishAllIssues- iftruethen all issues should be published, otherwise only new issues
-
setIgnoreQualityGate
@DataBoundSetter public void setIgnoreQualityGate(boolean ignoreQualityGate) Iftrue, then the result of the quality gate is ignored when selecting a reference build. This option is disabled by default, so a failing quality gate will be passed from build to build until the original reason for the failure has been resolved.- Parameters:
ignoreQualityGate- iftruethen the result of the quality gate is ignored, otherwise only build with a successful quality gate are selected
-
getIgnoreQualityGate
public boolean getIgnoreQualityGate() -
setQuiet
@DataBoundSetter public void setQuiet(boolean quiet) Iftrue, then logger content is muted Iffalse, then logger content goes to loghandler output.- Parameters:
quiet- iftruethen logger content is muted.
-
isQuiet
public boolean isQuiet() -
getSourceCodeEncoding
-
setSourceCodeEncoding
Sets the encoding to use to read source files.- Parameters:
sourceCodeEncoding- the encoding, e.g. "ISO-8859-1"
-
getHealthy
public int getHealthy() -
setHealthy
@DataBoundSetter public void setHealthy(int healthy) Sets the healthy threshold, i.e., the number of issues when health is reported as 100%.- Parameters:
healthy- the number of issues when health is reported as 100%
-
getUnhealthy
public int getUnhealthy() -
setUnhealthy
@DataBoundSetter public void setUnhealthy(int unhealthy) Sets the healthy threshold, i.e., the number of issues when health is reported as 0%.- Parameters:
unhealthy- the number of issues when health is reported as 0%
-
getMinimumSeverity
-
getMinimumSeverityAsSeverity
@CheckForNull public edu.hm.hafner.analysis.Severity getMinimumSeverityAsSeverity() -
setMinimumSeverity
Sets the minimum severity to consider when computing the health report. Issues with a severity less than this value will be ignored.- Parameters:
minimumSeverity- the severity to consider
-
setTrendChartType
Sets the type of the trend chart that should be shown on the job page.- Parameters:
trendChartType- the type of the trend chart to use
-
getTrendChartType
-
setQualityGates
Defines the optional list of quality gates.- Parameters:
qualityGates- the quality gates
-
getQualityGates
-
start
public org.jenkinsci.plugins.workflow.steps.StepExecution start(org.jenkinsci.plugins.workflow.steps.StepContext stepContext) - Specified by:
startin classorg.jenkinsci.plugins.workflow.steps.Step
-
getChecksAnnotationScope()instead