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

Use build numbers as IDs

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Stop using the formatted timestamp to compute Run.id, and just use the build number as the directory name, so that

      r.getId().equals(String.valueOf(r.number))

      in which case the timestamp would have to be made a nontransient field (but number could be transient). Then build number symlinks could be dispensed with, saving some hassle and overhead; and AbstractLazyLoadRunMap could be greatly simplified, since the disk location would be immediately predictable from the number, which is what most API calls care about.

      The downside is that there would have to be a one-time migration, which could be slow on a big installation, and not reversible.

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            The Disk Usage plugin issue is already filed in JENKINS-26496; disable that plugin until its maintainer merges my PR, unless you want to run a snapshot build.

            The NPE from unmigrateJobsDir I have not seen. Apparently there is a file f for which f.isDirectory() && f.listFiles() == null, which seems anomalous (usually null from listFiles means the directory does not really exist), but prior to Java 7 there is no way to get a detailed exception from a file listing so I can only speculate about what that might have been. Anyway I can make that code more robust in 1.599.

            Show
            jglick Jesse Glick added a comment - The Disk Usage plugin issue is already filed in JENKINS-26496 ; disable that plugin until its maintainer merges my PR, unless you want to run a snapshot build. The NPE from unmigrateJobsDir I have not seen. Apparently there is a file f for which f.isDirectory() && f.listFiles() == null , which seems anomalous (usually null from listFiles means the directory does not really exist), but prior to Java 7 there is no way to get a detailed exception from a file listing so I can only speculate about what that might have been. Anyway I can make that code more robust in 1.599.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/hudson/plugins/disk_usage/BuildDiskUsageAction.java
            src/main/java/hudson/plugins/disk_usage/DiskUsageBuildInformation.java
            src/main/java/hudson/plugins/disk_usage/DiskUsageUtil.java
            src/main/java/hudson/plugins/disk_usage/ProjectDiskUsage.java
            src/main/java/hudson/plugins/disk_usage/ProjectDiskUsageAction.java
            http://jenkins-ci.org/commit/disk-usage-plugin/19e500d2a168a1dfedf8987c618b4a4d0c9be8a0
            Log:
            JENKINS-24380 Stop relying on the format of Run.id.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/hudson/plugins/disk_usage/BuildDiskUsageAction.java src/main/java/hudson/plugins/disk_usage/DiskUsageBuildInformation.java src/main/java/hudson/plugins/disk_usage/DiskUsageUtil.java src/main/java/hudson/plugins/disk_usage/ProjectDiskUsage.java src/main/java/hudson/plugins/disk_usage/ProjectDiskUsageAction.java http://jenkins-ci.org/commit/disk-usage-plugin/19e500d2a168a1dfedf8987c618b4a4d0c9be8a0 Log: JENKINS-24380 Stop relying on the format of Run.id.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oliver Gondža
            Path:
            src/main/java/hudson/plugins/disk_usage/BuildDiskUsageAction.java
            src/main/java/hudson/plugins/disk_usage/DiskUsageBuildInformation.java
            src/main/java/hudson/plugins/disk_usage/DiskUsageUtil.java
            src/main/java/hudson/plugins/disk_usage/ProjectDiskUsage.java
            src/main/java/hudson/plugins/disk_usage/ProjectDiskUsageAction.java
            http://jenkins-ci.org/commit/disk-usage-plugin/e1555569bfb43cde12816de9abe08039ea043e48
            Log:
            Merge pull request #26 from jglick/build-number-is-id-JENKINS-24380

            JENKINS-24380 Stop relying on the format of Run.id

            Compare: https://github.com/jenkinsci/disk-usage-plugin/compare/f9c0ef96b19a...e1555569bfb4

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: src/main/java/hudson/plugins/disk_usage/BuildDiskUsageAction.java src/main/java/hudson/plugins/disk_usage/DiskUsageBuildInformation.java src/main/java/hudson/plugins/disk_usage/DiskUsageUtil.java src/main/java/hudson/plugins/disk_usage/ProjectDiskUsage.java src/main/java/hudson/plugins/disk_usage/ProjectDiskUsageAction.java http://jenkins-ci.org/commit/disk-usage-plugin/e1555569bfb43cde12816de9abe08039ea043e48 Log: Merge pull request #26 from jglick/build-number-is-id- JENKINS-24380 JENKINS-24380 Stop relying on the format of Run.id Compare: https://github.com/jenkinsci/disk-usage-plugin/compare/f9c0ef96b19a...e1555569bfb4
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/hudson/plugins/build_publisher/ExternalProjectProperty.java
            src/main/java/hudson/plugins/build_publisher/HTTPBuildTransmitter.java
            http://jenkins-ci.org/commit/build-publisher-plugin/9a44c001e80cb5575aae92db53642667fd419e6c
            Log:
            JENKINS-24380 Stop relying on the format of Run.id.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/hudson/plugins/build_publisher/ExternalProjectProperty.java src/main/java/hudson/plugins/build_publisher/HTTPBuildTransmitter.java http://jenkins-ci.org/commit/build-publisher-plugin/9a44c001e80cb5575aae92db53642667fd419e6c Log: JENKINS-24380 Stop relying on the format of Run.id.
            Hide
            ydubreuil Yoann Dubreuil added a comment -

            Adding link to wiki

            Show
            ydubreuil Yoann Dubreuil added a comment - Adding link to wiki

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                3 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: