Commit 63cbaa5e authored by ddavison's avatar ddavison

Delegate CiVariable delegation to API

Instead of Resource::CiVariable fabricating via the browser_ui, let's
delegate to the API instead. (will shave off roughly 3-4s every use)

Override resource_web_url to catch ResourceURLMissingError as there
is no "show" action for a CI/CD var
Signed-off-by: default avatarddavison <ddavison@gitlab.com>
parent 168cd1ec
......@@ -25,6 +25,33 @@ module QA
end
end
end
def fabricate_via_api!
resource_web_url(api_get)
rescue ResourceNotFoundError
super
end
def resource_web_url(resource)
super
rescue ResourceURLMissingError
# this particular resource does not expose a web_url property
end
def api_get_path
"/projects/#{project.id}/variables/#{key}"
end
def api_post_path
"/projects/#{project.id}/variables"
end
def api_post_body
{
key: key,
value: value
}
end
end
end
end
......@@ -7,6 +7,7 @@ module QA
class Project < Base
include Events::Project
attribute :id
attribute :name
attribute :description
......
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