I'm using the BuildAgentRequirementFilter and I've run into a problem where my remote agents are not finding a BuildTask in the same plugin.
This is the message I get in Bamboo, I've removed the task name and task key in the string to post here.
Could not execute task '<Task Name>' no Plugin with key '<Build Task Key>' is installed.
Is this a bug with Bamboo or with the way the Agent Filter is implemented?
Community moderators have prevented the ability to post new answers.
How are you implementing the BuildAgentRequirementFilter? You should also note that the BuildAgentRequirementFilter is a Plugins v1 module so it cant be reloaded in development using atlas-cli (likely why the Task is missing). To make it work, you will need to start and stop atlas-debug every time you make a change.
I tried using atlas-debug but I get the same issue.
This is my code for the BuildAgentRequirmentFilter, maybe I'm not implementing it correctly:
@Override public Collection<com.atlassian.bamboo.v2.build.agent.BuildAgent> filter( BuildContext buildContext, Collection<com.atlassian.bamboo.v2.build.agent.BuildAgent> agents, RequirementSet requirements) { Collection<com.atlassian.bamboo.v2.build.agent.BuildAgent> filtered = new ArrayList<com.atlassian.bamboo.v2.build.agent.BuildAgent>(); out.println("Plan Name: " + buildContext.getPlanName()); final String projectName = buildContext.getProjectName(); final String jobName = buildContext.getShortName(); try { for(java.util.Iterator<com.atlassian.bamboo.v2.build.agent.BuildAgent> i = agents.iterator(); i.hasNext();) { com.atlassian.bamboo.v2.build.agent.BuildAgent agent = i.next(); String agentName = agent.getName(); out.println("Got agent: " + agentName + " ; Got job: " + jobName); if(agentName.contains(jobName)) { out.println("Building " + jobName + " on this agent: " + agentName); filtered.add(agent); } } if(filtered.size() == 0) { out.println("No Agents Found"); } } catch(Exception e) { out.println("Some bad happened:\n" + e.toString()); } return filtered; }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just to add I also get this issue if I install the plugin to release version of Bamboo 4.0.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What happens if you change
<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2">
to
<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="1">
Do you still get the same problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yep that solves the problem. I also found out that by splitting the task and build agent modules into 2 different plugins also did the trick.
Thanks for the help.
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.