Commit 8e6b1818 authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'delete-subgroups-sandbox-id' into 'master'

Get sandbox group ID for subgroup deletion

See merge request gitlab-org/gitlab!47217
parents ef73c4dd 51db5365
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
require_relative '../../qa' require_relative '../../qa'
# This script deletes all subgroups of a group specified by ENV['GROUP_NAME_OR_PATH'] # This script deletes all subgroups of a group specified by ENV['TOP_LEVEL_GROUP_NAME']
# Required environment variables: GITLAB_QA_ACCESS_TOKEN and GITLAB_ADDRESS # Required environment variables: GITLAB_QA_ACCESS_TOKEN and GITLAB_ADDRESS
# Optional environment variable: GROUP_NAME_OR_PATH (defaults to 'gitlab-qa-sandbox-group') # Optional environment variable: TOP_LEVEL_GROUP_NAME (defaults to 'gitlab-qa-sandbox-group')
# Run `rake delete_subgroups` # Run `rake delete_subgroups`
module QA module QA
...@@ -47,8 +47,9 @@ module QA ...@@ -47,8 +47,9 @@ module QA
end end
def fetch_group_id def fetch_group_id
group_search_response = get Runtime::API::Request.new(@api_client, "/groups", search: ENV['GROUP_NAME_OR_PATH'] || 'gitlab-qa-sandbox-group').url group_name = ENV['TOP_LEVEL_GROUP_NAME'] || 'gitlab-qa-sandbox-group'
JSON.parse(group_search_response.body).first["id"] group_search_response = get Runtime::API::Request.new(@api_client, "/groups/#{group_name}" ).url
JSON.parse(group_search_response.body)["id"]
end end
def fetch_subgroup_ids(group_id, group_pages) def fetch_subgroup_ids(group_id, group_pages)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment