apache / apache/openwhisk-cli

CLI should not encode API response schema

Offen
#148 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug tech debt
Vorherrschende Sprache
Go
Sterne
109
Forks
98
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

@rabbah commented on [Thu Nov 10 2016](https://github.com/apache/incubator-openwhisk/issues/1489)

I've experience several instances where a schema change in the controller must be reflected in the CLI to properly render the expected output on the command line because the current CLI implementation encodes the types too strictly and *unnecessarily* - in every case I've encountered so far where I've made a schema change to add or remove a field, the CLI would have been just fine if it treated the response from the controller opaquely.

We should refactor the API respond handling in the CLI so that it uses more generic JSON object interface rather than strict types that just get in the way.

I've also found several instances where the CLI is not in sync with the controller (Evidenced by several defects I've opened for these in recent days) and the CLI injects properties that should not exist (and hence confusing).

---

@ioana-blue commented on [Thu Nov 10 2016](https://github.com/apache/incubator-openwhisk/issues/1489#issuecomment-259872098)

I was bit by this as well and it's not fun. In fact, if I hadn't checked with RR, I would have wasted a lot of time on chasing a "bug" in my code, while it was really a schema change for activations which is not reflected in the cli.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, die Verarbeitung der API-Antworten der CLI und die im Issue erwähnten strikten Antworttypen zu lokalisieren. Vergleiche, wie Änderungen am Controller-Schema von der CLI dargestellt werden, und refaktoriere anschließend die Verarbeitung in Richtung generischer JSON-Objekte. Erledigt ist die Aufgabe, wenn Schema-Erweiterungen oder -Entfernungen ohne Aktualisierungen der CLI-Typen dargestellt werden und die CLI keine nicht unterstützten Eigenschaften mehr einfügt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
go
Bereich
api, cli
Issue-Typ
Refactoring
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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