Skip to content

Use default branch protection defaults

What does this MR do and why?

Use default branch protection defaults

This commit adds using of default_branch_protection_defaults column while creating protected branch

How to set up and validate locally

Protection none

{
"default_branch_protection_defaults": {
        "allowed_to_push": [
            {
                "access_level": 30
            }
        ],
        "allow_force_push": true,
        "allowed_to_merge": [
            {
                "access_level": 30
            }
        ]
    }
}

Screenshot_2023-10-12_at_2.41.03_PM

Protection Partial

{
"default_branch_protection_defaults": {
        "allowed_to_push": [
            {
                "access_level": 30
            }
        ],
        "allow_force_push": false,
        "allowed_to_merge": [
            {
                "access_level": 30
            }
        ]
    }
}

Screenshot_2023-10-12_at_2.41.59_PM

Protected Fully

{
"default_branch_protection_defaults": {
        "allowed_to_push": [
            {
                "access_level": 40
            }
        ],
        "allow_force_push": false,
        "allowed_to_merge": [
            {
                "access_level": 40
            }
        ]
    }
}

Screenshot_2023-10-12_at_2.48.55_PM

Protected Against Developer Pushes

{
"default_branch_protection_defaults": {
        "allowed_to_push": [
            {
                "access_level": 40
            }
        ],
        "allow_force_push": true,
        "allowed_to_merge": [
            {
                "access_level": 30
            }
        ]
    }
}

Screenshot_2023-10-12_at_2.52.07_PM

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #408152 (closed)

Edited by Harsimar Sandhu

Merge request reports

Loading