Loading
fix(update): keep the update check error short when GitLab is down
Description
During a gitlab.com incident the releases endpoint answers with an HTML maintenance page, and the API client's error carries the whole page. glab then printed the entire 503 HTML after a command that did not even need the network (the update check runs on every invocation).
This MR reports the host and status code instead — failed checking for glab updates: gitlab.com responded with HTTP 503 — which is what a user can act on. Errors that are not API responses (DNS, network) are unchanged. A test feeds a gitlab.ErrorResponse carrying an HTML body and asserts the short message.
Related Issues
Resolves #7642 (closed)
How has this been tested?
go test ./internal/commands/update/
Edited by Jeston Singh