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

Move loading and merging intermediate Reports to its own file #767

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

Swatinem
Copy link
Contributor

@Swatinem Swatinem commented Oct 8, 2024

This should make the high level steps of parallel processing a bit more obvious and easier to grasp.

@Swatinem Swatinem requested a review from a team October 8, 2024 08:35
@Swatinem Swatinem self-assigned this Oct 8, 2024
@codecov-staging
Copy link

codecov-staging bot commented Oct 8, 2024

Codecov Report

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

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
services/processing/merging.py 93.75% 4 Missing ⚠️

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #767   +/-   ##
=======================================
  Coverage   98.03%   98.03%           
=======================================
  Files         440      442    +2     
  Lines       36566    36613   +47     
=======================================
+ Hits        35846    35895   +49     
+ Misses        720      718    -2     
Flag Coverage Δ
integration 98.03% <97.27%> (+<0.01%) ⬆️
unit 98.03% <97.27%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 95.93% <97.18%> (+0.02%) ⬆️
OutsideTasks 98.00% <96.42%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
services/processing/loading.py 100.00% <100.00%> (ø)
services/processing/state.py 97.50% <100.00%> (ø)
services/tests/test_processing_state.py 100.00% <100.00%> (ø)
tasks/upload_finisher.py 97.66% <100.00%> (+1.69%) ⬆️
services/processing/merging.py 93.75% <93.75%> (ø)

@codecov-qa
Copy link

codecov-qa bot commented Oct 8, 2024

Codecov Report

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

Project coverage is 98.03%. Comparing base (2973343) to head (5774097).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
services/processing/merging.py 93.75% 4 Missing ⚠️

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #767   +/-   ##
=======================================
  Coverage   98.03%   98.03%           
=======================================
  Files         440      442    +2     
  Lines       36566    36613   +47     
=======================================
+ Hits        35846    35895   +49     
+ Misses        720      718    -2     
Flag Coverage Δ
integration 98.03% <97.27%> (+<0.01%) ⬆️
unit 98.03% <97.27%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 95.93% <97.18%> (+0.02%) ⬆️
OutsideTasks 98.00% <96.42%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
services/processing/loading.py 100.00% <100.00%> (ø)
services/processing/state.py 97.50% <100.00%> (ø)
services/tests/test_processing_state.py 100.00% <100.00%> (ø)
tasks/upload_finisher.py 97.66% <100.00%> (+1.69%) ⬆️
services/processing/merging.py 93.75% <93.75%> (ø)

Copy link

codecov-public-qa bot commented Oct 8, 2024

Codecov Report

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

Project coverage is 98.03%. Comparing base (2973343) to head (5774097).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #767   +/-   ##
=======================================
  Coverage   98.03%   98.03%           
=======================================
  Files         440      442    +2     
  Lines       36566    36613   +47     
=======================================
+ Hits        35846    35895   +49     
+ Misses        720      718    -2     
Flag Coverage Δ
integration 98.03% <97.27%> (+<0.01%) ⬆️
unit 98.03% <97.27%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 95.93% <97.18%> (+0.02%) ⬆️
OutsideTasks 98.00% <96.42%> (-0.01%) ⬇️
Files Coverage Δ
services/processing/loading.py 100.00% <100.00%> (ø)
services/processing/state.py 97.50% <100.00%> (ø)
services/tests/test_processing_state.py 100.00% <100.00%> (ø)
tasks/upload_finisher.py 97.66% <100.00%> (+1.69%) ⬆️
services/processing/merging.py 93.75% <93.75%> (ø)

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

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

Project coverage is 98.03%. Comparing base (2973343) to head (5774097).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
services/processing/merging.py 93.75% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #767   +/-   ##
=======================================
  Coverage   98.03%   98.03%           
=======================================
  Files         440      442    +2     
  Lines       36566    36613   +47     
=======================================
+ Hits        35846    35895   +49     
+ Misses        720      718    -2     
Flag Coverage Δ
integration 98.03% <97.27%> (+<0.01%) ⬆️
unit 98.03% <97.27%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 95.93% <97.18%> (+0.02%) ⬆️
OutsideTasks 98.00% <96.42%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
services/processing/loading.py 100.00% <100.00%> (ø)
services/processing/state.py 97.50% <100.00%> (ø)
services/tests/test_processing_state.py 100.00% <100.00%> (ø)
tasks/upload_finisher.py 97.66% <100.00%> (+1.69%) ⬆️
services/processing/merging.py 93.75% <93.75%> (ø)

@Swatinem Swatinem marked this pull request as ready for review October 14, 2024 10:16
This should make the high level steps of parallel processing a bit more obvious and easier to grasp.
services/processing/loading.py Show resolved Hide resolved
upload_ids: list[int],
) -> list[IntermediateReport]:
@sentry_sdk.trace
def load_report(upload_id: int) -> IntermediateReport:
Copy link
Contributor

Choose a reason for hiding this comment

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

[very nit] I wonder if it would make sense for this to be a method of IntermediateReport class. Maybe a classmethod like load.

I only say this to avoid having 1 of 2 functions inside another function. But that is a personal preference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its a good idea in general, though that would require to pass the archive_service and commitsha to that method, as the current fn captures that from the parent scope.

upload.state = "processed"
upload.order_number = session_id

if upload:
Copy link
Contributor

Choose a reason for hiding this comment

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

is this supposed to be inside the for? It seems to only affect the last upload.
From it being a loop it looks like there might be more than 1 upload

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that is indeed confusing, I admit. The Upload is really only used to get the DB session, as well as joining the Upload.report. It is pretty much querying all the sibling uploads for the same report. so any Upload (for the same report, which is true here) will do.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I see. Thank for the clarification

Copy link
Contributor

@giovanni-guidini giovanni-guidini left a comment

Choose a reason for hiding this comment

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

LGTM

upload.state = "processed"
upload.order_number = session_id

if upload:
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I see. Thank for the clarification

@Swatinem Swatinem added this pull request to the merge queue Oct 15, 2024
Merged via the queue into main with commit e373a03 Oct 15, 2024
20 of 27 checks passed
@Swatinem Swatinem deleted the swatinem/merging branch October 15, 2024 08:35
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