Show only Archived Projects in group.projects graphQL

What does this MR do and why?

Show only Archived Projects in group.projects graphQL

Add a archived_only filter param to the group.projects graphQL https://docs.gitlab.com/api/graphql/reference/#groupprojects

This is going to be used to filter projects which are archived in the Compliance project report, ref Compliance Center Enhancement: Display and Filt... (#500520 - closed)

Database query plan

https://console.postgres.ai/gitlab/gitlab-production-main/sessions/36725/commands/112776

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Ensure that you have a group with mutiple projects, including at least one archived project
  2. Run the following query:
query {
  group(fullPath: "your-group-path") {
    projects(archivedOnly: true) {
      nodes {
        id
        name
        archived
      }
    }
  }
}
  1. You should only see the projects that are archived
  2. Replace archivedOnly: false
  3. You should only see the projects that are not archived
  4. Remove the archivedOnly filter
  5. You should only see all projects

Related to #500520 (closed)

Edited by Nate Rosandich

Merge request reports

Loading