jenkinsci / jenkinsci/java-client-api

Unable to fetch build details

Abierto
#284 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Java
Estrellas
913
Forks
466
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hi ! I'm currently working with Jenkins (v2.65). I want to get details from builds but I'm unable to do so. Here a sample of my code (Some checks are skipped).

Map jobs = null;
JobWithDetails jobWithDetails;

jobs = Config.jenkins.getJobs();

for (Map.Entry entry : jobs.entrySet()) {

jobWithDetails = Config.jenkins.getJob(entry.getKey());

if (jobWithDetails != null) {
List list = null;
BuildWithDetails buildWithDetails = null;

list = jobWithDetails.getAllBuilds();

for (Build build : list) {
Build tmp_b = jobWithDetails.getBuildByNumber(build.getNumber());

buildWithDetails = tmp_b.details();

if (buildWithDetails != null)
// Do something....
else
System.out.println("Cannot retrieved 'BuildWithDetails'.");
}
}
}

> `Config.jenkins` is nothing more than a `JenkinsServer` instance.

I do mostly the same as @khmarbaise on issue #138 but `buildWithDetails` keep being equal to null.
Here a screenshot to illustrate :

![image](https://user-images.githubusercontent.com/11960724/30318093-65d24370-97ac-11e7-8d60-c18d69a862fe.png)

Notice that I have to use `jobWithDetails = Config.jenkins.getJob(entry.getKey());` to get a valid `JobWithDetail` instance.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Start by reproducing the example with Jenkins 2.65, then trace JenkinsServer.getJob, JobWithDetails.getAllBuilds, getBuildByNumber, and Build.details. Compare the behavior with issue #138 and determine why Build.details returns null; done means build details can be retrieved or the limitation is clearly documented.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
api
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.