codecov / codecov-browser-extension

A browser extension for Codecov. Works for Chrome and Firefox
Apache License 2.0
36 stars 11 forks source link

Cannot view Coverage on Private Repos #44

Closed eliatcodecov closed 1 year ago

eliatcodecov commented 1 year ago

Browser: Chrome Extension Version: v0.3.3

Integration seems to be working well on public repos. See: https://github.com/codecov/uploader/blob/main/src/index.ts

But I don't have the same experience with private repos.

Here's the extension:

Screenshot 2023-08-02 at 7 53 54 AM

compared to the same file in the codecov ui:

Screenshot 2023-08-02 at 7 54 38 AM

I've confirmed even after logging into Codecov that viewing coverage on private repos in the extension does not seem to work.

jacquesg commented 1 year ago

+1 Experiencing the same.

eliatcodecov commented 1 year ago

@anukul and I dug into this issue today, here is what we believe is the root cause, and a proposed fix.

The GitHub API returns the head commit of the main branch as part of the refInfo in the API response. This commit SHA is sent to Codecov. If that SHA does not have coverage on Codecov for some reason (an error, perhaps it's still processing, etc), coverage will not display in the browser.

For these cases, we will render an error message to the effect of "Coverage for commit is not available, you can view this most recent coverage for this branch at "

Where provides a link to the viewed file at that particular commit.

There may be other error cases that lead to coverage not being rendered by the extension, but this is one we were able to easily identify and will be providing a fix for it.