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

feat: Add bundle analysis processor task #215

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

scott-codecov
Copy link
Contributor

Similar to the existing upload processor task but for processing bundle analysis uploads.

@codecov-qa
Copy link

codecov-qa bot commented Dec 14, 2023

Codecov Report

Merging #215 (705c17f) into main (7232534) will increase coverage by 0.00%.
The diff coverage is 97.22%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             main     #215    +/-   ##
========================================
  Coverage   98.24%   98.24%            
========================================
  Files         362      366     +4     
  Lines       29168    29474   +306     
========================================
+ Hits        28655    28956   +301     
- Misses        513      518     +5     
Flag Coverage Δ
integration 98.24% <97.22%> (+<0.01%) ⬆️
latest-uploader-overall 98.24% <97.22%> (+<0.01%) ⬆️
unit 98.24% <97.22%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 96.48% <95.77%> (+0.01%) ⬆️
OutsideTasks 97.95% <95.07%> (-0.03%) ⬇️
Files Coverage Δ
database/enums.py 100.00% <100.00%> (ø)
services/bundle_analysis.py 100.00% <100.00%> (ø)
tasks/__init__.py 100.00% <100.00%> (ø)
.../tests/unit/test_bundle_analysis_processor_task.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_upload_task.py 99.47% <100.00%> (+0.02%) ⬆️
database/models/core.py 97.06% <83.33%> (-0.31%) ⬇️
services/report/__init__.py 97.70% <94.44%> (-0.24%) ⬇️
tasks/bundle_analysis_processor.py 98.24% <98.24%> (ø)
tasks/upload.py 98.49% <92.30%> (+1.23%) ⬆️
services/lock_manager.py 88.88% <88.88%> (ø)

Copy link

codecov-public-qa bot commented Dec 14, 2023

Codecov Report

Merging #215 (705c17f) into main (7232534) will increase coverage by 0.00%.
The diff coverage is 97.22%.

Impacted file tree graph

@@           Coverage Diff            @@
##             main     #215    +/-   ##
========================================
  Coverage   98.24%   98.24%            
========================================
  Files         362      366     +4     
  Lines       29168    29474   +306     
========================================
+ Hits        28655    28956   +301     
- Misses        513      518     +5     
Flag Coverage Δ
integration 98.24% <97.22%> (+<0.01%) ⬆️
latest-uploader-overall 98.24% <97.22%> (+<0.01%) ⬆️
unit 98.24% <97.22%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 96.48% <95.77%> (+0.01%) ⬆️
OutsideTasks 97.95% <95.07%> (-0.03%) ⬇️
Files Coverage Δ
database/enums.py 100.00% <100.00%> (ø)
services/bundle_analysis.py 100.00% <100.00%> (ø)
tasks/__init__.py 100.00% <100.00%> (ø)
.../tests/unit/test_bundle_analysis_processor_task.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_upload_task.py 99.47% <100.00%> (+0.02%) ⬆️
database/models/core.py 97.06% <83.33%> (-0.31%) ⬇️
services/report/__init__.py 97.70% <94.44%> (-0.24%) ⬇️
tasks/bundle_analysis_processor.py 98.24% <98.24%> (ø)
tasks/upload.py 98.49% <92.30%> (+1.23%) ⬆️
services/lock_manager.py 88.88% <88.88%> (ø)

Copy link

codecov bot commented Dec 14, 2023

Codecov Report

Merging #215 (13059b0) into main (9639dc1) will increase coverage by 0.00%.
Report is 1 commits behind head on main.
The diff coverage is 97.23%.

❗ Current head 13059b0 differs from pull request most recent head 705c17f. Consider uploading reports for the commit 705c17f to get more accurate results

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

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             main     #215    +/-   ##
========================================
  Coverage   98.21%   98.21%            
========================================
  Files         393      397     +4     
  Lines       29868    30175   +307     
========================================
+ Hits        29334    29636   +302     
- Misses        534      539     +5     
Flag Coverage Δ
integration 98.24% <97.22%> (+<0.01%) ⬆️
latest-uploader-overall 98.24% <97.22%> (+<0.01%) ⬆️
onlysomelabels 98.21% <97.23%> (+<0.01%) ⬆️
unit 98.24% <97.22%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 96.38% <95.79%> (+0.01%) ⬆️
OutsideTasks 97.95% <95.07%> (-0.03%) ⬇️
Files Coverage Δ
database/enums.py 100.00% <100.00%> (ø)
services/bundle_analysis.py 100.00% <100.00%> (ø)
tasks/__init__.py 100.00% <100.00%> (ø)
.../tests/unit/test_bundle_analysis_processor_task.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_upload_task.py 99.47% <100.00%> (+0.02%) ⬆️
database/models/core.py 97.06% <83.33%> (-0.31%) ⬇️
services/report/__init__.py Critical 97.70% <94.73%> (-0.23%) ⬇️
tasks/bundle_analysis_processor.py 98.24% <98.24%> (ø)
tasks/upload.py Critical 98.50% <92.30%> (+1.22%) ⬆️
services/lock_manager.py 88.88% <88.88%> (ø)

... and 2 files with indirect coverage changes

Related Entrypoints
run/app.tasks.upload.Upload

bundle_report = BundleAnalysisReport()

# download raw upload data to local tempfile
_, local_path = tempfile.mkstemp()
Copy link
Contributor

Choose a reason for hiding this comment

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

Who's responsible for cleaning up this local_path?

I see that the BuindleAnalysisReport does clean up its own report file (the sqlite one). But I don't think that's the same as local_path...
In any case it was not clear, so maybe add a comment saying who does the cleanup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh good point. I can delete it in this function right after calling ingest. I'll do it in a finally block so we cleanup even on an unexpected exception. And come to think of it - I'm not actually calling the bundle_report.cleanup() method either. I'll do that right before the task ends.

I think these will get cleaned up by the OS (since they're in /tmp) but probably a good practice to do it ourselves as well.

self.countdown = countdown


class LockManager:
Copy link
Contributor

Choose a reason for hiding this comment

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

Damn that's cool... nice

@codecov-staging
Copy link

codecov-staging bot commented Dec 15, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Impacted file tree graph

@@           Coverage Diff            @@
##             main     #215    +/-   ##
========================================
  Coverage   98.24%   98.24%            
========================================
  Files         362      366     +4     
  Lines       29168    29474   +306     
========================================
+ Hits        28655    28956   +301     
- Misses        513      518     +5     
Flag Coverage Δ
integration 98.24% <97.22%> (+<0.01%) ⬆️
latest-uploader-overall 98.24% <97.22%> (+<0.01%) ⬆️
unit 98.24% <97.22%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 96.48% <95.77%> (+0.01%) ⬆️
OutsideTasks 97.95% <95.07%> (-0.03%) ⬇️
Files Coverage Δ
database/enums.py 100.00% <100.00%> (ø)
services/bundle_analysis.py 100.00% <100.00%> (ø)
tasks/__init__.py 100.00% <100.00%> (ø)
.../tests/unit/test_bundle_analysis_processor_task.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_upload_task.py 99.47% <100.00%> (+0.02%) ⬆️
database/models/core.py 97.06% <83.33%> (-0.31%) ⬇️
services/report/__init__.py 97.70% <94.44%> (-0.24%) ⬇️
tasks/bundle_analysis_processor.py 98.24% <98.24%> (ø)
tasks/upload.py 98.49% <92.30%> (+1.23%) ⬆️
services/lock_manager.py 88.88% <88.88%> (ø)

@scott-codecov scott-codecov force-pushed the scott/bundle-analysis-processor branch 2 times, most recently from 6630b13 to a3f443b Compare December 18, 2023 14:26
@scott-codecov scott-codecov merged commit c0ba311 into main Dec 18, 2023
17 of 24 checks passed
@scott-codecov scott-codecov deleted the scott/bundle-analysis-processor branch December 18, 2023 14:37
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