diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /qa/qa/runtime/api/repository_storage_moves.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) | |
download | gitlab-ce-6e4e1050d9dba2b7b2523fdd1768823ab85feef4.tar.gz |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'qa/qa/runtime/api/repository_storage_moves.rb')
-rw-r--r-- | qa/qa/runtime/api/repository_storage_moves.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/qa/qa/runtime/api/repository_storage_moves.rb b/qa/qa/runtime/api/repository_storage_moves.rb index c94a693289f..d0211d3f66d 100644 --- a/qa/qa/runtime/api/repository_storage_moves.rb +++ b/qa/qa/runtime/api/repository_storage_moves.rb @@ -10,16 +10,24 @@ module QA RepositoryStorageMovesError = Class.new(RuntimeError) def has_status?(project, status, destination_storage = Env.additional_repository_storage) - all.any? do |move| - move[:project][:path_with_namespace] == project.path_with_namespace && + find_any do |move| + next unless move[:project][:path_with_namespace] == project.path_with_namespace + + QA::Runtime::Logger.debug("Move data: #{move}") + move[:state] == status && move[:destination_storage_name] == destination_storage end end - def all + def find_any Logger.debug('Getting repository storage moves') - parse_body(get(Request.new(api_client, '/project_repository_storage_moves').url)) + + Support::Waiter.wait_until do + with_paginated_response_body(Request.new(api_client, '/project_repository_storage_moves', per_page: '100').url) do |page| + break true if page.any? { |item| yield item } + end + end end private |