terraform-provider-gitlab icon indicating copy to clipboard operation
terraform-provider-gitlab copied to clipboard

Feature request: Protected branches and deploy keys

Open mottetm opened this issue 4 years ago • 4 comments

Hi there,

I'd like to enable a deploy key to push on a protected branch.

I can see how to create my deploy key with write access, how to enable it for a given project. But the allowed_to_push block in the gitlab_branch_protection resource does not support the use of a deployment key. Any chance to see the feature supported in the future?

Best regards

mottetm avatar Aug 11 '21 11:08 mottetm

Marking this issue as stale due to 90 days of inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 14 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

github-actions[bot] avatar Feb 02 '22 03:02 github-actions[bot]

This is an ask to add deploy_key_id to the respective allowed_to_push and allowed_to_merge schema blocks for the gitlab_branch_protection resource. This is already supported in the go-gitlab client: https://github.com/xanzy/go-gitlab/blob/35322d7e1aa7b90c8f758ff7574f8d1f8fefa6ca/protected_branches.go#L141

armsnyder avatar Feb 02 '22 03:02 armsnyder

I've looked into this and come to the conclusion that we are still blocked - but this time by the upstream GitLab API. See the issue I've created here: https://gitlab.com/gitlab-org/gitlab/-/issues/354657

Basically the deploy_key_id isn't part of the GET responses ...

timofurrer avatar Mar 06 '22 18:03 timofurrer

I've just double checked this and actually the deploy_key_id support seems to be missing in the upstream API completely. No idea how it made it's way into go-gitlab ...

timofurrer avatar Aug 20 '22 08:08 timofurrer