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

New jobs not validating github webhook filters

      We have a Github repo that can trigger multiple builds based on certain filters.  The most obvious one is the branch and then some are filtered down based on the Included Regions filter (ie Jenkins is triggered based on which path files are committed to).  As an example:

      • App-AuthAPI
      • App-LookupAPI
      • App-DBAPI

      Each one is from the same repo however, App-DBAPI was added recently and is triggered no matter what happens (random branch is deleted, a commit to a completely different branch).  I have a test build that I modified and that worked fine based on filters.  When I created anything new, none of the filters are respected.

      I restarted Jenkins and the filters are fine for about 10 minutes before it goes back to triggering for every event in the repo.  I've tested cloning projects, to recreating from scratch, to doing the most basic thing (ie random string branch that doesn't actually exist) and it's still triggering the build no matter what.

      The regular jenkins log just shows that it's poking each project and then triggers App-DBAPI but without reason.  I've tried enabling extra logging in https://jenkins.com/log but there's a lot of noise

          [JENKINS-50522] New jobs not validating github webhook filters

          Byron Kim added a comment -

          lanwen - I've done a bunch of testing and the behavior is seemingly random.  I even tried running this locally from the official Jenkins container from scratch, install all relevant plugins, taking a sample Github payload and posting to my local container and it's triggering the build.  The sample payload was changes set to push to a branch called integration and my projects were set to only trigger a build on branch master

          The behavior is seemingly random on my production container.  Some old projects are fulfilling the filters while mostly new ones are not.

          Please let me know if you need any other information.

          STEPS TO REPRODUCE:

          1. docker run -d -p 8080:8080 jenkins/jenkins:lts

          2. Install Git/Github plugins

          3. Create a project and select Github project and enable GitHub hook trigger for GITScm polling. Configure auth for Github (ie SSH key or username/password)

          4. Set Branch Specifier (blank for 'any')  to "./random"

          5. Create a branch with (not "random") and push something.  Grab payload and copy to test.json

          6. Post to local container:

          curl -v POST localhost:8080/github-webhook/ -d @test.json -H "Content-Type: application/json" -H "X-Github-Event: push"

           

          If you want to see the behavior repeat, you need to update the payload with a new one.

          Byron Kim added a comment - lanwen - I've done a bunch of testing and the behavior is seemingly random.  I even tried running this locally from the official Jenkins container from scratch, install all relevant plugins, taking a sample Github payload and posting to my local container and it's triggering the build.  The sample payload was changes set to push to a branch called integration and my projects were set to only trigger a build on branch master The behavior is seemingly random on my production container.  Some old projects are fulfilling the filters while mostly new ones are not. Please let me know if you need any other information. STEPS TO REPRODUCE: 1. docker run -d -p 8080:8080 jenkins/jenkins:lts 2. Install Git/Github plugins 3. Create a project and select Github project and enable GitHub hook trigger for GITScm polling. Configure auth for Github (ie SSH key or username/password) 4. Set Branch Specifier (blank for 'any')   to "./random" 5. Create a branch with (not "random") and push something.  Grab payload and copy to test.json 6. Post to local container: curl -v POST localhost:8080/github-webhook/ -d @test.json -H "Content-Type: application/json" -H "X-Github-Event: push"   If you want to see the behavior repeat, you need to update the payload with a new one.

            lanwen Kirill Merkushev
            nocode Byron Kim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: