Job configuration changes upon viewing

961 views
Skip to first unread message

Stephen Price

unread,
Jul 14, 2016, 1:47:40 PM7/14/16
to job-dsl-plugin
After my seed jobs update Jenkins jobs, some jobs show up as being changed when I view them. For example, I can see the warning on the job's summary: "This item has been changed manually since it was generated by the seed job.", and I can see an entry in the Job Config History for my user (using the JobConfigHistory plugin). When view the diffs between the SYSTEM-edited version (via Job DSL) and the version listed as being changed by myself, the data's all the same, but there are slight differences in whitespace and XML element ordering. This happens even if I do not view the Configuration page for the job. It doesn't happen for every job, but I haven't been able to nail down a common thread between the jobs that exhibit this issue.

Additionally, I can see history entries for anyone who happens to be using Jenkins at the time the jobs were re-seeded. You get a long list of history entries that alternate between SYSTEM and individuals. Makes it kind of useless. I realize that the real history is now in git, but it'd be nice to at least get rid of the warning, since nothing's really been modified.

Anyone else had this problem?

Matt Sheehan

unread,
Jul 14, 2016, 2:25:54 PM7/14/16
to job-dsl-plugin
All of my generated jobs have that warning, but I haven't looked into it.

--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugi...@googlegroups.com.
To post to this group, send email to job-dsl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/47a170e3-e858-4d98-beed-2c760cccaee4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stephen Price

unread,
Jul 14, 2016, 2:39:18 PM7/14/16
to job-dsl-plugin
Hrm. Maybe caused by some plugin?

Daniel Spilker

unread,
Jul 15, 2016, 3:12:18 AM7/15/16
to job-dsl...@googlegroups.com
Yes, that will be some plugin that modifies the Job configuration. It would be great if you could investigate and report the results here. Then we could add the info to the wiki.

Background:
The config.xml generated by Job DSL does not match 100% the config.xml generated by Jenkins, e.g. if you hit the "Save" button. Some elements have a different order and Job DSL does not generate the plugin ID attributes. To check if a job has been modified, Job DSL stores a hash of the config.xml. After it has been saved by Jenkins, the hash does not match with the existing config. And that triggers the warning on the job's summary.

Daniel


Stephen Price

unread,
Jul 15, 2016, 3:51:50 PM7/15/16
to job-dsl-plugin
I did some log investigation, and I was able to find the Disk Usage plugin modifies the job config when you view any part of the job.

I saw this in the logs:
Jul 15, 2016 12:38:57 PM FINEST hudson.plugins.jobConfigHistory.JobConfigHistorySaveableListener
In onChange for hudson.plugins.disk_usage.ProjectDiskUsage@6ab6e43a
Jul 15, 2016 12:38:57 PM FINEST hudson.plugins.jobConfigHistory.JobConfigHistorySaveableListener
onChange for hudson.plugins.disk_usage.ProjectDiskUsage@6ab6e43a done.
Jul 15, 2016 12:38:57 PM FINEST hudson.plugins.jobConfigHistory.JobConfigHistorySaveableListener
In onChange for hudson.model.FreeStyleProject@6d3eead5[Ansible/Pod_Create]
Jul 15, 2016 12:38:57 PM FINE hudson.plugins.jobConfigHistory.FileHistoryDao
hudson.plugins.jobConfigHistory.FileHistoryDao@5d8392ec on /var/lib/jenkins/config-history/jobs/Ansible/jobs/Pod_Create/2016-07-15_12-38-57
Jul 15, 2016 12:38:57 PM FINEST hudson.plugins.jobConfigHistory.JobConfigHistorySaveableListener
onChange for hudson.model.FreeStyleProject@6d3eead5[Ansible/Pod_Create] done.
Jul 15, 2016 12:38:57 PM FINEST hudson.plugins.jobConfigHistory.JobConfigHistorySaveableListener
In onChange for hudson.plugins.disk_usage.ProjectDiskUsage@6ab6e43a
Jul 15, 2016 12:38:57 PM FINEST hudson.plugins.jobConfigHistory.JobConfigHistorySaveableListener
onChange for hudson.plugins.disk_usage.ProjectDiskUsage@6ab6e43a done.
Jul 15, 2016 12:39:01 PM FINE hudson.plugins.jobConfigHistory.JobConfigHistoryActionFactory
hudson.plugins.jobConfigHistory.JobConfigHistoryActionFactory@79ea0263 adds hudson.plugins.jobConfigHistory.JobConfigHistoryProjectAction@6922f3ea for com.cloudbees.hudson.plugins.folder.Folder@5561ec24[Seed_Jobs]
Jul 15, 2016 12:39:01 PM FINE hudson.plugins.jobConfigHistory.JobConfigHistoryActionFactory
hudson.plugins.jobConfigHistory.JobConfigHistoryActionFactory@79ea0263 adds hudson.plugins.jobConfigHistory.JobConfigHistoryProjectAction@75bbbd92 for com.cloudbees.hudson.plugins.folder.Folder@5561ec24[Seed_Jobs]

After disabling it and restarting Jenkins, I can now see no extra job config entries for individual users, just SYSTEM. I can clearly see the changes I'm making via DSL now.

Sven Ackermann

unread,
Sep 21, 2016, 8:46:49 AM9/21/16
to job-dsl-plugin
I found a workaround to prevent the disk usage plugin (version 0.28) from modifying the config.xml. You just have to include its configuration in your job definition:

job ('myJob') {
 
...
  configure
{
    it
/ 'properties' << 'hudson.plugins.disk__usage.DiskUsageProperty' { }

   }
}


It seems that if the disk usage plugin finds that this is already configured, it does not change the config.xml, which it otherwise did during the first build of the generated job.
Maybe that could be included in the job-dsl plugin, such that it automatically adds that stuff to the XML if the disk usage plugin is installed.

I also found and updated https://issues.jenkins-ci.org/browse/JENKINS-20176 and https://issues.jenkins-ci.org/browse/JENKINS-23044 which complain about the behavior of the disk usage plugin.

Regards,
Sven
Reply all
Reply to author
Forward
0 new messages