codecov / worker

Code for Background Workers of Codecov
Other
50 stars 10 forks source link

chore: fix (some) type errors in BA notify #777

Closed giovanni-guidini closed 2 weeks ago

giovanni-guidini commented 2 weeks ago

This was not the main goal I had, but these errors were really distracting, so fixing some type errors in BA notifiers.

One side-effect is that when loading the user_config we are now expecting the comment config to be bool | dict (not None). This is in fact the case because we have default config in place, but the tests didn't know that. Now they do.

I might have also caught a bug in the user activation in terms of the func args.

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[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.03%. Comparing base (901c335) to head (8aef1bf). Report is 3 commits behind head on main.

:white_check_mark: All tests successful. No failed tests found.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/codecov/worker/pull/777/graphs/tree.svg?width=650&height=150&src=pr&token=BWTOrjBaE5&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov)](https://app.codecov.io/gh/codecov/worker/pull/777?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) ```diff @@ Coverage Diff @@ ## main #777 +/- ## ======================================= Coverage 98.03% 98.03% ======================================= Files 438 438 Lines 36470 36477 +7 ======================================= + Hits 35752 35759 +7 Misses 718 718 ``` | [Flag](https://app.codecov.io/gh/codecov/worker/pull/777/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | Coverage Δ | | |---|---|---| | [integration](https://app.codecov.io/gh/codecov/worker/pull/777/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `98.03% <100.00%> (+<0.01%)` | :arrow_up: | | [unit](https://app.codecov.io/gh/codecov/worker/pull/777/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `98.03% <100.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#carryforward-flags-in-the-pull-request-comment) to find out more. | [Components](https://app.codecov.io/gh/codecov/worker/pull/777/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | Coverage Δ | | |---|---|---| | [NonTestCode](https://app.codecov.io/gh/codecov/worker/pull/777/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `95.90% <100.00%> (ø)` | | | [OutsideTasks](https://app.codecov.io/gh/codecov/worker/pull/777/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `98.01% <100.00%> (+<0.01%)` | :arrow_up: | | [Files with missing lines](https://app.codecov.io/gh/codecov/worker/pull/777?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | Coverage Δ | | |---|---|---| | [services/activation.py](https://app.codecov.io/gh/codecov/worker/pull/777?src=pr&el=tree&filepath=services%2Factivation.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-c2VydmljZXMvYWN0aXZhdGlvbi5weQ==) | `93.10% <100.00%> (ø)` | | | [services/bundle\_analysis/notify/\_\_init\_\_.py](https://app.codecov.io/gh/codecov/worker/pull/777?src=pr&el=tree&filepath=services%2Fbundle_analysis%2Fnotify%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-c2VydmljZXMvYnVuZGxlX2FuYWx5c2lzL25vdGlmeS9fX2luaXRfXy5weQ==) | `100.00% <100.00%> (ø)` | | | [...rvices/bundle\_analysis/notify/contexts/\_\_init\_\_.py](https://app.codecov.io/gh/codecov/worker/pull/777?src=pr&el=tree&filepath=services%2Fbundle_analysis%2Fnotify%2Fcontexts%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-c2VydmljZXMvYnVuZGxlX2FuYWx5c2lzL25vdGlmeS9jb250ZXh0cy9fX2luaXRfXy5weQ==) | `99.10% <100.00%> (ø)` | | | [...ervices/bundle\_analysis/notify/contexts/comment.py](https://app.codecov.io/gh/codecov/worker/pull/777?src=pr&el=tree&filepath=services%2Fbundle_analysis%2Fnotify%2Fcontexts%2Fcomment.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-c2VydmljZXMvYnVuZGxlX2FuYWx5c2lzL25vdGlmeS9jb250ZXh0cy9jb21tZW50LnB5) | `98.88% <100.00%> (ø)` | | | [...s/bundle\_analysis/notify/contexts/commit\_status.py](https://app.codecov.io/gh/codecov/worker/pull/777?src=pr&el=tree&filepath=services%2Fbundle_analysis%2Fnotify%2Fcontexts%2Fcommit_status.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-c2VydmljZXMvYnVuZGxlX2FuYWx5c2lzL25vdGlmeS9jb250ZXh0cy9jb21taXRfc3RhdHVzLnB5) | `100.00% <100.00%> (ø)` | | | [...ysis/notify/contexts/tests/test\_comment\_context.py](https://app.codecov.io/gh/codecov/worker/pull/777?src=pr&el=tree&filepath=services%2Fbundle_analysis%2Fnotify%2Fcontexts%2Ftests%2Ftest_comment_context.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-c2VydmljZXMvYnVuZGxlX2FuYWx5c2lzL25vdGlmeS9jb250ZXh0cy90ZXN0cy90ZXN0X2NvbW1lbnRfY29udGV4dC5weQ==) | `100.00% <100.00%> (ø)` | | | [...otify/contexts/tests/test\_commit\_status\_context.py](https://app.codecov.io/gh/codecov/worker/pull/777?src=pr&el=tree&filepath=services%2Fbundle_analysis%2Fnotify%2Fcontexts%2Ftests%2Ftest_commit_status_context.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-c2VydmljZXMvYnVuZGxlX2FuYWx5c2lzL25vdGlmeS9jb250ZXh0cy90ZXN0cy90ZXN0X2NvbW1pdF9zdGF0dXNfY29udGV4dC5weQ==) | `100.00% <100.00%> (ø)` | | | [services/bundle\_analysis/notify/helpers.py](https://app.codecov.io/gh/codecov/worker/pull/777?src=pr&el=tree&filepath=services%2Fbundle_analysis%2Fnotify%2Fhelpers.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-c2VydmljZXMvYnVuZGxlX2FuYWx5c2lzL25vdGlmeS9oZWxwZXJzLnB5) | `100.00% <100.00%> (ø)` | | | [...dle\_analysis/notify/messages/tests/test\_comment.py](https://app.codecov.io/gh/codecov/worker/pull/777?src=pr&el=tree&filepath=services%2Fbundle_analysis%2Fnotify%2Fmessages%2Ftests%2Ftest_comment.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-c2VydmljZXMvYnVuZGxlX2FuYWx5c2lzL25vdGlmeS9tZXNzYWdlcy90ZXN0cy90ZXN0X2NvbW1lbnQucHk=) | `100.00% <100.00%> (ø)` | | | [...alysis/notify/messages/tests/test\_commit\_status.py](https://app.codecov.io/gh/codecov/worker/pull/777?src=pr&el=tree&filepath=services%2Fbundle_analysis%2Fnotify%2Fmessages%2Ftests%2Ftest_commit_status.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-c2VydmljZXMvYnVuZGxlX2FuYWx5c2lzL25vdGlmeS9tZXNzYWdlcy90ZXN0cy90ZXN0X2NvbW1pdF9zdGF0dXMucHk=) | `100.00% <100.00%> (ø)` | | | ... and [2 more](https://app.codecov.io/gh/codecov/worker/pull/777?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | |
codecov-notifications[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

:white_check_mark: All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #777   +/-   ##
=======================================
  Coverage   98.03%   98.03%           
=======================================
  Files         438      438           
  Lines       36470    36477    +7     
=======================================
+ Hits        35752    35759    +7     
  Misses        718      718           
Flag Coverage Δ
integration 98.03% <100.00%> (+<0.01%) :arrow_up:
unit 98.03% <100.00%> (+<0.01%) :arrow_up:

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

Components Coverage Δ
NonTestCode 95.90% <100.00%> (ø)
OutsideTasks 98.01% <100.00%> (+<0.01%) :arrow_up:
Files with missing lines Coverage Δ
services/activation.py 93.10% <100.00%> (ø)
services/bundle_analysis/notify/__init__.py 100.00% <100.00%> (ø)
...rvices/bundle_analysis/notify/contexts/__init__.py 99.10% <100.00%> (ø)
...ervices/bundle_analysis/notify/contexts/comment.py 98.88% <100.00%> (ø)
...s/bundle_analysis/notify/contexts/commit_status.py 100.00% <100.00%> (ø)
...ysis/notify/contexts/tests/test_comment_context.py 100.00% <100.00%> (ø)
...otify/contexts/tests/test_commit_status_context.py 100.00% <100.00%> (ø)
services/bundle_analysis/notify/helpers.py 100.00% <100.00%> (ø)
...dle_analysis/notify/messages/tests/test_comment.py 100.00% <100.00%> (ø)
...alysis/notify/messages/tests/test_commit_status.py 100.00% <100.00%> (ø)
... and 2 more
codecov-qa[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.03%. Comparing base (901c335) to head (8aef1bf). Report is 3 commits behind head on main.

:white_check_mark: All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #777   +/-   ##
=======================================
  Coverage   98.03%   98.03%           
=======================================
  Files         438      438           
  Lines       36470    36477    +7     
=======================================
+ Hits        35752    35759    +7     
  Misses        718      718           
Flag Coverage Δ
integration 98.03% <100.00%> (+<0.01%) :arrow_up:
unit 98.03% <100.00%> (+<0.01%) :arrow_up:

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

Components Coverage Δ
NonTestCode 95.90% <100.00%> (ø)
OutsideTasks 98.01% <100.00%> (+<0.01%) :arrow_up:
Files with missing lines Coverage Δ
services/activation.py 93.10% <100.00%> (ø)
services/bundle_analysis/notify/__init__.py 100.00% <100.00%> (ø)
...rvices/bundle_analysis/notify/contexts/__init__.py 99.10% <100.00%> (ø)
...ervices/bundle_analysis/notify/contexts/comment.py 98.88% <100.00%> (ø)
...s/bundle_analysis/notify/contexts/commit_status.py 100.00% <100.00%> (ø)
...ysis/notify/contexts/tests/test_comment_context.py 100.00% <100.00%> (ø)
...otify/contexts/tests/test_commit_status_context.py 100.00% <100.00%> (ø)
services/bundle_analysis/notify/helpers.py 100.00% <100.00%> (ø)
...dle_analysis/notify/messages/tests/test_comment.py 100.00% <100.00%> (ø)
...alysis/notify/messages/tests/test_commit_status.py 100.00% <100.00%> (ø)
... and 2 more
codecov-public-qa[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.03%. Comparing base (901c335) to head (8aef1bf).

:white_check_mark: All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #777   +/-   ##
=======================================
  Coverage   98.03%   98.03%           
=======================================
  Files         438      438           
  Lines       36470    36477    +7     
=======================================
+ Hits        35752    35759    +7     
  Misses        718      718           
Flag Coverage Δ
integration 98.03% <100.00%> (+<0.01%) :arrow_up:
unit 98.03% <100.00%> (+<0.01%) :arrow_up:

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

Components Coverage Δ
NonTestCode 95.90% <100.00%> (ø)
OutsideTasks 98.01% <100.00%> (+<0.01%) :arrow_up:
Files Coverage Δ
services/activation.py 93.10% <100.00%> (ø)
services/bundle_analysis/notify/__init__.py 100.00% <100.00%> (ø)
...rvices/bundle_analysis/notify/contexts/__init__.py 99.10% <100.00%> (ø)
...ervices/bundle_analysis/notify/contexts/comment.py 98.88% <100.00%> (ø)
...s/bundle_analysis/notify/contexts/commit_status.py 100.00% <100.00%> (ø)
...ysis/notify/contexts/tests/test_comment_context.py 100.00% <100.00%> (ø)
...otify/contexts/tests/test_commit_status_context.py 100.00% <100.00%> (ø)
services/bundle_analysis/notify/helpers.py 100.00% <100.00%> (ø)
...dle_analysis/notify/messages/tests/test_comment.py 100.00% <100.00%> (ø)
...alysis/notify/messages/tests/test_commit_status.py 100.00% <100.00%> (ø)
... and 2 more