codecov / engineering-team

This is a general repo to use with GH Projects
1 stars 1 forks source link

Remove bundle analysis PR message on an unrelated change #1459

Closed Adal3n3 closed 3 months ago

Adal3n3 commented 5 months ago

Describe the bug The problem is Codecov is posting a bundle analysis message on an unrelated change. Here is an example from asottile -- "the frontend bundle isn't being changed in my patch and notifying someone for 500 bytes change is very noisy". https://github.com/getsentry/sentry/pull/67686#issuecomment-2020493828

According to @rohan-at-sentry this is most likely a platform bug/ unintended side effect.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

Adal3n3 commented 5 months ago

@trent-codecov Can you assign this issue?

asottile commented 5 months ago

you've pinged the wrong asottile

Adal3n3 commented 5 months ago

oh no so sorry! I'll fix it.

nicholas-codecov commented 5 months ago

Just for context whoever looks at this.

This is where/how we do the PR comment message: https://github.com/codecov/shared/blob/e111513db853d42be5405ab18eb2b988c54b0e51/shared/bundle_analysis/comparison.py#L222

This is the class where we sum the total of the assets: https://github.com/codecov/shared/blob/e111513db853d42be5405ab18eb2b988c54b0e51/shared/bundle_analysis/report.py#L89-L97

And this is where we collect the information from the bundler, which is provided directly via Webpack: https://github.com/codecov/codecov-javascript-bundler-plugins/blob/main/packages/webpack-plugin/src/webpack-bundle-analysis/webpackBundleAnalysisPlugin.ts#L51-L57

adrian-codecov commented 4 months ago

Intended work to follow this https://github.com/codecov/engineering-team/issues/1485#issuecomment-2075207039

In summary: 1) Default = false (comment “no bundle change” when there’s no bundle. Else no comment at all) 2) require_bundle_changes in the codecov_yaml