Fix: validation errors for Duo settings when creating project

What does this MR do and why?

  • Fix for changes added in !199042 (merged)
  • After this fix, when we tried to create a new project where the ancestor had Duo Features Enabled locked, there would be a validation error: "Unable to save project. Error: Unable to save #<ActiveRecord::RecordInvalid: Validation failed: Duo features enabled cannot be changed because it is locked by an ancestor>: Duo features enabled cannot be changed because it is locked by an ancestor"
  • Now, if the parent has the setting locked we just ignore it because it will be enforce properly without setting the attribute

References

Screenshots or screen recordings

Before: creating project from template results in no repo. After: creating project from template works as expected

Before After
Screenshot_2025-07-30_at_11.41.48_AM Screenshot_2025-07-30_at_11.42.36_AM

How to set up and validate locally

  1. Create a premium or ultimate group
  2. Set Duo features to "never on"
  3. Create a project from a template within the group. Project should be created successfully with a repository (before this change the repository would never be created)

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 Jessie Young

Merge request reports

Loading