Class PendingApprovalAction.ApprovalScanListener

java.lang.Object
io.jenkins.plugins.github_pr_approval.PendingApprovalAction.ApprovalScanListener
All Implemented Interfaces:
ExtensionPoint, ExecutorListener
Enclosing class:
PendingApprovalAction

@Extension public static class PendingApprovalAction.ApprovalScanListener extends Object implements ExecutorListener
Settles every pull request once a branch scan has finished.

Nothing else tells us a scan happened: no item listener fires for a re-index, and branch indexing writes down the revision it has just seen only after it has scheduled the build. So a scan is the one moment we most need to look again, and the only safe place to look is once it is over. A pull request that has moved past the commit it was approved for goes back to pending here, and the build the scan just scheduled for the new commit is cancelled with it, as long as it has not started yet.

Branch indexing runs as a queue task on the multibranch project itself, which is why this hangs off ExecutorListener rather than anything branch-related.