Codecov doesn't synchronize with github repo

Description

I have an open-source repo connected to codecov.
I have noticed that a branch that I deleted in the repo still appears in codecov.
As far as I understand codecov should sync with the repo via a webhook that codecov created.
I have opened the log of deliveries in the webhook, all deliveries fail with HTTP error 403
and the following body:

{“detail”:“You do not have permission to perform this action.”}

CI/CD URL

Codecov Output

The uploader succeeds.
The webhook delivery fails with the following:

Allow: POST, DELETE, OPTIONS
Alt-Svc: clear
Content-Length: 63
Content-Type: application/json
Date: Fri, 17 Dec 2021 15:53:25 GMT
Referrer-Policy: same-origin
Server: envoy
Vary: Accept, Origin, Cookie
Via: 1.1 google
X-Content-Type-Options: nosniff
X-Envoy-Upstream-Service-Time: 12
X-Frame-Options: DENY

{"detail":"You do not have permission to perform this action."}

Expected Results

codecov should synchronize with the Github repo, and remove the branch deleted in the repo.

Actual Results

The deleted branch remains in the codecov branches list.

@r-bk can you try installing the GitHub app integration?

@tom Thanks for the link.
Installed it just now. However, it doesn’t seem to make any difference.
Webhook deliveries still fail with the same 403 error and body.

@r-bk are you able to delete the webhooks from the GitHub side? Codecov will automatically try to re-connect them.

@tom Deleted the webhook in github. codecode failed to re-create is with an error code saying it cannot find the webhook number.
So, I deleted the repo completely in codecov, and then recreated it.
This time I have pushed the “Create Webhook” button (in codecov repo “Settings”) before submitting the first coverage report from github.
Now it works … webhooks receive HTTP 200 status.

@r-bk yikes, I’m sorry that this was such a hassle. I’m not sure why we were in a weird state, but it sounds like it’s fixed for you now?

@tom No, codecov still doesn’t synchronize with the github repo.
I have crated a branch in github and pushed to codecov. The branch was successfully created in codecov.
However, it has been almost 2 days that I have deleted the branch in github, and it still appears in codecov. I have checked the webkooks history, and I see the webhook delivery that was sent to codecov following the deletion of the branch. The delivery was successfully accepted with 200 code.

Is my expectation correct? Should codecov delete the branch after it is removed in github?

Hi @r-bk, Codecov doesn’t actually delete the branch from our side if it’s deleted in GitHub. The reason is that if coverage is uploaded for a commit on that branch, we will keep the history in case it is needed as a diff for future commits.