codecov / engineering-team

This is a general repo to use with GH Projects
1 stars 1 forks source link

[Regression] Data in compare_commitcomparison table is stale, leading to misleading patch coverage info on the UI #2387

Closed rohan-at-sentry closed 1 month ago

rohan-at-sentry commented 2 months ago

Describe the bug Users (mostly those that upload multiple coverage reports per commit) are reporting seeing stale patch coverage on the UI.

To Reproduce See PR here --> https://github.com/vlad-ko/laravel-stripe-app-gh/pull/58

@vlad-ko can add more color - we saw that the patch coverage was being displayed correctly by the annotation / browser plugin (anything using the public API to pull info from our DB).

Looking at the compare_commitcomparison table in DB for the commit ID shows data that is stale (null in db) from the real value (100%).

Expected behavior Data consistent with reality.

rohan-at-sentry commented 2 months ago

@vlad-ko @drazisil-codecov can you please add more examples here.

drazisil-codecov commented 2 months ago

https://app.codecov.io/gh/rustymotors/server/commit/98fd4ba35a0da187cae71ea23295ba5413f1f039

https://github.com/rustymotors/server/commit/98fd4ba35a0da187cae71ea23295ba5413f1f039

^^ This SHA, as an example seems to be in disagreement about ptch coverage.

==

https://app.codecov.io/gh/rustymotors/server/commit/7cad266e8230cd7a719298ed0763b778a4577ce1

https://github.com/rustymotors/server/commit/7cad266e8230cd7a719298ed0763b778a4577ce1

^^ This SHA was almost 100% only tests, and while the UI seems to realize this (despite two errored reports (All uploaded reports are identical, except for flags)), the status check does not agree.

==

https://app.codecov.io/gh/rustymotors/server/pull/2037/commits

Apparently , 99% of the commits for this PR have patch coverage, which is incorrect. Might be unrelated to the rest of the examples though, unclear.

jerrodcodecov commented 2 months ago

Another example here: If we have the head coverage, then by definition we should have a patch coverage as well

Image

Relevant commit SHA:

4213aec7afab787d42252ff61e86674d43e7baf

giovanni-guidini commented 2 months ago

Random notes

giovanni-guidini commented 2 months ago

Small update

@JerrySentry and I have looked quite a bit into this at this point. We did agree that the Comparison didn't needed a BASE report to have patch coverage, and that has been fixed. Now we should get patch info even if the BASE REPORT is missing (base commit missing doesn't get patch coverage because there's no git diff to apply)

Some examples we checked are explained by:

The original example fixed itself after a while. The ComputeComparison task ran twice. We believe the 1st run indicated no coverage because that upload didn't include any info in the diff (so it looks like coverage was not affected by patch). Many (6) hours later the task ran again, and this time the patch coverage was updated. We believe this has to do with a known issue in which UploadProcessor tasks "disappear" and "appear" again after 6h.

There was another instance in which the PR view displayed patch coverage, but the commit view didn't. We noticed there were 2 comparisons, and the commit one was correctly saying the coverage was not affected by the patch, because the uploads never included the files in the patch.

We will review more examples in the coming days, but nothing seems terribly broken at this point (other than what was mentioned before).