Issue Summary
In a multi-repository scenario with Bitbucket Repository Triggered, Bamboo still publishes a change detection required event when a remote event is received for a repository that is disabled on the trigger. This causes an unnecessary change detection to be performed on the other triggering repositories, compounded significantly when there are large number of branch plans and can flood the plan exec queue.
Steps to Reproduce
- Create a plan with two repositories pointed at master and two plan branches
- Each branch will point at their respective branch for the primary repository and master for the secondary
- Configure the trigger so that its only enabled for the primary repository.
- Push a change to master on the secondary repository
Expected Results
The remote event is ignored and no change detection is performed, as the repository the event is received for is not a triggering repository.
Actual Results
Bamboo publishes 6 change detection events; two for the master plan and each plan branch even though the secondary repository isn't a triggering repository. The primary repository is checked with a ls-remote even though the change happened on the secondary repository that was disabled for triggering:
Example:
2020-01-31 15:14:49,305 DEBUG [http-nio-8085-exec-7] [RemoteEventConsumerResource] Received request c131a543-f75a-4716-84a9-89ea34dc4384 to capability stash-branch-changed-remote-event 2020-01-31 15:14:49,306 DEBUG [http-nio-8085-exec-7] [RemoteEventConsumerResource] Publishing event com.atlassian.stash.plugin.remote.event.StashBranchChangedRemoteEvent@596772c[branchName=master,repositoryProject=NEW,repositorySlug=changedet,committer=charlie,sourceId=1d35a314-afef-3b70-bccd-3faa4609591b,sourceUrl=http://localhost:7990/bitbucket] from request c131a543-f75a-4716-84a9-89ea34dc4384 to capability stash-branch-changed-remote-event 2020-01-31 15:14:49,307 DEBUG [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-4] [BranchChangedEventListener] Received Bitbucket Server ref changed event NEW/changedet::master 2020-01-31 15:14:49,638 DEBUG [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-4] [BranchChangedEventListener] publishing change detection event for PROJ-PLAN 2020-01-31 15:14:49,638 DEBUG [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-4] [BranchChangedEventListener] publishing change detection event for PROJ-PLAN0 2020-01-31 15:14:49,638 DEBUG [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-4] [BranchChangedEventListener] publishing change detection event for PROJ-PLAN1 2020-01-31 15:14:49,638 DEBUG [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-4] [BranchChangedEventListener] publishing change detection event for PROJ-PLAN 2020-01-31 15:14:49,638 DEBUG [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-4] [BranchChangedEventListener] publishing change detection event for PROJ-PLAN0 2020-01-31 15:14:49,638 DEBUG [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-4] [BranchChangedEventListener] publishing change detection event for PROJ-PLAN1 2020-01-31 15:14:49,651 DEBUG [9-BAM::PlanExec:pool-15-thread-3] [GitCommandProcessor] Running in /opt/atlassian/bamboo/current/temp: [/usr/bin/git ls-remote ssh://5c7fffa9-016e-4948-9d33-50b6b3091980@127.0.0.1:40009/lfs/git-hw.git] 2020-01-31 15:14:49,878 DEBUG [9-BAM::PlanExec:pool-15-thread-3] [GitCommandProcessor] ls-remote ssh://5c7fffa9-016e-4948-9d33-50b6b3091980@127.0.0.1:40009/lfs/git-hw.git took 226.8 ms 2020-01-31 15:14:49,878 INFO [9-BAM::PlanExec:pool-15-thread-2] [ChangeDetectionListenerPROJion] No changes found for 'PROJ-PLAN0' 2020-01-31 15:14:49,878 INFO [9-BAM::PlanExec:pool-15-thread-3] [ChangeDetectionListenerPROJion] No changes found for 'PROJ-PLAN1' 2020-01-31 15:14:49,878 INFO [9-BAM::PlanExec:pool-15-thread-1] [ChangeDetectionListenerPROJion] No changes found for 'PROJ-PLAN'
Workaround
Convert the repository that you don't want to trigger off, to a plain Git type repository instead of Bitbucket Server.
- is cloned as
-
BDEV-15755 Loading...