Details
-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
5.15.7, 6.5.0
-
9
-
Severity 3 - Minor
-
1
-
Description
Summary
Repository setting Change Detection Options unable to exclude merge commit
Steps to Reproduce
- Create a plan with 2 Bitbucket Server repositories (master branch)
The second repository does not need to trigger the build plan - 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: .*
- Push a commit to the second repository
The build plan isn't triggered - Push a commit to a branch of the second repository
- Create a Pull Request to merge the above commit to master which is used by the build plan
- 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