Interface QueuedBuildEx

    • Method Detail

      • getCanRunOnAgentTypes

        @NotNull
        List<StartableAgentType> getCanRunOnAgentTypes()
        Returns:
        available cloud agent types where this build can be started
        Since:
        2017.1.4
      • getCanRunOnAgents

        @NotNull
        List<SBuildAgent> getCanRunOnAgents​(@NotNull
                                            List<SBuildAgent> availableAgents)
        Returns:
        accepts collection of agents and returns those where this queued build can run
        Since:
        2017.1.4
      • canRunInPool

        boolean canRunInPool​(int agentPoolId)
        Since:
        2020.2
      • tryLockBuildStarting

        boolean tryLockBuildStarting()
        Should be called when build starts. Returns true if build can be started or false if there is a build starting from this queued build.
        Returns:
      • startChangesCollecting

        void startChangesCollecting()
      • markAsStarted

        void markAsStarted()
        Called when a build started from this queued build
      • removeFailedToStartFromQueue

        void removeFailedToStartFromQueue()
        removes current build from queue without marking it as stated.
      • terminate

        void terminate​(boolean isCanceled,
                       @Nullable
                       String comment,
                       @NotNull
                       BuildProblemData buildProblemData)
        Removes current build from queue and creates a history build entry for it.
        Parameters:
        isCanceled - whether to create cancelation info for a history build entry. Status of the created build is also detrmined by this parameter: true->UNKNOWN, false->FAILURE.
        comment - comment to use for logging during remove operation as well as cancellation info comment if 'isCanceled' is true
        buildProblemData - build problem to add to the history build
        Throws:
        IllegalArgumentException - in case 'isCanceled' is false and 'buildProblemData' type is not an internal error (see ErrorData.isInternalError(String))
        Since:
        2023.11.1
      • isStarted

        boolean isStarted()
        Returns true if this build started
        Returns:
        true if this build started
      • unlockBuildStarting

        void unlockBuildStarting()
        Undoes start of a build, new build can be started from this queued build after that.
      • getBuildTypeEx

        @NotNull
        BuildTypeEx getBuildTypeEx()
      • isPersisted

        boolean isPersisted()
      • markPersisted

        void markPersisted()
      • isCanBeReplacedByMergeOptimization

        boolean isCanBeReplacedByMergeOptimization()
        Returns:
        true if this queued build can be optimized (removed from the queue by queue optimizer)
      • startBuild

        @NotNull
        RunningBuildEx startBuild​(@NotNull
                                  String requestor)
        Start build. The method can be used to start build wihtout agent.
        Parameters:
        requestor - build requestor information like name or so
        Since:
        2019.2
      • getWaitReasons

        @NotNull
        Map<String,​Long> getWaitReasons()
        Returns current wait reasons for this queued build. The key of the map is a wait reason description in human friendly form. The value is amount of milliseconds this wait reason was reported for this queued build.
        Returns:
        map of a wait reason to amount of time it was reported for the build in milliseconds
        Since:
        2022.1
      • getLatestWaitReason

        @Nullable
        String getLatestWaitReason()
        Returns:
        the latest wait reason which prevented this build from starting.