JIRA service being executed without a reason
When something is merged we execute JIRA service without an external issue https://gitlab.com/gitlab-org/gitlab-ce/issues/24777#note_18933094
This is happening because JIRA service tests the service when an issue is not given:
# app/models/project.rb
def execute_services(data, hooks_scope = :push_hooks)
# Call only service hooks that are active for this scope
services.send(hooks_scope).each do |service|
service.async_execute(data)
end
end
# app/models/project_services/jira_service.rb
def execute(push, issue = nil)
if issue.nil?
# No specific issue, that means
# we just want to test settings
test_settings
else
jira_issue = jira_request { client.Issue.find(issue.iid) }
return false unless jira_issue.present?
close_issue(push, jira_issue)
end
end
This is creating a useless job on sidekiq which executes a test every time we merge something,
JIRA service should only be executed when the user references an issue using the markdown
and only tested when users hits test settings on service setup screen.