Class PendingApprovalAction.ApprovalQueueGuard
- All Implemented Interfaces:
ExtensionPoint
- Enclosing class:
PendingApprovalAction
Disabling the job (see PendingApprovalAction.ApprovalItemListener) is not enough on its own. When branch
indexing discovers a new fork PR it schedules that PR's first build in the same pass, and that
build can win the race against the job being disabled — which is how an unapproved PR slipped
through and built. A manual "Build Now" or a re-trigger would get past a disabled job too.
Jenkins asks every Queue.QueueDecisionHandler before it queues anything, so refusing
here blocks the build no matter what triggered it. The disabled flag is then just what the
user sees; this is what enforces it.
This runs while the build queue is locked, so it stays deliberately cheap: a few in-memory checks and one small file read — never a GitHub call and never a write.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Queue.QueueDecisionHandler
all
-
Constructor Details
-
ApprovalQueueGuard
public ApprovalQueueGuard()
-
-
Method Details
-
shouldSchedule
- Specified by:
shouldSchedulein classQueue.QueueDecisionHandler
-