Skip to content

Fix default branch protection defaults on new groups

Illya Klymov requested to merge xanf-fix-default-branch-protection-default into master

What does this MR do and why?

!148349 (merged) introduced a bug where you fail to open settings > repository for newly created groups

This is caused because of default_branch_protection_defaults returns {} while we're expecting structure

Group model has dedicated method default_branch_protection_settings which properly delegates resolution to application settings, however these partials are reused across group & application_settings using different fields

  • default_branch_protection_settings for group
  • default_branch_protection_defaults for application settings

Note: application settings are guaranteed to have valid structure by previous migrations

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

  • Enable feature flag default_branch_protection_defaults
  • Create new group
  • Observe you can access group > settings > repository
  • Observe you can access admin area > settings > repository

_Nu

Merge request reports