Class ReplayAction

  • All Implemented Interfaces:
    Action, ModelObject

    public class ReplayAction
    extends Object
    implements Action
    Attached to a Run when it could be replayed with script edits.
    • Field Detail

    • Method Detail

      • isRebuildEnabled

        public boolean isRebuildEnabled()
      • isEnabled

        public boolean isEnabled()
      • isReplayableSandboxTest

        public boolean isReplayableSandboxTest()
        Runs the extra tests for replayability beyond isEnabled() that require a blocking load of the execution.
      • getOwner

        public Run getOwner()
      • doRun

        @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class)
        public void doRun​(org.kohsuke.stapler.StaplerRequest req,
                          org.kohsuke.stapler.StaplerResponse rsp)
                   throws javax.servlet.ServletException,
                          IOException
        Throws:
        javax.servlet.ServletException
        IOException
      • doRebuild

        @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class)
        public void doRebuild​(org.kohsuke.stapler.StaplerRequest req,
                              org.kohsuke.stapler.StaplerResponse rsp)
                       throws javax.servlet.ServletException,
                              IOException
        Throws:
        javax.servlet.ServletException
        IOException
      • run

        @CheckForNull
        public QueueTaskFuture run​(@NonNull
                                   String replacementMainScript,
                                   @NonNull
                                   Map<String,​String> replacementLoadedScripts)
        For whitebox testing.
        Parameters:
        replacementMainScript - main script; replacement for getOriginalScript()
        replacementLoadedScripts - auxiliary scripts, keyed by class name; replacement for getOriginalLoadedScripts()
        Returns:
        a way to wait for the replayed build to complete
      • run2

        @CheckForNull
        public Queue.Item run2​(@NonNull
                               String replacementMainScript,
                               @NonNull
                               Map<String,​String> replacementLoadedScripts)
        For use in projects that want initiate a replay via the Java API.
        Parameters:
        replacementMainScript - main script; replacement for getOriginalScript()
        replacementLoadedScripts - auxiliary scripts, keyed by class name; replacement for getOriginalLoadedScripts()
        Returns:
        build queue item
      • replacementsIn

        @NonNull
        public static Set<String> replacementsIn​(@NonNull
                                                 CpsFlowExecution execution)
                                          throws IOException
        Finds a set of Groovy class names which are eligible for replacement.
        Parameters:
        execution - the associated execution
        Returns:
        Groovy class names expected to be produced, like Script1
        Throws:
        IOException
      • getDiff

        public String getDiff()
      • doCheckScriptCompile

        public net.sf.json.JSON doCheckScriptCompile​(@AncestorInPath
                                                     Item job,
                                                     @QueryParameter
                                                     String value)