Class ForgeAIBuildAction

java.lang.Object
io.forgeai.jenkins.actions.ForgeAIBuildAction
All Implemented Interfaces:
Action, ModelObject, RunAction2

public class ForgeAIBuildAction extends Object implements RunAction2
The result of a forgeAI step, kept with the build. It renders the analysis as a page of the build (forgeai-analysis/), styled by Jenkins itself, and feeds the score trend on the job page.

When a build calls forgeAI more than once, the result of the last call is kept.

  • Field Details

  • Constructor Details

    • ForgeAIBuildAction

      public ForgeAIBuildAction(List<AnalysisResult> results, List<String> failedAnalyzers, String analysisScope, int filesAnalyzed, int filesSkipped, boolean gateEnabled, int threshold)
  • Method Details

    • getIconFileName

      public String getIconFileName()
      Specified by:
      getIconFileName in interface Action
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface Action
      Specified by:
      getDisplayName in interface ModelObject
    • getUrlName

      public String getUrlName()
      Specified by:
      getUrlName in interface Action
    • onAttached

      public void onAttached(Run<?,?> r)
      Specified by:
      onAttached in interface RunAction2
    • onLoad

      public void onLoad(Run<?,?> r)
      Specified by:
      onLoad in interface RunAction2
    • getRun

      public Run<?,?> getRun()
    • isScored

      public boolean isScored()
      False when every analyzer failed, so there is no score to show.
    • getCompositeScore

      public double getCompositeScore()
      Average of the analyzer scores, or 0 when every analyzer failed.
    • getCompositeScoreText

      public String getCompositeScoreText()
    • getVerdict

      public String getVerdict()
    • getVerdictKey

      public String getVerdictKey()
      CSS modifier for the verdict: ship, caution, hold, block, or none.
    • band

      public static String band(double score)
    • getTotalFindings

      public long getTotalFindings()
    • getCriticalCount

      public long getCriticalCount()
    • getHighCount

      public long getHighCount()
    • getResults

      public List<AnalysisResult> getResults()
    • getFailedAnalyzers

      public List<String> getFailedAnalyzers()
    • getFailedAnalyzersText

      public String getFailedAnalyzersText()
    • getAnalysisScope

      public String getAnalysisScope()
    • getFilesAnalyzed

      public int getFilesAnalyzed()
    • getFilesSkipped

      public int getFilesSkipped()
    • isGateEnabled

      public boolean isGateEnabled()
    • getThreshold

      public int getThreshold()
    • getScopeText

      public String getScopeText()
    • getGateStatus

      public String getGateStatus()
      PASSED, FAILED or OFF, matching what the step did with the build.
    • getGateText

      public String getGateText()
    • getAnalyzerRows

      public List<ForgeAIBuildAction.AnalyzerRow> getAnalyzerRows()
    • getFindingRows

      public List<ForgeAIBuildAction.FindingRow> getFindingRows()
      Every finding, most severe first, in analyzer order within a severity.