Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-4110

Setting 0 in the "Number of builds to keep" fields produce strange behavior

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Platform: All, OS: All

      If you set the number of builds to keep on a project to zero, successfull and
      unstable builds behave right but failed builds are simply ignored (no history,
      no red bullet, nothing ...).

      On a projet with such a setup, when the build fails nothing particular is logged
      but in the build console you get this :

      [HUDSON] Archiving /srv/var/hudson/jobs/dumb/workspace/checkout/pom.xml to
      /srv/var/hudson/jobs/dumb/modules/foo$dumb/builds/2009-07-27_09-27-51/archive/foo/dumb/1.0.0-SNAPSHOT/pom.xml
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Compilation failure
      Failure executing javac, but could not parse the error:
      Fatal Error: Unable to find package java.lang in classpath or bootclasspath

      [INFO] ------------------------------------------------------------------------
      [INFO] For more information, run Maven with the -e switch
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 7 seconds
      [INFO] Finished at: Mon Jul 27 09:28:01 UTC 2009
      <html><head><title>Error 404</title></head><body bgcolor="#ffffff"><h1>Status
      Code: 404</h1>Exception: <br>Stacktrace: <pre>(none)
      </pre><br><hr size="1" width="90%"><i>Generated by Winstone Servlet Engine
      v0.9.10 at Mon Jul 27 09:28:02 UTC 2009</i></body></html>

      I don't know how this can be solved, maybe by preventing a value of zero in this
      field.

          [JENKINS-4110] Setting 0 in the "Number of builds to keep" fields produce strange behavior

          Alan Harder added a comment -

          I would argue that the behavior you describe is correct.. you told it to save no
          builds, though Hudson will exceed your limits in some cases in order to save a
          successful build. So it saves 1 stable/unstable build even though you said save
          none, and when there is a failed build it deletes it right away and keeps the
          stable/unstable build instead.

          That said, a zero setting doesn't make much sense.. so I've added a validator
          warning if you enter zero.

          Alan Harder added a comment - I would argue that the behavior you describe is correct.. you told it to save no builds, though Hudson will exceed your limits in some cases in order to save a successful build. So it saves 1 stable/unstable build even though you said save none, and when there is a failed build it deletes it right away and keeps the stable/unstable build instead. That said, a zero setting doesn't make much sense.. so I've added a validator warning if you enter zero.

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/main/core/src/main/resources/hudson/tasks/LogRotator/config.jelly
          trunk/hudson/main/war/resources/scripts/hudson-behavior.js
          http://fisheye4.cenqua.com/changelog/hudson/?cs=20559
          Log:
          [FIXED JENKINS-4110] show warning if zero value entered for #builds/#days to save

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/main/core/src/main/resources/hudson/tasks/LogRotator/config.jelly trunk/hudson/main/war/resources/scripts/hudson-behavior.js http://fisheye4.cenqua.com/changelog/hudson/?cs=20559 Log: [FIXED JENKINS-4110] show warning if zero value entered for #builds/#days to save

            mindless Alan Harder
            eskatos eskatos
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: