Not able to see Code Coverage Difference in Merge Request for a java project

Problem to solve

We are having a Java project repo on GitLab where we are encountering an issue with the CI/CD pipeline’s code coverage reporting.

  • Current Behavior: The Merge Request (MR) shows “Test coverage 26.25% from 4 jobs.”
  • Expected Behavior: The MR should display “Test coverage 26.25% (+10%)” in green or "(-10%) in red " depending on the coverage report to indicate the increase or decrease in code coverage after the merge.

Here is the gitlab ci
- if: $CI_PIPELINE_SOURCE == “merge_request_event”
when: on_success
stage: Reports-Generation
name: maven:3.9.6-ibm-semeru-21-jammy
- cat example/example/functions/example/target/site/jacoco/index.html | grep -o 'Total[^%]%’
needs: [“Unit-Tests”]
expire_in: 30 days
when: always
- example/example/functions/example/target/surefire-reports/TEST-
- example/example/functions/example/target/site/jacoco/index.html
- example/example/functions/example/target/site/jacoco/jacoco.xml
- example/example/functions/example/target/site/jacoco/
coverage: ‘/Total.*?([0-9]{1,3})%/’
- docker-runner

I have attached the image of MR, how it currently shown

The Gitlab Version we are currently using is 15.1

We are experiencing the same issue on a NodeJS project.
Against the default branch it works, but against another branch it doesn’t.
Both coverage checks work and are reported on the jobs overview. But the diff is not working.
This result in the coverage check approval rule not working correctly as well.
Target branch job:

MR job