Skip to content

Fix default protected branch settings for user namespace

What does this MR do and why?

Fix default protected branch settings for user namespace

This commit fixes a bug where default branch protection settings where not being created for user namespace

Changelog: fixed

Earlier we pushed !136181 (merged) to backfill default branch protection settings in namespace settings, However we forgot to consider that only group namespace should have these settings and user namespaces should be avoided which caused this bug.

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.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Go to Admin -> Repository -> Default Branch, change settings to protected and fill values.
  2. Create new project under user namespace.
  3. Check if project has default branch protection.
Edited by Harsimar Sandhu

Merge request reports