Class InteractiveViewJobAction

java.lang.Object
io.jenkins.plugins.interactiveinput.ui.InteractiveViewJobAction
All Implemented Interfaces:
Action, ModelObject, Badgeable

public class InteractiveViewJobAction extends Object implements Action, Badgeable
Per-job "Interactive View" surface. Attached to every Job by InteractiveViewJobAction.Factory when the per-project surfaces are enabled; the sidebar link shows whenever the job has any review the viewer can read (so decided reviews — and their comment history — stay reachable after the build completes), while the live count badge still reflects only open notifications the viewer should act on. Its index.jelly lists the job's reviews across builds, each linking to that build's review editor.
  • Field Details

    • URL_NAME

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

    • InteractiveViewJobAction

      public InteractiveViewJobAction(@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()
    • getReviews

      @NonNull public List<ReviewDocument> getReviews()
      Returns:
      every review for this job the current viewer may read (any status), newest builds first.
    • getReviewGroups

      @NonNull public Map<String,List<ReviewDocument>> getReviewGroups()
      Returns:
      this job's readable reviews grouped by report name (a stable, newest-first ordering), so the page can render a section per report/folder across builds. A LinkedHashMap preserves the newest-first insertion order for both the group headings and their rows.
    • getPendingCount

      public int getPendingCount()
      Returns:
      the open, notify-enabled reviews this job should surface to the current viewer as a live count badge, honouring the user-scope switch (0 on any store error). Note this is the notification count, not the sidebar-link visibility gate — see isHasAnyReviews().
    • isHasAnyReviews

      public boolean isHasAnyReviews()
      Returns:
      true if the job has any review the current viewer may read (any status). Gates the sidebar link so completed/decided reviews (and their comment history) stay reachable after the build finishes, mirroring the per-build audit link's "stays visible" behaviour.
    • isBuildDeleted

      public boolean isBuildDeleted(@NonNull ReviewDocument r)
      Returns:
      true if the review's owning build has been deleted. The per-job page keeps listing such reviews (their comment/decision history is durable) but marks them "build deleted" and drops the link to the — now absent — per-build review editor. Called per row from index.jelly. The flag is set by BuildLifecycleCleanup on deletion (and by its startup reconcile for builds deleted earlier), so no live build lookup is needed here.
    • getPollingIntervalSeconds

      public int getPollingIntervalSeconds()
    • 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
      Returns:
      the stable sidebar / overflow label. The pending count is getBadge(), not a (N) suffix, so the classic sidepanel does not flicker from Interactive View (N) to a pill.
    • getBadge

      @CheckForNull public Badge getBadge()
      Specified by:
      getBadge in interface Badgeable
      Returns:
      a numeric DANGER badge while this job has open reviews the current viewer should act on; null at zero. Core renders this on the sidepanel (task-icon-badge) and in the experimental overflow / tab chrome.
    • getUrlName

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