Looking for a 'janitor' or 'sanity check' plugin for enterprise use cases

65 views
Skip to first unread message

Benjamin Francisoud

unread,
Dec 18, 2015, 12:17:57 PM12/18/15
to Jenkins Developers
Hi,

as explain here https://wiki.jenkins-ci.org/display/JENKINS/Before+starting+a+new+plugin, I'd like to know before hacking my own plugin if there is any existing plugin for my current issues.

People create jobs but never delete them when they either: quit the company, move to an other project, delete the branch/tags in the scm associated with a job, etc...
From time to time I cleanup old jobs manually and it's a boring job :(

Do you know any plugin that could (by order of priorirty):
- deactivate never build jobs after a certain period of time X +send a notification mail to the latest commiter
- then delete them after X+Y days
- deactivate jobs in case of unreachable scm url + email notification
- delete user listed in jenkins but not in ldap anymore or desactivated (a sign that the person as left the company)

Another issue is that people use there own credentials to checkout from scm in jenkins.
when they change their passwords (every 3 months 'enterprise active directory password policy'), they forget to change the one in jenkins... jenkins then tried many times to query the subversion server, but fails ... unfortunately the subversion server thinks it's a DoS attack and then blacklist the jenkins server (and actually a whole part of the company network) :(
We force people to use service accounts which password don't change or deploy key for gitlab but I'm reluctant to deactivate the possibility to use one own credentials since creating the service account can take some time...
I created a Log Recorder that logs scm errors (jenkins.scm.impl.subversion & hudson.scm) but it doesn't prevent the problem just help find the origin :(
I'd like to send email notifications to a list of admins and the user associated with those failing credentials and eventually deactivate the jobs as soon as such event may occur... any plugin ?

I could script this using jenkins api, curl, python etc. but looking at my requirements the plugin can become quite complex so java seems more accurate...

Thanks

Victor Martinez

unread,
Dec 19, 2015, 2:32:22 AM12/19/15
to Jenkins Developers
Hi,

You can easily automate your validations via groovy Jenkins api and run a jenkins job every X time to either report/notify or disable any jobs.

That's how I automate any maintainace tasks.

My tips:

1) create your jobs via DSL.
a) and run a system groovy step
2) script your logic in groovy. Look at the scriptler and groovy post build plugins since there are a bunch of examples.

Ideally you will query every build which run in the last X time, read the log file and look for any regex if so disable that job and notify with some email. The first case will be similar but querying every job which hasn't run any build in the last X time and disable it.

Probably if it doesn't exist any plugin yet it would be a good idea to have a disable policy plugin in case any jobs haven't been triggered in the last X days and notify via email to the admin list. But I don't recall any plugin like that.

I hope it helps.

Cheers

Robert Sandell

unread,
Dec 21, 2015, 10:13:33 AM12/21/15
to jenkin...@googlegroups.com
Performing an action when something is found in a build log has been on my todo list for the Build Failure Analyzer Plugin [1] for a long time.
Given my current priorities I'll probably not get around to it in the foreseeable future, but as usual I'm open to pull requests ;)
Finding unused jobs is, in my experience, somewhat of a black art, since there are so many variables to take into consideration, at least in the environment that I used to work. A job could for example still be running once a day even though nobody is using the results due to a scheduled trigger, one folder might need special tweaking because it contains reference jobs etc.
So it lends itself better to scripting than a static plugin that is more bulky to update when you need more fine grained rules etc.

/B



--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/e6ce499a-07b9-4a87-b8a5-08cdaca1d4dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Robert Sandell
Software Engineer
CloudBees Inc.
Reply all
Reply to author
Forward
0 new messages