summaryrefslogtreecommitdiff
path: root/qa/qa/resource/project.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-05 13:54:15 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-05 13:54:15 +0000
commitbe834a25982746ffd85252ff502df42bb88cb9d5 (patch)
treeb4d6a8ba0931e12fac08f05abea33a3b8ec2c8a2 /qa/qa/resource/project.rb
parentee925a3597f27e92f83a50937a64068109675b3d (diff)
downloadgitlab-ce-be834a25982746ffd85252ff502df42bb88cb9d5.tar.gz
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc32
Diffstat (limited to 'qa/qa/resource/project.rb')
-rw-r--r--qa/qa/resource/project.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/qa/qa/resource/project.rb b/qa/qa/resource/project.rb
index 0025ebb2fd5..163c0b40bb5 100644
--- a/qa/qa/resource/project.rb
+++ b/qa/qa/resource/project.rb
@@ -110,6 +110,10 @@ module QA
response.any? { |file| file[:path] == file_path }
end
+ def has_branch?(branch)
+ has_branches?(Array(branch))
+ end
+
def has_branches?(branches)
branches.all? do |branch|
response = get(Runtime::API::Request.new(api_client, "#{api_repository_branches_path}/#{branch}").url)
@@ -140,6 +144,10 @@ module QA
"#{api_get_path}/members"
end
+ def api_merge_requests_path
+ "#{api_get_path}/merge_requests"
+ end
+
def api_runners_path
"#{api_get_path}/runners"
end
@@ -223,6 +231,14 @@ module QA
result[:import_status]
end
+ def merge_requests
+ parse_body(get(Runtime::API::Request.new(api_client, api_merge_requests_path).url))
+ end
+
+ def merge_request_with_title(title)
+ merge_requests.find { |mr| mr[:title] == title }
+ end
+
def runners(tag_list: nil)
response = if tag_list
get Runtime::API::Request.new(api_client, "#{api_runners_path}?tag_list=#{tag_list.compact.join(',')}").url