Execute bamboo spec plan only when PR is created.

Suprabhat Sinha
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 27, 2025

Hi Guys,

This is my first post. Hope i get a quick response.

What i have now is:-

a build plan which run unit test with every commit pushed in feature/* branch

What i need is 

I want to create a plan which get executes only when PR is created and merge is blocked until build passes.

Im really stuggling to find out correct solution. 

Any help is really appreciated.

Thanks

Supra

1 answer

0 votes
Shashank Kumar
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 27, 2025

Hello Supra,

Welcome to Atlassian community.

A build plan which run unit test with every commit pushed in feature/* branch - This is the expected behaviour as you have trigger enabled on Bamboo and it will build the plan with each commit so this is expected, if you don't want to trigger this with each build then remove the trigger and probably set some other trigger like a scheduled trigger where frequency would be low. 

Coming to your other question

I want to create a plan which get executes only when PR is created and merge is blocked until build passes.

Here you can use the concept of plan branches, whenever a PR is created in Bitbucket Bamboo will create a new plan branch automatically and will build it. This plan will automatically get disabled once the PR is merged successfully.

Create a plan and link it to the repository on which PR will be created and then on this plan you can enable branches as shown below, whenever a PR is created it will create a new plan branch on this plan and automatic build will start on it.

Read more about it at Using plan branches , you can use the below options from Branches tab on your plan

image.png

 

I am not yet sure on you ask regarding Merging, are you talking automatic Merging from Bamboo or manual PR merge in Bitbucket or any other repo

Regards,

Shashank Kumar

Suprabhat Sinha
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 27, 2025

Hi @Shashank Kumar 

Thanks for ur quick reply.

my second question is the one im trying to solve it.
So just now i did a commit and added below logic in a feature/* branch. It did triggered the build which u mentioned as above as default behaviour

branches:
create: for-pull-request

In order to stop where should i go to remove the trigger, as shown below i cannot remove trigger.

Screenshot 2025-02-27 at 9.00.25 pm.png

 
Suprabhat Sinha
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 27, 2025

Screenshot 2025-02-27 at 9.09.27 pm.png

I cannot edit this. What permission should i have?

Suprabhat Sinha
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 27, 2025

Screenshot 2025-02-27 at 10.42.11 pm.png

I was able to sort the issue now the plan branch looks as it needs to be. However, i deleted the PR and recreated a new PR didnt work, what am i missing?

Shashank Kumar
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 27, 2025

So when you recreated the new PR, new plan branches are not created in Bamboo?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events