Follow-up from "Add a new scenario to add an SSH key, perform Git actions with it, and then remove the key"
The following discussion from !19754 (merged) should be addressed:
-
@mlapierre started a discussion: (+1 comment) I found another problem while trying to troubleshoot the CI failures. The merge from fork test fails:
Failures: 1) create Merge request creation from fork user forks a project, submits a merge request and maintainer merges it Failure/Error: merge_request = Factory::Resource::MergeRequestFromFork.fabricate! do |merge_request| merge_request.fork_branch = 'feature-branch' end NoMethodError: undefined method `repository_http_location' for #<QA::Factory::Product:0x0000556da6d60d08> # ./qa/factory/repository/project_push.rb:25:in `repository_http_uri' # ./qa/factory/repository/push.rb:39:in `block in fabricate!' # ./qa/scenario/actable.rb:14:in `perform' # ./qa/git/repository.rb:16:in `block (2 levels) in perform' # ./qa/git/repository.rb:16:in `chdir' # ./qa/git/repository.rb:16:in `block in perform' # ./qa/git/repository.rb:15:in `perform' # ./qa/factory/repository/push.rb:34:in `fabricate!' # ./qa/factory/base.rb:23:in `block in fabricate!' # ./qa/factory/base.rb:16:in `tap' # ./qa/factory/base.rb:16:in `fabricate!' # ./qa/factory/dependency.rb:32:in `fabricate!' # ./qa/factory/dependency.rb:19:in `build!' # ./qa/factory/base.rb:20:in `block (2 levels) in fabricate!' # ./qa/factory/base.rb:19:in `each' # ./qa/factory/base.rb:19:in `block in fabricate!' # ./qa/factory/base.rb:16:in `tap' # ./qa/factory/base.rb:16:in `fabricate!' # ./qa/specs/features/browser_ui/3_create/merge_request/merge_merge_request_from_fork_spec.rb:10:in `block (3 levels) in <module:QA>' ...
I'm not sure why the method doesn't exist when it's called at that point.
The relevant code in qa/factory/repository/project_push.rb
is:
@repository_http_uri ||= project.repository_http_location.uri
It works when used in other factories, but not in Factory::Resource::MergeRequestFromFork
That line was intended to replace:
def repository_http_uri
@repository_http_uri ||= begin
project.visit!
Page::Project::Show.act do
choose_repository_clone_http
repository_location.uri
end
end
end