Logo

dev-resources.site

for different kinds of informations.

Why isn't coverage badge in GitLab updating?

Published at
11/19/2021
Categories
gitlab
devops
lifehack
Author
xfenix
Categories
3 categories in total
gitlab
open
devops
open
lifehack
open
Author
6 person written this
xfenix
open
Why isn't coverage badge in GitLab updating?

Sometimes coverage badge is not updating at all and remains at the same value as it was in the past.
Earlier this was an old bug in Gitlab that lead you to this situation. But these days are gone and the bug was fixed. And all articles on the whole internet show you mainly this irrelevant information. So I wrote this article in hopes of adding a piece of valuable information.

If you search in your setup of Gitlab and find a «blocked» pipeline — exactly this type of pipeline is the main reason for coverage score staling.
In earlier versions of Gitlab, it was easy to get stuck in this situation. A single job with the following configuration in your pipeline and your coverage gets pinned at one value:

my-job:
    when: manual
Enter fullscreen mode Exit fullscreen mode

To fix this you need to add only one line:

my-job:
    when: manual
    allow_failure: true
Enter fullscreen mode Exit fullscreen mode

And poof, you get lucky, your coverage badge is free of the evil witch curse and updates as it should.

Recently Gitlab guys fixed that behavior. How exactly? Just added default value allow_failure: true for manual pipelines automatically. This is a very good decision, because otherwise, a single manual step may ruin the whole CI/CD prosperity of your project.
But if your think that you are now completely free of this trouble, I may change your opinion.
Just write anything like this:

my-job:
    when: manual
    allow_failure: false
Enter fullscreen mode Exit fullscreen mode

and poof once again — you are stuck with never-ever updating coverage badge. The fix is obvious — add «true» for allow_failure or strip this line. But I have no answer to a simple question: what we should do if we need manual pipelines with disabled failure option and updatable coverage badge? Probably, this question should be addressed directly to Gitlab.

This may not be so easy to grasp from official documentation, so I decided to write this article. I hope it helped.

lifehack Article's
30 articles in total
Favicon
â›”Stop Excessive Validation, you are ruining my life hack!
Favicon
Completed My Blogging Challenge
Favicon
Hacking Watson with Haskell - Part 3
Favicon
Hacking Watson with Haskell - Part 2
Favicon
Hacking Watson with Haskell - Part 1
Favicon
Don’t Panic! The Hitchhiker’s Brew to Serenity
Favicon
Why Multi-tasking is not Good (Bite-size Article)
Favicon
Using Task Management Tools to Forget Tasks (Bite-size Article)
Favicon
Life Hacks: Make the Most of Your Commute (Bite-size Article)
Favicon
On personal goal-setting
Favicon
Power of Logseq - Manage Your Daily Tasks with Outliner
Favicon
How To Customize Your LinkedIn URL in 6 Easy Steps AKA How To Boost Your LinkedIn SEO AKA Lifehacks By Miki Szeles
Favicon
making tough decisions fast
Favicon
Transform any Telegram bot into (almost) an app
Favicon
Why isn't coverage badge in GitLab updating?
Favicon
Code Reactjs Faster by Enabling Emmet for JavaScript and TypeScript in VS Code
Favicon
Automated Form Filling in 4 Steps | No Coding Skills Required
Favicon
A Python package that makes it easier to work with lists on Twitter
Favicon
Git Conflict resolution made simple
Favicon
Finding new music on Spotify by aggregating the choices of tastemakers
Favicon
Transfer files between your phone and computer without any cable and internet!
Favicon
100% Reliability Myth
Favicon
A tip to declutter unused cables with a tape writer and pouches
Favicon
How to get things done in real. A step by step guide.
Favicon
Optimize Your Notetaking With Glyphs
Favicon
Dealing with programmer's burnout
Favicon
Be a good host and share your WiFi
Favicon
Squashing Software Defects with Eisenhower Matrix
Favicon
🗣 Communication Hack – Use Labelled Links
Favicon
Tired of turning Wifi/Bluetooth/Data off in Settings? (iPhone)

Featured ones: