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

Add message for users to install Codecov app if they're using public commenter #516

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

michelletran-codecov
Copy link
Contributor

@michelletran-codecov michelletran-codecov commented Jun 24, 2024

This adds a message when we detect that

  1. the user doesn't have any app integrations and
  2. is using the Codecov commenter bot to publish the message.

The idea is to drive more adoption for the Codecov App.

Issue link: codecov/engineering-team#1833

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-qa
Copy link

codecov-qa bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #516      +/-   ##
==========================================
- Coverage   97.48%   97.48%   -0.01%     
==========================================
  Files         418      418              
  Lines       34973    35006      +33     
==========================================
+ Hits        34093    34125      +32     
- Misses        880      881       +1     
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 Δ
services/bots/public_bots.py 92.59% <ø> (ø)
services/comparison/__init__.py 97.26% <100.00%> (+0.01%) ⬆️
.../notification/notifiers/mixins/message/__init__.py 100.00% <100.00%> (ø)
.../notification/notifiers/tests/unit/test_comment.py 100.00% <100.00%> (ø)
tasks/notify.py 98.25% <100.00%> (-0.42%) ⬇️
tasks/tests/unit/test_notify_task.py 100.00% <100.00%> (ø)

@codecov-notifications
Copy link

codecov-notifications bot commented Jun 24, 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     #516      +/-   ##
==========================================
- Coverage   97.48%   97.48%   -0.01%     
==========================================
  Files         418      418              
  Lines       34973    35006      +33     
==========================================
+ Hits        34093    34125      +32     
- Misses        880      881       +1     
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 Δ
services/bots/public_bots.py 92.59% <ø> (ø)
services/comparison/__init__.py 97.26% <100.00%> (+0.01%) ⬆️
.../notification/notifiers/mixins/message/__init__.py 100.00% <100.00%> (ø)
.../notification/notifiers/tests/unit/test_comment.py 100.00% <100.00%> (ø)
tasks/notify.py 98.25% <100.00%> (-0.42%) ⬇️
tasks/tests/unit/test_notify_task.py 100.00% <100.00%> (ø)

Copy link

codecov-public-qa bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #516      +/-   ##
==========================================
- Coverage   97.48%   97.48%   -0.01%     
==========================================
  Files         418      418              
  Lines       34973    35006      +33     
==========================================
+ Hits        34093    34125      +32     
- Misses        880      881       +1     
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 Δ
services/bots/public_bots.py 92.59% <ø> (ø)
services/comparison/__init__.py 97.26% <100.00%> (+0.01%) ⬆️
.../notification/notifiers/mixins/message/__init__.py 100.00% <100.00%> (ø)
.../notification/notifiers/tests/unit/test_comment.py 100.00% <100.00%> (ø)
tasks/notify.py 98.25% <100.00%> (-0.42%) ⬇️
tasks/tests/unit/test_notify_task.py 100.00% <100.00%> (ø)

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

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

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #516      +/-   ##
==========================================
- Coverage   97.50%   97.50%   -0.01%     
==========================================
  Files         449      449              
  Lines       35696    35729      +33     
==========================================
+ Hits        34806    34838      +32     
- Misses        890      891       +1     
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 Δ
services/bots/public_bots.py 92.59% <ø> (ø)
services/comparison/__init__.py 97.27% <100.00%> (+0.01%) ⬆️
.../notification/notifiers/mixins/message/__init__.py 100.00% <100.00%> (ø)
.../notification/notifiers/tests/unit/test_comment.py 100.00% <100.00%> (ø)
tasks/notify.py Critical 98.25% <100.00%> (-0.42%) ⬇️
tasks/tests/unit/test_notify_task.py 100.00% <100.00%> (ø)

This change has been scanned for critical changes. Learn more

tasks/notify.py Outdated
Comment on lines 414 to 420
commenter_bot_token = get_config(repository_service.service, "bots", "comment")
return (
repository_service.service == "github"
and repository_service.data.get("installation") is None
and repository_service.get_token_by_type(TokenType.comment)
== commenter_bot_token
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'm not 100% sure about this part. Am I missing some checks to make sure that the user doesn't have any installations and is also using the commenter bot?

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks OK

Maybe just for peace of mind you should add 1 extra check commenter_bot_token is not None to make sure something is configured for the commenter bot...

@michelletran-codecov michelletran-codecov marked this pull request as ready for review June 25, 2024 00:46
@michelletran-codecov michelletran-codecov requested a review from a team June 25, 2024 00:46
mocker,
):
comparison = sample_comparison
mocker.patch.object(
Copy link
Contributor

Choose a reason for hiding this comment

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

This might be unecessary in this test if you only care for the 1st line of the comment

tasks/notify.py Outdated
Comment on lines 414 to 420
commenter_bot_token = get_config(repository_service.service, "bots", "comment")
return (
repository_service.service == "github"
and repository_service.data.get("installation") is None
and repository_service.get_token_by_type(TokenType.comment)
== commenter_bot_token
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks OK

Maybe just for peace of mind you should add 1 extra check commenter_bot_token is not None to make sure something is configured for the commenter bot...

…commenter

This is to drive more adoption for the Codecov App.
@michelletran-codecov michelletran-codecov added this pull request to the merge queue Jun 28, 2024
Merged via the queue into main with commit aceebad Jun 28, 2024
29 of 30 checks passed
@michelletran-codecov michelletran-codecov deleted the 1833_encourage_users_to_install branch June 28, 2024 13:39
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