Skip to content

Update csp_enabled? to always return a boolean value

What does this MR do and why?

In MR !196402 (merged) we changed the behavior of Project#csp_enabled? method to rely on data in organization_policy_setting table. However, as described in this comment, this table is populated with the organization_id in a post-deployment migration, which could not happen until the end of the GitLab upgrade process, throwing a NoMethodError.

This MR updates the csp_enabled? method to return a boolean value, returning false if the organization_id is not present in the organization_policy_setting table.

References

Related to !196402 (comment 2719275884)

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Marcos Rocha

Merge request reports

Loading