I've upgrading our Jenkins instance to the latest version of the SCM 
plugins. We use Folders, Multibranch, GitHub Source, and Pipelines for all 
of our builds. Previously, we were just building all branches but we would 
like to switch over to building a few select branches and pull requests 
only.

After failing to get this working with our main folder, I setup a second 
folder to test and limited it to one repository so not to trigger the rate 
limits (seeing the same behavior as I did in the primary). I have the 
following options set on the folder:

Include Branches: master stage prod releases*
Build origin branches - Checked
Build origin PRs (merged with base branch) - Checked
   ...

Build fork PRs (merged with base branch) - Checked

When the plugin scans our organization, it finds the repository and setups 
up the branches and pull requests as expected:

Looking up myorg/sample_repo


    Getting remote pull requests...


    Checking pull request #2257

    (not from a trusted source)

      ‘Jenkinsfile’ found

    Met criteria

 
Scheduled build for branch: PR-2257
...


  6 pull requests were processed


  Getting remote branches...

    Checking branch master

      ‘Jenkinsfile’ found

    Met criteria

No changes detected: master (still at 
ef5c71062fe80ac2950e8ece9126d15c7e549771)



  3 branches were processed


Done examining myorg/sample_repo


I then go and create a new pull request against the sample_repo. I can see 
that the webhooks are being received correctly, but the event does not 
trigger a build for the PR:

[Sun Apr 23 17:45:14 GMT 2017] Received 
org.jenkinsci.plugins.github_branch_source.PushGHEventSubscriber$SCMHeadEventImpl
 
UPDATED event from <scrubbed> → <scrubbed> → <scrubbed> ⇒ 
http://<scrubbed>/github-webhook/ with timestamp Sun Apr 23 17:45:08 GMT 
2017
17:45:14 Connecting to https://api.github.com using <scrubbed>/****** 
(jenkins user/pass)
Looking up myorg/sample_repo

  Getting remote pull requests...

  0 pull requests were processed

  Getting remote branches...

  0 branches were processed

Done examining myorg/sample_reo

[Sun Apr 23 17:45:15 GMT 2017] 
org.jenkinsci.plugins.github_branch_source.PushGHEventSubscriber$SCMHeadEventImpl
 
UPDATED event from <scrubbed> → <scrubbed> → <scrubbed> ⇒ 
http://<scrubbed>/github-webhook/ with timestamp Sun Apr 23 17:45:08 GMT 
2017 processed in 1.1 sec

If I subsequently go back and rescan the repo (either at a folder level or 
the repo level), then the new PR is picked up and the build is kicked off.

Any suggestions? Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/84b41f80-92b4-4baf-b09b-e830c4d22370%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to