Improve the size, speed, and functionality of generated code coverage page
Problem
The CI job rspec:coverage
(for example https://gitlab.com/gitlab-org/gitlab/-/jobs/3356615469) generates an HTML page (artifact) to be viewed by developers to check the code coverage for individual files. The generated HTML files is huge (193 MB), slow to load, and broken when clicking on some file details.
Screenshots
Example: https://gitlab-org.gitlab.io/-/gitlab/-/jobs/3356615469/artifacts/coverage/index.html (generated by https://gitlab.com/gitlab-org/gitlab/-/jobs/3356615469)
Artifact size | Overview | Details |
---|---|---|
193 MB artifact ![]() |
It takes several seconds to render this page on Firefox ![]() |
Details page is broken due to 503 ![]() ![]() |
Proposed solution
Reduce the size of the artifact by excluding GitLab's source code from that page and load the code dynamically (via https://gitlab.com/gitlab-org/gitlab/-/raw/<SHA>/<PATH>
) and annotate it using the generated .resultset.json
. This would require a patch of simplecov-html
or a new simplecov plugin.