Skip to content

Fix GRPC 500 from BlobsResolver

Avielle Wolfe requested to merge aw-fix-invalid-ref-in-blob-resolver into master

What does this MR do and why?

This MR fixes a bug that occurred when an invalid ref was passed to BlobsResolver, which resulted in a GRPC::InvalidArgument being thrown and a 500 for the requester.

Now, BlobsResolver validates the ref and returns a GraphQL ArgumentError with the message Ref is not valid

Resolves: GRPC::InvalidArgumentGraphqlController#execute
Part of: #349973 (closed)

Screenshots or screen recordings

Before the fix:

GPRC exception causes 500

After the fix:

ArgumentError is returned

How to set up and validate locally

  1. Go to /-/graphql-explorer
  2. Enter the following query with your own project and file path:
    {
      project(fullPath: "PROJECT_FULL_PATH") {
        repository {
          blobs(paths: "REAL_FILE_PATH", ref: ":::") {
            nodes {
              id
            }
          }
        }
      }
    }
  3. After submitting the query, see that you receive the following message:

Argument error message

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Avielle Wolfe

Merge request reports

Loading