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.
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:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It worked! Do I still need to set the trigger on the plan branches or set it to inherit the main plan trigger?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
And the plans generated:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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. =]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.