CI job summaries in markdown format based on artifact MD-file with reserved name
Problem to solve
This feature will allow developers report CI errors and warnings in readable format using Markdown. For example, if there is a job that lints code for correct style guide, then it will be possible to format all errors as Markdown table and display it, for example, above the CI log.
Report example:
File | Line | Error message |
---|---|---|
qa/qa/factory/api_fabricator.rb |
33 | Using deprecated method resource_web_url()
|
A lot of tools return reports in parseable formats such as JSON so it's possible easily build Markdown file.
Further details
User should save artifact with specific name (file name should be discussed, but for example I will talk about file named job-$CI_JOB_ID-summary.md
) and then GitLab will parse it to display its content on job and pipeline pages. My idea is inspired by dependency scanning feature where artifact's content used in GitLab UI at merge request pages.
Proposal
What does success look like, and how can we measure that?
.gitlab-ci.yml
file
There are [probably] will no changes in .gitlab-ci.yml
config reference. User should save artifact with name job-$CI_JOB_ID-summary.md
to make it work:
artifacts:
paths:
- job-$CI_JOB_ID-summary.md
Pipeline page
New tab will be displayed at pipeline page with counter if at least one summary file was saved. This counter will reflect amount of jobs that returned artifact file.
Job page
At the job page summary file's content will be displayed between job title and black log sections.
Merge request page
Summary files' content should added to discussion session at merge request page each time pipeline with summary files finishes.
Footnote
It's just raw proposal, if you're interested welcome to discussion.