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

Push notifications on Windows and a local repository



    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: mercurial-plugin
    • Labels:
    • Environment:
      Windows Server 2003
    • Similar Issues:


      Push notifications do not work well with a Windows server accessing the repo as a local directory.

      It looks like the issue is that, doNotifyCommit in MercurialStatus creates a URL out of the passed in Repo location string. This creates limitations that are not present when the Repository URL is passed into hg.

      Additionally, the string passed into the push notification is processed as a URL when it goes through the web server, then it is processed again in the plugin. As a result, I had to double escape some characters.

      Here is an example:
      The URL I originally had in the settings: E:\Repo\Track App.hg
      The job accesses the repo and updates the working directory properly.

      If I access http://myjenkins:8080/mercurial/notifyCommit?url=E:\RepoApps\Repo\Track App.hg
      I get an illegal character exception.

      I can get it to accept it if I double escape the illegal characters.

      This doesn't work because, when looking for a relevant job, it fails on this comparison:
      E:%5CRepoApps%5CRepo%5CTrack%20App.hg == E:\RepoApps\Repo\Track App.hg

      It needs both the URL in the settings to be escaped in the same way as the one passed into the web API. I can't find a way to do this with a local directory.

      This also may not work because it seems to process the string in the settings page as a URL as well, so this may fail with illegal characters.

      The double processing of the string in the API would be OK if it then compared a fully escaped string to the string in the settings page (without trying to escape the settings string as well). I would be able to construct an API call that would make it through processing and match correctly.

      I found a convoluted way to get this to work with the current design. It needs a network share instead of a local directory.
      The URL in settings looks like this:
      And the API call:

      This work-around has one final problem. The convoluted URL in the settings does not match the one hg adds to hgrc. This causes the repo to be cloned for every build. I was able to work around this by manually updating the hgrc file in the workspace with the expected string.

      After all this tweaking, it seems to work OK.



          djasek Dan Jasek created issue -
          jglick Jesse Glick made changes -
          Field Original Value New Value
          Priority Major [ 3 ] Minor [ 4 ]
          scm_issue_link SCM/JIRA link daemon made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 149557 ] JNJira + In-Review [ 193174 ]


            jglick Jesse Glick
            djasek Dan Jasek
            0 Vote for this issue
            4 Start watching this issue