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 holds the pull request back is PendingApprovalAction.ApprovalQueueGuard. The job stays enabled and shows a "pending approval" banner rather than being disabled, so a project administrator can still start a one-off build with "Build Now" while everyone else is refused.

  • 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; once the record is pending again the guard blocks the pull request.