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

chore: don't delete comments. #543

Merged
merged 1 commit into from
Jul 5, 2024
Merged

Conversation

giovanni-guidini
Copy link
Contributor

Currently the require_changes will deelte an existing comment if the requirements are not met but a commit exists. The commit vanishes without trace, which is not great UX.

To improve UX we are changing this behavior to bypass required changes if a comment already exists for that PR. We will update that comment.

We did verify that this does not trigger a new email being sent to users, so it should be fine.

closes: codecov/engineering-team#2023

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.

Currently the `require_changes` will deelte an existing comment if the requirements are not met but a commit exists. The commit vanishes without trace, which is not great UX.

To improve UX we are changing this behavior to bypass required changes if a comment already exists for that PR. We will update that comment.

We did verify that this does not trigger a new email being sent to users, so it should be fine.

closes: codecov/engineering-team#2023
@giovanni-guidini giovanni-guidini requested a review from a team July 4, 2024 18:53
@codecov-notifications
Copy link

codecov-notifications bot commented Jul 4, 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     #543   +/-   ##
=======================================
  Coverage   97.51%   97.51%           
=======================================
  Files         420      420           
  Lines       35432    35407   -25     
=======================================
- Hits        34550    34526   -24     
+ Misses        882      881    -1     
Flag Coverage Δ
integration 97.51% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 97.51% <100.00%> (+<0.01%) ⬆️
unit 97.51% <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 97.14% <100.00%> (+0.59%) ⬆️
.../notification/notifiers/tests/unit/test_comment.py 100.00% <100.00%> (ø)

@codecov-qa
Copy link

codecov-qa bot commented Jul 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.51%. Comparing base (7691f5a) to head (0e28672).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #543   +/-   ##
=======================================
  Coverage   97.51%   97.51%           
=======================================
  Files         420      420           
  Lines       35432    35407   -25     
=======================================
- Hits        34550    34526   -24     
+ Misses        882      881    -1     
Flag Coverage Δ
integration 97.51% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 97.51% <100.00%> (+<0.01%) ⬆️
unit 97.51% <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 97.14% <100.00%> (+0.59%) ⬆️
.../notification/notifiers/tests/unit/test_comment.py 100.00% <100.00%> (ø)

Copy link

codecov-public-qa bot commented Jul 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.51%. Comparing base (7691f5a) to head (0e28672).

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #543   +/-   ##
=======================================
  Coverage   97.51%   97.51%           
=======================================
  Files         420      420           
  Lines       35432    35407   -25     
=======================================
- Hits        34550    34526   -24     
+ Misses        882      881    -1     
Flag Coverage Δ
integration 97.51% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 97.51% <100.00%> (+<0.01%) ⬆️
unit 97.51% <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 97.14% <100.00%> (+0.59%) ⬆️
.../notification/notifiers/tests/unit/test_comment.py 100.00% <100.00%> (ø)

Copy link

codecov bot commented Jul 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.53%. Comparing base (7691f5a) to head (0e28672).

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #543   +/-   ##
=======================================
  Coverage   97.53%   97.53%           
=======================================
  Files         451      451           
  Lines       36155    36129   -26     
=======================================
- Hits        35263    35238   -25     
+ Misses        892      891    -1     
Flag Coverage Δ
integration 97.51% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 97.51% <100.00%> (+<0.01%) ⬆️
unit 97.51% <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.74% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
...vices/notification/notifiers/comment/conditions.py 97.14% <100.00%> (+0.59%) ⬆️
.../notification/notifiers/tests/unit/test_comment.py 100.00% <100.00%> (ø)

This change has been scanned for critical changes. Learn more

Copy link
Contributor

@michelletran-codecov michelletran-codecov left a comment

Choose a reason for hiding this comment

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

Code LGTM!

on_failure_side_effect isn't really used anymore. Should we also remove this from the abstract classes? (maybe open up a new ticket to clean up on_failure_side_effect?)

@@ -207,6 +204,12 @@ async def check_condition_OR_group(
async def check_condition(
notifier: AbstractBaseNotifier, comparison: ComparisonProxy
) -> bool:
if comparison.pull and comparison.pull.commentid:
log.info(
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be a warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so... It's the expected behavior after all.
I'm adding this just to help us with debugging in the future

@giovanni-guidini
Copy link
Contributor Author

Code LGTM!

on_failure_side_effect isn't really used anymore. Should we also remove this from the abstract classes? (maybe open up a new ticket to clean up on_failure_side_effect?)

I think it should be on a separate ticket if we decide to remove that functionality, yes.
It's a good point though

@giovanni-guidini giovanni-guidini added this pull request to the merge queue Jul 5, 2024
Merged via the queue into main with commit d1c1caf Jul 5, 2024
29 of 30 checks passed
@giovanni-guidini giovanni-guidini deleted the gio/dont-delete-comments branch July 5, 2024 13:58
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.

Don't delete comment anymore if it exists but required_changes are not met
2 participants