Class PendingApprovalAction
java.lang.Object
io.jenkins.plugins.github_pr_approval.PendingApprovalAction
- All Implemented Interfaces:
Action, ModelObject
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAttaches aPendingApprovalActionto any branch job that needs external approval.static classPuts a newly discovered fork pull request on hold, and catches the jobs that were already there when the trust policy got switched on.static classThe gate that actually stops an unapproved fork pull request from building.static classSettles every pull request once a branch scan has finished.static classSpends the approval once the build it was granted for has started: the job goes back to disabled, so the next commit needs a fresh approval.static enumApproval state of an external pull request.static classMarks a build as having been triggered by an external approval. -
Method Summary
Modifier and TypeMethodDescriptionorg.kohsuke.stapler.HttpResponsedoApprove(org.kohsuke.stapler.StaplerRequest2 req) Approves the pull request: enables the job and starts a build.org.kohsuke.stapler.HttpResponsedoReject(org.kohsuke.stapler.StaplerRequest2 req) Takes the approval back and disables the job again.Job<?, ?> getOwner()intgetState()boolean
-
Method Details
-
getIconFileName
- Specified by:
getIconFileNamein interfaceAction
-
getDisplayName
- Specified by:
getDisplayNamein interfaceAction- Specified by:
getDisplayNamein interfaceModelObject
-
getUrlName
- Specified by:
getUrlNamein interfaceAction
-
getState
-
getPrNumber
public int getPrNumber() -
getPrAuthor
-
getCurrentPullHash
-
isRequireApprovalForNewCommits
public boolean isRequireApprovalForNewCommits() -
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.
-