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:
  • Constructor Details

    • QualityGate

      protected QualityGate()
      Creates a new instance of QualityGate.
  • Method Details

    • getName

      public abstract String 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

      public String toString()
      Overrides:
      toString in class Object
    • setCriticality

      @DataBoundSetter public final void setCriticality(QualityGate.QualityGateCriticality criticality)
      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

      public final QualityGate.QualityGateCriticality getCriticality()
    • getStatus

      public final QualityGateStatus getStatus()