jenkinsci / jenkinsci/java-client-api

Enhancement: re-work crumbFlag handling

Offen
#361 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Java
Sterne
913
Forks
466
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Currently the way to handle the crumbFlag is not very intuitive and even not complete. Some methods offer a parameter "crumbFlag" but other dont (see #350).

IMHO it would be better to handle this internally in the library or at least in one central place. So my suggestion is to have a new constructor:
`new JenkinsServer(..., boolean crumbFlag)`

Furthermore, if no crumbFlag is specified (by using the existing constructors) the library itself determines if the crumbFlag should be set or not by calling
```
String json = client.get("api/json");
boolean crumbFlag = new JsonObject(json).get("useCrumbs").getAsBoolean();
```

This would allow to cleanup the API from all overloaded methods that allow passing a "crumbFlag" parameter.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start at the JenkinsServer constructors and the methods that currently expose a crumbFlag parameter. Trace the client.get("api/json") entry point and the existing overloads; done means crumb handling is centralized, an optional boolean constructor is available, and redundant crumbFlag parameters are removed.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
api
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.