Fix CiPipelineCreationRequest id field resolution

What does this MR do and why?

What was breaking: the id field on the CiPipelineCreationRequest GraphQL type (added in Add user_initiated flag to MR pipeline creation... (!249876 - merged)) returns a 500 for any query that selects it. The field has no resolver of its own, so it falls back to BaseObject#id, which tries to build a global ID. That was throwing an error because the object behind this type is a JSON hash read from Redis, not a record with a global ID.

The fix: hash_key: 'id' makes the field read 'id' straight from the hash, which holds the request UUID.

Why now: the frontend MR Gate pipeline creation failure alerts on user-i... (!251333 - merged) starts selecting id, so this fix has to be fully deployed first. Otherwise, during a rollout, new frontend assets hitting an old Rails node would 500 the MR Pipelines tab.

How to validate

  1. On any MR's Pipelines tab, select Run pipeline (or comment /run_pipeline).

  2. Within 5 minutes (the request's Redis TTL), run this in /-/graphql-explorer:

    query {
      project(fullPath: "<project path>") {
        mergeRequest(iid: "<mr iid>") {
          pipelineCreationRequests {
            id
            status
          }
        }
      }
    }

Without this change the query 500s. With it, id is the request UUID.

References

Related to MR pipelines tab has error "Pipeline creation f... (#605631 - closed)

Edited by Sahil Sharma

Merge request reports

Loading
Loading