• Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • copyartifact-plugin
    • None

      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.

          [JENKINS-16476] Add "Last Completed Build" to permalink list

          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.

          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.

          Roland Clobus added a comment -

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

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

          Roland Clobus added a comment -

          Add 'lastCompletedBuild' as a valid option to SpecificBuildSelector

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

          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'.

          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'.

          Daniel Beck added a comment -

          Consider submitting a pull request on GitHub.

          Daniel Beck added a comment - Consider submitting a pull request on GitHub.

          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

          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

          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

          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

          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

          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

          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.

          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.

          ikedam added a comment -

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

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

            ikedam ikedam
            smorriso Stephen Morrison
            Votes:
            6 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: