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

Subversion polling does not work when the Repository URL contains a variable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: subversion-plugin
    • Labels:
      None
    • Environment:
      Windows Server 2008 R2
      Jenkins 1.634 or 1.625.1
      Subversion Plug-in 2.5.3
    • Similar Issues:

      Description

      In my repository URLs I use variables for specifying branches like

      http://subversion/svn/repos/${branch}/plugins/at.myplugin
      

      The variable is defined as environment variable in Manage Jenkins -> Configure System -> Global properties -> Environment variables

      This fails with Subversion Plugin > 2.4.5
      The last configuration that worked for me is Jenkins 1.580.3 and Subversion 2.4.5
      Checking out and building works fine.

      The error message in the polling log is:

      Started on 20.10.2015 15:14:00
      Location 'http://subversion/svn/repos/${branch}/plugins/at.myplugin' does not exist
      One or more repository locations do not exist anymore for hudson.model.FreeStyleProject@78dd0b8f[MyProject], project will be disabled.
      The project has been disabled
      Done. Took 0,1 sec
      No changes
      

      When I define the whole URL in the variable it seems to trigger every time it checks - although there are no changes.
      The message in the polling log is:

      Started on 20.10.2015 18:25:00
      ERROR: Failed to check repository revision for ${testtest}
      org.tmatesoft.svn.core.SVNException: svn: E125002: Malformed URL '${testtest}'
      	at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:64)
      	at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51)
      	at org.tmatesoft.svn.core.SVNURL.<init>(SVNURL.java:227)
      	at org.tmatesoft.svn.core.SVNURL.parseURIEncoded(SVNURL.java:121)
      	at hudson.scm.SubversionSCM$ModuleLocation.getSVNURL(SubversionSCM.java:2760)
      	at hudson.scm.SubversionSCM.compareRemoteRevisionWith(SubversionSCM.java:1366)
      	at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:381)
      	at hudson.scm.SCM.poll(SCM.java:398)
      	at hudson.model.AbstractProject._poll(AbstractProject.java:1454)
      	at hudson.model.AbstractProject.poll(AbstractProject.java:1357)
      	at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:526)
      	at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:555)
      	at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:744)
      Done. Took 1 ms
      Changes found
      

      The system log shows:

      Okt 20, 2015 6:36:00 PM WARNING hudson.scm.SubversionSCM buildEnvVars
      no revision found corresponding to ${testtest}; known: [http://subversion/svn/repos_sw_tools/samples]
      Okt 20, 2015 6:36:00 PM WARNING hudson.scm.SubversionSCM buildEnvVars
      no revision found corresponding to ${testtest}; known: [http://subversion/svn/repos_sw_tools/samples]
      Okt 20, 2015 6:36:00 PM INFO hudson.triggers.SCMTrigger$Runner run
      SCM changes detected in testtest. Triggering  #19
      Okt 20, 2015 6:36:09 PM INFO hudson.model.Run execute
      testtest #19 main build action completed: SUCCESS
      Okt 20, 2015 6:37:00 PM WARNING hudson.scm.SubversionSCM buildEnvVars
      no revision found corresponding to ${testtest}; known: [http://subversion/svn/repos_sw_tools/samples]
      Okt 20, 2015 6:37:00 PM WARNING hudson.scm.SubversionSCM buildEnvVars
      no revision found corresponding to ${testtest}; known: [http://subversion/svn/repos_sw_tools/samples]
      Okt 20, 2015 6:37:00 PM INFO hudson.triggers.SCMTrigger$Runner run
      SCM changes detected in testtest. Triggering  #20
      Okt 20, 2015 6:37:09 PM INFO hudson.model.Run execute
      testtest #20 main build action completed: SUCCESS
      

        Attachments

          Activity

          Hide
          chris_mh3 chris_mh3 added a comment -

          Looks good for me. Tested on our buildserver and my local jenkins (1.634) - works without the Environment Injector Plugin again.

          Thanks for the fix!

          Show
          chris_mh3 chris_mh3 added a comment - Looks good for me. Tested on our buildserver and my local jenkins (1.634) - works without the Environment Injector Plugin again. Thanks for the fix!
          Hide
          recena Manuel Recena Soto added a comment -

          chris_mh3, thanks so much for your feedback. I've added a comment in the PR.

          I hope to cut a release soon. Probably, this week.

          Show
          recena Manuel Recena Soto added a comment - chris_mh3 , thanks so much for your feedback. I've added a comment in the PR. I hope to cut a release soon. Probably, this week.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Manuel Recena
          Path:
          src/main/java/hudson/scm/SubversionSCM.java
          http://jenkins-ci.org/commit/subversion-plugin/bc590398fa23ef459aeb101de6fef6884ab24af0
          Log:
          JENKINS-31067 Global environment variables are not available on Subversion Polling

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Manuel Recena Path: src/main/java/hudson/scm/SubversionSCM.java http://jenkins-ci.org/commit/subversion-plugin/bc590398fa23ef459aeb101de6fef6884ab24af0 Log: JENKINS-31067 Global environment variables are not available on Subversion Polling
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Manuel Recena
          Path:
          src/test/java/hudson/scm/SubversionEnvVarsTest.java
          http://jenkins-ci.org/commit/subversion-plugin/05f1b867e0d3080b26bbf9135d9f23cd050ef85f
          Log:
          JENKINS-31067 Added a test

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Manuel Recena Path: src/test/java/hudson/scm/SubversionEnvVarsTest.java http://jenkins-ci.org/commit/subversion-plugin/05f1b867e0d3080b26bbf9135d9f23cd050ef85f Log: JENKINS-31067 Added a test
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Manuel Recena
          Path:
          src/main/java/hudson/scm/SubversionSCM.java
          src/test/java/hudson/scm/SubversionEnvVarsTest.java
          http://jenkins-ci.org/commit/subversion-plugin/d5d3bb9b850190c3ad9968d403540d34efa94216
          Log:
          Merge pull request #139 from recena/JENKINS-31067

          JENKINS-31067 Global env vars are not available on SVN Polling

          Compare: https://github.com/jenkinsci/subversion-plugin/compare/5da9ddbcf8d7...d5d3bb9b8501

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Manuel Recena Path: src/main/java/hudson/scm/SubversionSCM.java src/test/java/hudson/scm/SubversionEnvVarsTest.java http://jenkins-ci.org/commit/subversion-plugin/d5d3bb9b850190c3ad9968d403540d34efa94216 Log: Merge pull request #139 from recena/ JENKINS-31067 JENKINS-31067 Global env vars are not available on SVN Polling Compare: https://github.com/jenkinsci/subversion-plugin/compare/5da9ddbcf8d7...d5d3bb9b8501

            People

            • Assignee:
              recena Manuel Recena Soto
              Reporter:
              chris_mh3 chris_mh3
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: