Welcome to mirror list, hosted at ThFree Co, Russian Federation.

group.rb « lib « tools « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5f15490607330150217662557b34fb8979fbb540 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

module QA
  module Tools
    module Lib
      module Group
        def fetch_group_id(api_client, group_number = nil)
          group_name = if group_number
                         "gitlab-qa-sandbox-group-#{group_number}"
                       else
                         ENV['TOP_LEVEL_GROUP_NAME'] || "gitlab-qa-sandbox-group-#{Time.now.wday + 1}"
                       end

          group_search_response = get Runtime::API::Request.new(api_client, "/groups/#{group_name}").url
          JSON.parse(group_search_response.body)["id"]
        end
      end
    end
  end
end