Class ApprovableBuildManager


  • public class ApprovableBuildManager
    extends Object
    • Method Detail

      • setTimeService

        public void setTimeService​(TimeService timeService)
      • hasApprovalRules

        public boolean hasApprovalRules​(@NotNull
                                        BuildPromotionEx buildPromotionEx)
        Returns true if this build has approval configuration(from untrusted build settings or approval build feature)
      • shouldCollectChangesInQueue

        public boolean shouldCollectChangesInQueue​(@NotNull
                                                   BuildPromotionEx buildPromotion)
      • hasApprovalFeature

        public boolean hasApprovalFeature​(@NotNull
                                          BuildPromotionEx buildPromotionEx)
      • hasApprovalFeature

        public Boolean hasApprovalFeature​(@NotNull
                                          SBuildType buildType)
      • getApprovalConfiguration

        @NotNull
        public ApprovalBuildFeatureConfiguration getApprovalConfiguration​(@NotNull
                                                                          BuildPromotionEx buildPromotionEx)
        Returns configuration for approval if this build type has approval rules(from untrusted build settings or approval feauture), or throws an exception if it does not. Use shouldBeApproved() method prior to calling this method.
      • allApprovalRulesAreMet

        public Boolean allApprovalRulesAreMet​(@NotNull
                                              BuildPromotionEx buildPromotionEx)
        Returns true if all approval rules for this promotion are met, or false otherwise. Always returns false for a build which does not need to be approved
      • getApprovedByUsers

        public Set<SUser> getApprovedByUsers​(@NotNull
                                             BuildPromotionEx buildPromotionEx)
        Retrieve set of SUser entities for users who have approved this build.
      • getApprovedByUsernames

        public static Set<String> getApprovedByUsernames​(@NotNull
                                                         BuildPromotionEx buildPromotionEx)
        Return set of usernames of users who have approved this build.
      • getTimeout

        @Nullable
        public Long getTimeout​(@NotNull
                               BuildPromotionEx buildPromotionEx)
        Retrieve timestamp (epoch seconds) for the moment when this build promotion will time out.
      • hasTimedOut

        public Boolean hasTimedOut​(@NotNull
                                   BuildPromotionEx buildPromotionEx)
        Returns true if this build promotion has timed out (e.g. timeout timestamp was reached), and false otherwise.
      • areApprovalRulesValid

        public Boolean areApprovalRulesValid​(@NotNull
                                             BuildPromotionEx buildPromotionEx)
                                      throws IllegalStateException
        Returns true if given build promotion has approval feature enabled and its rules are valid. Throws IllegalStateException if given build promotion does not have approval feature enabled (use getApprovalFeature method).
        Throws:
        IllegalStateException
      • isApprovedByUser

        public Boolean isApprovedByUser​(@NotNull
                                        BuildPromotionEx buildPromotionEx,
                                        @NotNull
                                        SUser user)
        Returns true if this build was approved by specified user, or false otherwise.
      • addApprovedByUser

        public void addApprovedByUser​(@NotNull
                                      BuildPromotionEx buildPromotionEx,
                                      @NotNull
                                      SUser user)
      • addApprovedByUser

        public void addApprovedByUser​(@NotNull
                                      BuildPromotionEx buildPromotionEx,
                                      @NotNull
                                      SUser user,
                                      boolean approveAll)