Job coverage badge reverting to previous coverage for blocked pipelines
Summary
Test coverage report badges for specific jobs are not updated correctly in a blocked pipeline.
The value is updated correctly as other jobs continue to run in the pipeline but then the coverage value in the badge reverts to it's previous value, obtained from a previous successful and complete pipeline once a manual blocking job is reached.
This came up in a Zendesk Ticket - internal only
Steps to reproduce
- Setup three jobs in your
.gitlab-ci.yml
build-1:
stage: build
script:
- TOTAL="35%"
- echo "Total $TOTAL"
coverage: /Total.*?([0-9]{1,3})%/
test-1:
stage: test
script:
- sleep 5
deploy-manual:
stage: deploy
script:
- echo `hostname`
when: manual
allow_failure: false
- After the first complete and successful run of the pipeline, note the coverage (
x) - Change the coverage to
yand run the pipeline. Don't run the manual job.
You'll notice that after build-1 is complete, the coverage is y. As test-1 is running, the coverage is y. Once it's time for deploy-manual to be manually run, the pipeline enters a blocked state and the coverage reverts back to x
What is the current bug behavior?
Coverage badges for specific jobs are not updated correctly if the pipeline is in a blocked state.
What is the expected correct behavior?
Coverage badges should reflect the current value of the job even if the pipeline is in a blocked state.
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)