Fix leaking cloud connector access record
What does this MR do and why?
Also fixes IssuePolicy
to handle missing services from cloud connector.
The spec is flaky because:
-
Our
:with_cloud_connector
specs leak data because the factory creation in https://gitlab.com/gitlab-org/gitlab/-/blob/4dbbb8d12c911e4bde3a8657b6007cb88262f8e1/ee/spec/spec_helper.rb#L50 is executed in anaround
block with is outside the transaction wrapper in specs. -
IssuePolicy#summarize_comments_service
returnsCloudConnector::MissingServiceData
when there are no records in the DB. But in the case where we have a cloud connector access record that does not have:summarize_comments
available, it would returnnil
.
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.
How to set up and validate locally
bin/rspec ee/spec/requests/api/settings_spec.rb ee/spec/requests/projects/issues_controller_spec.rb
Related to #471993 (closed)