Closed ikethecoder closed 4 months ago
The pile of HTML returned from some gwa
commands is the result of trying to hit a /v2/ endpoint that doesn't exist, e.g. https://api-gov-bc-ca.dev.api.gov.bc.ca/ds/api/v2/gateways. This is resolved by changing GWA_VERSION
in .env to v3.
Should improving the handling of this type of error happen in the cli or in the API? or neither since it isn't easy for users to users to alter the API version?
Yeah, I think on the CLI if content-type: text/html
is returned then there's no point in showing the output as it is most certainly garbage. But the Portal should also use the Accept
header to return JSON if it is set to application/json
.
Also to consider for gateway services, gwa-api
does not have a v3
of its API, so https://github.com/bcgov/api-services-portal/blob/feature/ns-to-gw/src/api-proxy.js#L20 will need to map /gw/api/v3
to /v2
. Otherwise it will probably give a 404
error.
The pile of HTML returned from some
gwa
commands is the result of trying to hit a /v2/ endpoint that doesn't exist, e.g. https://api-gov-bc-ca.dev.api.gov.bc.ca/ds/api/v2/gateways. This is resolved by changingGWA_VERSION
in .env to v3.Should improving the handling of this type of error happen in the cli or in the API? or neither since it isn't easy for users to users to alter the API version?
If people upgrade their gwa
, are they going to have to manually edit the .env file to v3
? Perhaps the gwa
command line should update this for you.
If people upgrade their
gwa
, are they going to have to manually edit the .env file tov3
? Perhaps thegwa
command line should update this for you.
I haven't done any builds yet but I'm guessing the .env contents get packed up somewhere. I'll see if I can add general handling for content-type: text/html
- the HTML response you'd have seen isn't actually total junk (it includes a 404 message), but we should be able to handle that much more cleanly.
Fixed the http error handling to give Error: received HTML error page (status code 404)
instead of a wall of text - https://github.com/bcgov/gwa-cli/commit/5b6c3cc9c1726a260d530cd38a09b9779691918d
And I checked out just release
locally and can confirm the executables created point to the API set in .env. For production releases, we set the .env defaults in the GHA - https://github.com/bcgov/gwa-cli/blob/5b6c3cc9c1726a260d530cd38a09b9779691918d/.github/workflows/main.yml#L11
env:
GWA_API_HOST: api.gov.bc.ca
GWA_CLIENT_ID: gwa-cli
GWA_VERSION: v2
Regression testing update
Related to:
1067
1018
1017
1020
As a Github user logging into the portal..
As an IDIR user with existing gateways logging into the portal..
Steps:
Gateways
tab/gateways/list
should render the top part immediately, with the row space having a skeleton:detail
page/admin/switch/undefined
, and fails to switch to gatewayAs an IDIR user with no gateways logging into the portal..
gwa cli
and theproduction checklist
gwa generate-config --template basic-service
gives the errorError: required flag(s) "service", "upstream" not set
andbasic-service is not a valid template
As an IDIR user I want to delete a gateway
Cannot read properties of null (reading 'displayName')
: