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
- New projects inherit parent value for duo_featu... (!199042 - merged)
- Incident issue: gitlab-com/gl-infra/production#20279 (closed)
Screenshots or screen recordings
Before: creating project from template results in no repo. After: creating project from template works as expected
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Create a premium or ultimate group
- Set Duo features to "never on"
- 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

