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

Failed check and status messaging in comment, part I #1014

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nora-codecov
Copy link
Contributor

The goal of this epic is to communicate details about check or status failures in the other notifiers, like pr comment.

This is part 1, which is mostly new data structures and variables, and handling of notifications.

Right now we collect all notifications and execute them in any order, they are all independent and they don't know about each other. In this pr, I split notifications into 2 categories (checks/status notifications, or other notifications). Now the check/status notifications go first, because their outcome will impact the messaging in the other types of notifications.

The specific condition I will tackle next: add custom helper text for users that have specified a target in their yaml. If their check/status fails, we will add a message to the pr comment telling them that the check/status failed, with advice that mentions target and links them to the target docs. There are screenshots in the tix linked below.

What are check/status notifications? Check out the best stack overflow answer I've ever seen

codecov/engineering-team#1605
codecov/engineering-team#1626
Epic here: codecov/engineering-team#1133

@nora-codecov nora-codecov requested a review from a team January 16, 2025 22:25
@codecov-notifications
Copy link

codecov-notifications bot commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 95.77465% with 3 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
services/notification/notifiers/status/patch.py 75.00% 2 Missing ⚠️
services/notification/__init__.py 93.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link

codecov bot commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 95.77465% with 3 lines in your changes missing coverage. Please review.

Project coverage is 97.75%. Comparing base (905d703) to head (9cdbe99).

❌ We are unable to process any of the uploaded JUnit XML files. Please ensure your files are in the right format.

Files with missing lines Patch % Lines
services/notification/notifiers/status/patch.py 75.00% 2 Missing ⚠️
services/notification/__init__.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1014   +/-   ##
=======================================
  Coverage   97.75%   97.75%           
=======================================
  Files         451      451           
  Lines       36812    36862   +50     
=======================================
+ Hits        35986    36035   +49     
- Misses        826      827    +1     
Flag Coverage Δ
integration 42.55% <77.46%> (+0.06%) ⬆️
unit 90.22% <87.32%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

⚠️ Impact Analysis from Codecov is deprecated and will be sunset on Jan 31 2025. See more

Copy link

✅ All tests successful. No failed tests were found.

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

Copy link
Contributor

@Swatinem Swatinem left a comment

Choose a reason for hiding this comment

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

I love the well defined return types now

CUSTOM_TARGET_TEXT_PATCH_KEY = "custom_target_helper_text_patch"
CUSTOM_TARGET_TEXT_PROJECT_KEY = "custom_target_helper_text_project"
CUSTOM_TARGET_TEXT_VALUE = (
"Your {context} {notification_type} has failed because the patch coverage is below the target coverage. "
Copy link
Contributor

Choose a reason for hiding this comment

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

also looking at the mockup for this, is it reasonable to include the numbers in this message as well, like:

… has failed because the patch coverage (X%) is below the target coverage (Y%).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's not in the design, but I think it makes sense - having the %s makes the message better, will add

# context=self.context, notification_type=notification_type
# )
# included_helper_text[CUSTOM_TARGET_TEXT_PATCH_KEY] = helper_text
# message = message + " - " + helper_text
Copy link
Contributor Author

Choose a reason for hiding this comment

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

also decided I'm not going to add the helper text to this message, so the resulting message for check or status will be unchanged

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