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

Add "Last Completed Build" to permalink list

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Would be useful to be able to select the "Last Completed Build" permalink. I have a job where I want to get the artifacts from it whether it is unstable or stable, but this job can also run twice in quick succession. If I use "Last Build", it just tries to get the artifacts from the newly running instance of the job rather than the one that just completed.

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            lastSuccessfulBuild is what you want in this case.

            Show
            jglick Jesse Glick added a comment - lastSuccessfulBuild is what you want in this case.
            Hide
            jameshowe James Howe added a comment -

            lastSuccessfulBuild only counts stable builds, not unstable

            Show
            jameshowe James Howe added a comment - lastSuccessfulBuild only counts stable builds, not unstable
            Hide
            jglick Jesse Glick added a comment - - edited

            No, lastSuccessfulBuild (available as a permalink) includes unstable builds. Job.getLastCompletedBuild would include failed builds but not running builds.

            Show
            jglick Jesse Glick added a comment - - edited No, lastSuccessfulBuild (available as a permalink) includes unstable builds. Job.getLastCompletedBuild would include failed builds but not running builds.
            Hide
            rclobus Roland Clobus added a comment -

            Add 'lastCompletedBuild' as an accepted argument to the SpecificBuildSelector.

            Show
            rclobus Roland Clobus added a comment - Add 'lastCompletedBuild' as an accepted argument to the SpecificBuildSelector.
            Hide
            rclobus Roland Clobus added a comment -

            Add 'lastCompletedBuild' as a valid option to SpecificBuildSelector

            Show
            rclobus Roland Clobus added a comment - Add 'lastCompletedBuild' as a valid option to SpecificBuildSelector
            Hide
            rclobus Roland Clobus added a comment -

            Sorry for many messages above...

            The permalink 'lastBuild' is the only permalink that can return running builds. All other permalinks that are available in PermalinkProjectAction contain a test that they will not return running builds.
            lastSuccessfulBuild will not work when there are only failed builds (so no stable or unstable builds)

            The patch allows me to use the 'lastCompletedBuild'.
            Alternatively, I could write a patch for 'core/src/main/java/hudso/model/PermalinkProjectAction.java'.

            Show
            rclobus Roland Clobus added a comment - Sorry for many messages above... The permalink 'lastBuild' is the only permalink that can return running builds. All other permalinks that are available in PermalinkProjectAction contain a test that they will not return running builds. lastSuccessfulBuild will not work when there are only failed builds (so no stable or unstable builds) The patch allows me to use the 'lastCompletedBuild'. Alternatively, I could write a patch for 'core/src/main/java/hudso/model/PermalinkProjectAction.java'.
            Hide
            danielbeck Daniel Beck added a comment -

            Consider submitting a pull request on GitHub.

            Show
            danielbeck Daniel Beck added a comment - Consider submitting a pull request on GitHub.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            src/main/java/hudson/plugins/copyartifact/LastCompletedBuildSelector.java
            src/main/resources/hudson/plugins/copyartifact/Messages.properties
            http://jenkins-ci.org/commit/copyartifact-plugin/22695256db41de25d14864a0a01d29d4f37e52df
            Log:
            Merge pull request #53 from hschaa/master

            [FIXED JENKINS-16476] Add new "last completed build" selector

            Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/0f9ce8306207...22695256db41

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/copyartifact/LastCompletedBuildSelector.java src/main/resources/hudson/plugins/copyartifact/Messages.properties http://jenkins-ci.org/commit/copyartifact-plugin/22695256db41de25d14864a0a01d29d4f37e52df Log: Merge pull request #53 from hschaa/master [FIXED JENKINS-16476] Add new "last completed build" selector Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/0f9ce8306207...22695256db41
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            src/test/java/hudson/plugins/copyartifact/LastCompletedBuildSelectorTest.java
            http://jenkins-ci.org/commit/copyartifact-plugin/0efc0e6173775f6049c7419776be9de24bfe2b72
            Log:
            JENKINS-16476 Tests for LastCompletedBuildSelector

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/test/java/hudson/plugins/copyartifact/LastCompletedBuildSelectorTest.java http://jenkins-ci.org/commit/copyartifact-plugin/0efc0e6173775f6049c7419776be9de24bfe2b72 Log: JENKINS-16476 Tests for LastCompletedBuildSelector
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            src/test/java/hudson/plugins/copyartifact/LastCompletedBuildSelectorTest.java
            http://jenkins-ci.org/commit/copyartifact-plugin/d64ea705e7eb37fab08b737cac86a8bd44369437
            Log:
            Merge pull request #54 from ikedam/feature/JENKINS-16476_LastCompletedBuildTest

            JENKINS-16476 Tests for Last Completed Build

            Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/22695256db41...d64ea705e7eb

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/test/java/hudson/plugins/copyartifact/LastCompletedBuildSelectorTest.java http://jenkins-ci.org/commit/copyartifact-plugin/d64ea705e7eb37fab08b737cac86a8bd44369437 Log: Merge pull request #54 from ikedam/feature/ JENKINS-16476 _LastCompletedBuildTest JENKINS-16476 Tests for Last Completed Build Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/22695256db41...d64ea705e7eb
            Hide
            ikedam ikedam added a comment -

            Added LastCompletedBuildSelector which copies artifacts from "Last Completed Build".
            I also created JENKINS-26270 and a pull request, but that works only with future versions of Jenkins.

            Show
            ikedam ikedam added a comment - Added LastCompletedBuildSelector which copies artifacts from "Last Completed Build". I also created JENKINS-26270 and a pull request, but that works only with future versions of Jenkins.
            Hide
            ikedam ikedam added a comment -

            Released in 1.33.
            It will be available in a day.

            Show
            ikedam ikedam added a comment - Released in 1.33. It will be available in a day.

              People

              • Assignee:
                ikedam ikedam
                Reporter:
                smorriso Stephen Morrison
              • Votes:
                6 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: