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

fix: add user_plan to apply_async options #631

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

joseph-sentry
Copy link
Contributor

we were previously calling get_user_plan_from_task_name twice, and this function makes a database call which slows things down.

This commit makes it so we call it once in apply_async and pass the value we get back through to the custom task router function.

Fixes: codecov/engineering-team#2258

we were previously calling get_user_plan_from_task_name twice, and
this function makes a database call which slows things down.

This commit makes it so we call it once in apply_async and pass the
value we get back through to the custom task router function.
@joseph-sentry joseph-sentry requested a review from a team August 16, 2024 15:49
@codecov-notifications
Copy link

codecov-notifications bot commented Aug 16, 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     #631   +/-   ##
=======================================
  Coverage   98.13%   98.13%           
=======================================
  Files         438      438           
  Lines       36565    36567    +2     
=======================================
+ Hits        35884    35886    +2     
  Misses        681      681           
Flag Coverage Δ
integration 98.13% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 98.13% <100.00%> (+<0.01%) ⬆️
unit 98.13% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 96.11% <100.00%> (+<0.01%) ⬆️
OutsideTasks 98.11% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
celery_task_router.py 100.00% <100.00%> (ø)
tasks/base.py 96.73% <ø> (ø)
tasks/tests/unit/test_base.py 98.36% <ø> (ø)

@codecov-qa
Copy link

codecov-qa bot commented Aug 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.13%. Comparing base (201323d) to head (7cb749a).
Report is 18 commits behind head on main.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #631   +/-   ##
=======================================
  Coverage   98.13%   98.13%           
=======================================
  Files         438      438           
  Lines       36565    36567    +2     
=======================================
+ Hits        35884    35886    +2     
  Misses        681      681           
Flag Coverage Δ
integration 98.13% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 98.13% <100.00%> (+<0.01%) ⬆️
unit 98.13% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 96.11% <100.00%> (+<0.01%) ⬆️
OutsideTasks 98.11% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
celery_task_router.py 100.00% <100.00%> (ø)
tasks/base.py 96.73% <ø> (ø)
tasks/tests/unit/test_base.py 98.36% <ø> (ø)

Copy link

codecov-public-qa bot commented Aug 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.13%. Comparing base (201323d) to head (7cb749a).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #631   +/-   ##
=======================================
  Coverage   98.13%   98.13%           
=======================================
  Files         438      438           
  Lines       36565    36567    +2     
=======================================
+ Hits        35884    35886    +2     
  Misses        681      681           
Flag Coverage Δ
integration 98.13% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 98.13% <100.00%> (+<0.01%) ⬆️
unit 98.13% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 96.11% <100.00%> (+<0.01%) ⬆️
OutsideTasks 98.11% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
celery_task_router.py 100.00% <100.00%> (ø)
tasks/base.py 96.73% <ø> (ø)
tasks/tests/unit/test_base.py 98.36% <ø> (ø)

Copy link

codecov bot commented Aug 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.16%. Comparing base (201323d) to head (7cb749a).
Report is 18 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     #631   +/-   ##
=======================================
  Coverage   98.15%   98.16%           
=======================================
  Files         473      473           
  Lines       37770    37772    +2     
=======================================
+ Hits        37075    37077    +2     
  Misses        695      695           
Flag Coverage Δ
integration 98.13% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 98.13% <100.00%> (+<0.01%) ⬆️
unit 98.13% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 96.15% <100.00%> (+<0.01%) ⬆️
OutsideTasks 98.11% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
celery_task_router.py 100.00% <100.00%> (ø)
tasks/base.py Critical 96.73% <ø> (ø)
tasks/tests/unit/test_base.py 98.37% <ø> (ø)
Related Entrypoints
run/app.tasks.bundle_analysis.BundleAnalysisProcessor
run/app.tasks.upload.Upload
run/app.tasks.notify.Notify
run/app.tasks.pulls.Sync
run/app.tasks.upload.UploadFinisher
run/app.tasks.upload.UploadProcessor
run/app.tasks.upload.PreProcessUpload
run/app.tasks.profiling.collection
run/app.tasks.test_results.TestResultsFinisherTask
run/app.tasks.sync_repos.SyncRepos
run/app.tasks.test_results.TestResultsProcessor
run/app.tasks.sync_teams.SyncTeams
run/app.tasks.timeseries.backfill_commits
run/app.tasks.timeseries.backfill_dataset
run/app.tasks.flush_repo.FlushRepo
run/app.tasks.upload.ManualUploadCompletionTrigger

@joseph-sentry joseph-sentry added this pull request to the merge queue Aug 27, 2024
Merged via the queue into main with commit 14faefc Aug 27, 2024
25 of 26 checks passed
@joseph-sentry joseph-sentry deleted the joseph/duplicate-get-user-plan branch August 27, 2024 15:08
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.

Remove duplicate _get_user_plan_from_task calls
2 participants