Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-19892

Unable to exclude merge commit with change detection option

    XMLWordPrintable

Details

    Description

      Summary

      Repository setting Change Detection Options unable to exclude merge commit

      Steps to Reproduce

      1. Create a plan with 2 Bitbucket Server repositories (master branch)
        The second repository does not need to trigger the build plan
      2. Edit the second Repository setting Change Detection Options to have the following settings:
        Include / exclude files: Exclude all changes that matches the following pattern
        File pattern: .*
        Exclude changesets: .*
        
      1. Push a commit to the second repository
        The build plan isn't triggered
      2. Push a commit to a branch of the second repository
      3. Create a Pull Request to merge the above commit to master which is used by the build plan
      4. Merge the Pull Request

      Expected Results

      The build plan isn't triggered

      Actual Results

      The build plan is triggered. The following is thrown in the atlassian-bamboo.log file:

      2018-05-18 20:37:05,563 INFO [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-10] [PullRequestAwareEventListener] Received pull request merged event [ stash, from: refs/heads/test4, to: refs/heads/master]
      2018-05-18 20:37:05,577 WARN [10-BAM::PlanExec:pool-16-thread-3] [CacheAwareness] Inheriting disabledCaches:[com.atlassian.bamboo.CHANGE_DETECTION]
      2018-05-18 20:37:05,968 INFO [10-BAM::PlanExec:pool-16-thread-3] [DefaultChangeDetectionManager] : Excluding changeset '4c14cb3d8556b483ccf9fe7d3c76fb29d0e6e388' from change log.
      2018-05-18 20:37:05,969 INFO [10-BAM::PlanExec:pool-16-thread-3] [ChangeDetectionListenerAction] : Change detection found 1 change for plan BAM-STAS
      2018-05-18 20:37:06,120 INFO [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-2] [BitbucketServerBuildStatusUpdater] Sending build notification to Stash (build key: BAM-STAS-2, repository: stash-master)
      2018-05-18 20:37:06,124 INFO [10-BAM::PlanExec:pool-16-thread-3] [ChainExecutionManagerImpl] Build BAM-STAS-JOB1-2 has been dispatched
      

      Workaround

      • Change from Exclude to Include only changes that matches to the following pattern
      • Use a negative regexp. The regexp needs to be negative lookahead, lookbehind or lookaround
      • E.g.: ^((?!(directory1|directory2)\/).)$*

      Notes

      The build plan commit tab showing the merge commit

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              klfoong Foong (Inactive)
              Votes:
              15 Vote for this issue
              Watchers:
              19 Start watching this issue

              Dates

                Created:
                Updated: