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

show patch coverage only for changed files, and don't show indirect changed files #60

Merged
merged 3 commits into from
Aug 15, 2023

Conversation

dana-yaish
Copy link
Contributor

@dana-yaish dana-yaish commented Aug 14, 2023

We want to show patch coverage only in the changed files table, and hide any indirect changed files

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

codecov bot commented Aug 14, 2023

Codecov Report

Merging #60 (02ecf27) into main (cd7259c) will decrease coverage by 0.01%.
The diff coverage is 92.59%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #60      +/-   ##
==========================================
- Coverage   98.61%   98.60%   -0.01%     
==========================================
  Files         357      357              
  Lines       25943    25967      +24     
==========================================
+ Hits        25584    25606      +22     
- Misses        359      361       +2     
Flag Coverage Δ
integration ?
latest-uploader-overall 98.57% <92.59%> (-0.01%) ⬇️
unit 98.57% <92.59%> (-0.01%) ⬇️

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

Components Coverage Δ
NonTestCode 97.35% <92.59%> (-0.02%) ⬇️
OutsideTasks 98.34% <92.59%> (-0.01%) ⬇️
Files Changed Coverage Δ
.../notification/notifiers/tests/unit/test_comment.py 100.00% <ø> (ø)
...s/notification/notifiers/mixins/message/helpers.py 93.75% <90.90%> (-0.59%) ⬇️
.../notification/notifiers/mixins/message/sections.py 99.63% <100.00%> (+<0.01%) ⬆️
Related Entrypoints
run/app.tasks.notify.Notify

Copy link
Contributor

@giovanni-guidini giovanni-guidini left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -464,11 +467,13 @@ async def do_write_section(self, comparison, diff, changes, links, behind_by=Non
head_report = comparison.head.report
if base_report is None:
base_report = Report()
hide_project_coverage = self.settings.get("hide_project_coverage", False)
metrics = get_metrics_method(hide_project_coverage)
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] I think make_metrics_fn would be a better name than metrics

return "".join(("|", coverage))


def get_metrics_method(hide_project_coverage):
Copy link
Contributor

Choose a reason for hiding this comment

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

[very nit] I think that technically both make_patch_only_metrics and make_metrics are functions, not methods

@@ -116,6 +116,53 @@ def make_metrics(before, after, relative, show_complexity, yaml):
return "".join(("|", coverage, complexity, icon))


def make_patch_only_metrics(before, after, relative, show_complexity, yaml):
if after is None:
# e.g. missing flags
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for these helpful comments

@dana-yaish dana-yaish merged commit d16beed into main Aug 15, 2023
8 of 12 checks passed
@dana-yaish dana-yaish deleted the dana/files-patch-cov branch August 15, 2023 14:17
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.

PR comment capable of not displaying project coverage
2 participants