Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Event for when a Deployment is Queued

Anne Hommelberg March 18, 2020

I'm writing a custom plugin to prioritise the build queue according to our requirements. It's loosely based on the the Bamboo Queue Priority plugin by AtlassianLab (many thanks to them for publishing the source code!).

Everything is running fine when it comes to reordering build plans through an event listener for the BuildQueuedEvent. However, I've found that the DeploymentTriggeredEvent is given before the deployment is actually added to the build queue (and starting a deployment does not trigger a BuildQueuedEvent). Naturally, reordering the queue for an item that is not in it fails. I've implemented a workaround where I add triggered deployments to a delayed order change queue and have a background thread periodically checking if these deployments are now in the build queue. However, I'd like to just have an event I could listen to and execute the reorder code immediately. 

Is there some sort of "DeploymentQueuedEvent" that I'm overlooking or does such a thing not exist?

 

1 answer

1 vote
Steffen Opel _Utoolity_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 18, 2020

Hi Anne, welcome to the Atlassian Community!

For app development related questions like this, I recommend to use the Atlassian Developer Community, you have a greater chance to get feedback from other app vendors  there (though given past experience, the Bamboo team might also answer here).

That said, I do not really know the definite answer and hope the Bamboo team chimes in as well, but from a related past exploration I remember having played with DeploymentTimingPoints.Queued, which is supposedly triggered when the Deployment was put to the queue.

I do not recall any details unfortunately, and in case it turns out to be applicable, there is also the related OutOfBandDeploymentTimingPoints.Queued to be considered, but given you are already deep into the weeds here, I figured these pointers might help eventually.

Cheers,
Steffen

Anne Hommelberg March 23, 2020

Hi Steffen, 

Thanks a lot for your answer. I've posted the same question on the Atlassian Developer Community. So far your suggestion to look into the DeploymentTimingPoints.Queued is the only suggestion though. I've looked at it but from the DeploymentTimingPoints.Queued I'm only able to get the deploymentResultId which is a long. I would need the full ResultKey in order to perform the reordering. Do you happen to know of a way to get that based on the deploymentResultId (or the DeploymentTimingPoints.Queued object)?

Thanks, Anne

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events