Class BatchControlJobProperty
- All Implemented Interfaces:
ExtensionPoint,Describable<JobProperty<?>>,ReconfigurableDescribable<JobProperty<?>>,BuildStep
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public class BatchControlJobProperty
extends JobProperty<Job<?,?>>
Per-job batch control settings (SPEC items 5 and 6): whether the job requires an approved run
request, trigger-blocking policy, and an optional job-level approver restriction.
These settings have no effect while the global run-control switch is off.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherListNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class hudson.model.JobProperty
ownerFields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BatchControlJobPropertyThe new-job activation lock of D-34:approvalRequired,blockTimerandblockUpstreamall on, and no upstream allow list — so no cause at all can start the job until somebody turns a switch off in its configuration.The trigger switches that are refusing unattended runs of this job right now, in the orderblockTimer,blockUpstream(job-page notice).booleanWhether these settings already are the activation lock, so that applying it again would cost the job a property rebuild and a save (S-20) and change nothing.booleanbooleanbooleanvoidsetAllowedUpstreamJobs(List<String> allowedUpstreamJobs) voidvoidsetBlockTimer(boolean blockTimer) voidsetBlockUpstream(boolean blockUpstream) voidsetJobApprovers(List<String> jobApprovers) voidsetJobApproversText(String text) These settings with the D-34 activation lock applied: every setting that decides whether a run may start is forced to its locked value, and the settings that decide nothing about starting a run are carried over.Methods inherited from class hudson.model.JobProperty
getDescriptor, getJobAction, getJobActions, getJobOverrides, getProjectAction, getProjectActions, getRequiredMonitorService, getSubTasks, perform, prebuild, reconfigure, reconfigure, setOwner
-
Constructor Details
-
BatchControlJobProperty
@DataBoundConstructor public BatchControlJobProperty(boolean approvalRequired)
-
-
Method Details
-
isApprovalRequired
public boolean isApprovalRequired() -
activationLocked
The new-job activation lock of D-34:approvalRequired,blockTimerandblockUpstreamall on, and no upstream allow list — so no cause at all can start the job until somebody turns a switch off in its configuration.The empty allow list is part of the lock rather than an accident of construction: with
blockUpstreamon,allowedUpstreamJobsis the list of upstream jobs that are exempt from it (D-16), so a non-empty list is an open upstream door (P-14). -
withActivationLock
These settings with the D-34 activation lock applied: every setting that decides whether a run may start is forced to its locked value, and the settings that decide nothing about starting a run are carried over.approvalRequiredis final, so the default has to rebuild the property rather than flip a field.jobApproversis carried over because it only ever narrows who may approve a request for this job (policy.ApprovalPolicy#checkDesignationapplies it on top of the global approver list), so honouring a creator-supplied value cannot widen anything. The trigger policy is not carried over — seeactivationLocked()and P-14. -
isActivationLocked
public boolean isActivationLocked()Whether these settings already are the activation lock, so that applying it again would cost the job a property rebuild and a save (S-20) and change nothing. -
getBlockingSwitches
The trigger switches that are refusing unattended runs of this job right now, in the orderblockTimer,blockUpstream(job-page notice). Empty while run control is off, because the queue gate then lets every cause pass and a switch that is set blocks nothing. Since D-46 the switches refuse timer and upstream runs whateverapprovalRequiredsays, so the notice follows the switches alone (e2e-03 DEF-15). The notice tells the reader to clear the switch in the job configuration, which is itself change-controlled. -
isBlockTimer
public boolean isBlockTimer() -
setBlockTimer
@DataBoundSetter public void setBlockTimer(boolean blockTimer) -
isBlockUpstream
public boolean isBlockUpstream() -
setBlockUpstream
@DataBoundSetter public void setBlockUpstream(boolean blockUpstream) -
getAllowedUpstreamJobs
-
setAllowedUpstreamJobs
-
getAllowedUpstreamJobsText
-
setAllowedUpstreamJobsText
-
getJobApprovers
-
setJobApprovers
-
getJobApproversText
-
setJobApproversText
-