Add resource groups API endpoint to list upcoming jobs
What does this MR do and why?
This merge request adds a new endpoint in the Resource Groups API allowing users to list all upcoming jobs for a specific resource group.
Another merge request will follow with the documentation.
Resolves #342016 (closed).
How to set up and validate locally
- Start up your GDK if it is not already:
gdk start
. - Create a new project, and create an environment:
production
in the same project from: Deployments > Environments. - Add the following
.gitlab-ci.yml
configuration to the project:
image: alpine:latest
stages:
- test
- deploy
say_test:
stage: test
script: echo 'test!'
deploy_production:
stage: deploy
script: echo 'deploying..' && sleep 45
resource_group: production
environment: production
- Go to CI/CD > Pipelines, and run two or three pipelines simultaneously.
- In your terminal, send a request to the new endpoint like below, while keeping in mind to:
- Use your preferred method of API authentication and update
YOUR_TOKEN
with your own. - Make sure to update
project_id
with the corresponding project id.
- Use your preferred method of API authentication and update
curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer YOUR_TOKEN" "http://localhost:3000/api/v4/projects/:project_id/resource_groups/production/upcoming_jobs"
- Validate that the response includes the jobs still showing as
pending
in CI/CD > Pipelines.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Ahmed Hemdan