Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Can I have a remote trigger only on the plan branches? Edited

Hi,

 

Context:

I have configured a build plan for the branches (so not develop or master), the repository for the plan is pointing to the develop branch, and I setup plan branch management so that only branches on PR have a plan branch, the plan branches have a remote trigger (bitbucket cloud webhook).

 

Problem:

The plan branches are not triggered by the webhook, the response from Bamboo server is 400 with body "The plan [xxx - Branches] is not configured for remote triggering." 

If I add a remote trigger to the parent plan itself (in addition of the one for the plan branches) it will trigger a build for the develop branch when there is a commit pushed to it (and there is a separate plan for the develop branch).

 

Question:

How do I achieve this? Is there a workaround? Is it a bug?

 

ps: I'm using Bamboo specs to create the plans.

1 answer

1 accepted

0 votes
Answer accepted

Hi @Vivien Jovet

Yes, you need the remote trigger configured in the main plan, but you can disable that one and therefore it will not be triggered.

Please add your Remote trigger back and disable the main plan by going to:

  • Plan configuration >> Plan details  and uncheck the [ ]Plan enabled checkbox.

I hope that will give you the behavior you want.
I don't think this is a bug, but the way Bamboo was designed to work.

Please let me know the results you get.

Thanks for your answer, I will try that today.

It worked! Do I still need to set the trigger on the plan branches or set it to inherit the main plan trigger?

Actually it works but it's not practical using Bamboo Specs, if I disable the plan when uploading the spec Bamboo will discard it.

 

Report from the scan:

image1.png

 

And the plans generated:

image2.png

 

You can see it's missing the `Branches` plan.

 

We'd have to remember to disable the main plan manually every time we make changes via Bamboo Specs.

Hi @Vivien Jovet

I've opened a bug for this behavior, it seems incoherent to me and can confuse users:

I was thinking about your initial issue and it seems simpler just to publish this plan with a different main repository. Instead of using develop branch, is it possible for you to use one of the branches that should be built in this plan?

No I can't do that unless I leave a dead branch at all time. The `Branches` plan I've shown above is meant for feature and bugfix branches, so once they're merged into the develop branch, they are deleted.

 

Does Bamboo have a REST API endpoint to disable a plan? If it does I could add a behavior to the plan spec class so that if a plan is disabled, it set it enabled before to publish and make a request to disable it afterward. At least until BAM-20669 is resolved. 

Hi @Vivien Jovet

No I can't do that unless I leave a dead branch at all time. The `Branches` plan I've shown above is meant for feature and bugfix branches, so once they're merged into the develop branch, they are deleted.

Got it! Thank you for explaining it.

Does Bamboo have a REST API endpoint to disable a plan? If it does I could add a behavior to the plan spec class so that if a plan is disabled, it set it enabled before to publish and make a request to disable it afterward. At least until BAM-20669 is resolved. 

Yes, there is an API endpoint for that.

Enable a plan

curl -k -u <BAMBOO_ADMIN_USER>:<BAMBOO_PASSWORD> \
       -H "Content-type: application/json" \
       -X POST "<BAMBOO_URL>/rest/api/latest/plan/<FULL_PLAN_KEY>/enable"

Disable a plan

curl -k -u <BAMBOO_ADMIN_USER>:<BAMBOO_PASSWORD> \
        -H "Content-type: application/json" \
        -X DELETE "<BAMBOO_URL>/rest/api/latest/plan/<FULL_PLAN_KEY>/enable"

I hope that helps to temporarily solve the issue. =]

Those API endpoints work but I'm having trouble using it within the Bamboo Specs scanner which has a security manager preventing my code to work.

 

I'm getting:

Caused by: java.security.AccessControlException: access denied ("java.net.SocketPermission" "bamboo.xxx.com" "resolve")

 

Is there a way to change the settings of the security manager?

Hi @Vivien Jovet

I've contacted the development team got from them that this is a known security implication. It intends to save users from malicious code embedded in specs. Unfortunately, you will not be able to use the rest API that way.

I guess the best option we have now is to use a dummy branch as the main branch. That will let you this separation of plans that you need.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

190 views 4 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you