CI lint: add include_jobs field to api endpoints
What does this MR do and why?
This MR exposes the jobs field in the CI lint APIs response by adding an optional include_jobs parameter to each of the three APIs. Adds additional tests for said parameter as well updates the docs for CI lint APIs.
It closes the following issue: #343261 (closed)
How to set up and validate locally
Setup a local environment with a project with a dummy job in the gitlab-ci.yml.
- Call any one of the following three APIs with a parameter
include_jobs
set as true to see if they return a jobs key in the JSON response. - Call the APIs without the include_jobs param or setting it to false and see that the jobs key is not returned in JSON response.
POST /ci/lint
POST /projects/:id/ci/lint
GET /projects/:id/ci/lint
To run CI lint APIs tests: Setup a local Gitlab development kit environment and cd into the gitlab repo and run
bundle exec rspec spec/requests/api/lint_spec.rb
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.
Related to #343261 (closed)
Edited by Rémy Coutable