Issues with code coverage (cobertura) visualization in MR

Greetings,

We are running selfhosted Gitlab CE 14.0.1 instance and recently I managed to setup cobertura code coverage reports for our projects. It seems to work fine, most of the time, but sometimes we are running into issues that coverate is not visualized in MRs.

Eg. yesterday I was able to see code coverage in one MR, today one of my colegue pushed to that MR additional changes (with processed code review remarks) and suddenly code coverage is not visualized even thought it was just a day ago.
There were no changes done in .gitlab-ci.yml nor we updated any of docker images used for pipeline.
I tried to re-run coverage jobs for both MR source & target branch but without success.
Then I added a blank line in README.md and committed it to MR source branch and once pipeline finished code coverage visualization was again available in MR diff.

Can somebody please explain me what’s going on / how can I fix it?
I’m suspecting that the issue can be somehow related to expiration of cobertura report as gitlab documentation claims that default expiration for this report is ~1 week… and coincidentally last pipeline for that MR target branch was executed ~1 week ago.

I would also appreciate if somebody could let me know how I can change default cobertura report expiration to, let’s say 2-4 weeks, as I would like to test whether it will resolve my problem.
Unfortunatelly I was not able to find any info about that anywhere.

Thank you in advance for your reply.

1 Like