Jenkins pipeline jobs being triggered by github webhooks from wrong repository

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Jenkins pipeline jobs being triggered by github webhooks from wrong repository

James Robson

I have 1 code repo that should be triggering jobs, and a separate repo for a jenkins pipeline library. There are 2 jenkins jobs that use the ‘GitHub hook trigger for GITScm polling’ build trigger, both are pipeline jobs using the ‘Pipeline script from SCM’ with the repository configured to point to the code repo and the ‘Branches to build’ set to ‘origin/develop’. The pipeline library is used inside the pipelines for these jobs.

I would expect these jobs to have their polling triggered by pushes to the code repo, however they are only being triggered by pushes to the jenkins pipeline library repo.


Using a log recorder set to get FINEST logs I can see:

Received PushEvent for https://github.com/<code repo> 
Considering to poke <job>
Skipped <job> because it doesn't have a matching repository.
...
Received PushEvent for https://github.com/<pipeline library repo>
Considering to poke <job>
Poked <job>


So something in jenkins seems to think these jobs do not use the code repository, but when a scan is triggered I see the following in the ‘Polling Log’:

Started by event from 192.30.252.97
...
 > git ls-remote -h https://github.com/<code repo> # timeout=10


So the repo poll is using the code repo, and the list of commits that show up in the ‘Changes’ list are from the code repo.

It seems to be only these 2 jobs that are affected, no other job is being triggered by pushes to the pipeline library repo.



Is there anyway to resolve this, or something I can do to gather more information?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/c987cc4c-3a40-44e1-9d62-045bf0df47cf%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins pipeline jobs being triggered by github webhooks from wrong repository

Ramanathan Muthaiah
On Wednesday, February 12, 2020 at 10:22:30 PM UTC+5:30, James Robson wrote:

I have 1 code repo that should be triggering jobs, and a separate repo for a jenkins pipeline library. There are 2 jenkins jobs that use the ‘GitHub hook trigger for GITScm polling’ build trigger, both are pipeline jobs using the ‘Pipeline script from SCM’ with the repository configured to point to the code repo and the ‘Branches to build’ set to ‘origin/develop’. The pipeline library is used inside the pipelines for these jobs.

I would expect these jobs to have their polling triggered by pushes to the code repo, however they are only being triggered by pushes to the jenkins pipeline library repo.


Using a log recorder set to get FINEST logs I can see:

Received PushEvent for <a href="https://github.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHReqsuKT6C86HcgL4TbSevF24rxQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHReqsuKT6C86HcgL4TbSevF24rxQ&#39;;return true;">https://github.com/<code repo> 
Considering to poke <job>
Skipped <job> because it doesn't have a matching repository.
...
Received PushEvent for <a href="https://github.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHReqsuKT6C86HcgL4TbSevF24rxQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHReqsuKT6C86HcgL4TbSevF24rxQ&#39;;return true;">https://github.com/<pipeline library repo>
Considering to poke <job>
Poked <job>


So something in jenkins seems to think these jobs do not use the code repository, but when a scan is triggered I see the following in the ‘Polling Log’:

Started by event from 192.30.252.97
...
 > git ls-remote -h <a href="https://github.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHReqsuKT6C86HcgL4TbSevF24rxQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHReqsuKT6C86HcgL4TbSevF24rxQ&#39;;return true;">https://github.com/<code repo> # timeout=10


So the repo poll is using the code repo, and the list of commits that show up in the ‘Changes’ list are from the code repo.

It seems to be only these 2 jobs that are affected, no other job is being triggered by pushes to the pipeline library repo.



This sounds like some missing or incorrect config settings.

Also, if you are using declarative pipeline model in the code repo, this thread may be of some help to you.

https://stackoverflow.com/questions/42062481/how-to-trigger-a-jenkins-multibranch-pipeline-when-code-change-is-pushed-to-gith

/Ram

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9572e01e-9104-4aa9-a26d-4a44a70ccc89%40googlegroups.com.