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

Only show comment when coverage/bundle is negatively changed (configurable) #1350

Closed
6 tasks done
Tracked by #1028
codecovdesign opened this issue Mar 7, 2024 · 5 comments
Closed
6 tasks done
Tracked by #1028
Assignees
Labels
epic this label is used to mark issues as epics in discovery The design, product, and specifications require refinement

Comments

@codecovdesign
Copy link
Contributor

codecovdesign commented Mar 7, 2024

Problem to solve

Today, you can can configure the pr comment to only show when any changes occur (https://docs.codecov.com/docs/common-recipe-list#only-comment-on-coverage-changes), both negative or positive. However, there are some customer requests for the ability to see Codecov reports only when there's a decrease in coverage or negative changes. This contrasts to another common preferences to confirm / see the ✅ - consideration here is if there was a config to remove only for negative reporting, that it's opt-in and showing is default.

As related to bundle:

It would also be nice to set a threshold change to not trigger a comment. We use Vite for our builds and it seems there is often a 10-35kB variation between builds even without any substantive changes to the code or dependencies. Being able to only have the comment appear when the change matters would help to avoid people from learning to ignore it when it shows up every time.

Proposed Solutions

Areas to explore:

  • YAML configuration update: introduce YAML options to display reports exclusively on coverage reduction.
    • not a default setting, but opt-in configuration
  • Leverage existing configurations: explore combining current YAML settings like threshold with a hypothetical require_changes: true to meet this need.
  • How this could work too on bundle analysis
  • Common issue is around email updating, are there any ways we can make the update less noisy?
  • Considerations around re-run scenarios
    • Do you still show a PR comment if coverage/bundle size had dropped on one commit and increased in a subsequent commit on the same PR
    • Opposite scenario : do you show a PR comment if coverage/bundle size had not dropped on one commit and dropped in a subsequent commit on the same PR
  • For bundle: only show is X threshold is changed

Tasks

Preview Give feedback
  1. giovanni-guidini
  2. enhancement
    giovanni-guidini
  3. enhancement
    giovanni-guidini
  4. enhancement
    giovanni-guidini
  5. giovanni-guidini
@codecovdesign codecovdesign added the in discovery The design, product, and specifications require refinement label Mar 7, 2024
@dabrahams
Copy link

I don't mind seeing an increase in the coverage in the PR itself; in fact I think it's a nice affirmation. But I really don't want to get an email unless something has changed for the worse.

@rohan-at-sentry
Copy link

philosophically related - #1485

@codecovdesign codecovdesign changed the title Only show comment when coverage is reduced Only show comment when coverage/bundle is reduced/increased (configurable) Apr 10, 2024
@codecovdesign codecovdesign changed the title Only show comment when coverage/bundle is reduced/increased (configurable) Only show comment when coverage/bundle is negatively changed (configurable) Apr 10, 2024
@rohan-at-sentry
Copy link

Related - codecov/feedback#340

@giovanni-guidini
Copy link

UPDATE

I'm still working on this, but wanted to give a small update here.

  • We just need to be careful creating the GitHub comment. Updates don't trigger email notifications (at least for me they don't…);
  • Posting statuses or checks also doesn't seem to trigger email notifications 🥳
  • There's no way to “silently” post a comment in GitHub (or GitLab);
  • Improving the YAML configuration is the easiest way to improve this functionality. We should do that;

There are other details (and more avenues of exploration we might consider) in this investigation: https://l.codecov.dev/1DKPDc (codecov-only)

The final thing I'd like to say is that customers can very easily create a filter in the email client that will silence the emails from Codecov. This might still be useful in the future if you find the emails annoying but doesn't have the "power" in your team to disable them completely.

I did a filter like in the image below. It auto-deletes emails from the Codecov comment if the patch is 100% covered. Otherwise I still see the email.

Image

@giovanni-guidini
Copy link

New configuration options have been released for both coverage and bundle analysis [beta] comments.

Check the updated documentation here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic this label is used to mark issues as epics in discovery The design, product, and specifications require refinement
Projects
None yet
Development

No branches or pull requests

5 participants