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

dev: Add Ruff Perf rules to worker #552

Merged
merged 4 commits into from
Jul 10, 2024
Merged

dev: Add Ruff Perf rules to worker #552

merged 4 commits into from
Jul 10, 2024

Conversation

ajay-sentry
Copy link
Contributor

Purpose/Motivation

Part of the lint enhancement epic, this PR aims to add the Perflint PERF rules, with the fixes majorly being around creating list comprehensions or using .keys() or .values() instead of .items() for dictionaries

These can be found here:

Links to relevant tickets

Closes codecov/engineering-team#2050

What does this PR do?

This PR adds the rules listed above and fixes any errors that stemmed from them.

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.

@codecov-notifications
Copy link

codecov-notifications bot commented Jul 9, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #552   +/-   ##
=======================================
  Coverage   97.51%   97.51%           
=======================================
  Files         420      420           
  Lines       35411    35389   -22     
=======================================
- Hits        34530    34509   -21     
+ Misses        881      880    -1     
Flag Coverage Δ
integration 97.51% <93.75%> (+<0.01%) ⬆️
latest-uploader-overall 97.51% <93.75%> (+<0.01%) ⬆️
unit 97.51% <93.75%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 94.58% <91.66%> (-0.01%) ⬇️
OutsideTasks 97.74% <90.90%> (-0.01%) ⬇️
Files Coverage Δ
services/flake_detection.py 95.90% <100.00%> (ø)
services/notification/__init__.py 100.00% <100.00%> (ø)
.../notification/notifiers/mixins/message/__init__.py 100.00% <100.00%> (ø)
.../notification/notifiers/mixins/message/sections.py 97.33% <100.00%> (-0.01%) ⬇️
services/notification/notifiers/slack.py 100.00% <100.00%> (ø)
services/notification/notifiers/status/base.py 98.70% <100.00%> (ø)
services/report/__init__.py 92.22% <100.00%> (-0.07%) ⬇️
tasks/compute_comparison.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_preprocess_upload.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_sync_repos_task.py 99.70% <100.00%> (+0.28%) ⬆️
... and 1 more

@codecov-qa
Copy link

codecov-qa bot commented Jul 9, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.51%. Comparing base (562a878) to head (857ba6c).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #552   +/-   ##
=======================================
  Coverage   97.51%   97.51%           
=======================================
  Files         420      420           
  Lines       35411    35389   -22     
=======================================
- Hits        34530    34509   -21     
+ Misses        881      880    -1     
Flag Coverage Δ
integration 97.51% <93.75%> (+<0.01%) ⬆️
latest-uploader-overall 97.51% <93.75%> (+<0.01%) ⬆️
unit 97.51% <93.75%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 94.58% <91.66%> (-0.01%) ⬇️
OutsideTasks 97.74% <90.90%> (-0.01%) ⬇️
Files Coverage Δ
services/flake_detection.py 95.90% <100.00%> (ø)
services/notification/__init__.py 100.00% <100.00%> (ø)
.../notification/notifiers/mixins/message/__init__.py 100.00% <100.00%> (ø)
.../notification/notifiers/mixins/message/sections.py 97.33% <100.00%> (-0.01%) ⬇️
services/notification/notifiers/slack.py 100.00% <100.00%> (ø)
services/notification/notifiers/status/base.py 98.70% <100.00%> (ø)
services/report/__init__.py 92.22% <100.00%> (-0.07%) ⬇️
tasks/compute_comparison.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_preprocess_upload.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_sync_repos_task.py 99.70% <100.00%> (+0.28%) ⬆️
... and 1 more

Copy link

codecov-public-qa bot commented Jul 9, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.51%. Comparing base (562a878) to head (857ba6c).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #552   +/-   ##
=======================================
  Coverage   97.51%   97.51%           
=======================================
  Files         420      420           
  Lines       35411    35389   -22     
=======================================
- Hits        34530    34509   -21     
+ Misses        881      880    -1     
Flag Coverage Δ
integration 97.51% <93.75%> (+<0.01%) ⬆️
latest-uploader-overall 97.51% <93.75%> (+<0.01%) ⬆️
unit 97.51% <93.75%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 94.58% <91.66%> (-0.01%) ⬇️
OutsideTasks 97.74% <90.90%> (-0.01%) ⬇️
Files Coverage Δ
services/flake_detection.py 95.90% <100.00%> (ø)
services/notification/__init__.py 100.00% <100.00%> (ø)
.../notification/notifiers/mixins/message/__init__.py 100.00% <100.00%> (ø)
.../notification/notifiers/mixins/message/sections.py 97.33% <100.00%> (-0.01%) ⬇️
services/notification/notifiers/slack.py 100.00% <100.00%> (ø)
services/notification/notifiers/status/base.py 98.70% <100.00%> (ø)
services/report/__init__.py 92.22% <100.00%> (-0.07%) ⬇️
tasks/compute_comparison.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_preprocess_upload.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_sync_repos_task.py 99.70% <100.00%> (+0.28%) ⬆️
... and 1 more

Copy link

codecov bot commented Jul 9, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.53%. Comparing base (562a878) to head (857ba6c).

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     #552   +/-   ##
=======================================
  Coverage   97.53%   97.53%           
=======================================
  Files         451      451           
  Lines       36133    36111   -22     
=======================================
- Hits        35242    35221   -21     
+ Misses        891      890    -1     
Flag Coverage Δ
integration 97.51% <93.75%> (+<0.01%) ⬆️
latest-uploader-overall 97.51% <93.75%> (+<0.01%) ⬆️
unit 97.51% <93.75%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 94.63% <91.66%> (-0.01%) ⬇️
OutsideTasks 97.74% <90.90%> (-0.01%) ⬇️
Files Coverage Δ
services/flake_detection.py 95.90% <100.00%> (ø)
services/notification/__init__.py 100.00% <100.00%> (ø)
.../notification/notifiers/mixins/message/__init__.py 100.00% <100.00%> (ø)
.../notification/notifiers/mixins/message/sections.py 96.54% <100.00%> (-0.01%) ⬇️
services/notification/notifiers/slack.py 100.00% <100.00%> (ø)
services/notification/notifiers/status/base.py 98.70% <100.00%> (ø)
services/report/__init__.py Critical 92.23% <100.00%> (-0.07%) ⬇️
tasks/compute_comparison.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_preprocess_upload.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_sync_repos_task.py 99.70% <100.00%> (+0.28%) ⬆️
... and 1 more
Related Entrypoints
run/app.tasks.notify.Notify

@ajay-sentry ajay-sentry added this pull request to the merge queue Jul 10, 2024
Merged via the queue into main with commit a9332e2 Jul 10, 2024
25 of 30 checks passed
@ajay-sentry ajay-sentry deleted the Ajay/ruff-perf-rules branch July 10, 2024 15:50
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.

Add Perf rules to Worker
2 participants