Skip to content

Filter issues by health status

charlie ablett requested to merge 218711-filter-health-status into master

What does this MR do and why?

Filter issues by health status in GraphQL

How to set up and validate locally

  1. create some issues in a project, assign some health statuses to some of them
  2. In GraphiQL, use the query
query {
	project(fullPath: "group/project_path") 
  {
issues(healthStatus: atRisk, first: 5) {
      nodes {
        title
        healthStatus
      }
    }
  }

You should get something like

{
  "data": {
    "project": {
      "issues": {
        "nodes": [
          {
            "title": "Top Banner with user information",
            "healthStatus": "atRisk"
          },
          {
            "title": "User sign up page view",
            "healthStatus": "atRisk"
          },
          {
            "title": "User login page view",
            "healthStatus": "atRisk"
          }}}}}}

db things

up

$ brake db:migrate:up:main VERSION=20220831021358
main: == 20220831021358 AddIndexOnIssueHealthStatus: migrating ======================
main: -- transaction_open?()
main:    -> 0.0000s
main: -- index_exists?(:issues, [:project_id, :health_status, :created_at, :id], {:name=>"index_issues_on_project_id_health_status_created_at_id", :algorithm=>:concurrently})
main:    -> 0.0190s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0003s
main: -- add_index(:issues, [:project_id, :health_status, :created_at, :id], {:name=>"index_issues_on_project_id_health_status_created_at_id", :algorithm=>:concurrently})
main:    -> 0.0038s
main: -- execute("RESET statement_timeout")
main:    -> 0.0003s
main: == 20220831021358 AddIndexOnIssueHealthStatus: migrated (0.0291s) =============

down

$ brake db:migrate:down:main VERSION=20220831021358
main: == 20220831021358 AddIndexOnIssueHealthStatus: reverting ======================
main: -- transaction_open?()
main:    -> 0.0000s
main: -- index_exists?(:issues, [:project_id, :health_status, :created_at, :id], {:name=>"index_issues_on_project_id_health_status_created_at_id", :algorithm=>:concurrently})
main:    -> 0.0198s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0003s
main: -- remove_index(:issues, {:name=>"index_issues_on_project_id_health_status_created_at_id", :algorithm=>:concurrently, :column=>[:project_id, :health_status, :created_at, :id]})
main:    -> 0.0187s
main: -- execute("RESET statement_timeout")
main:    -> 0.0003s
main: == 20220831021358 AddIndexOnIssueHealthStatus: reverted (0.0454s) =============

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 #218711 (closed)

Edited by charlie ablett

Merge request reports