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: bundle analysis comment threshold #271

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

giovanni-guidini
Copy link
Contributor

@giovanni-guidini giovanni-guidini commented Jul 1, 2024

These changes improve documentation (and add unit tests) to comment.require_bundle_changes
and adds a new config key bundle_change_threshold.

The new key is a threshold size for the bundle in bytes. The input value
is preferably a string that accepts certain size extensions (kb, mb, gb, ...) and is
coerced into a size in bytes (as an integer)

closes: codecov/engineering-team#2018

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 12:49
These changes improve documentation (and add unit tests) to `comment.require_bundle_changes`
and adds a new config key `bundle_change_threshold`.

The new key is a threshold size for the bundle in bytes. The input value
is preferably a string that accepts certain size extensions (kb, mb, gb, ...) and is
coerced into a size in bytes (as an integer)
Copy link

codecov bot commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.44%. Comparing base (9966229) to head (68ecee0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #271      +/-   ##
==========================================
- Coverage   90.17%   89.44%   -0.73%     
==========================================
  Files         351      324      -27     
  Lines       11079    10184     -895     
  Branches     1969     1841     -128     
==========================================
- Hits         9990     9109     -881     
+ Misses       1015     1005      -10     
+ Partials       74       70       -4     
Flag Coverage Δ
shared-docker-uploader ?

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

giovanni-guidini added a commit to codecov/worker that referenced this pull request Jul 1, 2024
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
@@ -147,6 +147,38 @@ def validate_str(self, data: str) -> CoverageCommentRequiredChangesANDGroup:
raise Invalid("Failed to parse required_changes")


class ByteSizeSchemaField(object):
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice class! Very well organized, documented, easy to read

Copy link
Contributor

@adrian-codecov adrian-codecov left a comment

Choose a reason for hiding this comment

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

PR looks good to me! Good job

@giovanni-guidini giovanni-guidini added this pull request to the merge queue Jul 3, 2024
Merged via the queue into main with commit 3b44680 Jul 3, 2024
7 of 8 checks passed
@giovanni-guidini giovanni-guidini deleted the gio/coerce-bundle-threshold branch July 3, 2024 19:11
giovanni-guidini added a commit to codecov/worker that referenced this pull request Jul 4, 2024
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
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.

Extend YAML configuration with bundle changes and threshold
2 participants