-
Notifications
You must be signed in to change notification settings - Fork 39
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
Send labels to Codecov only after collecting them #191
Conversation
We can still make this behavior optional by adding some flag to enable/disable it. |
c679bef
to
8c0eff1
Compare
Codecov Report
@@ Coverage Diff @@
## master #191 +/- ##
==========================================
+ Coverage 95.67% 95.76% +0.08%
==========================================
Files 70 70
Lines 2475 2500 +25
==========================================
+ Hits 2368 2394 +26
+ Misses 107 106 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
else: | ||
# Initial request with no labels failed | ||
# Retry it | ||
eid = _send_labelanalysis_request(payload, url, token_header) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see that we patch labels in the first trial, but we don't do that if the first one failed and we retried?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. If the first request failed, then Codecov haven't started the label analysis task yet. So instead of simply patching the labels we need to send that POST request again. Since we already have the labels at this point we can send them in the request, like it was done before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah got it!
8c0eff1
to
33921e2
Compare
33921e2
to
9324e83
Compare
These changes alter the way label analysis command works by making 2 requests to Codecov instead of 1. Why would we want to do this, if it's more time to make a second request? Because it takes (usually) longer to collect the labels than it takes to make a second request. Specially for bigger repos, collecting the labels can take dozens of seconds. By making the label collection parallel with the labels processing we can speed up the total ATS time. We still PATCH the labels in case the worker hasn't finished the calculations, and it will correctly refresh the request labels from the DB (based on [here](https://github.com/codecov/worker/pull/1210)). However even if it misses the requested labels we recalculate the `absent_labels`, if needed (`_potentially_calculate_absent_labels`). So we still guarantee the exact same response everytime. Potentially faster. PS.: The file `test_instantiation.py` changes because of the linter
9324e83
to
6b548fe
Compare
These changes alter the way label analysis command works by making 2 requests to Codecov instead of 1.
Why would we want to do this, if it's more time to make a second request?
Because it takes (usually) longer to collect the labels than it takes to make a second request.
Specially for bigger repos, collecting the labels can take dozens of seconds.
By making the label collection parallel with the labels processing we can speed up the total ATS time.
We still PATCH the labels in case the worker hasn't finished the calculations, and it will
correctly refresh the request labels from the DB (based on here).
However even if it misses the requested labels we recalculate the
absent_labels
, if needed (_potentially_calculate_absent_labels
).So we still guarantee the exact same response everytime. Potentially faster.
PS.: The file
test_instantiation.py
changes because of the linter