Capture gitaly errors in Security Policies
What does this MR do and why?
This change adds capturing errors happening outside of the Security Policies scope (when the repository is inaccessible, during Postgres update, etc.). Currently, these errors are affecting the group's error budget, and there is no action that we can take to solve them.
Related to GRPC::ResourceExhausted: 8:detecting object has... (#412419 - closed)
How to test it locally?
- Create a new project
- Go to
Secure
->Policies
and create a new policy (ie. Scan Execution Policy) - Go to GraphQL Explorer (
/-/graphql-explorer
) and query policies for the created project (you should see this created policy there):query { project(fullPath: "root/cis-test") { scanExecutionPolicies { nodes { name } } } }
- Now turn off gitaly locally
gdk stop praefect praefect-gitaly-0
-
- Go to GraphQL Explorer (
/-/graphql-explorer
) and query policies again for the created project (you should see an empty list), while before this change, you would get 500 errors.
- Go to GraphQL Explorer (
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Alan (Maciej) Paruszewski