Class BatchControlRootAction

java.lang.Object
io.jenkins.plugins.batchcontrol.action.BatchControlRootAction
All Implemented Interfaces:
ExtensionPoint, Action, ModelObject, RootAction, ModelObjectWithContextMenu

@Extension @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class BatchControlRootAction extends Object implements RootAction, ModelObjectWithContextMenu
Global "Batch Control" page at /batch-control.

URL space (fixed contract, asserted by tests):

  • /batch-control/ — landing page
  • /batch-control/requests/ — run request list (paged, newest first)
  • /batch-control/requests/<id>/ — request detail with decision endpoints
  • /batch-control/activations/ — activation approval inbox and list; <id>/ detail with approve/reject/cancel/changeApprover endpoints (SPEC item 6a)
  • /batch-control/grants/ — grant request list, active grants, create/decision/revoke endpoints
  • /batch-control/changes/ — change record list (per month, read-only)
  • /batch-control/dashboard/ — run record dashboard (last 7 days by default)
  • /batch-control/incidents/ — incident list; <id>/ detail with acknowledge/resolve/comment/rerun endpoints
  • /batch-control/history/ — filtered history, summary JSON and CSV exports

The action is absent for a user who holds none of the Batch Control permissions (SPEC item 2): getIconFileName() and getUrlName() both return null, so it is not listed and /batch-control/ and every URL beneath it answer 404. A user who holds some Batch Control permission but not the one a section needs gets 403 from that section's gate.

Hosting review 2026-10-02 (PR6): the sections are reached through a tab bar (bc:tabs, built from SectionTabs) instead of a side panel, and the action is a ModelObjectWithContextMenu, so its breadcrumb offers the same sections as a dropdown on every subpage.

  • Constructor Details

    • BatchControlRootAction

      public BatchControlRootAction()
  • Method Details

    • getIconFileName

      @CheckForNull 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

      @CheckForNull public String getUrlName()
      null without any Batch Control permission: per Action.getUrlName() that makes the action unreachable, so the URL space answers 404 instead of disclosing it.
      Specified by:
      getUrlName in interface Action
    • doContextMenu

      public ModelObjectWithContextMenu.ContextMenu doContextMenu(org.kohsuke.stapler.StaplerRequest2 request, org.kohsuke.stapler.StaplerResponse2 response)
      The breadcrumb dropdown: the same tabs, in the same order and with the same badges, as the tab bar (SectionTabs.current(), permission-filtered by SectionAccess), plus the configuration page for a BatchControl/Manage holder. Read-only; empty for a user the page does not admit (SectionAccess.canOpenRoot(), the gate of the tab bar too), who gets 404 before reaching it anyway.
      Specified by:
      doContextMenu in interface ModelObjectWithContextMenu
    • getViewPermissions

      public Permission[] getViewPermissions()
      Permissions for the landing page's l:layout: any Batch Control permission.
    • pagerQuery

      public String pagerQuery(String parameter, long page)
      #45: the query string of a bc:pager link to page of the list paged with parameter, keeping the current URL's other parameters (Paging.query(java.lang.String, long)). The tag reaches it through this action, as bc:tabs does, because j:invokeStatic loads classes with core's class loader and cannot see plugin classes in a real Jenkins. long, so the view's arithmetic on the page number binds whatever its number type.
    • statusLabel

      public String statusLabel(@CheckForNull Enum<?> value, boolean runRequest)
      #18.2: the readable label of a status or cause for bc:status (StatusLabels), reached through this action for the same reason as pagerQuery(java.lang.String, long). With runRequest, a run request's APPROVED reads "Approved, waiting to run".
    • resultLabel

      public String resultLabel(@CheckForNull String result)
      #18.2 (owner decision 2026-10-14): the readable label of a build result for bc:result (StatusLabels.ofResult(java.lang.String)), reached through this action for the same reason as pagerQuery(java.lang.String, long). A result is plain text, never a badge.
    • statusTone

      @CheckForNull public String statusTone(@CheckForNull Object value, boolean ended)
      #18.2 (colour badges): the tone of the badge bc:status renders for a request or incident status (StatusLabels.tone(java.lang.Enum<?>)); null for anything else (a run cause, a value that is not an enum constant), which the tag then shows as plain text. With ended, the badge is in an Ended table, where an approved request is no longer in effect and is neutral (StatusLabels.endedTone(java.lang.Enum<?>)).
    • runCell

      public RunCell runCell(RunRecord record)
      #6 (Wave D, D3): the Run cell of a run record for bc:runCell (RunCell); the job and run links follow the viewer's Item/Read (D-44). Reached through this action for the same reason as pagerQuery(java.lang.String, long).
    • incidentRunCell

      public RunCell incidentRunCell(Incident incident)
      #6 (Wave D, D3): the Run cell of an incident's run for bc:runCell, as runCell(RunRecord).
    • parameterLines

      public ParameterLines parameterLines(@CheckForNull Map<String,String> parameters)
      #6, #18.1 (Wave D, D3): the Parameters cell of a run record for bc:parameters (ParameterLines).
    • getTabs

      public List<SectionTabs.Tab> getTabs()
      The tabs the viewer may open, with their open-item badges (overview page).
    • getLinks

      public SectionAccess getLinks()
      Link predicates of the overview: each entry is shown only if it can be opened.
    • getConfigurationLink

      @CheckForNull public BatchControlConfigurationLink getConfigurationLink()
      e2e-03 DEF-10: the Batch Control configuration page for a BatchControl/Manage holder, who may not reach Manage Jenkins; null (no link) for anyone else, or while the page is not shipped.
    • getRequests

      public RequestsSection getRequests()
      Stapler: serves /batch-control/requests/....
    • getActivations

      public ActivationsSection getActivations()
      Stapler: serves /batch-control/activations/....
    • getGrants

      public GrantsSection getGrants()
      Stapler: serves /batch-control/grants/....
    • getChanges

      public ChangesSection getChanges()
      Stapler: serves /batch-control/changes/....
    • getDashboard

      public DashboardSection getDashboard()
      Stapler: serves /batch-control/dashboard/....
    • getIncidents

      public IncidentsSection getIncidents()
      Stapler: serves /batch-control/incidents/....
    • getHistory

      public HistorySection getHistory()
      Stapler: serves /batch-control/history/....
    • markedRuns

      public List<ReplayedRuns.Row> markedRuns(String itemFullName)
      D-58c, for the batch-control-strategy monitor's view (reached there through app.getExtensionList): the runs of the item named itemFullName replayed under a permission window. Not a Stapler route (no get/do prefix); the monitor is Administer-only, and the item is resolved as the viewer.
    • isCanRequestGrants

      public boolean isCanRequestGrants()
      For refusal pages outside this action (reached through app.getExtensionList, since j:invokeStatic cannot load plugin classes): whether the viewer may open the Grants screen and submit a grant request. Not a Stapler route (an is getter of a boolean is never dispatched to).
    • grantRequestUrl

      @CheckForNull public String grantRequestUrl(String fullName, String action)
      Root-relative URL of the new grant request form prefilled for the item and the action, or null when the viewer cannot see the item or it cannot carry a window. Not a Stapler route (no get/do prefix).
    • changedUnderGrant

      @CheckForNull public GuardInfo.Changed changedUnderGrant(String itemFullName)
      For the batch-control-strategy monitor's view: the permission window that recorded a change to the item (or a folder above it), or null. Not a Stapler route.
    • reviewOutcome

      @CheckForNull public GuardInfo.Outcome reviewOutcome(String itemFullName)
      For the monitor's reviewed view: what still guards the item after it was marked as reviewed, or null when that is not true now. Not a Stapler route.