Skip to content

Print out projects and subgroup name when delete

Tiffany Rea requested to merge printout-project-group-name into master

What does this MR do and why?

Describe in detail what your merge request does and why.

Per suggestion in team task https://gitlab.com/gitlab-org/quality/team-tasks/-/issues/1337#note_990769004 - printing out what is being deleted for better tracking/investigation purposes.

It should look like this now

$ GITLAB_ADDRESS=http://192.168.4.25:3000 GITLAB_QA_ACCESS_TOKEN=<blah> bundle exec rake delete_projects
Running...
Number of projects to be deleted: 1
Deleting 1 projects...

Deleting project gitlab-qa-sandbox-group-3/delete_me...
.
Done

AND

$ GITLAB_ADDRESS=http://192.168.4.25:3000 GITLAB_QA_ACCESS_TOKEN=<blah> bundle exec rake delete_subgroups
Fetching subgroups for deletion...
.
Number of Sub Groups not already marked for deletion: 6
Deleting 6 subgroups...

Deleting subgroup gitlab-qa-sandbox-group-3/qa-test-2022-06-01-11-41-03-12de8edde66dc495...
.
Deleting subgroup gitlab-qa-sandbox-group-3/qa-test-2022-06-14-10-31-29-9fa6e8e42b5ea0c0...
.
Deleting subgroup gitlab-qa-sandbox-group-3/qa-test-2022-06-14-10-55-20-b5a159a872c0aa85...
.
Deleting subgroup gitlab-qa-sandbox-group-3/testing-image-pull-policy-bksjv6pf...
.
Deleting subgroup gitlab-qa-sandbox-group-3/testing-image-pull-policy-h89o1ctl...
.
Deleting subgroup gitlab-qa-sandbox-group-3/testing-image-pull-policy-s53crh0q...
.
Done

Also add delete response to output if a deletion fails

$ GITLAB_ADDRESS=http://192.168.4.25:3000 GITLAB_QA_ACCESS_TOKEN=<blah> bundle exec rake test_resources:delete['tmp/test-resources.json']
[Jun 14 2022 14:29:16 PDT (QA Tests)] INFO  -- Gathering JSON files...
[Jun 14 2022 14:29:16 PDT (QA Tests)] INFO  -- Filtering resources - Only keep deletable resources...
[Jun 14 2022 14:29:17 PDT (QA Tests)] INFO  -- Deleting QA::Resource::Group - with full_path 'gitlab-qa-sandbox-group-3/testing-image-pull-policy-h89o1ctl'... FAILED - {"message":"Group has been already marked for deletion"}

Failed to delete 1 resources:
QA::Resource::Group - with full_path 'gitlab-qa-sandbox-group-3/testing-image-pull-policy-h89o1ctl'

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Tiffany Rea

Merge request reports

Loading