Allow creation/management of Resource Groups Outside of Pipeline
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Release notes
Problem to solve
As a Platform Engineer, I want to pre-provision resource groups and set their process mode outside of pipelines.
Original issue description:
I am currently implementing resource groups for several projects in my organization. Based on the documentation and the api around resource groups, it appears there is no way to pre-provision these.
The reason that this is important is that we do not want to utilize the default process mode for our resource groups. It is important that we use the "oldest first" process mode. However, it appears that the only way to do this on a consistent basis is with API calls AFTER the resource group has been added to a project's CI/CD pipeline and AFTER that pipeline has executed a job containing the resource group. This means we cannot control concurrency on our pipelines until after the fact.
A simple way around this would be the ability to pre-provision name spaced resource groups and set their process mode, regardless of whether they've been used in a pipeline. The resource groups API does not allow for this.
Further, it appears that resource groups do not appear in webhooks, meaning I cannot build a reliable external trigger to change process mode upon detection of a resource group being used in a pipeline.
Please let me know if there's something I'm missing, but some enhanced abilities around resource group creation and management would be greatly appreciated.
Proposal
A new API endpoint to create/delete a resource group:
POST /projects/:id/resource_groups/
| Attribute | Type | Required | Description |
|---|---|---|---|
key |
string | yes | the name of the resource group |
process_mode |
`oldest_first | newest_first | unordered` |
Returns in the following schema:
{
"id": 3,
"key": "production",
"process_mode": "oldest_first",
"created_at": "2021-09-01T08:04:59.650Z",
"updated_at": "2021-09-01T08:13:38.679Z"
}
Possible errors:
- 409 - Conflict : the
keyis already taken - 422 - Unprocessable input: the
keyorprocess_modevalue is invalid
Intended users
Feature Usage Metrics
Does this feature require an audit event?
No
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.