Hi guys,
I spent a couple of hours to figure out why I'm not able to trigger a webhook from bitbucket to bamboo, I found nothing yet
Issue:
I want to detect when a PR is merged or a branch is deleted which as I see I'm not able to track these need from bamboo, so I need to have a webhook in bitbucket and call a bamboo reset api base on this page
https://confluence.atlassian.com/bamboo/triggering-a-bamboo-build-from-bitbucket-cloud-using-webhooks-873949130.html
But this solution is now working because each time I got this error message
{"message":"Anonymous user can't access this resource. If it should be available, modify anonymous user permissions at Administration > Security settings","status-code":401}
The only access we have for Anonymous group is view which I see this is not enough to call this API from bitbucket
https://confluence.atlassian.com/bamboo/bamboo-permissions-369296034.html
So I don't know what to do and how to track if a PR is merged or a branch is deleted.
I would appreciate to tell me what the problem is
FYI: bamboo and bitbucket version is the latest one
To allow an anonymous user to trigger change detection you need to enable the following security option:
Your instance should be able to get the branch deletion even if there is no webhook configured. Bamboo has a feature for that. The branch detection feature is enabled by default and has the check interval configured in:
Let me know if after configuring the security property you get it working.
@Daniel Santos Thank you for your reply. I really appreciate it.
About anonymous user, I think it's not a good idea in security perspective because it will enable the public to trigger the plan.
And about the branch deletion, I do not know the way to trigger a plan when a branch is deleted.
let me tell you what I want to do, for each PR a new environment would be created which it's supposed to be deleted when the PR is merged or deleted.
So I created a new plan for this case, but I need to trigger it when the PR is merged or deleted.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not sure if I really understood you from the beginning.
About anonymous user, I think it's not a good idea in security perspective because it will enable the public to trigger the plan.
It would not be free to everyone. Only the IPs configured in the repository trigger will be able to use the resource, but I understand your concern.
And about the branch deletion, I do not know the way to trigger a plan when a branch is deleted.
If I understand you correctly you are trying run a build to check the changes of a pull request, is that correct? I think I didn't get that from the first message.
Have you tried the Plan configuration >> Branches >> When pull request is created configuration?
let me tell you what I want to do, for each PR a new environment would be created which it's supposed to be deleted when the PR is merged or deleted.
So I created a new plan for this case, but I need to trigger it when the PR is merged or deleted.
Please check that configuration. It should work for what you need.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I already know about this part
Plan configuration >> Branches >> When pull request
and about
It would not be free to everyone. Only the IPs configured in the repository trigger will be able to use the resource
we do not allow to this solution for security stuff
but anyway I really appreciate for your time to spent to answer my question
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sorry about the late reply, but I have a question for you.
https://<USER>:<PASSWROD>@BAMBOO_URL/rest/triggers/1.0/remote/changeDetection?planKey=PLAN-KEY&skipBranches=false
I just wanted to make sure you tried this option before giving up.
Let me know if that is an option to move forward.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Daniel Santos , It seems that I have same issue, I can't trigger bamboo plan using Bitbucket webhook, I tried your last suggestion:
/<USER>:<PASSWROD>@BAMBOO_URL
But unfortunately it not helped
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.