Skip to content

Environment creation doesn't set custom branch policies #876

@muscraziest

Description

@muscraziest

Problem Description

Currently the environment configuration doesn't properly create environments with custom branch policies. It creates the environment and sets it to use "Custom branch policies" but it doesn't create the rules for the selected branches/tags.

What is actually happening

We are using the following configuration to set our environment but it's not applying the branch policies:

environments:
  - name: prod
    prevent_self_review: true
    deployment_branch_policy:
      protected_branches: false
      custom_branch_policies: 
         - names: ["main"]
            type: "branch"
Image

We also tried the legacy format, org level and suborg level; no success.

We know the environment creation and configuration it's a two step operation from the API side (one call to create the environment and a second one to create the branch protection policy). It looks like it's only doing the first one.

What is the expected behavior

I would expect to have the environment created and the defined custom branch policy set.

Safe-settings version

Commit SHA: 861d70f

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions