Bamboo PR create webhook from Bitbucket

Beau Herger June 6, 2023

Hello!  We are using Bitbucket Cloud and Bamboo 9.2 (edited, I had mistakenly said 9.3) with linked repos configured with the Bitbucket Cloud remote repository webhook (default events).  
We can see the webhook firing in the case of the pull request creation, and the return status is 204, but Bamboo is ignoring it.  
Is there some unwritten logic that Bamboo is applying around this hook event?  e.g. there must be a new commit since the last build??

1 answer

1 accepted

1 vote
Answer accepted
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 6, 2023

Hello @Beau Herger

Your setup looks correct.

To allow Bamboo to start a build after a Pull Request or Commit is pushed from the BBC Webhook, a "Bitbucket Cloud repository triggered" trigger needs to be added to the referred Plan "Triggers" tab, otherwise Bamboo will simply ignore the request.

Sincerely,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Beau Herger June 7, 2023

Thanks for the response, Eduardo.

We do have the cloud trigger set.  We are following Triggering a Bamboo build from Bitbucket Cloud using Webhooks exactly.

The problem remains that the creation of a pull request does not trigger a build in the following scenario.

  • create a new branch, make a dummy commit, push
    • -> bamboo creates new branch plan and executes
  • wait ten minutes
  • create a pull request on that branch
    • -> bamboo receives the webhook, see log below
    • ->X bamboo DOES NOT EXECUTE

2023-06-07 09:39:43,731 INFO [AtlassianEvent::0-BAM::EVENTS:pool-2-thread-51] [BitbucketCloudWebhooksPullRequestsEventListener] Received pull request opened event [ from: msasafety/smartsensor_firmware ( feature/JTTC-1547-test ), to: msasafety/smartsensor_firmware ( develop ) ]

 

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 7, 2023

Hello @Beau Herger

If a Plan branch already exists and Bamboo is already in sync with the repository's last commit revision, no builds will be triggered as it is already up to date. To validate that, create the Pull Request and update it with another commit, you'll see Bamboo will start a new build, meaning that your initial assumption is correct.

If you want to create a Plan branch only for Pull Requests, you need to modify the "Create plan branch" setting under the "Branches" tab on the Plan configuration and set it to "Pull Request".

As the Push payload is sent over the Pull Request webhook, Bamboo needs that setting 

Sincerely,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Beau Herger June 7, 2023

Ok, thank you Eduardo.  Your first sentence aligns with my assumption of what is going on.  Webhooks events from the cloud are not a trigger to build, but a trigger to analyze the opportunity to build (if there is in fact a change).  We made assumptions in our workflows in which we require a fresh build when a PR is created.  It would be an improvement in the documentation if this caveat was made clear.

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events