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

    • 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();
                  }
              }
      

          [JENKINS-12501] LastStable and LastSuccessful symbolic links created in wrong location if Build Record Root Directory does not end in builds

          cjo9900 created issue -
          cjo9900 made changes -
          Description Original: 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
          [code]
          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);
              }
          [code]

          Called by
          [code]
                  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();
                      }
                  }
          [code]




          New: 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
          {code}
          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);
              }
          {code}

          Called by
          {code}
                  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();
                      }
                  }
          {code}




          Daniel Beck added a comment -

          Duplicates JENKINS-17137 resolved in 1.506.

          Daniel Beck added a comment - Duplicates JENKINS-17137 resolved in 1.506.
          Daniel Beck made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Daniel Beck made changes -
          Link New: This issue duplicates JENKINS-17137 [ JENKINS-17137 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 142867 ] New: JNJira + In-Review [ 190315 ]

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

              Created:
              Updated:
              Resolved: