Class QualityGate
- All Implemented Interfaces:
Describable<QualityGate>
,Serializable
Defines a quality gate based on a specific threshold of issues (total, new, delta) 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.- Author:
- Ullrich Hafner
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Descriptor of theQualityGate
.static enum
Determines the Jenkins build result if the quality gate is failed.static enum
Available quality gate types. -
Constructor Summary
ConstructorsConstructorDescriptionQualityGate
(int threshold, QualityGate.QualityGateType type, boolean unstable) Creates a new instance ofQualityGate
.QualityGate
(int threshold, QualityGate.QualityGateType type, QualityGate.QualityGateResult result) Creates a new instance ofQualityGate
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the method that should be used to determine the actual number of issues in the build.getName()
Returns the human-readable name of the quality gate.Returns the quality gate status to set if the quality gate is failed.Returns the quality gate status to set if the quality gate is failed.int
Returns the minimum number of issues that will fail the quality gate.getType()
boolean
boolean
int
hashCode()
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Constructor Details
-
QualityGate
@DataBoundConstructor public QualityGate(int threshold, QualityGate.QualityGateType type, boolean unstable) Creates a new instance ofQualityGate
.- Parameters:
threshold
- the minimum number of issues that fails the quality gatetype
- the type of the quality gateunstable
- determines whether the build result will be set to unstable or failed if the quality gate is failed
-
QualityGate
public QualityGate(int threshold, QualityGate.QualityGateType type, QualityGate.QualityGateResult result) Creates a new instance ofQualityGate
.- Parameters:
threshold
- the minimum number of issues that fails the quality gatetype
- the type of the quality gateresult
- determines whether the quality gate is a warning or failure
-
-
Method Details
-
getUnstable
public boolean getUnstable() -
getType
-
getWarning
public boolean getWarning() -
getThreshold
public int getThreshold()Returns the minimum number of issues that will fail the quality gate.- Returns:
- minimum number of issues
-
getActualSizeMethodReference
Returns the method that should be used to determine the actual number of issues in the build.- Returns:
- threshold getter
-
getName
Returns the human-readable name of the quality gate.- Returns:
- the human-readable name
-
getStatus
Returns the quality gate status to set if the quality gate is failed.- Returns:
- the status
-
getResult
Returns the quality gate status to set if the quality gate is failed.- Returns:
- the status
-
equals
-
hashCode
public int hashCode()
-