Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't require BASE report for patch in comparison #650

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

giovanni-guidini
Copy link
Contributor

This changes is related to codecov/engineering-team#2387.
Currently we require that the BASE report exists to compute the comparison, which includes patch data.
In fact we only need the HEAD report and a base commit, to have a diff from the git provider.
These changes calculate the patch coverage with those assumptions, thus we no longer need a BASE report to have patch coverage.

I also removed some timers in favor of sentry tracing

This changes is related to codecov/engineering-team#2387.
Currently we require that the BASE report exists to compute the comparison, which includes patch data.
In fact we only need the HEAD report and a base commit, to have a diff from the git provider.
These changes calculate the patch coverage with those assumptions, thus we no longer need a BASE report to have patch coverage.

I also removed some timers in favor of sentry tracing
@giovanni-guidini giovanni-guidini requested a review from a team August 28, 2024 10:02
@codecov-notifications
Copy link

codecov-notifications bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 98.33333% with 1 line in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files Patch % Lines
tasks/compute_comparison.py 97.43% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #650      +/-   ##
==========================================
- Coverage   98.12%   98.11%   -0.02%     
==========================================
  Files         437      437              
  Lines       36751    36727      -24     
==========================================
- Hits        36063    36034      -29     
- Misses        688      693       +5     
Flag Coverage Δ
integration 98.11% <98.33%> (-0.02%) ⬇️
latest-uploader-overall 98.11% <98.33%> (-0.02%) ⬇️
unit 98.11% <98.33%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 96.03% <97.82%> (-0.04%) ⬇️
OutsideTasks 98.09% <100.00%> (-0.03%) ⬇️
Files Coverage Δ
services/comparison/__init__.py 97.40% <100.00%> (+0.06%) ⬆️
tasks/tests/unit/test_compute_comparison.py 100.00% <100.00%> (ø)
tasks/compute_comparison.py 99.37% <97.43%> (-0.63%) ⬇️

... and 9 files with indirect coverage changes

@codecov-qa
Copy link

codecov-qa bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 98.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 98.11%. Comparing base (14faefc) to head (4c2518c).
Report is 6 commits behind head on main.

✅ All tests successful. No failed tests found.

Files Patch % Lines
tasks/compute_comparison.py 97.43% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #650      +/-   ##
==========================================
- Coverage   98.12%   98.11%   -0.02%     
==========================================
  Files         437      437              
  Lines       36751    36727      -24     
==========================================
- Hits        36063    36034      -29     
- Misses        688      693       +5     
Flag Coverage Δ
integration 98.11% <98.33%> (-0.02%) ⬇️
latest-uploader-overall 98.11% <98.33%> (-0.02%) ⬇️
unit 98.11% <98.33%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 96.03% <97.82%> (-0.04%) ⬇️
OutsideTasks 98.09% <100.00%> (-0.03%) ⬇️
Files Coverage Δ
services/comparison/__init__.py 97.40% <100.00%> (+0.06%) ⬆️
tasks/tests/unit/test_compute_comparison.py 100.00% <100.00%> (ø)
tasks/compute_comparison.py 99.37% <97.43%> (-0.63%) ⬇️

... and 9 files with indirect coverage changes

Copy link

codecov bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 98.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 98.17%. Comparing base (14faefc) to head (4c2518c).
Report is 6 commits behind head on main.

✅ All tests successful. No failed tests found.

Files Patch % Lines
tasks/compute_comparison.py 97.43% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #650      +/-   ##
==========================================
+ Coverage   98.16%   98.17%   +0.01%     
==========================================
  Files         476      476              
  Lines       38072    38639     +567     
==========================================
+ Hits        37374    37935     +561     
- Misses        698      704       +6     
Flag Coverage Δ
integration 98.11% <98.33%> (-0.02%) ⬇️
latest-uploader-overall 98.11% <98.33%> (-0.02%) ⬇️
unit 98.11% <98.33%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 96.14% <97.82%> (-0.02%) ⬇️
OutsideTasks 98.09% <100.00%> (-0.03%) ⬇️
Files Coverage Δ
services/comparison/__init__.py 97.41% <100.00%> (+0.06%) ⬆️
tasks/tests/unit/test_compute_comparison.py 100.00% <100.00%> (ø)
tasks/compute_comparison.py 99.37% <97.43%> (-0.63%) ⬇️

... and 9 files with indirect coverage changes

Related Entrypoints
run/app.tasks.compute_comparison.ComputeComparison

Copy link

codecov-public-qa bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 98.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 98.11%. Comparing base (14faefc) to head (4c2518c).
Report is 5 commits behind head on main.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #650      +/-   ##
==========================================
- Coverage   98.12%   98.11%   -0.02%     
==========================================
  Files         437      437              
  Lines       36751    36727      -24     
==========================================
- Hits        36063    36034      -29     
- Misses        688      693       +5     
Flag Coverage Δ
integration 98.11% <98.33%> (-0.02%) ⬇️
latest-uploader-overall 98.11% <98.33%> (-0.02%) ⬇️
unit 98.11% <98.33%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 96.03% <97.82%> (-0.04%) ⬇️
OutsideTasks 98.09% <100.00%> (-0.03%) ⬇️
Files Coverage Δ
services/comparison/__init__.py 97.40% <100.00%> (+0.06%) ⬆️
tasks/tests/unit/test_compute_comparison.py 100.00% <100.00%> (ø)
tasks/compute_comparison.py 99.37% <97.43%> (-0.63%) ⬇️

... and 9 files with indirect coverage changes

Comment on lines +99 to +103
calculated_patch_totals = impacted_files.get("changes_summary").get(
"patch_totals"
)
if calculated_patch_totals != comparison.patch_totals:
log.warning(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

under which circumstances would this ever happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, to be honest. Hopefully never.

But as I'm switching from that calculation to a copy of the one we use for the notifications I thought it would be prudent to add this just in case.

I also thought it was a good idea to always keep the result that come from the same place

@giovanni-guidini giovanni-guidini added this pull request to the merge queue Aug 28, 2024
Merged via the queue into main with commit 2faadcf Aug 28, 2024
17 of 26 checks passed
@giovanni-guidini giovanni-guidini deleted the gio/get-patch-without-base-report branch August 28, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants