Klasse IssuesRecorder

Alle implementierten Schnittstellen:
ExtensionPoint, Describable<Publisher>, BuildStep

public class IssuesRecorder extends Recorder
Freestyle or Maven job Recorder that scans report files or the console log for issues. Stores the created issues in an AnalysisResult. The result is attached to a Run by registering a ResultAction.

Additional features:

  • It evaluates the quality gates after each run. If the quality gate is not passed, then the build will be set to Result.UNSTABLE or Result.FAILURE, depending on the configuration properties.
  • It provides thresholds for the build health that could be adjusted in the configuration screen. These values are used by the HealthReportBuilder to compute the health and the health trend graph.
Autor:
Ullrich Hafner
  • Konstruktordetails

    • IssuesRecorder

      @DataBoundConstructor public IssuesRecorder()
      Creates a new instance of IssuesRecorder.
  • Methodendetails

    • readResolve

      protected Object readResolve()
      Called after deserialization to retain backward compatibility or to populate new elements (that would be otherwise initialized to null).
      Gibt zurück:
      this
    • setScm

      @DataBoundSetter public void setScm(String scm)
      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.
      Parameter:
      scm - the ID of the SCM to use (a substring of the full ID)
    • getScm

      public String getScm()
    • setQualityGates

      @DataBoundSetter public void setQualityGates(List<WarningsQualityGate> qualityGates)
      Defines the optional list of quality gates.
      Parameter:
      qualityGates - the quality gates
    • getQualityGates

      public List<WarningsQualityGate> getQualityGates()
    • setId

      @DataBoundSetter public void setId(String id)
      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.

      Note: this property is not used if isAggregatingResults is false. It is also not visible in the UI in order to simplify the user interface.

      Parameter:
      id - the ID of the results
    • getId

      public String getId()
    • setName

      @DataBoundSetter public void setName(String name)
      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 associated StaticAnalysisLabelProvider is used.

      Note: this property is not used if isAggregatingResults is false. It is also not visible in the UI in order to simplify the user interface.

      Parameter:
      name - the name of the results
    • getName

      public String getName()
    • getToolProxies

      @CheckForNull @Deprecated public List<ToolProxy> getToolProxies()
      Veraltet.
      this method is only intended to be called by the UI
      Gets the static analysis tools that will scan files and create issues.
      Gibt zurück:
      the static analysis tools (wrapped as ToolProxy)
      Siehe auch:
    • setToolProxies

      @DataBoundSetter @Deprecated public void setToolProxies(List<ToolProxy> toolProxies)
      Veraltet.
      this method is only intended to be called by the UI
      Sets the static analysis tools that will scan files and create issues.
      Parameter:
      toolProxies - the static analysis tools (wrapped as ToolProxy)
      Siehe auch:
    • setTools

      @DataBoundSetter public void setTools(List<Tool> tools)
      Sets the static analysis tools that will scan files and create issues.
      Parameter:
      tools - the static analysis tools
    • setTools

      public void setTools(Tool tool, Tool... additionalTools)
      Sets the static analysis tools that will scan files and create issues.
      Parameter:
      tool - the static analysis tool
      additionalTools - additional static analysis tools (might be empty)
      Siehe auch:
    • getTools

      public List<Tool> getTools()
      Returns the static analysis tools that will scan files and create issues.
      Gibt zurück:
      the static analysis tools
    • getSourceCodeEncoding

      @CheckForNull public String getSourceCodeEncoding()
    • setSourceCodeEncoding

      @DataBoundSetter public void setSourceCodeEncoding(String sourceCodeEncoding)
      Sets the encoding to use to read source files.
      Parameter:
      sourceCodeEncoding - the encoding, e.g. "ISO-8859-1"
    • setSourceDirectories

      @DataBoundSetter public void setSourceDirectories(List<io.jenkins.plugins.prism.SourceCodeDirectory> sourceDirectories)
      Sets the paths to the directories that contain the source code. If not relative and thus not part of the workspace, then these directories need to be added in Jenkins global configuration to prevent accessing of forbidden resources.
      Parameter:
      sourceDirectories - directories containing the source code
    • getSourceDirectories

      public List<io.jenkins.plugins.prism.SourceCodeDirectory> getSourceDirectories()
    • setSourceCodeRetention

      @DataBoundSetter public void setSourceCodeRetention(io.jenkins.plugins.prism.SourceCodeRetention sourceCodeRetention)
      Defines the retention strategy for source code files.
      Parameter:
      sourceCodeRetention - the retention strategy for source code files
    • getSourceCodeRetention

      public io.jenkins.plugins.prism.SourceCodeRetention getSourceCodeRetention()
    • getAggregatingResults

      public boolean getAggregatingResults()
      Returns whether the results for each configured static analysis result should be aggregated into a single result or if every tool should get an individual result.
      Gibt zurück:
      true if the results of each static analysis tool should be aggregated into a single result, false if every tool should get an individual result.
    • setAggregatingResults

      @DataBoundSetter public void setAggregatingResults(boolean aggregatingResults)
    • isQuiet

      public boolean isQuiet()
      Returns whether report logging should be enabled.
      Gibt zurück:
      true report logging is disabled false report logging is enabled
    • setQuiet

      @DataBoundSetter public void setQuiet(boolean quiet)
    • getBlameDisabled

      public boolean getBlameDisabled()
      Returns whether the SCM blaming should be disabled.
      Gibt zurück:
      true if SCM blaming should be disabled
    • setBlameDisabled

      @DataBoundSetter public void setBlameDisabled(boolean blameDisabled)
    • isSkipBlames

      public boolean isSkipBlames()
      Returns whether the SCM blaming should be disabled.
      Gibt zurück:
      true if SCM blaming should be disabled
    • setSkipBlames

      @DataBoundSetter public void setSkipBlames(boolean skipBlames)
    • isSkipPublishingChecks

      public boolean isSkipPublishingChecks()
      Returns whether publishing checks should be skipped.
      Gibt zurück:
      true if publishing checks should be skipped, false otherwise
    • 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.
      Parameter:
      checksAnnotationScope - the scope to use
    • getChecksAnnotationScope

      public io.jenkins.plugins.analysis.core.steps.WarningChecksPublisher.ChecksAnnotationScope getChecksAnnotationScope()
    • isSkipPostProcessing

      public boolean isSkipPostProcessing()
      Returns whether post-processing of the issues should be disabled.
      Gibt zurück:
      true if post-processing of the issues should be disabled.
    • setSkipPostProcessing

      @DataBoundSetter public void setSkipPostProcessing(boolean skipPostProcessing)
    • setFailOnError

      @DataBoundSetter public void setFailOnError(boolean failOnError)
      Determines whether to fail the step on errors during the step of recording issues.
      Parameter:
      failOnError - if true then the build will be failed on errors, false then errors are only reported in the UI
    • getFailOnError

      public boolean getFailOnError()
    • getEnabledForFailure

      public boolean getEnabledForFailure()
      Returns whether recording should be enabled for failed builds as well.
      Gibt zurück:
      true if recording should be enabled for failed builds as well, false if recording is enabled for successful or unstable builds only
    • setEnabledForFailure

      @DataBoundSetter public void setEnabledForFailure(boolean enabledForFailure)
    • setIgnoreQualityGate

      @DataBoundSetter public void setIgnoreQualityGate(boolean ignoreQualityGate)
      If true, 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.
      Parameter:
      ignoreQualityGate - if true then the result of the quality gate is ignored, otherwise only build with a successful quality gate are selected
    • getIgnoreQualityGate

      public boolean getIgnoreQualityGate()
    • 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%.
      Parameter:
      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%.
      Parameter:
      unhealthy - the number of issues when health is reported as 0%
    • getMinimumSeverity

      @CheckForNull public String getMinimumSeverity()
    • setTrendChartType

      @DataBoundSetter public void setTrendChartType(TrendChartType trendChartType)
      Sets the type of the trend chart that should be shown on the job page.
      Parameter:
      trendChartType - the type of the trend chart to use
    • getTrendChartType

      public TrendChartType getTrendChartType()
    • setMinimumSeverity

      @DataBoundSetter public void setMinimumSeverity(String minimumSeverity)
      Sets the minimum severity to consider when computing the health report. Issues with a severity less than this value will be ignored.
      Parameter:
      minimumSeverity - the severity to consider
    • getFilters

      public List<RegexpFilter> getFilters()
    • setFilters

      @DataBoundSetter public void setFilters(List<RegexpFilter> filters)
    • setChecksInfo

      public void setChecksInfo(@CheckForNull io.jenkins.plugins.checks.steps.ChecksInfo checksInfo)
    • getRequiredMonitorService

      public BuildStepMonitor getRequiredMonitorService()
    • getDescriptor

      public IssuesRecorder.Descriptor getDescriptor()
      Angegeben von:
      getDescriptor in Schnittstelle Describable<Publisher>
      Setzt außer Kraft:
      getDescriptor in Klasse Recorder
    • perform

      public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException
      Angegeben von:
      perform in Schnittstelle BuildStep
      Setzt außer Kraft:
      perform in Klasse BuildStepCompatibilityLayer
      Löst aus:
      InterruptedException
      IOException