Class InteractiveOutputJobAction

java.lang.Object
io.jenkins.plugins.interactiveinput.output.InteractiveOutputJobAction
All Implemented Interfaces:
Action, ModelObject

public class InteractiveOutputJobAction extends Object implements Action
Per-job "Interactive Output" trend surface. Iterates the job's builds, reads each build's persisted InteractiveOutputBuildAction, and assembles a compact JSON model (build labels + one numeric series per metric key) that output.js renders as a theme-aware ECharts line chart.

Attached to every Job by InteractiveOutputJobAction.Factory when the per-project surfaces feature is on; the sidebar link only appears when at least one build actually published output (so it is never permanent clutter). All heavy lifting (reading builds) is bounded to the most recent MAX_BUILDS.

  • Field Details

    • URL_NAME

      public static final String URL_NAME
      Stable URL segment under the job (e.g. /job/foo/interactive-output/).
      See Also:
  • Constructor Details

    • InteractiveOutputJobAction

      public InteractiveOutputJobAction(@NonNull Job<?,?> job)
  • Method Details

    • getJob

      @NonNull public Job<?,?> getJob()
    • getObject

      @NonNull public Job<?,?> getObject()
      Returns:
      the owning job. Required by core's l:job-subpage (it.object).
    • getJobFullName

      @NonNull public String getJobFullName()
    • getLatestRun

      @CheckForNull public Run<?,?> getLatestRun()
      Returns:
      the most recent build (newest first) that published a non-empty output action, or null if none has. Used to show "latest values" cards on the job page.
    • getLatestReports

      @NonNull public List<MetricReport> getLatestReports()
      Returns:
      the latest build's reports (newest first), or an empty list if none published output.
    • isHasAnyOutput

      public boolean isHasAnyOutput()
      Returns:
      true if any scanned build published output at all (drives the sidebar link).
    • isHasTrend

      public boolean isHasTrend()
      Returns:
      true if at least one numeric series exists to plot.
    • isHasCharts

      public boolean isHasCharts()
      Returns:
      true if there is at least one renderable per-report chart.
    • getCharts

      @NonNull public List<InteractiveOutputJobAction.Chart> getCharts()
      Returns:
      one chart model per report (in first-appearance order) for the per-job page. A report's line/bar chart is its numeric series across the recent builds; a pie chart is the latest build's numeric metrics as slices; a timeseries chart is the latest build's date-labelled metrics as points sorted by date. Reports with no plottable data are omitted. Each InteractiveOutputJobAction.Chart carries the JSON output.js renders.
    • getTrendJson

      @NonNull public String getTrendJson()
      Returns:
      the trend model as a JSON string: {"builds":[...],"urls":[...], "series":[{"name":..,"data":[num|null,..]}]}. Consumed by output.js; empty series are omitted. Values are aligned to builds (null where a build did not report that key).
    • getIconFileName

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

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

      @NonNull public String getUrlName()
      Specified by:
      getUrlName in interface Action