• Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major Major
    • subversion-plugin
    • None
    • Platform: All, OS: All

      Provide a permanent download link for the svn revision of a build.

      This allows you to do something like:

      1. svn update -r `wget http://hudson/job/foo/lastSuccessfullBuild/revision`
        and get a revision that is guaranteed to work.

          [JENKINS-626] permanent url for svn revision of a build

          Implemented in 1.115 as a combination of two generic features.

          1. I added svn revision info to the XML API of the build object. So now
          http://hudson/job/foo/lastSuccessfullBuild/api/xml will include the information
          you need.

          2. The XML API takes optional 'xpath' query parameter to allow you to specify
          which part of the information you'd like to retrieve. So you can request URL
          like
          http://localhost:8080/job/svn-test/lastSuccessfulBuild/api/xml?xpath=/*/changeSet/revision/revision/text()
          to just fetch the revision number (say "1234"), then feed that into wget.

          Kohsuke Kawaguchi added a comment - Implemented in 1.115 as a combination of two generic features. 1. I added svn revision info to the XML API of the build object. So now http://hudson/job/foo/lastSuccessfullBuild/api/xml will include the information you need. 2. The XML API takes optional 'xpath' query parameter to allow you to specify which part of the information you'd like to retrieve. So you can request URL like http://localhost:8080/job/svn-test/lastSuccessfulBuild/api/xml?xpath=/*/changeSet/revision/revision/text( ) to just fetch the revision number (say "1234"), then feed that into wget.

          Elifarley added a comment -

          When you build twice in a row, the second build will probably have no changes. In that case, you won't be able to find out the working copy revision.

          I have tested this on my Mercurial-backed project using a URL like this:
          http://my-server/hudson/view/RC/job/My-job/102/api/xml?xpath=/*/changeSet/item[1]/node/text()

          Elifarley added a comment - When you build twice in a row, the second build will probably have no changes. In that case, you won't be able to find out the working copy revision. I have tested this on my Mercurial-backed project using a URL like this: http://my-server/hudson/view/RC/job/My-job/102/api/xml?xpath=/*/changeSet/item[1]/node/text( )

          Danny Staple added a comment -

          How does this now work since the "primitive XPath result sets now forbidden"? I can query without "text()" and have the surrounding XML - but that requires additional SED or other transformation to de-xml it.

          Danny Staple added a comment - How does this now work since the "primitive XPath result sets now forbidden"? I can query without "text()" and have the surrounding XML - but that requires additional SED or other transformation to de-xml it.

            Unassigned Unassigned
            huybrechts huybrechts
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: