Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
93e752ae
Commit
93e752ae
authored
Jun 16, 2020
by
Jan Provaznik
Committed by
Marcin Sedlak-Jakubowski
Jun 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add requirements CI job documentation
Adds basic documentation how to trace requirements from CI
parent
89b4487c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
0 deletions
+69
-0
doc/ci/pipelines/job_artifacts.md
doc/ci/pipelines/job_artifacts.md
+11
-0
doc/user/project/requirements/index.md
doc/user/project/requirements/index.md
+58
-0
No files found.
doc/ci/pipelines/job_artifacts.md
View file @
93e752ae
...
...
@@ -266,6 +266,17 @@ as artifacts.
The collected Metrics report will be uploaded to GitLab as an artifact and will
be automatically shown in merge requests.
#### `artifacts:reports:requirements` **(ULTIMATE)**
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/2859) in GitLab 13.1.
> - Requires GitLab Runner 11.5 and above.
The
`requirements`
report collects
`requirements.json`
files as artifacts.
The collected Requirements report will be uploaded to GitLab as an artifact and
existing
[
requirements
](
../../user/project/requirements/index.md
)
will be
marked as Satisfied.
## Browsing artifacts
> - From GitLab 9.2, PDFs, images, videos, and other formats can be previewed directly in the job artifacts browser without the need to download them.
...
...
doc/user/project/requirements/index.md
View file @
93e752ae
...
...
@@ -93,3 +93,61 @@ You can also sort requirements list by:
-
Created date
-
Last updated
## Allow requirements to be satisfied from a CI job
> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/2859) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.1.
GitLab supports
[
requirements test
reports
](
../../../ci/pipelines/job_artifacts.md#artifactsreportsrequirements-ultimate
)
now.
You can add a job to your CI pipeline that, when triggered, marks all existing
requirements as Satisfied.
### Add the manual job to CI
To configure your CI to mark requirements as Satisfied when the manual job is
triggered, add the code below to your
`.gitlab-ci.yml`
file.
```
yaml
requirements_confirmation
:
when
:
manual
allow_failure
:
false
script
:
-
mkdir tmp
-
echo "{\"*\":\"passed\"}" > tmp/requirements.json
artifacts
:
reports
:
requirements
:
tmp/requirements.json
```
This definition adds a manually-triggered (
`when: manual`
) job to the CI
pipeline. It's blocking (
`allow_failure: false`
), but it's up to you what
conditions you use for triggering the CI job. Also, you can use any existing CI job
to mark all requirements as satisfied, as long as the
`requirements.json`
artifact is generated and uploaded by the CI job.
When you manually trigger this job, the
`requirements.json`
file containing
`{"*":"passed"}`
is uploaded as an artifact to the server. On the server side,
the requirement report is checked for the "all passed" record
(
`{"*":"passed"}`
), and on success, it marks all existing open requirements as
Satisfied.
### Add the manual job to CI conditionally
To configure your CI to include the manual job only when there are some open
requirements, add a rule which checks
`CI_HAS_OPEN_REQUIREMENTS`
CI variable.
```
yaml
requirements_confirmation
:
rules
:
-
if
:
"
$CI_HAS_OPEN_REQUIREMENTS"
== "true"
when
:
manual
-
when
:
never
allow_failure
:
false
script
:
-
mkdir tmp
-
echo "{\"*\":\"passed\"}" > tmp/requirements.json
artifacts
:
reports
:
requirements
:
tmp/requirements.json
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment