Process `requirements_v2` artifact on CI jobs
What does this MR do and why?
Parses a new CI build artifact introduced with !105822 (merged) called requirements_v2
. This allows switching requirements states from CI jobs using work items iids. This step
is needed to deprecate the Requirement
objects which are now work-items.
related to #329435 (closed)
How to set up and validate locally
- Create two requirements using the UI and get their work-items iids. Rails console can be used to get work items iids with the following command:
RequirementsManagement::Requirement.order(id: :desc).limit(2).map { |r| r.requirement_issue.iid }
- Setup a runner following these instructions. A simple one using shell should be enough.
- Add a
.gitlab-ci.yml
file to a project with the content below, make sure to use the work items iids retrieved on step 1.
requirements_confirmation:
when: manual
allow_failure: false
script:
- mkdir tmp
- echo "{\"4\":\"failed\", \"6\":\"passed\"}" > tmp/requirements_v2.json
artifacts:
reports:
requirements_v2: tmp/requirements_v2.json
- Trigger the job defined above in the project pipelines section
Both requirements should now have the statuses defined on the CI job.
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 Felipe Cardozo