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

A current active build in the build history is lost if the job configuration XML uploaded

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None

      If a job is currently building and new configuration is uploaded via an HTTP POST then the current build in build history is lost.

      Build information is maintained as transient state on the job object, which is reset and then reloaded from the build directory:

      @Override
      public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException {
      super.onLoad(parent, name);

      this.builds = new RunMap<R>();
      this.builds.load(this,new Constructor<R>() {
      public R create(File dir) throws IOException

      { return loadBuild(dir); }

      });

      However, the builds.load(...) ignores directories without a build.xml, which is the case when a build is currently building:

      public synchronized void load(Job job, Constructor<R> cons) {
      ....
      for( String build : buildDirs ) {
      File d = new File(buildDir,build);
      if(new File(d,"build.xml").exists()) {
      // if the build result file isn't in the directory, ignore it.
      try

      { R b = cons.create(d); builds.put( b.getNumber(), b ); }

      catch (IOException e)

      { e.printStackTrace(); } catch (InstantiationError e) { e.printStackTrace(); }

      }
      }

      The job will be out of sync with the persisted build history until the job is reloaded or saved.

          [JENKINS-12318] A current active build in the build history is lost if the job configuration XML uploaded

          Paul Sandoz created issue -
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Kohsuke Kawaguchi made changes -
          Link New: This issue is duplicated by JENKINS-3265 [ JENKINS-3265 ]
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-15340 [ JENKINS-15340 ]
          Jesse Glick made changes -
          Link New: This issue duplicates JENKINS-3265 [ JENKINS-3265 ]
          Jesse Glick made changes -
          Link Original: This issue is duplicated by JENKINS-3265 [ JENKINS-3265 ]
          Jesse Glick made changes -
          Link Original: This issue is related to JENKINS-15340 [ JENKINS-15340 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 142641 ] New: JNJira + In-Review [ 190213 ]

            Unassigned Unassigned
            paulsandoz Paul Sandoz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: