jenkinsci / jenkinsci/java-client-api
JobWithDetails.getAllBuilds() throws Exception with 404
- Langage dominant
- Java
- Étoiles
- 913
- Forks
- 466
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
My job has many builds, but I got null when call `jenkinsServer.getJob("Folder1/Folder2/jobName").getAllBuilds()`.
Then I check the source code, and find:
```
List builds = client.get(path + "job/" + EncodingUtils.encode(this.getName())
+ "?tree=allBuilds[number[*],url[*],queueId[*]]", AllBuilds.class).getAllBuilds();
```
The problem is `this.getName()`. My job's full path is :
`/job/Folder1/job/Folder2/job/jobName`
But this.getName() only returns jobName.
So I can get correct results with this:
```
List builds = client.get("/job/Folder1/job/Folder2/job/jobName"
+ "?tree=allBuilds[number[*],url[*],queueId[*]]", AllBuilds.class).getAllBuilds();
```
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Start at JobWithDetails.getAllBuilds() and inspect how the Jenkins path is assembled when getName() is used. Compare that path with the nested-job path shown in the report; done means getAllBuilds() returns the builds for jobs such as Folder1/Folder2/jobName instead of failing with a 404.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- api, backend
- Type d'issue
- Bug
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 48/100