1

Our Jenkins instance is currently reporting BUILDS_ALL_TIME to be 999 for all builds of all jobs. Has anyone else experienced this and understand the path of least resistance to getting it to handle this environment variable as expected?

The back story: Yesterday morning I updated all of the plugins on our Jenkins instance to the latest stable version. There were half a dozen or more plugins to be updated and I never pay close attention to them but the Credentials Binding plugin stuck out because it turned my monitor red regarding a critical security update and kicked off the whole process.

Yesterday afternoon, my coworker noted that the version number of one of his builds went from 1.0.0.7 to 1.0.0.999 and I was able to confirm the same thing with one of mine. Now all jobs that rely on the BUILDS_ALL_TIME environment variable report 999 for that variable in every build.

The Version Number Plugin is installed & up to date, and here's an excerpt from build.xml from an affected build:

<org.jvnet.hudson.tools.versionnumber.VersionNumberAction plugin="versionnumber@1.9">
  <info>
    <buildsToday>34</buildsToday>
    <buildsThisWeek>40</buildsThisWeek>
    <buildsThisMonth>40</buildsThisMonth>
    <buildsThisYear>40</buildsThisYear>
    <buildsAllTime>24</buildsAllTime>  <!-- This is correct, is incremented properly between builds, and is updated appropriately when overridden in the job configuration GUI -->
  </info>
  <versionNumber>999.0.0</versionNumber>  <!-- This is incorrect and NOT incremented properly between builds -->
</org.jvnet.hudson.tools.versionnumber.VersionNumberAction>

The timing of this behavior seems to be associated with an upgrade to plugins (this association is by no means certain but it's the best I've got at this point). Consequently I tried downgrading each plugin with that option available in the management GUI, one-by-painful-one, to see if I can find the one culprit. This was fruitless. I'm not given the option to downgrade the Version Number plugin, but the last release of this thing was two years ago.

Dan Narsavage
  • 325
  • 3
  • 13

1 Answers1

0

Well after a year and a half of workarounds and self-loathing, the problem occurred to me. Somehow, someone set the BUILDS_ALL_TIME environment variable globally on our build server. Once I unset that and restarted Jenkins, our builds' version numbers returned to their appropriate values.

Dan Narsavage
  • 325
  • 3
  • 13