Skip to content

Fix leaking cloud connector access record

Heinrich Lee Yu requested to merge 471993-fix-flaky-spec into master

What does this MR do and why?

Also fixes IssuePolicy to handle missing services from cloud connector.

The spec is flaky because:

  1. 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 an around block with is outside the transaction wrapper in specs.

  2. IssuePolicy#summarize_comments_service returns CloudConnector::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 return nil.

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)

Edited by Heinrich Lee Yu

Merge request reports