diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-08-19 18:22:54 +0300 |
---|---|---|
committer | Ruben Davila <rdavila84@gmail.com> | 2016-08-19 23:33:17 +0300 |
commit | 845d29a27f674a64596c0cfd1cd6a2e976a8656d (patch) | |
tree | 26dfc2e40306e7edfde8100ae62858c26f3a6ae7 /lib | |
parent | 04d5dfe4043783aa613e2c2173f56fb24c9e7810 (diff) |
Merge branch 'fix/improve-test-coverage-badge-pipelines' into 'master'
Render coverage badge using latest successful pipeline
## What does this MR do?
This MR make test coverage badge to report value for the latest successful pipeline, instead of the latest one, regardless the status.
Latest pipeline is often running, which makes coverage report inaccurate. Latest pipeline can be also the failed one, which may mean that not all stages got processed, therefore coverage report can be inaccurate as well.
This also improves coverage badge performance because it is not necessary to touch repository to get recent SHA on the branch.
## Why was this MR needed?
See #21013
## What are the relevant issue numbers?
Closes #21013
## Does this MR meet the acceptance criteria?
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- Tests
- [x] Added for this feature/bug
- [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
See merge request !5862
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/badge/coverage/report.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/gitlab/badge/coverage/report.rb b/lib/gitlab/badge/coverage/report.rb index 3d56ea3e47a..95d925dc7f3 100644 --- a/lib/gitlab/badge/coverage/report.rb +++ b/lib/gitlab/badge/coverage/report.rb @@ -13,8 +13,7 @@ module Gitlab @job = job @pipeline = @project.pipelines - .where(ref: @ref) - .where(sha: @project.commit(@ref).try(:sha)) + .latest_successful_for(@ref) .first end |