I can still reproduce with Jenkins 1.477 and EnvInject 1.66, I literally only have the jobConfigHistory and envInject plugins installed on top of a clean jenkins and a simple job that only uses 'sleeps 15' as the only build step. OS = Linux.

Summary of what I understand to be happening:
envinject modifieds the config.xml adding a buildwrapper entry when starting the build if there is an environment variable to be injected.
job config history plugin is monitoring for changes to the config.xml file, spots the change and saves the new file
envinject removes it's modification once the build is finished and rewrites the config.xml file
job config history plugin spots the second modification, and saves another new file.

jobConfigHistory extends the SaveableListener with a class that catches any time a change is saved (I suspect using jenkins API's) to any build config files.

If I add a log recorder in jenkins to monitor hudson.plugins.jobConfigHistory at the "all" level I see the following output from executing the sample job I attached just once:
Aug 9, 2012 5:52:27 PM hudson.plugins.jobConfigHistory.JobConfigHistorySaveableListener
FINEST: onChange for test-job-buildhistoryconfig #9 done.

Aug 9, 2012 5:52:27 PM hudson.plugins.jobConfigHistory.JobConfigHistorySaveableListener
FINEST: In onChange for test-job-buildhistoryconfig #9

Aug 9, 2012 5:52:27 PM hudson.plugins.jobConfigHistory.JobConfigHistorySaveableListener
FINEST: onChange for hudson.model.FreeStyleProject@6eef9525[test-job-buildhistoryconfig] done.

Aug 9, 2012 5:52:27 PM hudson.plugins.jobConfigHistory.JobConfigHistorySaveableListener
FINEST: In onChange for hudson.model.FreeStyleProject@6eef9525[test-job-buildhistoryconfig]

Aug 9, 2012 5:52:12 PM hudson.plugins.jobConfigHistory.JobConfigHistorySaveableListener
FINEST: onChange for hudson.model.FreeStyleProject@6eef9525[test-job-buildhistoryconfig] done.

Aug 9, 2012 5:52:12 PM hudson.plugins.jobConfigHistory.JobConfigHistorySaveableListener
FINEST: In onChange for hudson.model.FreeStyleProject@6eef9525[test-job-buildhistoryconfig]

The times recorded correspond with the start (5:52:12) and finish times of the job (5:52:27). I did notice before that if the job finishes too quickly, < 5 seconds, sometimes the jobConfigHistory plugin may not see the differences long enough to backup the modified config.xml. So it may be necessary to extend the time taken for the build step to be longer, and you need to configure envInject in the job to have some property getting injected in order for the buildwrapper to get added/removed to/from the config.xml file at runtime.

Basically any time the envinject plugin modifies the build job config.xml and saves the changes, jobConfigHistory plugin is going to fire and create a new backup of the xml file. This renders jobConfigHistory virtually useless for any build job using envInject.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to