Class RunLinks

java.lang.Object
io.jenkins.plugins.batchcontrol.ui.RunLinks

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final class RunLinks extends Object
Builds root-relative build URLs from stored identifiers, and small display helpers shared by the dashboard/incident/history views. Read-only, no Jenkins model lookups: records may refer to builds or jobs that no longer exist, and the link is then simply a 404.
  • Method Details

    • runUrl

      public static String runUrl(String jobFullName, int number)
      Returns:
      job/a/job/b/12/ for job full name a/b and build number 12 (relative to the Jenkins root URL, each path segment URL-encoded)
    • jobUrl

      public static String jobUrl(String jobFullName)
      Returns:
      job/a/job/b/ for job full name a/b.
    • runUrlFromRunId

      @CheckForNull public static String runUrlFromRunId(@CheckForNull String runId)
      Builds the run URL from a stored run id of the form jobFullName#number.
      Returns:
      the root-relative URL, or null when the id does not have that form (the view then renders plain text instead of a link)
    • formatParameters

      public static String formatParameters(@CheckForNull Map<String,String> parameters)
      One-line name=value rendering of a parameter map for table cells and CSV. Values arrive already masked from the store (D-72: the display map derived once by store.ParameterDisplay, a secret as ********, a file as [file] <name>); output is escaped by the Jelly default.
    • formatDuration

      public static String formatDuration(long durationMs)
      Human-readable duration (3 min 20 sec); empty for non-positive values.

      Delegates to Dates.span(long) so durations and grant countdowns cannot drift into two different spellings of the same kind of value (U-07).