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

Duplicate builds being triggered upon github merges.

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • github-plugin
    • None

      Hi there, we're seeing some strange behavior that might be a bug in this plugin. Merges performed on github are triggering two builds it seems instead of one.

      One thing that is odd is that often the push is attributed to a user that did not perform the merge nor did they contribute any commits to the branch.

      I'm sure this probably isn't enough information to reproduce this bug locally, and the project this is happening in is closed source. Sorry about that. I have turned on some additional logging. Please let me know what information I can provide to assist.

          [JENKINS-16513] Duplicate builds being triggered upon github merges.

          Miles Georgi added a comment -

          I have a hypothesis that deleting the branch on github using their shiny new delete branch button after merging but before jenkins has started its build will result in a second build getting scheduled. Not sure if that's accurate but seems consistent with what we're seeing so far. Will keep testing it out.

          Miles Georgi added a comment - I have a hypothesis that deleting the branch on github using their shiny new delete branch button after merging but before jenkins has started its build will result in a second build getting scheduled. Not sure if that's accurate but seems consistent with what we're seeing so far. Will keep testing it out.

          Eric Lordahl added a comment - - edited

          I thought I was seeing this issue but was incorrect. I double checked the github settings and found that all repositories' settings had been duplicated (not sure how).

          Still seeing other issue where jobs, triggered by pushes, don't show up in queue/executor until after currently running, github-triggered jobs complete.

          Eric Lordahl added a comment - - edited I thought I was seeing this issue but was incorrect. I double checked the github settings and found that all repositories' settings had been duplicated (not sure how). Still seeing other issue where jobs, triggered by pushes, don't show up in queue/executor until after currently running, github-triggered jobs complete.

          Graham Hay added a comment -

          I can confirm that the second build is triggered by a notification that a branch was deleted

          Graham Hay added a comment - I can confirm that the second build is triggered by a notification that a branch was deleted

          github-plugin contains only githubpush trigger atm that kicks GitSCM.poll() if you have any problems with find commit logic, then it git-plugin issue.
          You can also search and try other variants of branch/pr triggers.

          Kanstantsin Shautsou added a comment - github-plugin contains only githubpush trigger atm that kicks GitSCM.poll() if you have any problems with find commit logic, then it git-plugin issue. You can also search and try other variants of branch/pr triggers.

          I can confirm, this happens when a branch on the repository itself is being deleted:

           

          {code}

          { "ref": "refs/heads/foobar-branch", "before": "xxxxx", "after": "0000000000000000000000000000000000000000", "created": false, "deleted": true, "forced": false, "base_ref": null, "compare": "https://github.com/foo/bar/compare/xxxxx...000000000000", "commits": [ ],

          {code}

           

          notice the "deleted = true" flag.

          Shouldn't this only trigger a jenkins project configured with the deleted branch? Because currently it will also trigger a project configured with the master-branch? Is that correct? Because no change is done to master?

           

          And if it is a correct behaviour - maybe it would be possible to configure the plugin to ignore branch deletes?

          Günter Grodotzki added a comment - I can confirm, this happens when a branch on the repository itself is being deleted:   {code} { "ref": "refs/heads/foobar-branch", "before": "xxxxx", "after": "0000000000000000000000000000000000000000", "created": false, "deleted": true, "forced": false, "base_ref": null, "compare": "https://github.com/foo/bar/compare/xxxxx...000000000000", "commits": [ ], {code}   notice the "deleted = true" flag. Shouldn't this only trigger a jenkins project configured with the deleted branch? Because currently it will also trigger a project configured with the master-branch? Is that correct? Because no change is done to master?   And if it is a correct behaviour - maybe it would be possible to configure the plugin to ignore branch deletes?

          integer: care to give an insight why this bug was closed?

          Günter Grodotzki added a comment - integer : care to give an insight why this bug was closed?

          Please read my last answer. You want unrelated features.

          Kanstantsin Shautsou added a comment - Please read my last answer. You want unrelated features.

            Unassigned Unassigned
            azimux Miles Georgi
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: