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: coverage_drop condition #529

Merged
merged 1 commit into from
Jul 4, 2024
Merged

Conversation

giovanni-guidini
Copy link
Contributor

@giovanni-guidini giovanni-guidini commented Jun 27, 2024

The coverage_drop comment condition looks for the project status threshold,
but the config might be a simple bool. This causes the notifier to fail with
and exception.

These changes fix that and add some more testing to cover this case (that should
have been added earlier, I know. My bad)

related to: codecov/engineering-team#1966
closes: codecov/engineering-team#2003

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.

THe `coverage_drop` comment condition looks for the project status threshold,
but the config might be a simple bool. This causes the notifier to fail with
and exception.

These changes fix that and add some more testing to cover this case (that should
have been added earlier, I know. My bad)
@giovanni-guidini giovanni-guidini requested a review from a team June 27, 2024 20:32
@codecov-notifications
Copy link

codecov-notifications bot commented Jun 27, 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     #529   +/-   ##
=======================================
  Coverage   97.48%   97.48%           
=======================================
  Files         418      418           
  Lines       34973    34984   +11     
=======================================
+ Hits        34093    34104   +11     
  Misses        880      880           
Flag Coverage Δ
integration 97.48% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 97.48% <100.00%> (+<0.01%) ⬆️
unit 97.48% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 94.53% <100.00%> (+<0.01%) ⬆️
OutsideTasks 97.74% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
...vices/notification/notifiers/comment/conditions.py 96.55% <100.00%> (+0.06%) ⬆️
...on/notifiers/tests/unit/test_comment_conditions.py 100.00% <100.00%> (ø)

@codecov-qa
Copy link

codecov-qa bot commented Jun 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.48%. Comparing base (646d815) to head (ba7f66f).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #529   +/-   ##
=======================================
  Coverage   97.48%   97.48%           
=======================================
  Files         418      418           
  Lines       34973    34984   +11     
=======================================
+ Hits        34093    34104   +11     
  Misses        880      880           
Flag Coverage Δ
integration 97.48% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 97.48% <100.00%> (+<0.01%) ⬆️
unit 97.48% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 94.53% <100.00%> (+<0.01%) ⬆️
OutsideTasks 97.74% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
...vices/notification/notifiers/comment/conditions.py 96.55% <100.00%> (+0.06%) ⬆️
...on/notifiers/tests/unit/test_comment_conditions.py 100.00% <100.00%> (ø)

Copy link

codecov-public-qa bot commented Jun 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.48%. Comparing base (646d815) to head (ba7f66f).

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #529   +/-   ##
=======================================
  Coverage   97.48%   97.48%           
=======================================
  Files         418      418           
  Lines       34973    34984   +11     
=======================================
+ Hits        34093    34104   +11     
  Misses        880      880           
Flag Coverage Δ
integration 97.48% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 97.48% <100.00%> (+<0.01%) ⬆️
unit 97.48% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 94.53% <100.00%> (+<0.01%) ⬆️
OutsideTasks 97.74% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
...vices/notification/notifiers/comment/conditions.py 96.55% <100.00%> (+0.06%) ⬆️
...on/notifiers/tests/unit/test_comment_conditions.py 100.00% <100.00%> (ø)

Copy link

codecov bot commented Jun 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.50%. Comparing base (646d815) to head (ba7f66f).

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #529   +/-   ##
=======================================
  Coverage   97.50%   97.50%           
=======================================
  Files         449      449           
  Lines       35696    35707   +11     
=======================================
+ Hits        34806    34817   +11     
  Misses        890      890           
Flag Coverage Δ
integration 97.48% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 97.48% <100.00%> (+<0.01%) ⬆️
unit 97.48% <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.74% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
...vices/notification/notifiers/comment/conditions.py 96.55% <100.00%> (+0.06%) ⬆️
...on/notifiers/tests/unit/test_comment_conditions.py 100.00% <100.00%> (ø)

This change has been scanned for critical changes. Learn more

threshold = 0
if isinstance(project_status_config, dict):
# Project status can also be a bool value, so check is needed
threshold = Decimal(project_status_config.get("threshold", 0))
Copy link
Contributor

@adrian-codecov adrian-codecov Jul 3, 2024

Choose a reason for hiding this comment

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

What does it mean for project to be a bool? If set to True, what value does it use as a threshold?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the project status is a bool it means "I want project status with the default configuration". The default threshold is 0.

Copy link
Contributor

Choose a reason for hiding this comment

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

sounds good, ty for clarifying

@giovanni-guidini giovanni-guidini added this pull request to the merge queue Jul 4, 2024
Merged via the queue into main with commit 68281f2 Jul 4, 2024
29 of 30 checks passed
@giovanni-guidini giovanni-guidini deleted the gio/fix-coverage-drop branch July 4, 2024 08:04
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.

Adjust coverage comment notification to new configuration
2 participants