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

Svn revisions not showing up in pipeline build

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • subversion-plugin
    • Jenkins-1.646
      Pipeline 1.13
      Subversion 2.5.7

      For pipeline builds it seems like the svn revision information isn't displayed on the build page like it is for normal freestyle builds.
      Correct me if I'm wrong but this seems like a bug to me, the corresponding information is shown correctly if I check out a git repository.
      I've attached some screenshots of a freestyle build and pipeline build.

      After looking in the build.xml and comparing between a freestyle build and pipeline build it is clear that the information is there, it is just not presented in the UI.

      Workflow script:

      node {
          svn '<<<svn-url>>>'
          bat 'echo "%BUILD_NUMBER%" > hello.txt'
          archive '*.txt'
      }
      

          [JENKINS-32744] Svn revisions not showing up in pipeline build

          While "<JENKINS HOST>/job/<PIPELINE JOB NAME>/pipeline-syntax/globals" at least documents that, I also think this should be fixed, if possible:

          Reinhold Füreder added a comment - While "<JENKINS HOST>/job/<PIPELINE JOB NAME>/pipeline-syntax/globals" at least documents that, I also think this should be fixed, if possible:

          Jon Sten added a comment -

          reinholdfuereder the problem isn't that the environment variables (like SVN_REVISION) isn't available in the pipeline script. The problem is that the svn revision information doesn't show up on the build page, .e.g. compare the two print-screens attached, one is from a freestyle build which check out an url and the other is from a pipeline script doing the same thing. The print-screen is of the respective build page. Freestyle show the revision number of the checkout URL while the pipeline build page does not.

          I might add that this issue seems to be intermittent, it sometimes shows the revision information and sometimes not. My current theory is that it is only shown if there are changes from last build.

          Jon Sten added a comment - reinholdfuereder the problem isn't that the environment variables (like SVN_REVISION) isn't available in the pipeline script. The problem is that the svn revision information doesn't show up on the build page, .e.g. compare the two print-screens attached, one is from a freestyle build which check out an url and the other is from a pipeline script doing the same thing. The print-screen is of the respective build page. Freestyle show the revision number of the checkout URL while the pipeline build page does not. I might add that this issue seems to be intermittent, it sometimes shows the revision information and sometimes not. My current theory is that it is only shown if there are changes from last build.

          Sorry jons, I was not reading carefully enough.

          However, what I just saw in my local environment (latest versions of everything, e.g. Jenkins 2.40) is that the SVN revision is NOT shown "only" for the first pipeline build, but seemingly for all subsequent ones.

          Reinhold Füreder added a comment - Sorry jons , I was not reading carefully enough. However, what I just saw in my local environment (latest versions of everything, e.g. Jenkins 2.40) is that the SVN revision is NOT shown "only" for the first pipeline build, but seemingly for all subsequent ones.

          Jon Sten added a comment -

          No worries
          Did all the subsequent builds have changes? The first build naturally doesn't have any changes since the previous builds (since there is none). If all the subsequent builds had changes, then it would justify my theory above.

          Jon Sten added a comment - No worries Did all the subsequent builds have changes? The first build naturally doesn't have any changes since the previous builds (since there is none). If all the subsequent builds had changes, then it would justify my theory above.

          Oh! Actually there are some intermediate builds that do not have any SVN changes (manual triggered builds IIRC) and then the SVN revision information is really NOT displayed in the build status page. Which, hm, might be an acceptable behaviour (kind of "works as expected/designed"), although one could also desire to always show it.
          (Considering the huge number of open subversion plugin issues, I might encourage you to maybe resolve this issue with e.g. "won't do" or "not a defect" or so?)

          Reinhold Füreder added a comment - Oh! Actually there are some intermediate builds that do not have any SVN changes (manual triggered builds IIRC) and then the SVN revision information is really NOT displayed in the build status page. Which, hm, might be an acceptable behaviour (kind of "works as expected/designed"), although one could also desire to always show it. (Considering the huge number of open subversion plugin issues, I might encourage you to maybe resolve this issue with e.g. "won't do" or "not a defect" or so?)

          Jon Sten added a comment -

          Well, I wouldn't say that it is per design considering that the behaviour differs from FreeStyle builds. I would say that it is a use-case where you can see the revision for a particular build regardless if there is a change or not, in fact I created this defect due to complains from users using the Jenkins services I'm managing. Cause without the revision entry, the only way I know how to get the information is to dig it out of the console output, which is rather cumbersome. In either cause, I would say that the behaviour should be the same in free style builds and pipeline builds.
          I do realise that there is a considerable number of issues open, unfortunately this one is important for our organisation, it is one of the issues holding of big scale migration to pipeline. Hopefully I will be able to make a pull request that fixes this issue some day.

          Jon Sten added a comment - Well, I wouldn't say that it is per design considering that the behaviour differs from FreeStyle builds. I would say that it is a use-case where you can see the revision for a particular build regardless if there is a change or not, in fact I created this defect due to complains from users using the Jenkins services I'm managing. Cause without the revision entry, the only way I know how to get the information is to dig it out of the console output, which is rather cumbersome. In either cause, I would say that the behaviour should be the same in free style builds and pipeline builds. I do realise that there is a considerable number of issues open, unfortunately this one is important for our organisation, it is one of the issues holding of big scale migration to pipeline. Hopefully I will be able to make a pull request that fixes this issue some day.

          Daniel added a comment - - edited

          Sorry to raise this again after 6 years.

          I am having the same problem.

          Was this bug ever solved? Does anyone still have this issue?

          My env:
          Jenkins 2.319.1
          Subversion Plug-in 2.16.0

          Daniel added a comment - - edited Sorry to raise this again after 6 years. I am having the same problem. Was this bug ever solved? Does anyone still have this issue? My env: Jenkins 2.319.1 Subversion Plug-in 2.16.0

            Unassigned Unassigned
            jons Jon Sten
            Votes:
            2 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: