Recreate project if Readme is missing

parent 488e0370
......@@ -96,7 +96,11 @@ module QA
end
def has_file?(file_path)
repository_tree.any? { |file| file[:path] == file_path }
response = repository_tree
raise ResourceNotFoundError, "#{response[:message]}" if response.is_a?(Hash) && response.has_key?(:message)
response.any? { |file| file[:path] == file_path }
end
def api_get_path
......
......@@ -52,14 +52,18 @@ module QA
group.api_client = @api_client
end
@file_template_project = Resource::Project.fabricate_via_api! do |project|
project.group = @group
project.name = 'group-file-template-project'
project.description = 'Add group file templates'
project.auto_devops_enabled = false
project.initialize_with_readme = true
project.user = admin
project.api_client = @api_client
Support::Retrier.retry_until(retry_on_exception: true) do
@file_template_project = Resource::Project.fabricate_via_api! do |project|
project.group = @group
project.name = 'group-file-template-project'
project.description = 'Add group file templates'
project.auto_devops_enabled = false
project.initialize_with_readme = true
project.user = admin
project.api_client = @api_client
end
@file_template_project.has_file?("README.md")
end
Resource::Repository::Commit.fabricate_via_api! do |commit|
......
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