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

Logic to remove checks from team plan customer #463

Merged
merged 6 commits into from
May 23, 2024

Conversation

adrian-codecov
Copy link
Contributor

@adrian-codecov adrian-codecov commented May 22, 2024

Customers with team plan only get patch status/checks, regardless of their yaml settings. This PR is to add this logic as it was never done when first creating the team plan. Ticket here codecov/engineering-team#1660.

I introduced 2 new variables that indicate whether we need a status and a check. We are reusing _should_use_checks_notifier to check for status I just added a small piece to make it work with this logic. We are adding _should_use_status_notifier which returns true unless it's a team plan without a patch status/check - we've always returned status otherwise. Let me know if there's any confusion with this approach

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 May 22, 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     #463   +/-   ##
=======================================
  Coverage   97.34%   97.34%           
=======================================
  Files         409      409           
  Lines       33898    33952   +54     
=======================================
+ Hits        32997    33051   +54     
  Misses        901      901           
Flag Coverage Δ
integration 97.34% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 97.34% <100.00%> (+<0.01%) ⬆️
unit 97.34% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 94.58% <100.00%> (+<0.01%) ⬆️
OutsideTasks 97.49% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
services/notification/__init__.py 97.88% <100.00%> (+0.23%) ⬆️
services/notification/notifiers/__init__.py 100.00% <100.00%> (ø)
...tification/tests/unit/test_notification_service.py 100.00% <100.00%> (ø)

@codecov-qa
Copy link

codecov-qa bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.34%. Comparing base (420237c) to head (e8ba0de).

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #463   +/-   ##
=======================================
  Coverage   97.34%   97.34%           
=======================================
  Files         409      409           
  Lines       33898    33952   +54     
=======================================
+ Hits        32997    33051   +54     
  Misses        901      901           
Flag Coverage Δ
integration 97.34% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 97.34% <100.00%> (+<0.01%) ⬆️
unit 97.34% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 94.58% <100.00%> (+<0.01%) ⬆️
OutsideTasks 97.49% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
services/notification/__init__.py 97.88% <100.00%> (+0.23%) ⬆️
services/notification/notifiers/__init__.py 100.00% <100.00%> (ø)
...tification/tests/unit/test_notification_service.py 100.00% <100.00%> (ø)

Copy link

codecov-public-qa bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.34%. Comparing base (420237c) to head (e8ba0de).

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #463   +/-   ##
=======================================
  Coverage   97.34%   97.34%           
=======================================
  Files         409      409           
  Lines       33898    33952   +54     
=======================================
+ Hits        32997    33051   +54     
  Misses        901      901           
Flag Coverage Δ
integration 97.34% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 97.34% <100.00%> (+<0.01%) ⬆️
unit 97.34% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 94.58% <100.00%> (+<0.01%) ⬆️
OutsideTasks 97.49% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
services/notification/__init__.py 97.88% <100.00%> (+0.23%) ⬆️
services/notification/notifiers/__init__.py 100.00% <100.00%> (ø)
...tification/tests/unit/test_notification_service.py 100.00% <100.00%> (ø)

Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.37%. Comparing base (420237c) to head (e8ba0de).

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #463   +/-   ##
=======================================
  Coverage   97.37%   97.37%           
=======================================
  Files         441      441           
  Lines       34653    34707   +54     
=======================================
+ Hits        33743    33797   +54     
  Misses        910      910           
Flag Coverage Δ
integration 97.34% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 97.34% <100.00%> (+<0.01%) ⬆️
unit 97.34% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 94.63% <100.00%> (+<0.01%) ⬆️
OutsideTasks 97.49% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
services/notification/__init__.py 97.90% <100.00%> (+0.22%) ⬆️
services/notification/notifiers/__init__.py 100.00% <100.00%> (ø)
...tification/tests/unit/test_notification_service.py 100.00% <100.00%> (ø)
Related Entrypoints
run/app.tasks.notify.Notify

continue

# We always send statuses, so there's currently no case of checks without status.
if should_use_status_notifiers:
Copy link
Contributor

Choose a reason for hiding this comment

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

for readability maybe the logic following here should be encapsulated in a function

)

# Introduced to gate team plan not having statuses nor checks based on conditionals.
if not should_use_status_notifiers and not should_use_checks_notifier:
Copy link
Contributor

Choose a reason for hiding this comment

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

i'm wondering if this is meant to skip the comment and slack notifiers, if not, or if they will be skipped anyways, then we can remove this if statement

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should have the comment, clarifying about the slack one, but how would removing this help?

To clarify the logic here, everything remains the same, the only change introduced by this ticket is "if you're in a team plan, and you have a "changes" or "project" status checks, we don't show them, we only show "patch" specific comments" (the ticket was originally "skip everything" but its now "skip some things". There was a fn _should_use_checks_notifier that has some logic in it already that decides whether you show checks or not - I added a small case inside to do the team plan changes. We also always sent statuses, which changes with this ticket, so I added a fn _should_use_status_notifier which just adds the team plan related logic to it, otherwise returns true.

So I don't see a way to get rid of this if ^ here.

@adrian-codecov adrian-codecov added this pull request to the merge queue May 23, 2024
Merged via the queue into main with commit d52817d May 23, 2024
29 of 30 checks passed
@adrian-codecov adrian-codecov deleted the 1303-no-checks-for-team-plan branch May 23, 2024 18:35
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