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: update bundle_analysis comment requirement #532

Merged
merged 2 commits into from
Jul 4, 2024

Conversation

giovanni-guidini
Copy link
Contributor

Updates the comment requirements for bundle_analysis.
Respects the comment.bundle_change_threshold defined in the YAML
and only notifies if changes are bigger than the threshold.
(threshold is expected to be an int. So technically this PR is a dependency of the present changes, because it does the
coercion into an integer, as expected)

Also adds the "bundle_increase" as a possible requirements. In this case
on top of the threshold the change also needs to cause the bundle to increase
in size for a comment to be sent.

closes: codecov/engineering-team#2021

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.

@giovanni-guidini giovanni-guidini requested a review from a team July 1, 2024 15:35
@codecov-notifications
Copy link

codecov-notifications bot commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 6 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #532      +/-   ##
==========================================
- Coverage   97.50%   97.50%   -0.01%     
==========================================
  Files         420      420              
  Lines       35320    35360      +40     
==========================================
+ Hits        34440    34478      +38     
- Misses        880      882       +2     
Flag Coverage Δ
integration 97.50% <87.50%> (-0.01%) ⬇️
latest-uploader-overall 97.50% <87.50%> (-0.01%) ⬇️
unit 97.50% <87.50%> (-0.01%) ⬇️

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

Components Coverage Δ
NonTestCode 94.57% <79.31%> (-0.01%) ⬇️
OutsideTasks 97.74% <87.50%> (-0.01%) ⬇️
Files Coverage Δ
services/tests/test_bundle_analysis.py 98.97% <100.00%> (+0.03%) ⬆️
services/yaml/tests/test_yaml.py 100.00% <ø> (ø)
services/bundle_analysis.py 96.75% <79.31%> (-0.86%) ⬇️

... and 3 files with indirect coverage changes

@codecov-qa
Copy link

codecov-qa bot commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 97.50%. Comparing base (a920fba) to head (2f69283).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #532      +/-   ##
==========================================
- Coverage   97.50%   97.50%   -0.01%     
==========================================
  Files         420      420              
  Lines       35320    35360      +40     
==========================================
+ Hits        34440    34478      +38     
- Misses        880      882       +2     
Flag Coverage Δ
integration 97.50% <87.50%> (-0.01%) ⬇️
latest-uploader-overall 97.50% <87.50%> (-0.01%) ⬇️
unit 97.50% <87.50%> (-0.01%) ⬇️

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

Components Coverage Δ
NonTestCode 94.57% <79.31%> (-0.01%) ⬇️
OutsideTasks 97.74% <87.50%> (-0.01%) ⬇️
Files Coverage Δ
services/tests/test_bundle_analysis.py 98.97% <100.00%> (+0.03%) ⬆️
services/yaml/tests/test_yaml.py 100.00% <ø> (ø)
services/bundle_analysis.py 96.75% <79.31%> (-0.86%) ⬇️

... and 3 files with indirect coverage changes

Copy link

codecov-public-qa bot commented Jul 1, 2024

Codecov Report

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

Project coverage is 97.50%. Comparing base (a920fba) to head (2f69283).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #532      +/-   ##
==========================================
- Coverage   97.50%   97.50%   -0.01%     
==========================================
  Files         420      420              
  Lines       35320    35360      +40     
==========================================
+ Hits        34440    34478      +38     
- Misses        880      882       +2     
Flag Coverage Δ
integration 97.50% <87.50%> (-0.01%) ⬇️
latest-uploader-overall 97.50% <87.50%> (-0.01%) ⬇️
unit 97.50% <87.50%> (-0.01%) ⬇️

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

Components Coverage Δ
NonTestCode 94.57% <79.31%> (-0.01%) ⬇️
OutsideTasks 97.74% <87.50%> (-0.01%) ⬇️
Files Coverage Δ
services/tests/test_bundle_analysis.py 98.97% <100.00%> (+0.03%) ⬆️
services/yaml/tests/test_yaml.py 100.00% <ø> (ø)
services/bundle_analysis.py 96.75% <79.31%> (-0.86%) ⬇️

... and 3 files with indirect coverage changes

Copy link

codecov bot commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 97.52%. Comparing base (a920fba) to head (2f69283).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #532      +/-   ##
==========================================
- Coverage   97.53%   97.52%   -0.01%     
==========================================
  Files         451      451              
  Lines       36043    36083      +40     
==========================================
+ Hits        35153    35191      +38     
- Misses        890      892       +2     
Flag Coverage Δ
integration 97.50% <87.50%> (-0.01%) ⬇️
latest-uploader-overall 97.50% <87.50%> (-0.01%) ⬇️
unit 97.50% <87.50%> (-0.01%) ⬇️

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

Components Coverage Δ
NonTestCode 94.62% <79.31%> (-0.01%) ⬇️
OutsideTasks 97.74% <87.50%> (-0.01%) ⬇️
Files Coverage Δ
services/tests/test_bundle_analysis.py 98.97% <100.00%> (+0.03%) ⬆️
services/yaml/tests/test_yaml.py 100.00% <ø> (ø)
services/bundle_analysis.py 96.75% <79.31%> (-0.86%) ⬇️

... and 3 files with indirect coverage changes

This change has been scanned for critical changes. Learn more

@giovanni-guidini giovanni-guidini changed the title feat: update bundle_analysis comment requirerement feat: update bundle_analysis comment requirement Jul 1, 2024
and comparison.total_size_delta > changes_threshold
)
case _:
log.warning(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is technically dead code because the YAML validation should let it get this far.
I added this just so it wouldn't break the interface by returning None... maybe I should remove it? Even if it does return None it won't break the app.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine as long as you leave a comment explaining that this code should never be reached, (maybe even throw an exception? emit a metric? not sure, but we would need some way to observe that this does not happen)

Copy link
Contributor

@joseph-sentry joseph-sentry left a comment

Choose a reason for hiding this comment

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

lgtm, left a comment regarding the unreachable code

and comparison.total_size_delta > changes_threshold
)
case _:
log.warning(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine as long as you leave a comment explaining that this code should never be reached, (maybe even throw an exception? emit a metric? not sure, but we would need some way to observe that this does not happen)

@giovanni-guidini giovanni-guidini force-pushed the gio/bundle-comment-requirements-update branch from c9e3e83 to b3c671d Compare July 3, 2024 19:26
Updates the comment requirements for bundle_analysis.
Respects the `comment.bundle_change_threshold` defined in the YAML
and only notifies if changes are bigger than the threshold.
(threshold is expected to be an int. So technically [this PR](codecov/shared#271) is a dependency of the present changes, because it does the
coercion into an integer, as expected)

Also adds the `"bundle_increase"` as a possible requirements. In this case
on top of the threshold the change also needs to cause the bundle to _increase_
in size for a comment to be sent.

closes: codecov/engineering-team#2021
@giovanni-guidini giovanni-guidini force-pushed the gio/bundle-comment-requirements-update branch from b3c671d to 619bdea Compare July 4, 2024 07:57
@giovanni-guidini giovanni-guidini force-pushed the gio/bundle-comment-requirements-update branch from 619bdea to 2f69283 Compare July 4, 2024 08:21
@giovanni-guidini giovanni-guidini added this pull request to the merge queue Jul 4, 2024
Merged via the queue into main with commit d47749f Jul 4, 2024
16 of 30 checks passed
@giovanni-guidini giovanni-guidini deleted the gio/bundle-comment-requirements-update branch July 4, 2024 08:37
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.

Adjust Bundle Analysis comment notification to new coniguration
2 participants