Trigger bamboo deploy plan creation in a plugin in 5.9

We've written a plugin that triggers deployment plans programatically.  After upgrading from 5.6 to 5.9 it has broken due to a backwards incompatible change in the bamboo api.  Previously we used 

Deploymentcontext context = deploymentExecutionService.prepareDeploymentContext(environment, version, reason);

However in 5.9, deploymentExecutionService.execute now takes an environment and an EnvironmentTriggeringAction.  I can't figure out how i'm supposed to create an EnvironmentTriggeringAction since it's an interface.  i found EnvironmentTriggeringActionFactory, but that's also an interface.  I tried wiring it in just like a service, but it doesn't get wired in.  I can't find anything else that would let me create an EnvironmentTriggeringAction.

How am i supposed to trigger deploy plans now? 

Also, tangentially, why was backwards compatibility broken without warning in the api changelog?

2 answers

This widget could not be displayed.

How am i supposed to trigger deploy plans now? 

Good question, I hope an Atlassian Bamboo team member chimes in here.

Also, tangentially, why was backwards compatibility broken without warning in the api changelog?

Likewise a good question - we had stumbled over a significant (and as of today still undocumented) Bamboo 5.9 API change as well, and I have requested a resp. changelog update two month ago already, which you might want to watch/vote/comment on accordingly:

While the minor sorting issue mentioned there too has meanwhile been (silently) fixed, the Changes for 5.9 documentation itself has not yet been amended in any way.

  • I really appreciate that the actual issue that we had encountered has been addressed in due course (less than a day turn around for fixing a critical bug is excellent!) - regardless, I'm a bit at a loss what keeps the Bamboo team from documenting such changes properly (and ideally upfront/ongoing) so that the add-on ecosystem can keep concentrating on adding value to Bamboo (instead of chasing undocumented incompatibilities like the one at hand).


This widget could not be displayed.

1) The change had to be done because old logic was broken. There is no meaningful implementation for the old interface and it had to be removed. See: BAM-15501

2) Moreover, the correct method to be called when triggering deployment is NonBlockingPlanExecutionService.tryToStart(
environment, environmentTriggeringAction). The method's signature:

 Future<ExecutionRequestResult> tryToStart(@NotNull Triggerable triggerable,
                                              @NotNull BuildDetectionAction buildDetectionAction);

3) EnvironmentTriggeringAction is an interface because plugins triggering deployments are supposed to implement it. You can find examples in Bamboo source code.

4) If you want to use one of existing implementations of EnvironmentTriggeringAction, EnvironmentTriggeringActionFactory is available to plugins. In fact, deployment triggers built-in in Bamboo are implemented as plugins. They wouldn't work if the factory wasn't available to them.
(did you put <component-import> statement into your atlassian-plugin.xml?)

Also, DeploymentExecutionService is now correctly annotated as @Internal.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

260 views 1 3
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you