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

Adjust call used in comparison file to avoid provider api call #1176

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

adrian-codecov
Copy link
Contributor

Purpose/Motivation

This PR intends to improve loading times in the Pull detail page by adjusting the logic in the has_different_number_of_head_and_base_reports resolver.

Links to relevant tickets

This is one of the many resolvers I'd like to tackle with the investigation done here.

What does this PR do?

This resolver calls the comparison.head_report, which always calls the apply_diff function, which ends up calling the provider. In some cases, this call is necessary, but for this particular resolver it is not as the logic inside the resolver compares number of sessions, not the contents of the sessions. Therefore, we're going to shave some time by adding a property that doesn't talk to the provider.

I left note in that implementation, there's an opportunity to improve the algorithm altogether and use the DB only instead of GCS.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@adrian-codecov adrian-codecov requested a review from a team as a code owner February 26, 2025 19:57
@codecov-notifications
Copy link

Codecov Report

Attention: Patch coverage is 71.42857% with 4 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
services/comparison.py 71.42% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 71.42857% with 4 lines in your changes missing coverage. Please review.

Project coverage is 95.88%. Comparing base (f4f7dc8) to head (f49d5d4).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
services/comparison.py 71.42% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1176      +/-   ##
==========================================
- Coverage   95.92%   95.88%   -0.04%     
==========================================
  Files         492      492              
  Lines       16876    16879       +3     
==========================================
- Hits        16188    16185       -3     
- Misses        688      694       +6     
Flag Coverage Δ
unit 95.88% <71.42%> (-0.04%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -252,10 +252,6 @@ def resolve_has_different_number_of_head_and_base_reports(
if "comparison" not in info.context:
return False
comparison: Comparison = info.context["comparison"]
try:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didnt specify but this is implicitly moved in the try/except inside the resolver logic

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