movio / bramble

A federated GraphQL API gateway
https://movio.github.io/bramble/
MIT License
497 stars 55 forks source link

Prevent panic when Service struct is nil #234

Closed pkqk closed 7 months ago

pkqk commented 7 months ago

If a service is unreachable the Services map could be unpopulated, so fetching the service name is not possible.

codecov-commenter commented 7 months ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (3c1b58b) 71.07% compared to head (9a105f0) 71.04%.

Files Patch % Lines
plugins/meta.go 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #234 +/- ## ========================================== - Coverage 71.07% 71.04% -0.04% ========================================== Files 27 27 Lines 2742 2742 ========================================== - Hits 1949 1948 -1 - Misses 671 672 +1 Partials 122 122 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

pkqk commented 7 months ago

It already has Unreachable in the status field so I think blank is better than using the field for multiple pieces of info in an unstructured way.

{
    "name": "",
    "version": "",
    "serviceUrl": "https://…",
    "status": "Unreachable",
    "schema": "",
    "__typename": "BrambleService"
},