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

feat: add message when test_result is setup #331

Merged
merged 2 commits into from
Mar 15, 2024

Conversation

giovanni-guidini
Copy link
Contributor

To help users confirm that test_results is setup correctly we want to display
a message near the header saying that that is the case and all tests passed.

These changes accomplish that by creating a new NotificationContext in the
ComparisonProxy and carrying the info to the notifier.

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.

To help users confirm that test_results is setup correctly we want to display
a message near the header saying that that is the case and all tests passed.

These changes accomplish that by creating a new `NotificationContext` in the
`ComparisonProxy` and carrying the info to the notifier.
@codecov-qa
Copy link

codecov-qa bot commented Mar 15, 2024

Codecov Report

Attention: Patch coverage is 94.87179% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 98.11%. Comparing base (600e403) to head (676a70f).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #331      +/-   ##
==========================================
- Coverage   98.11%   98.11%   -0.01%     
==========================================
  Files         385      385              
  Lines       31955    31989      +34     
==========================================
+ Hits        31354    31386      +32     
- Misses        601      603       +2     
Flag Coverage Δ
integration ?
latest-uploader-overall 98.11% <94.87%> (-0.01%) ⬇️
unit 98.11% <94.87%> (-0.01%) ⬇️

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

Components Coverage Δ
NonTestCode 96.22% <90.90%> (-0.02%) ⬇️
OutsideTasks 97.90% <94.73%> (-0.01%) ⬇️
Files Coverage Δ
services/comparison/__init__.py 96.72% <100.00%> (+0.13%) ⬆️
services/notification/__init__.py 97.58% <100.00%> (ø)
...cation/notifiers/tests/integration/test_comment.py 92.39% <100.00%> (+0.04%) ⬆️
.../notification/notifiers/tests/unit/test_comment.py 100.00% <100.00%> (ø)
tasks/notify.py 98.50% <100.00%> (ø)
.../notification/notifiers/mixins/message/sections.py 92.90% <81.81%> (-0.39%) ⬇️

Copy link

codecov-public-qa bot commented Mar 15, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (600e403) 98.11% compared to head (676a70f) 98.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #331      +/-   ##
==========================================
- Coverage   98.11%   98.11%   -0.01%     
==========================================
  Files         385      385              
  Lines       31955    31989      +34     
==========================================
+ Hits        31354    31386      +32     
- Misses        601      603       +2     
Flag Coverage Δ
integration 98.11% <94.87%> (-0.01%) ⬇️
latest-uploader-overall 98.11% <94.87%> (-0.01%) ⬇️
unit 98.11% <94.87%> (-0.01%) ⬇️

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

Components Coverage Δ
NonTestCode 96.22% <90.90%> (-0.02%) ⬇️
OutsideTasks 97.90% <94.73%> (-0.01%) ⬇️
Files Coverage Δ
services/comparison/__init__.py 96.72% <100.00%> (+0.13%) ⬆️
services/notification/__init__.py 97.58% <100.00%> (ø)
...cation/notifiers/tests/integration/test_comment.py 92.39% <100.00%> (+0.04%) ⬆️
.../notification/notifiers/tests/unit/test_comment.py 100.00% <100.00%> (ø)
tasks/notify.py 98.50% <100.00%> (ø)
.../notification/notifiers/mixins/message/sections.py 92.90% <81.81%> (-0.39%) ⬇️

Copy link

codecov bot commented Mar 15, 2024

Codecov Report

Attention: Patch coverage is 94.87179% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 98.10%. Comparing base (600e403) to head (7e662d2).

❗ Current head 7e662d2 differs from pull request most recent head 676a70f. Consider uploading reports for the commit 676a70f to get more accurate results

Changes have been made to critical files, which contain lines commonly executed in production. Learn more

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #331      +/-   ##
==========================================
- Coverage   98.11%   98.10%   -0.01%     
==========================================
  Files         416      416              
  Lines       32655    32689      +34     
==========================================
+ Hits        32038    32070      +32     
- Misses        617      619       +2     
Flag Coverage Δ
integration 98.11% <94.87%> (-0.01%) ⬇️
latest-uploader-overall 98.11% <94.87%> (-0.01%) ⬇️
unit 98.11% <94.87%> (-0.01%) ⬇️

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

Components Coverage Δ
NonTestCode 96.16% <90.90%> (-0.02%) ⬇️
OutsideTasks 97.90% <94.73%> (-0.01%) ⬇️
Files Coverage Δ
services/comparison/__init__.py 96.73% <100.00%> (+0.12%) ⬆️
services/notification/__init__.py 97.60% <100.00%> (ø)
...cation/notifiers/tests/integration/test_comment.py 92.39% <100.00%> (+0.04%) ⬆️
.../notification/notifiers/tests/unit/test_comment.py 100.00% <100.00%> (ø)
tasks/notify.py Critical 98.50% <100.00%> (ø)
.../notification/notifiers/mixins/message/sections.py 92.10% <81.81%> (-0.35%) ⬇️

This change has been scanned for critical changes. Learn more

@giovanni-guidini giovanni-guidini requested a review from a team March 15, 2024 10:09
yield ("")
yield (
":heavy_check_mark: Test ingestion set up successfully. No failed tests found. :relaxed:"
)
Copy link

@rohan-at-sentry rohan-at-sentry Mar 15, 2024

Choose a reason for hiding this comment

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

Looks like this message will fire every time the all_test_passed bool is true. @giovanni-guidini can you confirm?

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 is accurate.
Keep in mind that if the setup for test_results is complete but not all tests passed then we don't notify with this notifier.

Copy link

@rohan-at-sentry rohan-at-sentry Mar 15, 2024

Choose a reason for hiding this comment

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

in that case... after first time setup every time all test pass, we'll show a message titled "Test ingestion set up successfully..."

Which is a little weird..

Maybe we alter that message to say "All tests successful... ☺️ " instead. wdyt @giovanni-guidini @Adal3n3 . That way it gives an indication that test result ingestion setup was successful and provides a meaningful update on subsequent runs, without extra conditional checks

Choose a reason for hiding this comment

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

@Adal3n3 @giovanni-guidini and @rohan-at-sentry aligned

Tweak the message to

✅ All tests successful. No failed tests found ☺️

@giovanni-guidini giovanni-guidini merged commit 52b003a into main Mar 15, 2024
11 of 19 checks passed
@giovanni-guidini giovanni-guidini deleted the gio/test-result-setup-comment branch March 15, 2024 16:30
Copy link

sentry-io bot commented Mar 20, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ AttributeError: 'NoneType' object has no attribute 'repoid' app.tasks.notify.Notify View Issue

Did you find this useful? React with a 👍 or 👎

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.

3 participants