[JIRA] (JENKINS-56530) Duplicate build job when merging and deleting GitHub branch with web hook

3 views
Skip to first unread message

prnei@beckman.com (JIRA)

unread,
Mar 12, 2019, 4:00:02 PM3/12/19
to jenkinsc...@googlegroups.com
P N created an issue
 
Jenkins / Bug JENKINS-56530
Duplicate build job when merging and deleting GitHub branch with web hook
Issue Type: Bug Bug
Assignee: Mark Waite
Components: git-plugin
Created: 2019-03-12 19:59
Environment: Jenkins v 2.150.2
Git client plugin v 2.7.6
Git plugin v 3.9.3
GitHub plugin v 1.29.3
GitHub API plugin v 1.95
Priority: Minor Minor
Reporter: P N

I have a pipeline job that builds the dev branch from a single repository hosted on our GitHub Enterprise instance. The repository is configured to use the Manage Jenkins (GitHub plugin) web hook. (i.e. The only build trigger checked is the "GitHub hook trigger for GITScm polling.")

After merging a feature branch branch into the dev branch and then deleting the feature branch, Jenkins started two concurrent builds for this pipeline. Both jobs were for the same commit. I expected it to only build the new commit once.

From the http://ourjenkins:8080/log/all page:

Mar 12, 2019 9:49:40 AM INFO org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber onEvent
Received PushEvent for http://ourgithub/Org/OurProject from ourgithub ⇒ http://ourjenkins:8080/github-webhook/
Mar 12, 2019 9:49:40 AM INFO org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber$1 run
Poked Our Project Pipeline Name
Mar 12, 2019 9:49:42 AM INFO com.cloudbees.jenkins.GitHubPushTrigger$1 run
SCM changes detected in Our Project Pipeline Name. Triggering #2
Mar 12, 2019 9:50:14 AM INFO org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber onEvent
Received PushEvent for http://ourgithub/Org/OurProject from ourgithub ⇒ http://ourjenkins:8080/github-webhook/
Mar 12, 2019 9:50:14 AM INFO org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber$1 run
Poked Our Project Pipeline Name
Mar 12, 2019 9:50:15 AM INFO com.cloudbees.jenkins.GitHubPushTrigger$1 run
SCM changes detected in Our Project Pipeline Name. Triggering #3
Mar 12, 2019 9:52:09 AM INFO org.jenkinsci.plugins.workflow.job.WorkflowRun finish
Our Project Pipeline Name #2 completed: SUCCESS
Mar 12, 2019 9:52:17 AM INFO org.jenkinsci.plugins.workflow.job.WorkflowRun finish
Our Project Pipeline Name #3 completed: SUCCESS

The logs for the individual jobs (#2 and #3) showed that they built the same remote head revision commit ID. They also compared it to the same "Last Built Revision" which was the commit ID built by job #1 a few days earlier.

Speculation about what happened:

  1. I merged my change to the dev branch and pushed it to our GitHub.
  2. GitHub called the Jenkins web hook to let it know about the change.
  3. Jenkins polled GitHub and saw that there were changes to the dev branch since job #1 and started job #2.
  4. I deleted my feature branch on our GitHub.
  5. GitHub called the Jenkins web hook to let it know about the change.
  6. Jenkins polled GitHub and saw that there were changes to the dev branch since the last completed job #1, but failed to compare it to the in-progress job #2. As a result, it started the unnecessary job #3.

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

mark.earl.waite@gmail.com (JIRA)

unread,
Mar 12, 2019, 8:59:02 PM3/12/19
to jenkinsc...@googlegroups.com

micylt727@gmail.com (JIRA)

unread,
Jan 14, 2020, 9:36:02 PM1/14/20
to jenkinsc...@googlegroups.com
Dylan Yelton commented on Bug JENKINS-56530
 
Re: Duplicate build job when merging and deleting GitHub branch with web hook

Any updates on this? Workarounds? This is blocking my team.

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

micylt727@gmail.com (JIRA)

unread,
Jan 14, 2020, 10:17:03 PM1/14/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages