build icon indicating copy to clipboard operation
build copied to clipboard

block PR with code coverage below threshold

Open steuhs opened this issue 7 years ago • 6 comments

Currently Covbot reports coverage change in PRs, without failing the job or blocking the PR from merging if the coverage falls below the threshold.

It's time to enforce the blocking feature now to block a PR from merging if any of the files is having a coverage below the threshold. Note that files can be excluded from this rule by having the git-attribute 'coverage-excluded'

Based on the post-submit data from https://testgrid.knative.dev/knative-build#coverage, 80% can be a useful coverage threshold for now.

I'd like to get a confirmation from repo owners before I enforce the blocking rule. If a different coverage threshold is needed, please also let me know.

/area test-and-release

/kind question /kind spec

This is a sub-issue of https://github.com/knative/test-infra/issues/220

steuhs avatar Oct 29 '18 22:10 steuhs

Looking at https://testgrid.knative.dev/knative-build#coverage, there are 15 files (colored in red) that has coverage rate below 80%. We probably want to bring up the coverage for those files or exclude those files, before we enforce the threshold.

steuhs avatar Oct 30 '18 03:10 steuhs

/assign mattmoor /assign ImJasonH /assign shashwathi

steuhs avatar Oct 30 '18 03:10 steuhs

/lgtm /approve

imjasonh avatar Oct 30 '18 09:10 imjasonh

implemented

steuhs avatar Jan 04 '19 03:01 steuhs

@steuhs This is not fixed, as the coverage job is not a blocker. I strongly recommend getting explicit agreement about blocking, since -- as you mentioned above -- there are files still below the new 80% threshold.

adrcunha avatar Jan 04 '19 13:01 adrcunha

@ImJasonH @shashwathi @mattmoor The job has been made to fail when the coverage falls below the threshold of 80%. Please make the job required so that PRs with low coverage can be blocked, when you feel comfortable doing so.

steuhs avatar Jan 04 '19 22:01 steuhs