Skip to content

Commit 30321d3

Browse files
committed
Update coverage excludes and bars
1 parent 511a0ae commit 30321d3

4 files changed

Lines changed: 76 additions & 71 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ We love getting PRs, but we hate asking people for the same basic changes every
77
- [ ] Push your changes to a branch other than `master`. Create your PR from that branch.
88
- [ ] Add JavaDocs and other comments
99
- [ ] Write tests that run and pass in CI. See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to capture snapshot data.
10-
- [ ] Run `mvn install site` locally. This may reformat your code, commit those changes. If this command doesn't succeed, your change will not pass CI.
10+
- [ ] Run `mvn -P ci install site ` locally. This may reformat your code, commit those changes. If this command doesn't succeed, your change will not pass CI.

pom.xml

Lines changed: 75 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@
3737
<okio.version>2.4.2</okio.version>
3838
<formatter-maven-plugin.goal>format</formatter-maven-plugin.goal>
3939
<impsort-maven-plugin.goal>sort</impsort-maven-plugin.goal>
40-
<jacoco.coverage.target.class>.80</jacoco.coverage.target.class>
41-
<jacoco.coverage.target.method>0.20</jacoco.coverage.target.method>
42-
<jacoco.coverage.target.line>0.50</jacoco.coverage.target.line>
43-
<jacoco.coverage.target.other>0.50</jacoco.coverage.target.other>
40+
<!-- Using this as the minimum bar for code coverage. Adding methods without covering them will fail this. -->
41+
<jacoco.coverage.target.bundle.bundle.method>0.556</jacoco.coverage.target.bundle.bundle.method>
42+
<jacoco.coverage.target.class.class.method>0.25</jacoco.coverage.target.class.class.method>
4443
<!-- For non-ci builds we'd like the build to still complete if jacoco metrics aren't met. -->
4544
<jacoco.haltOnFailure>false</jacoco.haltOnFailure>
4645
</properties>
@@ -373,6 +372,8 @@
373372
<properties>
374373
<formatter-maven-plugin.goal>validate</formatter-maven-plugin.goal>
375374
<impsort-maven-plugin.goal>check</impsort-maven-plugin.goal>
375+
<enable-jacoco>true</enable-jacoco>
376+
<jacoco.haltOnFailure>true</jacoco.haltOnFailure>
376377
</properties>
377378
<build>
378379
</build>
@@ -412,61 +413,93 @@
412413
</goals>
413414
<configuration>
414415
<rules>
416+
<rule>
417+
<element>BUNDLE</element>
418+
<limits>
419+
<limit>
420+
<counter>METHOD</counter>
421+
<value>COVEREDRATIO</value>
422+
<minimum>${jacoco.coverage.target.bundle.method}</minimum>
423+
</limit>
424+
</limits>
425+
</rule>
415426
<rule>
416427
<!--We end up with chatty logs, but it shows us which particular classes -->
417428
<!--are lacking in coverage. If this is too much, just remove the -->
418429
<!--<element>CLASS</element> tag below. -->
419430
<element>CLASS</element>
420431
<limits>
421-
<!-- These limits can be overridden, in the form of `0.50` for -->
422-
<!-- 50%, as necessary. Using a property just puts it in one spot. -->
423-
<!--
424-
<limit>
425-
<counter>LINE</counter>
426-
<value>COVEREDRATIO</value>
427-
<minimum>${jacoco.coverage.target.lines}</minimum>
428-
</limit>
429-
-->
430-
<!--
431-
<limit>
432-
<counter>BRANCH</counter>
433-
<value>COVEREDRATIO</value>
434-
<minimum>${jacoco.coverage.target.other}</minimum>
435-
</limit>
436-
-->
437-
<!--
438-
<limit>
439-
<counter>INSTRUCTION</counter>
440-
<value>COVEREDRATIO</value>
441-
<minimum>${jacoco.coverage.target.other}</minimum>
442-
</limit>
443-
-->
444-
<!--
445-
<limit>
446-
<counter>COMPLEXITY</counter>
447-
<value>COVEREDRATIO</value>
448-
<minimum>${jacoco.coverage.target.other}</minimum>
449-
</limit>
450-
-->
451432
<limit>
452433
<counter>METHOD</counter>
453434
<value>COVEREDRATIO</value>
454-
<minimum>${jacoco.coverage.target.method}</minimum>
435+
<minimum>${jacoco.coverage.target.class.method}</minimum>
455436
</limit>
456-
<!-- <limit>-->
457-
<!-- <counter>CLASS</counter>-->
458-
<!-- <value>COVEREDRATIO</value>-->
459-
<!-- <minimum>${jacoco.coverage.target.class}</minimum>-->
460-
<!-- </limit>-->
461437
</limits>
462438
<excludes>
439+
<!-- Code implemented externally -->
463440
<exclude>org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory.**</exclude>
464441
<exclude>org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory</exclude>
465-
<exclude>org.kohsuke.github.extras.OkHttp3Connector</exclude>
442+
443+
<!-- Sample only -->
466444
<exclude>org.kohsuke.github.example.*</exclude>
467-
<!-- Deprecated iterateRepositories -->
445+
446+
<!-- No methods -->
447+
<exclude>org.kohsuke.github.DeleteToken</exclude>
448+
<exclude>org.kohsuke.github.Previews</exclude>
449+
450+
<!-- Deprecated -->
451+
<exclude>org.kohsuke.github.extras.OkHttp3Connector</exclude>
452+
<exclude>org.kohsuke.github.EnforcementLevel</exclude>
468453
<exclude>org.kohsuke.github.GHPerson.1</exclude>
469454
<exclude>org.kohsuke.github.GHPerson.1.1</exclude>
455+
456+
<!-- TODO: These still need test coverage -->
457+
<exclude>org.kohsuke.github.GHBranchProtection.RequiredSignatures</exclude>
458+
<exclude>org.kohsuke.github.GHBranchProtectionBuilder.Restrictions</exclude>
459+
<exclude>org.kohsuke.github.GHBranchProtection.Restrictions</exclude>
460+
<exclude>org.kohsuke.github.GHCommentAuthorAssociation</exclude>
461+
<exclude>org.kohsuke.github.GHCommitBuilder.UserInfo</exclude>
462+
<exclude>org.kohsuke.github.GHCommitSearchBuilder.CommitSearchResult</exclude>
463+
<exclude>org.kohsuke.github.GHCommitSearchBuilder.Sort</exclude>
464+
<exclude>org.kohsuke.github.GHCommitSearchBuilder</exclude>
465+
<exclude>org.kohsuke.github.GHCommitState</exclude>
466+
<exclude>org.kohsuke.github.GHCompare.Commit</exclude>
467+
<exclude>org.kohsuke.github.GHCompare.InnerCommit</exclude>
468+
<exclude>org.kohsuke.github.GHCompare.Status</exclude>
469+
<exclude>org.kohsuke.github.GHCompare.Tree</exclude>
470+
<exclude>org.kohsuke.github.GHCompare.User</exclude>
471+
<exclude>org.kohsuke.github.GHCompare</exclude>
472+
<exclude>org.kohsuke.github.GHDeployKey</exclude>
473+
<exclude>org.kohsuke.github.GHDeploymentStatusBuilder</exclude>
474+
<exclude>org.kohsuke.github.GHDirection</exclude>
475+
<exclude>org.kohsuke.github.GHEmail</exclude>
476+
<exclude>org.kohsuke.github.GHEventPayload.Ping</exclude>
477+
<exclude>org.kohsuke.github.GHEventPayload.Release</exclude>
478+
<exclude>org.kohsuke.github.GHException</exclude>
479+
<exclude>org.kohsuke.github.GHHook</exclude>
480+
<exclude>org.kohsuke.github.GHHooks.OrgContext</exclude>
481+
<exclude>org.kohsuke.github.GHInvitation</exclude>
482+
<exclude>org.kohsuke.github.GHIssueSearchBuilder.IssueSearchResult</exclude>
483+
<exclude>org.kohsuke.github.GHIssueSearchBuilder.Sort</exclude>
484+
<exclude>org.kohsuke.github.GHIssueSearchBuilder</exclude>
485+
<exclude>org.kohsuke.github.GHMilestoneState</exclude>
486+
<exclude>org.kohsuke.github.GHOrgHook</exclude>
487+
<exclude>org.kohsuke.github.GHProject.ProjectStateFilter</exclude>
488+
<exclude>org.kohsuke.github.GHPullRequestCommitDetail.Authorship</exclude>
489+
<exclude>org.kohsuke.github.GHPullRequestCommitDetail.Commit</exclude>
490+
<exclude>org.kohsuke.github.GHPullRequestCommitDetail.CommitPointer</exclude>
491+
<exclude>org.kohsuke.github.GHPullRequestCommitDetail.Tree</exclude>
492+
<exclude>org.kohsuke.github.GHPullRequestCommitDetail</exclude>
493+
<exclude>org.kohsuke.github.GHPullRequestFileDetail</exclude>
494+
<exclude>org.kohsuke.github.GHPullRequestQueryBuilder.Sort</exclude>
495+
<exclude>org.kohsuke.github.GHReleaseUpdater</exclude>
496+
<exclude>org.kohsuke.github.GHRepository.ForkSort</exclude>
497+
<exclude>org.kohsuke.github.GHStargazer</exclude>
498+
<exclude>org.kohsuke.github.GHTagObject</exclude>
499+
<exclude>org.kohsuke.github.GHTeam.Role</exclude>
500+
<exclude>org.kohsuke.github.GHUserSearchBuilder.Sort</exclude>
501+
<exclude>org.kohsuke.github.GHVerifiedKey</exclude>
502+
<exclude>org.kohsuke.github.GitHubBuilder.1</exclude>
470503
</excludes>
471504
</rule>
472505
</rules>

src/main/java/org/kohsuke/github/GHRepository.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,9 +1963,6 @@ public GHHook createWebHook(URL url) throws IOException {
19631963
@SuppressFBWarnings(value = "DMI_COLLECTION_OF_URLS",
19641964
justification = "It causes a performance degradation, but we have already exposed it to the API")
19651965
public Set<URL> getPostCommitHooks() {
1966-
if (postCommitHooks == null) {
1967-
1968-
}
19691966
return postCommitHooks;
19701967
}
19711968

src/test/java/org/kohsuke/github/AbstractGitHubApiTestBase.java

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)