We have Upgraded our bamboo version from 5.9.7 to 6.10.4. Due to a number of deprecations and removals in the API, our plugin codebase has been effected. Found a specific code segment needs to be updated and Not sure if there are any other changes also we need to do so.
src\main\java\com\atg\bamboo\plugins\web\condition\DetailedStatusTabCondition.java is as below.
package com.atg.bamboo.plugins.web.condition;
import com.atlassian.bamboo.plan.Plan;
import com.atlassian.bamboo.plan.PlanHelper;
import com.atlassian.bamboo.plan.PlanManager;
import com.atlassian.bamboo.repository.Repository;
import com.atlassian.plugin.PluginParseException;
import com.atlassian.plugin.web.Condition;
import org.apache.log4j.Logger;
import java.util.List;
import java.util.Map;
/**
* @author ddziamen
*/
public class DetailedStatusTabCondition implements Condition {
private static final Logger log = Logger.getLogger(DetailedStatusTabCondition.class);
private PlanManager planManager;
public void init(Map params) throws PluginParseException {
}
/**
* @return true only if it is Devtools repository
*/
public boolean shouldDisplay(Map context) {
String buildKey = context.get("buildKey") != null ? (String)context.get("buildKey") : null;
Plan plan = planManager.getPlanByKey(buildKey);
List<Repository> repositories = PlanHelper.getRepositories(plan);
for(Repository repository : repositories) {
if(repository.getKey().endsWith("devtoolsP4")) return true;
}
return false;
}
public void setPlanManager(PlanManager planManager) {
this.planManager = planManager;
}
}
References: getRepositories(ImmutablePlan plan) is not there in 6.10.4 version Bamboo.
https://docs.atlassian.com/atlassian-bamboo/5.9.7/com/atlassian/bamboo/plan/PlanHelper.html
https://docs.atlassian.com/atlassian-bamboo/6.10.4/com/atlassian/bamboo/plan/PlanHelper.html
Is there a way to replace the above or any alternative to modify the code.
Thanks in advance.