jenkinsci / working-hours-plugin Goto Github PK
View Code? Open in Web Editor NEWJenkins plugin to prevent a build step from running outside working hours
Home Page: https://plugins.jenkins.io/working-hours/
License: MIT License
Jenkins plugin to prevent a build step from running outside working hours
Home Page: https://plugins.jenkins.io/working-hours/
License: MIT License
When the WorkingHours plugin is installed, any jobs that have it enabled via the enforceBuildSchedule()
option that were running at the time of a restart, will fail to resume after Jenkins restarts, showing the following error repeatedly in their log:
Waiting to resume part of <job> » <job>:<run>: Exception evaluating if the queue can run the task
The Jenkins log shows this stacktrace:
Exception evaluating if the queue can run the task 'part of <job>'
java.lang.NullPointerException
at org.jenkinsci.plugins.workinghours.WorkingHoursQueueTaskDispatcher.canRunNow(WorkingHoursQueueTaskDispatcher.java:120)
at org.jenkinsci.plugins.workinghours.WorkingHoursQueueTaskDispatcher.canRun(WorkingHoursQueueTaskDispatcher.java:82)
at hudson.model.Queue.getCauseOfBlockageForItem(Queue.java:1209)
at hudson.model.Queue.maintain(Queue.java:1539)
at hudson.model.Queue$MaintainTask.doRun(Queue.java:2904)
at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:91)
at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
The only resolution is aborting and restarting the jobs.
System info:
Jenkins version: 2.249.1 (seen for several of the past LTS versions)
WorkingHours Plugin version: 1.0
When a job is held, the build log will contain the text "Outside working hours - job will run during next available time.".
It would be nice to have the ability to specify a different string in the UI as an option, and use that if provided.
I would like to be able to define more than one schedule. My use cases:
It would be nice to be able to limit holding jobs to certain branches. One use case for this plugin is to prevent deployments, but those typically are scoped to certain branches. It would be nice to allow branches that don't deploy (such as PRs) to proceed.
One idea would be to add some properties, e.g.
enforceBuildSchedule(branches: ['master', 'prod', 'test'])
But other solutions are welcome
We want to use the Working Hours Jenkins Plugin in our project to stop the Jenkins execution for the fixed time frame. When I configured the same under the system configuration, it didn't work the way expected. We are using Jenkins GUI to schedule the jobs. Please find the attached screenshot of my Working Hours Jenkins Plugin schedule. Am I missing something here? Would you please help me to go through this? I appreciate any help you can provide. (edited)
I have the working hours plugin installed on my Jenkins master, and whenever the local time is outside of the configured working hours, the log gets filled with hundreds of these error messages:
Could not parse into format HHmm
Could not parse into format HHmm
Could not parse into format HHmm
Could not parse into format HHmm
Could not parse into format HHmm
Could not parse into format HHmm
Could not parse into format HHmm
Could not parse into format HHmm
Could not parse into format HHmm
2021-02-25 23:33:48.642+0000 [id=133] INFO o.j.p.w.WorkingHoursQueueTaskDispatcher#log: Blocking item 345921
021-02-25 23:33:48.643+0000 [id=133] INFO o.j.p.w.WorkingHoursQueueTaskDispatcher#log: Blocking item 345922
I'm running the latest available version of the working hours plugin (1.1) with Jenkins 2.263.3, but this has been an issue for months now.
My configuration for the working hours plugin looks like so:
I've tried changing 00:00
to 0:00
, no change in the logging. The working hours plugin is working as expected - it's blocking jobs outside the configured working hours - yet it's still spamming the system log with these parse errors.
When entering holidays, it would be nice to have a way to indicate that date is a holiday every year (right now it only applies to the specific year). The easiest thing to do is probably to just add a checkbox to the UI.
Jenkins Version: 2.7.3
I have a use case where I do not want jobs to run out side of office hours, however instead of queuing the job to run in office hours I'd like to just cancel/not run the job at all.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.