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

Comparing repo owner in webhook with SCM source should be case-insensitive

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      We have a GitHub (Enterprise) organisation whose canonical name is "FooBar".

      However, we have a Multibranch Pipeline that uses a GitHub Branch Source with owner "foobar". In this case, the branch source GitHub ignores incoming webhooks, as String.equals() is used (e.g. in PullRequestGHEventSubscriber).

      GitHub is very lenient when checking out repos, e.g. git clone git@github.example.com:fooBAR/AnDroiD.git works fine for the FooBar/android repo — so it seems likely that people will end up configuring jobs using a non-canonical capitalisation of the user/org name.

      The repo name comparison should likely be case-insensitive too. The repo name is usually configured via a dropdown, so it should have the canonical case, but I also configure MB Pipelines with the Job DSL plugin, so the possibility for error remains.

      Log:

      // With branch source owner = "foobar"
      Oct 19, 2016 3:35:06 PM FINE org.jenkinsci.plugins.github_branch_source.PullRequestGHEventSubscriber
      Received POST for https://github.example.com/FooBar/android
      Oct 19, 2016 3:35:11 PM FINE org.jenkinsci.plugins.github_branch_source.PullRequestGHEventSubscriber
      PR event on github.example.com:FooBar/android did not match any project
      
      // With branch source owner = "FooBar"
      Oct 19, 2016 3:38:15 PM FINE org.jenkinsci.plugins.github_branch_source.PullRequestGHEventSubscriber
      Received POST for https://github.example.com/FooBar/android
      Oct 19, 2016 3:38:20 PM FINE org.jenkinsci.plugins.github_branch_source.PullRequestGHEventSubscriber
      PR event on github.example.com:FooBar/android forwarded to foobar/android-pr
      

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubRepositoryEventSubscriber.java
            src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestGHEventSubscriber.java
            http://jenkins-ci.org/commit/github-branch-source-plugin/85a9cf36d3afb8ce7637bc02a9741efb73346de3
            Log:
            [FIXED JENKINS-39114] Compare api, owner and repo case insensitively

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubRepositoryEventSubscriber.java src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestGHEventSubscriber.java http://jenkins-ci.org/commit/github-branch-source-plugin/85a9cf36d3afb8ce7637bc02a9741efb73346de3 Log: [FIXED JENKINS-39114] Compare api, owner and repo case insensitively

              People

              • Assignee:
                stephenconnolly Stephen Connolly
                Reporter:
                orrc Christopher Orr
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: