[FEATURE REQUEST] CLI could be more helpful about some kinds of API responses
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Comienza con pkg/errors/deduce.go, especialmente con las indicaciones existentes para las respuestas 401 y 403. Revisa los ejemplos enlazados y determina qué rutas de API conocidas o respuestas 404 deberían recibir indicaciones similares. Se considera terminado cuando la CLI ofrece indicaciones útiles que no revelen información para los casos acordados, en lugar de sugerir únicamente un informe de errores.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is your feature request related to a problem? Please describe.
fastly CLI operations failed for me in ways that made no sense (404s configuring a service that has existed for years, etc), and it took me a moment to figure out it was because I had unwittingly used the wrong token.
Describe the solution you'd like
The CLI suggests "If you believe this error is the result of a bug, please file an issue", but for example cases like "404 on PUT /service/<service_id>" are probably not returning 404 as a bug but as a result of the service not existing or provided API token not being able to manage that service.
The CLI offers basically exactly the advice that would have helped me but only for 401 and 403 responses. for some known API paths (is there an OpenAPI document for the Fastly API? I don't remember) this would definitely have helped me too.
Describe alternatives you've considered
https://github.com/fastly/cli/issues/894 describes the API's somewhat minimal 404 "Cannot find ..." as there being a bug ticket to track a fix. I imagine that the experience of operating on a service you can't access wouldn't substantially change from the API PoV - you don't want to inadvertently disclose a service ID to be valid or the scope on a token, after all - but maybe there's something there.
or maybe no change to the CLI after all 🤷♀️
Additional context
in addition to my own, this probably would have helped (or at least been the same advice Fastly offers, without the round trip) in many of the following cases:
https://github.com/fastly/cli/issues/1780
https://github.com/fastly/cli/issues/1237 <-- don't know for sure since there was no followup from OP, but this was the advice to the issue-filer
https://github.com/fastly/cli/issues/1256 <-- from the same author, this was the issue
https://github.com/fastly/cli/issues/894
https://github.com/fastly/cli/issues/793 <-- educated guess given 404 on a fresh fastly profile create...
- Lenguaje dominante
- Go
- Estrellas
- 164
- Forks
- 80
- Merge medio
- 23 h 51 min
- PR fusionados (30 d)
- 18
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de fastly/cli
-
bug feature request
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
feature request
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 62/100
-
feature request
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
-
feature request
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
Todos los issues de fastly/cli
Issues similares
-
nix: vendorHash is outdated Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
Bob Shell support Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
santhosh-tekuri/jsonschema#276 ·