Class PendingApprovalAction

java.lang.Object
io.jenkins.plugins.github_pr_approval.PendingApprovalAction
All Implemented Interfaces:
Action, ModelObject

public class PendingApprovalAction extends Object implements Action
Shown on a branch job while its fork pull request waits for external approval, with the buttons and endpoints an administrator uses to approve or take back that approval.

What actually holds the pull request back is PendingApprovalAction.ApprovalQueueGuard. The job is disabled too, but only so the state is visible: the guard is what refuses the build.

  • Method Details

    • getIconFileName

      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

      public String getUrlName()
      Specified by:
      getUrlName in interface Action
    • getState

    • getPrNumber

      public int getPrNumber()
    • getPrAuthor

      public String getPrAuthor()
    • getCurrentPullHash

      public String getCurrentPullHash()
    • isRequireApprovalForNewCommits

      public boolean isRequireApprovalForNewCommits()
    • getOwner

      public Job<?,?> getOwner()
    • doApprove

      @POST public org.kohsuke.stapler.HttpResponse doApprove(org.kohsuke.stapler.StaplerRequest2 req)
      Approves the pull request: enables the job and starts a build.
    • doReject

      @POST public org.kohsuke.stapler.HttpResponse doReject(org.kohsuke.stapler.StaplerRequest2 req)
      Takes the approval back and disables the job again.