Disable gitlab-workhorse static error page on health endpoints
What does this MR do?
Additional fix to #23927 (closed)
When the health probes raise an error, they return an HTTP error 503 accompanied by JSON detailing which probe has failed.
Unfortunately, gitlab-workhorse
intercepts any HTTP error and substitutes a static, HTML error page. The expected behavior is for workhorse to not overwrite this response, so users can see probe results.
This MR makes use of the X-Gitlab-Custom-Error
header, supported by workhorse here https://gitlab.com/gitlab-org/gitlab-workhorse/blob/master/internal%2Fstaticpages%2Ferror_pages.go#L57 to disable rewriting of the response and pass the probe results to the user.
It also adds a detailed spec of the readiness error case, which was absent until now
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team