Allow nil for remaining CI CD settings

What does this MR do?

In !63809 (merged) we allowed some methods of the Project model that are delegated to ci_cd_settings to return nil to prevent the API returning error 500.

The remaining methods delegated to ci_cd_settings also cause error 500 when the CI CD settings are deleted but the project still exists.

This change allows them to return nil instead of raising an error.

See #321467 (comment 606143908)

  • Question for reviewers: It looks likely that any method delegated to ci_cd_settings will cause errors unless it's allowed to return nil. Is it possible to make it the default for all methods delegated to ci_cd_settings? Or fail a test if a new delegated method is added that doesn't allow nil?

Does this MR meet the acceptance criteria?


Availability and Testing


Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Mark Lapierre

Merge request reports