Giter Site home page Giter Site logo

jenkinsci / working-hours-plugin Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 14.0 1.37 MB

Jenkins plugin to prevent a build step from running outside working hours

Home Page: https://plugins.jenkins.io/working-hours/

License: MIT License

Java 99.89% HTML 0.11%

working-hours-plugin's Issues

Any running jobs fail to resume after Jenkins restart with WorkingHours plugin installed

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

Allow custom text when jobs are held

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.

More than one schedule

I would like to be able to define more than one schedule. My use cases:

  • I have some build jobs that I only want to run during office hours
  • I have some maintenance jobs that I only want to run outside office hours
  • I work in an international team, spread over several geographic locations and time zones. Office hours in Asia, Europe and Americas hardly overlap.

Limit holding jobs to certain branchs

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

Working Hours Jenkins Plugin schedule didn't get triggered

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)

image

Persistent "Could not parse into format" error

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:
Screen Shot 2021-02-25 at 5 32 56 PM

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.

Repeatable holiday

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.

Option to cancel job and not queue it

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.