Class QualityGate

java.lang.Object
hudson.model.AbstractDescribableImpl<QualityGate>
io.jenkins.plugins.analysis.core.util.QualityGate
All Implemented Interfaces:
Describable<QualityGate>, Serializable

public class QualityGate extends AbstractDescribableImpl<QualityGate> implements 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:
  • Constructor Details

    • QualityGate

      @DataBoundConstructor public QualityGate(int threshold, QualityGate.QualityGateType type, boolean unstable)
      Creates a new instance of QualityGate.
      Parameters:
      threshold - the minimum number of issues that fails the quality gate
      type - the type of the quality gate
      unstable - 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 of QualityGate.
      Parameters:
      threshold - the minimum number of issues that fails the quality gate
      type - the type of the quality gate
      result - determines whether the quality gate is a warning or failure
  • Method Details

    • getUnstable

      public boolean getUnstable()
    • getType

      public QualityGate.QualityGateType 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

      public Function<IssuesStatistics,Integer> getActualSizeMethodReference()
      Returns the method that should be used to determine the actual number of issues in the build.
      Returns:
      threshold getter
    • getName

      public String getName()
      Returns the human-readable name of the quality gate.
      Returns:
      the human-readable name
    • getStatus

      public QualityGateStatus getStatus()
      Returns the quality gate status to set if the quality gate is failed.
      Returns:
      the status
    • getResult

      public QualityGate.QualityGateResult getResult()
      Returns the quality gate status to set if the quality gate is failed.
      Returns:
      the status
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • map

      public static List<QualityGate> map(@CheckForNull Thresholds thresholds)
      Maps the old style Thresholds to the new style list of QualityGate instances.
      Parameters:
      thresholds - the thresholds
      Returns:
      the list of quality gates