use of io.jenkins.blueocean.rest.impl.pipeline.BranchImpl in project blueocean-plugin by jenkinsci.
the class BlueOceanWebURLBuilder method getPipelineModelMapping.
private static BlueOceanModelMapping getPipelineModelMapping(Job job) {
BluePipeline blueResource = (BluePipeline) BluePipelineFactory.resolve(job);
if (blueResource instanceof BranchImpl) {
// No abstract "Branch" type?
ItemGroup multibranchJob = job.getParent();
BluePipeline multibranchJobResource = (BluePipeline) BluePipelineFactory.resolve((Item) multibranchJob);
return new BlueOceanModelMapping(multibranchJob, multibranchJobResource, getOrgPrefix() + "/" + encodeURIComponent(multibranchJobResource.getFullName()));
} else {
return new BlueOceanModelMapping(job, blueResource, getOrgPrefix() + "/" + encodeURIComponent(blueResource.getFullName()));
}
}
Aggregations