jenkinsci / jenkinsci/java-client-api

Bug: build.details() throws MismatchedInputException: Cannot deserialize instance of `com.offbytwo.jenkins.model.BuildChangeSet` out of START_ARRAY token

Ouverte
#355 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
913
Forks
466
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

I'm using jenkins-client 0.3.8 and build.details() fails for the Jenkins server v1.652. The reason is: the JSON that is returned contains:
`"changeSet": []`
but the BuildWithDetails class expects not an array/list but an object:
`private BuildChangeSet changeSet;`

I tested build.details() successfully with Jenkins server 2.127 & 2.121.2. The reason is that the JSON looks different (i.e. it contains an object as expected in BuildWithDetails class):
```
"changeSet": {
"_class": "hudson.scm.EmptyChangeLogSet",
"items": [],
"kind": null
}
```

I know there are similar issues (#177, #143, #141, #138) but they are all closed although the problem seems to be still around ... IMHO there needs to be a different handling of the serialization depending on the server version.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Inspect BuildWithDetails and its changeSet field, along with BuildChangeSet, then reproduce build.details() against Jenkins 1.652 and compare the returned JSON with the object form from Jenkins 2.127 or 2.121.2. Done means the client handles both the empty-array and object representations without throwing MismatchedInputException.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
api
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.