Skip to content

Bug: Analyzer group statuses counts archived projects as not configured

Summary

When archiving a project, the group's analyzerStatuses graphql query increases the notConfigured field by 1.
This is the result of using group.all_project_ids (See related discussion here).
The query that is being executed when calling group.all_project_ids doesn't take into account archived projects.
We calculate the notConfigured counter using this statement: total_number_of_projects - success - failure. Since the archive doesn't change the total_number_of_projects, it results in a higher notConfigured counter.

Steps to reproduce

  1. In GraphQL explorer:
query test {
  group(fullPath: "path/to/a/group/you/have") {
  name
  analyzerStatuses{
    success
    failure
    notConfigured
    analyzerType
  }
}

Then, archive a project and run the same query again. You will notice that the notConfigured counter is being increased by 1.

I verified the source of this bug to group.all_project_ids by doing this:
In rails c, run:

g = Group.find_by_id(id)
g.all_project_ids.length

Then, archive one of the projects in the group and run the same thing again. The result will remain the same.

What is the expected correct behavior?

Not increasing the notConfigured counter

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Patch release information for backports

If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.

Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.

High-severity bug remediation

To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.

Edited by Yuval Siev