Skip to content

Commit

Permalink
Use spotbugs plugin 4.8.2.0 with additional suppressions
Browse files Browse the repository at this point in the history
jenkinsci/pom#510 needs this change along with
checks of the other repositories that use the Jenkins parent pom.

jenkinsci/pom#501 (review)
recommends that the new spotbugs issues be either suppressed or resolved
in the upstream release of spotbugs.  This change suppresses the new
warning for primitive fields that are pu9blicly visible and the new
warning for a few cases where a field could be made static.

This change skips the warnings related to CT_CONSTRUCTOR_THROWS because
they are not relevant to Jenkins.

jenkinsci/plugin-pom#869 (comment)
provides more details along with the discussion at
spotbugs/spotbugs#2695
  • Loading branch information
MarkEWaite committed Dec 24, 2023
1 parent 2ece2cc commit 95bfb6f
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 0 deletions.
118 changes: 118 additions & 0 deletions core/src/spotbugs/excludesFilter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,120 @@
<Bug pattern="SF_SWITCH_NO_DEFAULT"/>
<Class name="hudson.scheduler.CrontabParser"/>
</Match>
<Match>
<!-- Preserve API compatibility -->
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
<Class name="hudson.PluginManager"/>
<Field name="pluginUploaded"/>
</Match>
<Match>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
<Class name="hudson.ProxyConfiguration"/>
<Field name="noProxyHost"/>
</Match>
<Match>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
<Class name="hudson.cli.CLICommand"/>
<Or>
<Field name="locale"/>
<Field name="stderr"/>
<Field name="stdin"/>
<Field name="stdout"/>
</Or>
</Match>
<Match>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
<Class name="hudson.cli.CopyJobCommand"/>
<Field name="dst"/>
</Match>
<Match>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
<Class name="hudson.cli.CreateJobCommand"/>
<Field name="name"/>
</Match>
<Match>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
<Class name="hudson.cli.SetBuildDescriptionCommand"/>
<Field name="description"/>
</Match>
<Match>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
<Class name="hudson.cli.SetBuildDisplayNameCommand"/>
<Field name="displayName"/>
</Match>
<Match>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
<Class name="hudson.model.Job"/>
<Field name="runIdMigrator"/>
</Match>
<Match>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
<Class name="hudson.model.StringParameterValue"/>
<Field name="value"/>
</Match>
<Match>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
<Class name="hudson.security.Permission"/>
<Field name="enabled"/>
</Match>
<Match>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
<Class name="hudson.tasks.Maven"/>
<Field name="usePrivateRepository"/>
</Match>
<Match>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
<Class name="hudson.util.Graph"/>
<Field name="defaultScale"/>
</Match>
<Match>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
<Class name="hudson.widgets.HistoryWidget"/>
<Field name="baseList"/>
</Match>
<Match>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
<Class name="jenkins.model.Jenkins"/>
<Or>
<Field name="tcpSlaveAgentListener"/>
<Field name="proxy"/>
<Field name="VERSION"/>
<Field name="CHANGELOG_URL"/>
<Field name="VERSION_HASH"/>
<Field name="SESSION_HASH"/>
<Field name="RESOURCE_PATH"/>
<Field name="VIEW_RESOURCE_PATH"/>
</Or>
</Match>
<Match>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
<Class name="jenkins.widgets.HistoryPageFilter"/>
<Or>
<Field name="hasDownPage"/>
<Field name="hasUpPage"/>
<Field name="newestOnPage"/>
<Field name="nextBuildNumber"/>
<Field name="oldestOnPage"/>
</Or>
</Match>
<Match>
<!-- Reserved for future use -->
<Bug pattern="SS_SHOULD_BE_STATIC"/>
<Class name="hudson.model.User"/>
<Field name="version"/>
</Match>
<Match>
<!-- Reserved for future use -->
<Bug pattern="SS_SHOULD_BE_STATIC"/>
<Class name="hudson.model.UserIdMapper"/>
<Field name="version"/>
</Match>
<Match>
<!-- Reserved for future use -->
<Bug pattern="SS_SHOULD_BE_STATIC"/>
<Class name="hudson.util.Graph"/>
<Field name="defaultScale"/>
</Match>
<!--
Here lies technical debt. Exclusions in this section have not yet been triaged. When working on
on this section, pick an exclusion to triage, then:
Expand Down Expand Up @@ -377,4 +491,8 @@
</And>
</Or>
</Match>
<Match>
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC"/>
<Class name="jenkins.security.stapler.StaplerDispatchValidator$ValidatorCache$Validator"/>
</Match>
</FindBugsFilter>
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ THE SOFTWARE.
<!-- Minimum Remoting version, which is tested for API compatibility -->
<remoting.minimum.supported.version>4.13</remoting.minimum.supported.version>

<!-- TODO: Remove when parent pom is using this version or newer -->
<!-- https://github.com/jenkinsci/pom/pull/510 -->
<spotbugs-maven-plugin.version>4.8.2.0</spotbugs-maven-plugin.version>
<spotbugs.effort>Max</spotbugs.effort>
<spotbugs.omitVisitors>FindReturnRef,ConstructorThrow</spotbugs.omitVisitors>
<spotbugs.threshold>Medium</spotbugs.threshold>

<access-modifier.version>1.33</access-modifier.version>
Expand Down

0 comments on commit 95bfb6f

Please sign in to comment.