Package io.jenkins.plugins.util
Class QualityGate
- All Implemented Interfaces:
Describable<QualityGate>
,Serializable
public abstract class QualityGate
extends AbstractDescribableImpl<QualityGate>
implements Serializable
Defines a quality gate based on a specific threshold of a selected property in the current build. After a build has
been finished, a set of
quality gates
will be evaluated and the overall quality gate status will
be reported in Jenkins UI. The criticality of the quality gate is determined by the
criticality
. Subclasses must implement the getName()
method to provide a
human-readable name of the quality gate. Additionally, subclasses must provide a Descriptor
to describe the
quality gate in the UI. Subclasses may add additional properties to configure the quality gate, these must be annotated with the
DataBoundSetter
annotation.- Author:
- Johannes Walter
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Determines the Jenkins build result if the quality gate is failed.static class
Descriptor of theQualityGate
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal int
abstract String
getName()
Returns a human-readable name of the quality gate.final QualityGateStatus
final double
final void
setCriticality
(QualityGate.QualityGateCriticality criticality) Sets the criticality of this quality gate.final void
setIntegerThreshold
(int integerThreshold) Sets the threshold of the quality gate.final void
setThreshold
(double threshold) Sets the threshold of the quality gate.toString()
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Constructor Details
-
QualityGate
protected QualityGate()Creates a new instance ofQualityGate
.
-
-
Method Details
-
getName
Returns a human-readable name of the quality gate.- Returns:
- a human-readable name
-
setThreshold
@DataBoundSetter public final void setThreshold(double threshold) Sets the threshold of the quality gate.- Parameters:
threshold
- the threshold of the quality gate
-
getThreshold
public final double getThreshold() -
setIntegerThreshold
@DataBoundSetter public final void setIntegerThreshold(int integerThreshold) Sets the threshold of the quality gate. This integer-based setter is required to bind a UI number element to this model object.- Parameters:
integerThreshold
- the threshold of the quality gate
-
getIntegerThreshold
public final int getIntegerThreshold() -
toString
-
setCriticality
Sets the criticality of this quality gate. When a quality gate has been missed, this property determines whether the result of the associated coverage stage will be marked as unstable or failure.- Parameters:
criticality
- the criticality for this quality gate
-
getCriticality
-
getStatus
-