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

git-plugin notifyCommit should ignore case when comparing uri

XMLWordPrintable

      The Stash Webhook To Jenkins sends a "notifyCommit" message to the git-plugin that contains a URL with the stash project and repository specified in lower case. However, Stash will accept a clone url specified in any combination of upper and lower case allowing developers and project teams to create jenkins jobs that clone from Git using urls that are not all lower case. As a result, when notifyCommit messages come in, jobs that specified urls with any upper case letters will not have polling triggered, and the jobs do not run.

      We can fix these jobs as we discover them, but it is an administrative task that could be avoided if the git-plugin ignored case when comparing the uri from the notifyCommit message with the uri specified in the job.

      The attached patch changes the comparison to use StringUtils.equalsIgnoreCase().

      A more complete improvement should probably limit the use of equalsIgnoreCase to SSH and HTTP schemes. or to host names that have been configured as Stash servers.

      Also, when using Stash as the Git server, HTTP urls include 'scm' so the looselyMatches method will not detect that scm://host:7990/project/repo is the same repository as http://host:8080/scm/project/repo. Short of configuring git-plugin with a list of Stash servers, or perhaps using a new parameter on the notifyCommit to indicate that request is from Stash, I'm not sure the best way to address this.

            Unassigned Unassigned
            mlgiroux Michael Giroux
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: