(Git plugin) Build trigger when branch is deleted in GitHub?

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

(Git plugin) Build trigger when branch is deleted in GitHub?

Alejandro Villarreal

I noticed that the github service/integration for the Jenkins Git Plugin triggers builds when branches are deleted in Github. Those builds fail because they try to checkout a SHA1 that just got deleted from the repository, and they're "polluting" my Jenkins dashboard, since I'm seeing projects with failed builds when the actual code builds just fine.


Is that expected? That a branch deletion in Github triggers a build in Jenkins? I'm thinking that if anything needs to change, or at least be more configurable, it's probably the Github integration. If it didn't send notifications for branch deletions, this problem would go away.

--
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/bbd05bc3-315a-4264-9937-26ac710ade07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: (Git plugin) Build trigger when branch is deleted in GitHub?

Mark Waite-2
I have never seen a case where a job is triggered by branch deletion.

The GitHub Branch Source plugin will (correctly) disable a job associated with a branch when branch deletion is detected, and will (correctly) remove the job according to the settings for that repository.

If the GitHub webhooks are notifying Jenkins of a branch deletion, that seems like a good thing, not a bad thing.

Mark Waite

On Thu, Apr 12, 2018 at 2:26 PM Alejandro Villarreal <[hidden email]> wrote:

I noticed that the github service/integration for the Jenkins Git Plugin triggers builds when branches are deleted in Github. Those builds fail because they try to checkout a SHA1 that just got deleted from the repository, and they're "polluting" my Jenkins dashboard, since I'm seeing projects with failed builds when the actual code builds just fine.


Is that expected? That a branch deletion in Github triggers a build in Jenkins? I'm thinking that if anything needs to change, or at least be more configurable, it's probably the Github integration. If it didn't send notifications for branch deletions, this problem would go away.

--
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/bbd05bc3-315a-4264-9937-26ac710ade07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/CAO49JtEo1mMq-kgCSeEpQShoJb%3DOSgG6i2ruee0U89ubT6Sw9w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: (Git plugin) Build trigger when branch is deleted in GitHub?

Alejandro Villarreal
Wow, sorry for the delay, I thought I was going to get some notification if someone replied, but if I did I missed it.

My setup is pretty simple so I'd like to think this issue is easy to reproduce. I'm only using the Git plugin, not the GitHub Branch Source plugin, and I have the "Jenkins (Git plugin)" Service installed on my GitHub repo (under Settings -> Integrations and Services). Per the Git Plugin's documenation, my jobs only have a build trigger of "Poll SCM" without a schedule (so they are only triggered by push notifications from github). What is that setup supposed to do if I delete a branch? The notification sent to Jenkins seems to be identical for a regular push and when the branch gets deleted:

Received notification from <github IP> ⇒ http://<my-jenkins-url>/git/notifyCommit for uri = https://github.com/<my-repo> ; sha1 = null ; branches = [<my-branch>]

I should also note that I have a single Jenkins job with a wildcard branch name to catch and build several feature branches, so I wouldn't want a branch deletion to disable or delete the job, but I think it shouldn't be triggered either. Since you've never seen it happen, I imagine that's the desired behavior, right?


On Thursday, April 12, 2018 at 3:43:46 PM UTC-5, Mark Waite wrote:
I have never seen a case where a job is triggered by branch deletion.

The GitHub Branch Source plugin will (correctly) disable a job associated with a branch when branch deletion is detected, and will (correctly) remove the job according to the settings for that repository.

If the GitHub webhooks are notifying Jenkins of a branch deletion, that seems like a good thing, not a bad thing.

Mark Waite

On Thu, Apr 12, 2018 at 2:26 PM Alejandro Villarreal <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="4Kn_NiRjCgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">al...@...> wrote:

I noticed that the github service/integration for the <a href="https://wiki.jenkins.io/display/JENKINS/Git+Plugin" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FGit%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLoKP_Tr20WB9756MR6cvk5hkXxw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FGit%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLoKP_Tr20WB9756MR6cvk5hkXxw&#39;;return true;">Jenkins Git Plugin triggers builds when branches are deleted in Github. Those builds fail because they try to checkout a SHA1 that just got deleted from the repository, and they're "polluting" my Jenkins dashboard, since I'm seeing projects with failed builds when the actual code builds just fine.


Is that expected? That a branch deletion in Github triggers a build in Jenkins? I'm thinking that if anything needs to change, or at least be more configurable, it's probably the Github integration. If it didn't send notifications for branch deletions, this problem would go away.

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="4Kn_NiRjCgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/bbd05bc3-315a-4264-9937-26ac710ade07%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/bbd05bc3-315a-4264-9937-26ac710ade07%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/bbd05bc3-315a-4264-9937-26ac710ade07%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/bbd05bc3-315a-4264-9937-26ac710ade07%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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/519e2093-bc12-4ca8-9fc4-c3ab2a8aa4b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: (Git plugin) Build trigger when branch is deleted in GitHub?

Alejandro Villarreal
Mark, did you get a chance to read my reply? If I understood you correctly, what I'm seeing is probably unexpected behavior and I can very easily reproduce it, so I'd be happy to file an issue in JIRA if needed.

On Thursday, April 26, 2018 at 2:39:23 PM UTC-5, Alejandro Villarreal wrote:
Wow, sorry for the delay, I thought I was going to get some notification if someone replied, but if I did I missed it.

My setup is pretty simple so I'd like to think this issue is easy to reproduce. I'm only using the <a href="https://wiki.jenkins.io/display/JENKINS/Git+Plugin" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FGit%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLoKP_Tr20WB9756MR6cvk5hkXxw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FGit%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLoKP_Tr20WB9756MR6cvk5hkXxw&#39;;return true;">Git plugin, not the <a href="https://wiki.jenkins.io/display/JENKINS/GitHub+Branch+Source+Plugin" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FGitHub%2BBranch%2BSource%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFlYa3trqaoi8L8Y2blTyXgF8kAtg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FGitHub%2BBranch%2BSource%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFlYa3trqaoi8L8Y2blTyXgF8kAtg&#39;;return true;">GitHub Branch Source plugin, and I have the "Jenkins (Git plugin)" Service installed on my GitHub repo (under Settings -> Integrations and Services). Per the Git Plugin's documenation, my jobs only have a build trigger of "Poll SCM" without a schedule (so they are only triggered by push notifications from github). What is that setup supposed to do if I delete a branch? The notification sent to Jenkins seems to be identical for a regular push and when the branch gets deleted:

Received notification from <github IP> ⇒ http://<my-jenkins-url>/git/notifyCommit for uri = <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/<my-repo> ; sha1 = null ; branches = [<my-branch>]

I should also note that I have a single Jenkins job with a wildcard branch name to catch and build several feature branches, so I wouldn't want a branch deletion to disable or delete the job, but I think it shouldn't be triggered either. Since you've never seen it happen, I imagine that's the desired behavior, right?


On Thursday, April 12, 2018 at 3:43:46 PM UTC-5, Mark Waite wrote:
I have never seen a case where a job is triggered by branch deletion.

The GitHub Branch Source plugin will (correctly) disable a job associated with a branch when branch deletion is detected, and will (correctly) remove the job according to the settings for that repository.

If the GitHub webhooks are notifying Jenkins of a branch deletion, that seems like a good thing, not a bad thing.

Mark Waite

On Thu, Apr 12, 2018 at 2:26 PM Alejandro Villarreal <[hidden email]> wrote:

I noticed that the github service/integration for the <a href="https://wiki.jenkins.io/display/JENKINS/Git+Plugin" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FGit%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLoKP_Tr20WB9756MR6cvk5hkXxw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FGit%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLoKP_Tr20WB9756MR6cvk5hkXxw&#39;;return true;">Jenkins Git Plugin triggers builds when branches are deleted in Github. Those builds fail because they try to checkout a SHA1 that just got deleted from the repository, and they're "polluting" my Jenkins dashboard, since I'm seeing projects with failed builds when the actual code builds just fine.


Is that expected? That a branch deletion in Github triggers a build in Jenkins? I'm thinking that if anything needs to change, or at least be more configurable, it's probably the Github integration. If it didn't send notifications for branch deletions, this problem would go away.

--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/bbd05bc3-315a-4264-9937-26ac710ade07%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/bbd05bc3-315a-4264-9937-26ac710ade07%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/bbd05bc3-315a-4264-9937-26ac710ade07%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/bbd05bc3-315a-4264-9937-26ac710ade07%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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/338f6ce7-6452-4504-945b-13e7c941168c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: (Git plugin) Build trigger when branch is deleted in GitHub?

Mark Waite-2
I've not done any investigation.  My time is quite limited during the week.  I'm unlikely to investigate until this weekend at the earliest.

I assume that you're using a multi-branch Pipeline job.  If that assumption is wrong, please share the type of job you're using.

If you can upload a gist of the job definition and include the URL of that gist in a response, that makes it even less ambiguous.

I've never used a GitHub service.  GitHub says that services will be officially deprecated 1 October 2018 and have not had new features since 25 April 2016.  See https://developer.github.com/changes/2018-04-25-github-services-deprecation/  for more details.

I see that the jenkinsci/git-plugin repository has services enabled to notify the obsolete CI service, but is not using a service to notify the current CI service.  I'm confident that means the current CI service is using webhooks rather than a GitHub service.

You're welcome to file a bug report.  A bug report won't speed (or slow) my investigation.  If you decide to file a bug report, please follow the bug reporting suggestions on the Jenkins wiki so that the bug report allows anyone to duplicate the behavior you're seeing.

Mark Waite

On Tue, May 1, 2018 at 6:11 PM Alejandro Villarreal <[hidden email]> wrote:
Mark, did you get a chance to read my reply? If I understood you correctly, what I'm seeing is probably unexpected behavior and I can very easily reproduce it, so I'd be happy to file an issue in JIRA if needed.

On Thursday, April 26, 2018 at 2:39:23 PM UTC-5, Alejandro Villarreal wrote:
Wow, sorry for the delay, I thought I was going to get some notification if someone replied, but if I did I missed it.

My setup is pretty simple so I'd like to think this issue is easy to reproduce. I'm only using the Git plugin, not the GitHub Branch Source plugin, and I have the "Jenkins (Git plugin)" Service installed on my GitHub repo (under Settings -> Integrations and Services). Per the Git Plugin's documenation, my jobs only have a build trigger of "Poll SCM" without a schedule (so they are only triggered by push notifications from github). What is that setup supposed to do if I delete a branch? The notification sent to Jenkins seems to be identical for a regular push and when the branch gets deleted:

Received notification from <github IP> ⇒ http://<my-jenkins-url>/git/notifyCommit for uri = https://github.com/<my-repo> ; sha1 = null ; branches = [<my-branch>]

I should also note that I have a single Jenkins job with a wildcard branch name to catch and build several feature branches, so I wouldn't want a branch deletion to disable or delete the job, but I think it shouldn't be triggered either. Since you've never seen it happen, I imagine that's the desired behavior, right?


On Thursday, April 12, 2018 at 3:43:46 PM UTC-5, Mark Waite wrote:
I have never seen a case where a job is triggered by branch deletion.

The GitHub Branch Source plugin will (correctly) disable a job associated with a branch when branch deletion is detected, and will (correctly) remove the job according to the settings for that repository.

If the GitHub webhooks are notifying Jenkins of a branch deletion, that seems like a good thing, not a bad thing.

Mark Waite

On Thu, Apr 12, 2018 at 2:26 PM Alejandro Villarreal <[hidden email]> wrote:

I noticed that the github service/integration for the Jenkins Git Plugin triggers builds when branches are deleted in Github. Those builds fail because they try to checkout a SHA1 that just got deleted from the repository, and they're "polluting" my Jenkins dashboard, since I'm seeing projects with failed builds when the actual code builds just fine.


Is that expected? That a branch deletion in Github triggers a build in Jenkins? I'm thinking that if anything needs to change, or at least be more configurable, it's probably the Github integration. If it didn't send notifications for branch deletions, this problem would go away.

--
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/bbd05bc3-315a-4264-9937-26ac710ade07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/338f6ce7-6452-4504-945b-13e7c941168c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/CAO49JtELmiPuK9DUOXpcf%3DCuupQn1Jnn0X8PXvdotoLwjyrttQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: (Git plugin) Build trigger when branch is deleted in GitHub?

Alejandro Villarreal
Thanks, no rush, I just wanted to make sure my reply didn't get lost, like I missed yours. I'm actually using a freestyle job, here's a gist with the XML definition, with some sensitive parts edited out (surrounded by [[ ]])

I didn't know about GitHub services being deprecated, I'll have to look into that. I actually tried setting up the webhooks manually in GitHub at first, but I didn't find a way of sending the "branches" parameter; since I have several Jenkins jobs for the same project but interested in different branches, all were triggering, no matter which branch was pushed to. Then I tried the GitHub service just for kicks and was happily surprised to see that it *did* send the branches parameter, so I kept it. And btw, it is pushing notifications to http://<my-jenkins-server>/git/notifyCommit, isn't that where they're supposed to go? The Git Plugin's documentation seems to suggest that it is...

That said, if there's a way to specify the "branches" parameter when manually setting up the webhook, I can definitely do that and set up the webhook to only trigger on push events, not branch/tag deletion, and that should fix my problem, I just haven't seen that it's possible.

On Tuesday, May 1, 2018 at 7:58:52 PM UTC-5, Mark Waite wrote:
I've not done any investigation.  My time is quite limited during the week.  I'm unlikely to investigate until this weekend at the earliest.

I assume that you're using a multi-branch Pipeline job.  If that assumption is wrong, please share the type of job you're using.

If you can upload a gist of the job definition and include the URL of that gist in a response, that makes it even less ambiguous.

I've never used a GitHub service.  GitHub says that services will be officially deprecated 1 October 2018 and have not had new features since 25 April 2016.  See <a href="https://developer.github.com/changes/2018-04-25-github-services-deprecation/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdeveloper.github.com%2Fchanges%2F2018-04-25-github-services-deprecation%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG3Mlr7FfzkGCDmP4e5DE_7L1iL3Q&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdeveloper.github.com%2Fchanges%2F2018-04-25-github-services-deprecation%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG3Mlr7FfzkGCDmP4e5DE_7L1iL3Q&#39;;return true;">https://developer.github.com/changes/2018-04-25-github-services-deprecation/  for more details.

I see that the jenkinsci/git-plugin repository has services enabled to notify the obsolete CI service, but is not using a service to notify the current CI service.  I'm confident that means the current CI service is using webhooks rather than a GitHub service.

You're welcome to file a bug report.  A bug report won't speed (or slow) my investigation.  If you decide to file a bug report, please follow the bug reporting suggestions on the Jenkins wiki so that the bug report allows anyone to duplicate the behavior you're seeing.

Mark Waite

On Tue, May 1, 2018 at 6:11 PM Alejandro Villarreal <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="YMk6kPBGBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">al...@...> wrote:
Mark, did you get a chance to read my reply? If I understood you correctly, what I'm seeing is probably unexpected behavior and I can very easily reproduce it, so I'd be happy to file an issue in JIRA if needed.

On Thursday, April 26, 2018 at 2:39:23 PM UTC-5, Alejandro Villarreal wrote:
Wow, sorry for the delay, I thought I was going to get some notification if someone replied, but if I did I missed it.

My setup is pretty simple so I'd like to think this issue is easy to reproduce. I'm only using the <a href="https://wiki.jenkins.io/display/JENKINS/Git+Plugin" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FGit%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLoKP_Tr20WB9756MR6cvk5hkXxw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FGit%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLoKP_Tr20WB9756MR6cvk5hkXxw&#39;;return true;">Git plugin, not the <a href="https://wiki.jenkins.io/display/JENKINS/GitHub+Branch+Source+Plugin" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FGitHub%2BBranch%2BSource%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFlYa3trqaoi8L8Y2blTyXgF8kAtg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FGitHub%2BBranch%2BSource%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFlYa3trqaoi8L8Y2blTyXgF8kAtg&#39;;return true;">GitHub Branch Source plugin, and I have the "Jenkins (Git plugin)" Service installed on my GitHub repo (under Settings -> Integrations and Services). Per the Git Plugin's documenation, my jobs only have a build trigger of "Poll SCM" without a schedule (so they are only triggered by push notifications from github). What is that setup supposed to do if I delete a branch? The notification sent to Jenkins seems to be identical for a regular push and when the branch gets deleted:

Received notification from <github IP> ⇒ http://<my-jenkins-url>/git/notifyCommit for uri = <a href="https://github.com/" rel="nofollow" target="_blank" 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/<my-repo> ; sha1 = null ; branches = [<my-branch>]

I should also note that I have a single Jenkins job with a wildcard branch name to catch and build several feature branches, so I wouldn't want a branch deletion to disable or delete the job, but I think it shouldn't be triggered either. Since you've never seen it happen, I imagine that's the desired behavior, right?


On Thursday, April 12, 2018 at 3:43:46 PM UTC-5, Mark Waite wrote:
I have never seen a case where a job is triggered by branch deletion.

The GitHub Branch Source plugin will (correctly) disable a job associated with a branch when branch deletion is detected, and will (correctly) remove the job according to the settings for that repository.

If the GitHub webhooks are notifying Jenkins of a branch deletion, that seems like a good thing, not a bad thing.

Mark Waite

On Thu, Apr 12, 2018 at 2:26 PM Alejandro Villarreal <[hidden email]> wrote:

I noticed that the github service/integration for the <a href="https://wiki.jenkins.io/display/JENKINS/Git+Plugin" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FGit%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLoKP_Tr20WB9756MR6cvk5hkXxw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins.io%2Fdisplay%2FJENKINS%2FGit%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFLoKP_Tr20WB9756MR6cvk5hkXxw&#39;;return true;">Jenkins Git Plugin triggers builds when branches are deleted in Github. Those builds fail because they try to checkout a SHA1 that just got deleted from the repository, and they're "polluting" my Jenkins dashboard, since I'm seeing projects with failed builds when the actual code builds just fine.


Is that expected? That a branch deletion in Github triggers a build in Jenkins? I'm thinking that if anything needs to change, or at least be more configurable, it's probably the Github integration. If it didn't send notifications for branch deletions, this problem would go away.

--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/bbd05bc3-315a-4264-9937-26ac710ade07%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/bbd05bc3-315a-4264-9937-26ac710ade07%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/bbd05bc3-315a-4264-9937-26ac710ade07%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/bbd05bc3-315a-4264-9937-26ac710ade07%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="YMk6kPBGBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/338f6ce7-6452-4504-945b-13e7c941168c%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/338f6ce7-6452-4504-945b-13e7c941168c%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/338f6ce7-6452-4504-945b-13e7c941168c%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/338f6ce7-6452-4504-945b-13e7c941168c%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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/4465629e-24d7-4f43-98cf-9b94794f9610%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.