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

branches to build specifier broken

    Details

    • Similar Issues:

      Description

      Attached are images of the configuration that I have set up for the pipeline.

      In 'branches to build' I indicated the dev branch for my pipeline which should be triggered by a push to my repo in Github. However, whenever a new commit is pushed to the repo, the webhook triggers both my dev branch pipeline and the master branch pipeline as can be seen here

      This problem is compounded by my Jenkinsfile that does a new commit to the branch after a successful build, hence, I have a build that will run indefinitely.

      The problem with 'polling ignores commits..', I believe, may be related to this issue.

        Attachments

          Activity

          Hide
          stephenconnolly Stephen Connolly added a comment -

          I should point out that the GitHub Branch Source is auto-wired to the webhook, so when you get that working you should not need a "Periodically unless otherwise ran" that is more often than once per hour... once per day being more likely (that setting should be seen as 'If an event from GitHub was not delivered, how long can I wait without it being detected'... most people are probably 1 week as typically event delivery is very reliable and there are usually follow-up events anyway)

          Show
          stephenconnolly Stephen Connolly added a comment - I should point out that the GitHub Branch Source is auto-wired to the webhook, so when you get that working you should not need a "Periodically unless otherwise ran" that is more often than once per hour... once per day being more likely (that setting should be seen as 'If an event from GitHub was not delivered, how long can I wait without it being detected'... most people are probably 1 week as typically event delivery is very reliable and there are usually follow-up events anyway)
          Hide
          f00ser Neuronal T added a comment -

          So, I may have chimed in on a thread where Ralph A's environment is centered on multi-branch and Pipeline Plugin usage. I'm not using Pipelines (yet; more of a team choice for that) and mine was a case specific to push event triggers from GitHub affecting branches with Multiple SCM Plugin, and the triggering of multiple branch build jobs. I isolated my situation (and wrote up a ticket here: Jenkins builds all jobs when user intends for one) around the behavior I saw. I'm open to understanding that we might have an ill-suited dev process for the way Jenkins functions with is SCM-push-trigger logic, but it seems to me that when a user commits a change to a branch, only that branch job should build, and not others (regardless if their GitHub state is a mismatch according to Jenkins).

          The "workaround" is that we use a single GitHub repo SCM with a submodule of the other GitHub repo that's needed (our jobs only had 2 repos). But since that 2nd repo is only needed for CI (and not dev work), this was an acceptable alternative.

          Show
          f00ser Neuronal T added a comment - So, I may have chimed in on a thread where Ralph A's environment is centered on multi-branch and Pipeline Plugin usage. I'm not using Pipelines (yet; more of a team choice for that) and mine was a case specific to push event triggers from GitHub affecting branches with Multiple SCM Plugin, and the triggering of multiple branch build jobs. I isolated my situation (and wrote up a ticket here: Jenkins builds all jobs when user intends for one ) around the behavior I saw. I'm open to understanding that we might have an ill-suited dev process for the way Jenkins functions with is SCM-push-trigger logic, but it seems to me that when a user commits a change to a branch, only that branch job should build, and not others (regardless if their GitHub state is a mismatch according to Jenkins). The "workaround" is that we use a single GitHub repo SCM with a submodule of the other GitHub repo that's needed (our jobs only had 2 repos). But since that 2nd repo is only needed for CI (and not dev work), this was an acceptable alternative.
          Hide
          ralphie02 Ralph A added a comment -

          I've given up and changed my previous workflow, as per Stephen's sugggestion. I would also like to apologize for my previous comment that is misleading and not entirely correct.

          I originally had a working freestyle project that did everything that I needed but, in order to satisfy our developers' need, we opted to switch it to a pipeline project in order to take advantage of Jenkinsfile. My memory got mixed up with what is working and what is half-working since I tested Jenkinsfile in a pipeline project in chunks so I remember the situation incorrectly.

          That aside, I would like to now focus on building a standalone pipeline project (I still could not get multibranch to work with Github webhooks) but I still need to get the polling ignore commits to function. As per Mark Waite "[t]here is already a separate bug report that pipeline polling does not ignore commits from specific users". Could you please comment on the issue number so I know which one to track? I found a few issue related to polling ignore commits/users but I am unsure which one you are specifically referring to

          Cheers!

          Show
          ralphie02 Ralph A added a comment - I've given up and changed my previous workflow, as per Stephen's sugggestion. I would also like to apologize for my previous comment that is misleading and not entirely correct. I originally had a working freestyle project that did everything that I needed but, in order to satisfy our developers' need, we opted to switch it to a pipeline project in order to take advantage of Jenkinsfile. My memory got mixed up with what is working and what is half-working since I tested Jenkinsfile in a pipeline project in chunks so I remember the situation incorrectly. That aside, I would like to now focus on building a standalone pipeline project (I still could not get multibranch to work with Github webhooks) but I still need to get the polling ignore commits to function. As per Mark Waite " [t] here is already a separate bug report that pipeline polling does not ignore commits from specific users". Could you please comment on the issue number so I know which one to track? I found a few issue related to polling ignore commits/users but I am unsure which one you are specifically referring to Cheers!
          Hide
          markewaite Mark Waite added a comment - - edited

          Refer to JENKINS-36195 or JENKINS-35988 for the pipeline specific polling bug report.

          Show
          markewaite Mark Waite added a comment - - edited Refer to JENKINS-36195 or JENKINS-35988 for the pipeline specific polling bug report.
          Hide
          integer Kanstantsin Shautsou added a comment -

          How github plugin works is written in docs. Screenshot contains wrong git configuration that unrelated to github-plugin. 

          Please go to user mail list with discussing user workflows and branch-source/org-folder etc

          Show
          integer Kanstantsin Shautsou added a comment - How github plugin works is written in docs. Screenshot contains wrong git configuration that unrelated to github-plugin.  Please go to user mail list with discussing user workflows and branch-source/org-folder etc

            People

            • Assignee:
              Unassigned
              Reporter:
              ralphie02 Ralph A
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: