Commit 3add719d authored by Justin Ho's avatar Justin Ho

Remove @service from integrations contollers

Since all views have been updated to use `@integration`,
we can now remove the instance variable `@service`.

Changelog: changed
parent 5e182902
...@@ -51,7 +51,6 @@ module IntegrationsActions ...@@ -51,7 +51,6 @@ module IntegrationsActions
# rubocop:disable Gitlab/ModuleWithInstanceVariables # rubocop:disable Gitlab/ModuleWithInstanceVariables
def integration def integration
@integration ||= find_or_initialize_non_project_specific_integration(params[:id]) @integration ||= find_or_initialize_non_project_specific_integration(params[:id])
@service ||= @integration # TODO: remove references to @service https://gitlab.com/gitlab-org/gitlab/-/issues/329759
end end
# rubocop:enable Gitlab/ModuleWithInstanceVariables # rubocop:enable Gitlab/ModuleWithInstanceVariables
......
...@@ -85,14 +85,13 @@ class Projects::ServicesController < Projects::ApplicationController ...@@ -85,14 +85,13 @@ class Projects::ServicesController < Projects::ApplicationController
def integration def integration
@integration ||= @project.find_or_initialize_service(params[:id]) @integration ||= @project.find_or_initialize_service(params[:id])
@service ||= @integration # TODO: remove references to @service https://gitlab.com/gitlab-org/gitlab/-/issues/329759
end end
alias_method :service, :integration alias_method :service, :integration
def web_hook_logs def web_hook_logs
return unless @service.service_hook.present? return unless integration.service_hook.present?
@web_hook_logs ||= @service.service_hook.web_hook_logs.recent.page(params[:page]) @web_hook_logs ||= integration.service_hook.web_hook_logs.recent.page(params[:page])
end end
def ensure_service_enabled def ensure_service_enabled
...@@ -101,8 +100,8 @@ class Projects::ServicesController < Projects::ApplicationController ...@@ -101,8 +100,8 @@ class Projects::ServicesController < Projects::ApplicationController
def serialize_as_json def serialize_as_json
integration integration
.as_json(only: @service.json_fields) .as_json(only: integration.json_fields)
.merge(errors: @service.errors.as_json) .merge(errors: integration.errors.as_json)
end end
def redirect_deprecated_prometheus_service def redirect_deprecated_prometheus_service
......
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