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

LastStable and LastSuccessful symbolic links created in wrong location if Build Record Root Directory does not end in builds

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • core
    • None
    • Jenkins1.448 on RHEL 6

      LastStable and LastSuccessful symbolic links created in wrong location if Build Record Root Directory does not end in builds

      CASE A
      When the default Build Record Root Directory of ${ITEM_ROOTDIR}/builds is used the lastStable and lastSuccess dir links are located at

      ${ITEM_ROOTDIR}/lastStable -> builds/2012-01-23_14-50-48
      ${ITEM_ROOTDIR}/lastSuccess -> builds/2012-01-23_14-50-48

      CASE B
      When Build Record Root Directory is set to
      /Some_shared_drive/builds/${ITEM_FULLNAME}/builds
      The result is

      /Some_shared_drive/builds/${ITEM_FULLNAME}/lastStable -> builds/2012-01-23_14-50-48
      /Some_shared_drive/builds/${ITEM_FULLNAME}/lastSuccess -> builds/2012-01-23_14-50-48

      CASE C
      When Build Record Root Directory is set to
      /Some_shared_drive/builds/${ITEM_FULLNAME}
      The result is

      /Some_shared_drive/builds/lastStable -> builds/2012-01-23_14-50-48

      and /Some_shared_drive/builds/lastSuccess -> builds/2012-01-23_14-50-48

      These links are then useless as they do not point to any valid location and they are located in the same directory level as ${ITEM_FULLNAME} so could have been set by any of the jobs.

      These links are created in the AbstractBuild class

      https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/AbstractBuild.java
      private void createSymlink(TaskListener listener, String name) throws InterruptedException {
              Util.createSymlink(getProject().getBuildDir(),"builds/"+getId(),"../"+name,listener);
          }
      

      Called by

              public final void post(BuildListener listener) throws Exception {
                  try {
                      post2(listener);
      
                      if (result.isBetterOrEqualTo(Result.UNSTABLE))
                          createSymlink(listener, "lastSuccessful");
      
                      if (result.isBetterOrEqualTo(Result.SUCCESS))
                          createSymlink(listener, "lastStable");
                  } finally {
                      // update the culprit list
                      HashSet<String> r = new HashSet<String>();
                      for (User u : getCulprits())
                          r.add(u.getId());
                      culprits = r;
                      CheckPoint.CULPRITS_DETERMINED.report();
                  }
              }
      

            Unassigned Unassigned
            cjo9900 cjo9900
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: