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

Only request a single RepoProvider in Notify task #827

Merged
merged 3 commits into from
Oct 30, 2024

Conversation

Swatinem
Copy link
Contributor

Previously, the Notify task would get a repo provider token multiple times. In the task itself, in the ComparisonProxy, and in each one of the configured checks.

This will now make sure to only get the repo provider once, and thread it through to all of its use-sites.

Fixes part of codecov/engineering-team#2760

@Swatinem Swatinem requested review from giovanni-guidini and a team October 28, 2024 16:15
@Swatinem Swatinem self-assigned this Oct 28, 2024
@codecov-notifications
Copy link

codecov-notifications bot commented Oct 28, 2024

Codecov Report

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

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
tasks/notify.py 97.36% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #827      +/-   ##
==========================================
- Coverage   98.02%   98.02%   -0.01%     
==========================================
  Files         441      441              
  Lines       36087    36042      -45     
==========================================
- Hits        35376    35330      -46     
- Misses        711      712       +1     
Flag Coverage Δ
integration 98.02% <98.96%> (-0.01%) ⬇️
unit 98.02% <98.96%> (-0.01%) ⬇️

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

Components Coverage Δ
NonTestCode 95.91% <98.07%> (-0.02%) ⬇️
OutsideTasks 98.01% <100.00%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
services/comparison/__init__.py 97.00% <100.00%> (+0.05%) ⬆️
services/notification/__init__.py 100.00% <100.00%> (ø)
services/notification/notifiers/base.py 92.72% <100.00%> (+0.13%) ⬆️
services/notification/notifiers/checks/base.py 97.54% <100.00%> (ø)
...ervices/notification/notifiers/comment/__init__.py 99.39% <ø> (-0.04%) ⬇️
services/notification/notifiers/generics.py 99.09% <ø> (-0.07%) ⬇️
services/notification/notifiers/status/base.py 99.32% <100.00%> (-0.05%) ⬇️
...cation/notifiers/tests/integration/test_comment.py 92.78% <ø> (ø)
...s/notification/notifiers/tests/unit/test_checks.py 100.00% <ø> (ø)
...ion/notifiers/tests/unit/test_codecov_slack_app.py 100.00% <ø> (ø)
... and 16 more

@codecov-qa
Copy link

codecov-qa bot commented Oct 28, 2024

Codecov Report

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

Project coverage is 98.02%. Comparing base (9c74b4e) to head (b3f5b8c).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
tasks/notify.py 97.36% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #827      +/-   ##
==========================================
- Coverage   98.02%   98.02%   -0.01%     
==========================================
  Files         441      441              
  Lines       36087    36042      -45     
==========================================
- Hits        35376    35330      -46     
- Misses        711      712       +1     
Flag Coverage Δ
integration 98.02% <98.96%> (-0.01%) ⬇️
unit 98.02% <98.96%> (-0.01%) ⬇️

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

Components Coverage Δ
NonTestCode 95.91% <98.07%> (-0.02%) ⬇️
OutsideTasks 98.01% <100.00%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
services/comparison/__init__.py 97.00% <100.00%> (+0.05%) ⬆️
services/notification/__init__.py 100.00% <100.00%> (ø)
services/notification/notifiers/base.py 92.72% <100.00%> (+0.13%) ⬆️
services/notification/notifiers/checks/base.py 97.54% <100.00%> (ø)
...ervices/notification/notifiers/comment/__init__.py 99.39% <ø> (-0.04%) ⬇️
services/notification/notifiers/generics.py 99.09% <ø> (-0.07%) ⬇️
services/notification/notifiers/status/base.py 99.32% <100.00%> (-0.05%) ⬇️
...cation/notifiers/tests/integration/test_comment.py 92.78% <ø> (ø)
...s/notification/notifiers/tests/unit/test_checks.py 100.00% <ø> (ø)
...ion/notifiers/tests/unit/test_codecov_slack_app.py 100.00% <ø> (ø)
... and 16 more

Copy link

codecov-public-qa bot commented Oct 28, 2024

Codecov Report

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

Project coverage is 98.02%. Comparing base (9c74b4e) to head (b3f5b8c).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #827      +/-   ##
==========================================
- Coverage   98.02%   98.02%   -0.01%     
==========================================
  Files         441      441              
  Lines       36087    36042      -45     
==========================================
- Hits        35376    35330      -46     
- Misses        711      712       +1     
Flag Coverage Δ
integration 98.02% <98.96%> (-0.01%) ⬇️
unit 98.02% <98.96%> (-0.01%) ⬇️

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

Components Coverage Δ
NonTestCode 95.91% <98.07%> (-0.02%) ⬇️
OutsideTasks 98.01% <100.00%> (-0.01%) ⬇️
Files Coverage Δ
services/comparison/__init__.py 97.00% <100.00%> (+0.05%) ⬆️
services/notification/__init__.py 100.00% <100.00%> (ø)
services/notification/notifiers/base.py 92.72% <100.00%> (+0.13%) ⬆️
services/notification/notifiers/checks/base.py 97.54% <100.00%> (ø)
...ervices/notification/notifiers/comment/__init__.py 99.39% <ø> (-0.04%) ⬇️
services/notification/notifiers/generics.py 99.09% <ø> (-0.07%) ⬇️
services/notification/notifiers/status/base.py 99.32% <100.00%> (-0.05%) ⬇️
...cation/notifiers/tests/integration/test_comment.py 92.78% <ø> (ø)
...s/notification/notifiers/tests/unit/test_checks.py 100.00% <ø> (ø)
...ion/notifiers/tests/unit/test_codecov_slack_app.py 100.00% <ø> (ø)
... and 16 more

Copy link

codecov bot commented Oct 28, 2024

Codecov Report

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

Project coverage is 98.02%. Comparing base (9c74b4e) to head (b3f5b8c).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
tasks/notify.py 97.36% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #827      +/-   ##
==========================================
- Coverage   98.02%   98.02%   -0.01%     
==========================================
  Files         441      441              
  Lines       36087    36042      -45     
==========================================
- Hits        35376    35330      -46     
- Misses        711      712       +1     
Flag Coverage Δ
integration 98.02% <98.96%> (-0.01%) ⬇️
unit 98.02% <98.96%> (-0.01%) ⬇️

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

Components Coverage Δ
NonTestCode 95.91% <98.07%> (-0.02%) ⬇️
OutsideTasks 98.01% <100.00%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
services/comparison/__init__.py 97.00% <100.00%> (+0.05%) ⬆️
services/notification/__init__.py 100.00% <100.00%> (ø)
services/notification/notifiers/base.py 92.72% <100.00%> (+0.13%) ⬆️
services/notification/notifiers/checks/base.py 97.54% <100.00%> (ø)
...ervices/notification/notifiers/comment/__init__.py 99.39% <ø> (-0.04%) ⬇️
services/notification/notifiers/generics.py 99.09% <ø> (-0.07%) ⬇️
services/notification/notifiers/status/base.py 99.32% <100.00%> (-0.05%) ⬇️
...cation/notifiers/tests/integration/test_comment.py 92.78% <ø> (ø)
...s/notification/notifiers/tests/unit/test_checks.py 100.00% <ø> (ø)
...ion/notifiers/tests/unit/test_codecov_slack_app.py 100.00% <ø> (ø)
... and 16 more

Previously, the Notify task would get a repo provider token multiple times.
In the task itself, in the `ComparisonProxy`, and in each one of the configured checks.

This will now make sure to only get the repo provider once, and thread it through to all of its use-sites.
@Swatinem Swatinem added this pull request to the merge queue Oct 30, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 30, 2024
@Swatinem Swatinem added this pull request to the merge queue Oct 30, 2024
Merged via the queue into main with commit 87923f0 Oct 30, 2024
25 of 27 checks passed
@Swatinem Swatinem deleted the swatinem/one-notify-provider branch October 30, 2024 09:33
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