When using the plugin with deployments, selecting "All artifacts" for the artifact downloader triggers an NPE

Issue #15 resolved
Min'an Tan created an issue

To reproduce:

  • Create a deployment, with the artifact downloader task set to "All artifacts"
  • Try and add a JIRA dpeloy task
  • The add task dialog remains open with an infinite spinner

In the logs, a stacktrace similar to:

java.lang.NullPointerException
    at com.atlassian.bamboo.plugins.confdeploy.AutoDeployConfigurator.addArtifactsFromDownloaderTasks(AutoDeployConfigurator.java:195)
    at com.atlassian.bamboo.plugins.confdeploy.AutoDeployConfigurator.addArtifactData(AutoDeployConfigurator.java:160)
    at com.atlassian.bamboo.plugins.confdeploy.AutoDeployConfigurator.populateContextForCreate(AutoDeployConfigurator.java:112)
    at com.atlassian.bamboo.ww2.actions.build.admin.config.task.TaskUIConfigBean.prepareCreateHtml(TaskUIConfigBean.java:99)
    at com.atlassian.bamboo.deployments.environments.actions.tasks.CreateEnvironmentTask.doDefault(CreateEnvironmentTask.java:65)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:358)
    at com.opensymphony.xwork.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:218)

Selecting an individual artifact for the artifact downloader task seems to work fine.

Comments (4)

  1. Joe Clark

    Oh snap. I noticed this myself when I was testing the Bamboo 5 pull request, but then I forgot to fix it. Thanks for picking up on this.

  2. Joe Clark

    The fix was not very pretty, since unfortunately Bamboo does not provide a good API for dealing with artifacts acquired via a download task. I ended up copying a bunch of code from the plugin that provides the download task.

    Minor bonus enhancement is that the plugin now works with Artifact Download tasks defined in a normal build plan, as well as in deployment projects.

    Fixed in 854c3ed

  3. Log in to comment