Resource groups API doesn't support creation and removal
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Proposal
Currently, the Terraform GitLab provider doesn't support the Resource Groups resource. In order to add the support, GitLab needs to implement the following actions via the API:
- Creation (currently missing)
- Removal (currently missing)
- Editing (available: https://docs.gitlab.com/ee/api/resource_groups.html#edit-an-existing-resource-group)
Creation
Currently, the Resource Group creation happens only when a job that uses it gets created. In order to support the creation API, the system would need to extract common business logic and re-use it in the creation API endpoint
Removal
Currently, it's not possible to remove an existing Resource Group. This is even more complicated if we consider that there might be pending/running jobs that use this Resource Group.
For simplicity, I propose the following approach:
- If there are running/pending/waiting_for_resource jobs that use a Resource Group, raise an error when trying to delete it
- If all jobs that use the Resource Group are in the
success,failed,manual,skippedstates, allow removal.- In such case, when jobs get retried or the manual job gets started, a new Resource Group will be created, with a different
id
- In such case, when jobs get retried or the manual job gets started, a new Resource Group will be created, with a different
Terraform provider link
A sibling issue has been created on the Terraform GitLab provider page, describing the issue on their side: terraform-provider-gitlab#1346
What does success look like, and how can we measure that?
Number of API calls to the new endpoints last 30d > 0
Number of Resource Group interactions last 30d > 0