Skip to content

feat: protected environments#290

Open
Vadims-U wants to merge 2 commits intocrossplane-contrib:masterfrom
Vadims-U:feat/protected-environments
Open

feat: protected environments#290
Vadims-U wants to merge 2 commits intocrossplane-contrib:masterfrom
Vadims-U:feat/protected-environments

Conversation

@Vadims-U
Copy link
Contributor

Description of your changes

This PR adds support for configuring GitLab Protected Environments via provider-gitlab.
It implements the Protected Environments API and introduces a new managed resource that allows users to define deploy access levels, approval rules, and required approval counts for project environments.

Fixes #269


I have:

  • Read and followed Crossplane's [contribution process].
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Automated

Added unit tests for client-side delta calculation and reconciliation logic.
Added controller unit tests covering Observe / Create / Update / Delete behavior and error paths.
Verified idempotent reconciliation behavior locally.
Ran make reviewable test

Manual

Tested locally against GitLab API using a standard Crossplane development setup.
Applied and updated ProtectedEnvironment resources and verified:

deploy access level changes
approval rules and required approval count handling
correct late initialization behavior

Test environment

Windows 11 with WSL2 (Ubuntu)
Podman‑based local Kubernetes cluster
Crossplane installed via Helm
Provider built and run locally in debug mode


Example manifest used during testing

apiVersion: projects.gitlab.m.crossplane.io/v1alpha1
kind: ProtectedEnvironment
metadata:
  name: prod-protected
  namespace: default
spec:
  forProvider:
    projectId: "12345678"
    name: "production"

    deployAccessLevels:
      - accessLevel: 60 # Owner

    approvalRules:
      - groupId: 123456789
        requiredApprovals: 2

  providerConfigRef:
    kind: ProviderConfig
    name: gitlab-provider

Signed-off-by: Vadims-U <vadims.ubikins@accenture.com>
Signed-off-by: Vadims-U <vadims.ubikins@accenture.com>
@Vadims-U Vadims-U changed the title Feat/protected environments Feat: protected environments Mar 10, 2026
@Vadims-U Vadims-U changed the title Feat: protected environments feat: protected environments Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Protected Environments

1 participant