Skip to content

Return default of zero for group descendants count

Abdul Wadood requested to merge 455871-default-zero-for-children-count into master

What does this MR do and why?

Return default of zero for group descendants count

While the group is being deleted we run the GraphQL query to get its descendants, the current query will return no row for this group ID. This was causing an error in the group.descendant_groups_count GraphQL query. This issue came to light in #455871.

We have fixed this issue here by setting a default of 0 for the hash returned by the Group#descendant_groups_counts method.

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

Video of bug

How to set up and validate locally

  1. Checkout this MR !148701 (merged).
  2. Go to https://gdk.test:3000/-/organizations/default/groups_and_projects and delete a subgroup. It will to go the Pending deletion state.
  3. Delete the subgroup again and it will show an error.
  4. Apply the changes from the current MR to the above MR.
  5. Repeat steps 2 to 3 and there should be no error.
  6. See this Groups (Bug) video for detailed instructions.

Related to #455871

Merge request reports