Skip to content

Return error message when locked issue state filter is used

Mario Celi requested to merge 420667-issue-filter-fix-error into master

What does this MR do and why?

locked is not a valid state for issues. GraphQL API allows to filter issues by locked, but when that request is made, users will get a server error. This change handles the error and returns a descriptive message

Changing the enum would be a breaking change, related discussion in #420667 (comment 1605900474) as to why we prefer this less disruptive fix even if not ideal as having the correct enum in the filter

How to set up and validate locally

There are many places where we should get this error when using the locked state filter. The specs cover all of them. But to test manually, you can use the following query in your local environment

{
  project(fullPath: "flightjs/flight") {
    id
    issues(state: locked) {
      nodes {
        title
      }
    }
  }
}

You should get a server error before this change

MR acceptance checklist

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

Related to #420667 (closed)

Merge request reports