Skip to content

Create cleanup script for personal snippets

Anastasia McDonald requested to merge qa-cleanup-script-for-snippets into master

Adding a script to delete personal snippets created during testing.

Personal snippets are attached to user therefore they are not being removed together with subgroups/projects during our cleanup runs on live environments. We do remove resources within tests, however, during a recent failure investigation on Staging I discovered that we still accumulated several thousands of snippets (combination of historic ones and ones where remove_via_api! failed) that make things slower and can contribute to intermittent failures. The script will be used to clean up the backlog on all live environments and add a monthly fallback job to delete anything missed in the future.

https://gitlab.com/gitlab-org/quality/team-tasks/-/issues/1295

To test on local:

  1. Set GITLAB_QA_ACCESS_TOKEN and GITLAB_ADDRESS variables
  2. Run the script in qa directory: bundle exec rake "delete_test_snippets[<delete_before>,<dry_run>]"
Edited by Anastasia McDonald

Merge request reports

Loading