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

Feature request - disallowing shared runners on group level

Open torinthiel opened this issue 3 years ago • 5 comments

The gitlab_project resource has an attribute shared_runners_enabled, which corresponds to similar setting in gitlab. However this setting exists as well on the group level, along with another one that blocks override on subgroups/projects.

It would be nice to be able to set this on the group level as well.

torinthiel avatar Mar 03 '21 15:03 torinthiel

This is a request to add the shared_runners_enabled attribute to the gitlab_group resource.

armsnyder avatar Mar 04 '21 07:03 armsnyder

I was curious and took a look into this issue, but at a first glance, this does not look as straightforward. Isn't it an issue that the Create Group API does not support setting the shared_runners_setting on creation? According to the documentation, it is only present on the Update Group.

GertVil avatar Feb 08 '22 21:02 GertVil

Yep, there are some GitLab APIs like that. It's less straightforward, but we do have a way of handling it. In the provider "create" function...

  1. Call the create API
  2. Set the resource Id (d.SetId(...))
  3. Call the update API (conditional on if shared_runners_setting needs to be updated)
  4. return

armsnyder avatar Feb 08 '22 21:02 armsnyder

@torinthiel Can I work on this ?

teekhandekar avatar Mar 26 '22 05:03 teekhandekar

@teekhandekar Yes, feel free to open a PR for that. @armsnyder has pretty much laid out the implementation steps already.

In addition, can you implement all the shared runners fields. Looking through the docs I can at least see these:

For the shared_runners_enabled field I've created a PR for go-gitlab to support it here:

  • https://github.com/xanzy/go-gitlab/pull/1429

timofurrer avatar Mar 26 '22 07:03 timofurrer