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

chore: extend UploadFlow with new ending #418

Merged
merged 2 commits into from May 3, 2024

Conversation

giovanni-guidini
Copy link
Contributor

It was a suspition that we might be overcounting beginnings in the UploadFlow.
I believe one of the exit paths was not being covered in the Upload task.

These changes add a new ending to the UploadFlow. Namely, for the scenario where
an UploadTask finishes without enqueuing other tasks because there are no reports
waiting to be processed.

Also updating the getutcnow function that is deprecated and fixing some typos.

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.

Copy link

sentry-io bot commented Apr 29, 2024

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: tasks/upload.py

Function Unhandled Issue
run_impl_within_lock TypeError: cannot unpack non-iterable NoneType object app.tasks.upload.U...
Event Count: 85

Did you find this useful? React with a 👍 or 👎

@codecov-qa
Copy link

codecov-qa bot commented Apr 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.40%. Comparing base (0790e36) to head (d12db27).
Report is 9 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #418      +/-   ##
==========================================
- Coverage   97.44%   97.40%   -0.05%     
==========================================
  Files         395      398       +3     
  Lines       33426    33583     +157     
==========================================
+ Hits        32572    32711     +139     
- Misses        854      872      +18     
Flag Coverage Δ
integration 97.40% <100.00%> (-0.05%) ⬇️
latest-uploader-overall 97.40% <100.00%> (-0.05%) ⬇️
unit 97.40% <100.00%> (-0.05%) ⬇️

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

Components Coverage Δ
NonTestCode 94.72% <100.00%> (-0.03%) ⬇️
OutsideTasks 97.48% <100.00%> (-0.07%) ⬇️
Files Coverage Δ
helpers/checkpoint_logger/flows.py 100.00% <100.00%> (ø)
services/lock_manager.py 91.48% <100.00%> (ø)
tasks/tests/unit/test_save_commit_measurements.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_upload_task.py 99.49% <100.00%> (+<0.01%) ⬆️
tasks/upload.py 91.17% <100.00%> (+0.10%) ⬆️

... and 25 files with indirect coverage changes

Copy link

codecov bot commented Apr 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.46%. Comparing base (0790e36) to head (d12db27).
Report is 9 commits behind head on main.

Changes have been made to critical files, which contain lines commonly executed in production. Learn more

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #418      +/-   ##
==========================================
- Coverage   97.47%   97.46%   -0.01%     
==========================================
  Files         426      429       +3     
  Lines       34117    35283    +1166     
==========================================
+ Hits        33254    34388    +1134     
- Misses        863      895      +32     
Flag Coverage Δ
integration 97.40% <100.00%> (-0.05%) ⬇️
latest-uploader-overall 97.40% <100.00%> (-0.05%) ⬇️
unit 97.40% <100.00%> (-0.05%) ⬇️

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

Components Coverage Δ
NonTestCode 94.79% <100.00%> (+0.02%) ⬆️
OutsideTasks 97.48% <100.00%> (-0.07%) ⬇️
Files Coverage Δ
helpers/checkpoint_logger/flows.py 100.00% <100.00%> (ø)
services/lock_manager.py 91.48% <100.00%> (ø)
tasks/tests/unit/test_save_commit_measurements.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_upload_task.py 99.49% <100.00%> (+<0.01%) ⬆️
tasks/upload.py Critical 91.22% <100.00%> (+0.10%) ⬆️

... and 25 files with indirect coverage changes

Related Entrypoints
run/app.tasks.bundle_analysis.BundleAnalysisProcessor
run/app.tasks.notify.Notify

Copy link

codecov-public-qa bot commented Apr 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.40%. Comparing base (0790e36) to head (d12db27).
Report is 9 commits behind head on main.

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #418      +/-   ##
==========================================
- Coverage   97.44%   97.40%   -0.05%     
==========================================
  Files         395      398       +3     
  Lines       33426    33583     +157     
==========================================
+ Hits        32572    32711     +139     
- Misses        854      872      +18     
Flag Coverage Δ
integration 97.40% <100.00%> (-0.05%) ⬇️
latest-uploader-overall 97.40% <100.00%> (-0.05%) ⬇️
unit 97.40% <100.00%> (-0.05%) ⬇️

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

Components Coverage Δ
NonTestCode 94.72% <100.00%> (-0.03%) ⬇️
OutsideTasks 97.48% <100.00%> (-0.07%) ⬇️
Files Coverage Δ
helpers/checkpoint_logger/flows.py 100.00% <100.00%> (ø)
services/lock_manager.py 91.48% <100.00%> (ø)
tasks/tests/unit/test_save_commit_measurements.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_upload_task.py 99.49% <100.00%> (+<0.01%) ⬆️
tasks/upload.py 91.17% <100.00%> (+0.10%) ⬆️

... and 25 files with indirect coverage changes

It was a suspition that we might be overcounting beginnings in the UploadFlow.
I believe one of the exit paths was not being covered in the `Upload` task.

These changes add a new ending to the UploadFlow. Namely, for the scenario where
an UploadTask finishes without enqueuing other tasks because there are no reports
waiting to be processed.

Also updating the `getutcnow` function that is deprecated and fixing some typos.

Changes to LockManager are probably from running 3.12 locally (new error appeared),
same thing for the test in `test_save_commit_measurements`
Copy link
Contributor

@michelletran-codecov michelletran-codecov left a comment

Choose a reason for hiding this comment

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

Just a small nit.

tasks/upload.py Outdated
Comment on lines 672 to 676
is_final=(
True
if i == ceil(len(argument_list) / chunk_size) - 1
else False
),
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: simplification

Suggested change
is_final=(
True
if i == ceil(len(argument_list) / chunk_size) - 1
else False
),
is_final=i == ceil(len(argument_list) / chunk_size) - 1

or for readability, set is_final outside of the dict as a variable.

improve readability of lint change.
following suggestion of @michelletran-codecov
@codecov-notifications
Copy link

codecov-notifications bot commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #418      +/-   ##
==========================================
- Coverage   97.44%   97.40%   -0.05%     
==========================================
  Files         395      398       +3     
  Lines       33422    33583     +161     
==========================================
+ Hits        32568    32711     +143     
- Misses        854      872      +18     
Flag Coverage Δ
integration 97.40% <100.00%> (-0.05%) ⬇️
latest-uploader-overall 97.40% <100.00%> (-0.05%) ⬇️
unit 97.40% <100.00%> (-0.05%) ⬇️

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

Components Coverage Δ
NonTestCode 94.72% <100.00%> (-0.03%) ⬇️
OutsideTasks 97.48% <95.00%> (-0.07%) ⬇️
Files Coverage Δ
helpers/checkpoint_logger/flows.py 100.00% <100.00%> (ø)
services/lock_manager.py 91.48% <100.00%> (ø)
tasks/tests/unit/test_save_commit_measurements.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_upload_task.py 99.49% <100.00%> (+<0.01%) ⬆️
tasks/upload.py 91.17% <100.00%> (+0.10%) ⬆️

... and 25 files with indirect coverage changes

@giovanni-guidini giovanni-guidini added this pull request to the merge queue May 3, 2024
Merged via the queue into main with commit 9635ccf May 3, 2024
18 of 29 checks passed
@giovanni-guidini giovanni-guidini deleted the gio/extend-upload-flow branch May 3, 2024 15:53
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.

None yet

3 participants