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

"Suppress automatic SCM triggering" prevents push notifications

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • branch-api-plugin
    • None

      When I add the branch property "Suppress automatic SCM triggering" (which was introduced with JENKINS-32396) to a multi-branch pipeline job, then it does not react on push notifications at all anymore.

      It does suppress the trigger of a build after branch indexing, as expected. But if I setup a jenkins hook e.g. in stash/Bitbucket it does also swallow all my pushes. If I push a new branch or a change to an existing branch no build is triggered.

      I would expect in this case a build starts, and only if a branch is detected during indexing t get suppressed.

      If I'm not mistaken the code should be here (and looks actually good to me):

      https://github.com/jenkinsci/branch-api-plugin/blob/master/src/main/java/jenkins/branch/NoTriggerBranchProperty.java#L69

       

          [JENKINS-45814] "Suppress automatic SCM triggering" prevents push notifications

          Thomas Schneider created issue -
          Thomas Schneider made changes -
          Link New: This issue relates to JENKINS-32396 [ JENKINS-32396 ]

          After debugging I think the problem here is that it also checks for BranchEventCause which drops all post-commit hooks. Would it be an issue to remove this? As the primary reason is to suppress indexing triggered builds...

          Thomas Schneider added a comment - After debugging I think the problem here is that it also checks for BranchEventCause which drops all post-commit hooks. Would it be an issue to remove this? As the primary reason is to suppress indexing triggered builds...
          Thomas Schneider made changes -
          Link New: This issue relates to JENKINS-41980 [ JENKINS-41980 ]

          Functioning as designed.

          Suppress SCM Triggers is intended to prevent any builds being triggered if there is a change detected in SCM. It does not matter whether the change is detected by indexing or by an event.

          Stephen Connolly added a comment - Functioning as designed. Suppress SCM Triggers is intended to prevent any builds being triggered if there is a change detected in SCM. It does not matter whether the change is detected by indexing or by an event.
          Stephen Connolly made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Thomas Schneider added a comment - - edited

          Looks like this bug was introduced with JENKINS-41980

          Thomas Schneider added a comment - - edited Looks like this bug was introduced with JENKINS-41980

          The reason the original code only suppressed indexing was because at the time event support could only trigger indexing. When we added event support, that exposed the bug in the original code which was then fixed by suppressing event triggered builds too

          Stephen Connolly added a comment - The reason the original code only suppressed indexing was because at the time event support could only trigger indexing. When we added event support, that exposed the bug in the original code which was then fixed by suppressing event triggered builds too

          stephenconnolly well in the source it says it was supposed to suppress indexing triggered builds which makes a lot of sense since I do not want to build all my branches on a scan. But why should i suppress build on hooks? Then I should just not setup a hook or use branch excludes in my hooks.

          Thomas Schneider added a comment - stephenconnolly well in the source it says it was supposed to suppress indexing triggered builds which makes a lot of sense since I do not want to build all my branches on a scan. But why should i suppress build on hooks? Then I should just not setup a hook or use branch excludes in my hooks.

          Thomas Schneider added a comment - - edited

          What about separating those into two different settings? Like suppress only indexing triggers or all scm triggers? 

          Maybe as a background: we run stateless jenkins instances that are fully configured by code. On starting it detects all branches and would start building them all, which does not make sense. But if somebody pushes a new branch or a change to an existing branch he would expect it to build.

          Thomas Schneider added a comment - - edited What about separating those into two different settings? Like suppress only indexing triggers or all scm triggers?  Maybe as a background: we run stateless jenkins instances that are fully configured by code. On starting it detects all branches and would start building them all, which does not make sense. But if somebody pushes a new branch or a change to an existing branch he would expect it to build.

            stephenconnolly Stephen Connolly
            schneidexe Thomas Schneider
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: