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

permanent url for svn revision of a build

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Reopened (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: subversion-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      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.

        Attachments

          Activity

          Hide
          kohsuke 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.

          Show
          kohsuke 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.
          Hide
          elifarley 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()

          Show
          elifarley 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( )
          Hide
          dannystaple 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.

          Show
          dannystaple 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.

            People

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

              Dates

              • Created:
                Updated: