Resolve cross DB issues in vulnerability feedback's create service
What does this MR do and why?
Refactors ee/app/services/vulnerability_feedback/create_service.rb to remove the cross DB transaction.
Behaviour has been kept in accordance with a discussion with Gregory (internal Slack link).
So I think we established before that nested transactions isn't something we can really do. But I don't think we need to here. I think we handle the transaction behaviour from the application level.It'll be a bit annoying, but each point where
raise ActiveRecord::Rollbackcan be changed to undo prior changes if needed.You don't need to worry too much about undoing the creation of a vulnerability record. Future attempts will reuse it, and it'll be removed by the retention policy in the future.The issue record will have dependent destroy on it, so if we fail after issue creation, we should be able to just delete it. This includes the vulnerability_issue_link, so if the feedback fails to save, if we delete the issue, the join will be cleaned up as well.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #480911 (closed)