Skip to content

Delete test resources in hierarchical order

What does this MR do and why?

  • Updates the resource cleanup scripts to permanently delete groups and projects first and directly after marking them for deletion.
  • Adds two resources to the ignored list since they cannot be deleted with this script.
  • Skips resource deletion silently if the resource returns a 404 (usually because the parent resource (group/project) has already been deleted).
  • Adds functionality to delete resources owned by a specific user.

How it works now is that groups and projects are marked for deletion, we attempt deletion of resources within these groups and projects, then these groups and projects are permanently deleted. Some resources fail to be deleted if the group or project associated with them is marked for deletion but not deleted yet and for various other reasons.

This change permanently deletes the groups and projects directly after marking them for deletion. Groups and projects will also be deleted first. Resources that are within the groups and projects will now be skipped as they'll return a 404 since they will be tangentially deleted. We also add functionality to delete personal resources like snippets that can only be deleted by the user who owns it.

This should clean up errors in the deletion pipelines so we can better focus on failures that require our attention.

Note for reviewers: I alphabetized the private methods as well hence the diff looks very busy.

Part of https://gitlab.com/gitlab-com/gitlab-OKRs/-/work_items/6490 and gitlab-org/quality/quality-engineering/team-tasks#2538 (closed) and gitlab-org/quality/quality-engineering/team-tasks#2407 (closed)

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.

Edited by Désirée Chevalier

Merge request reports