Skip to content

Move global Spotbugs suppressions to SDK level - #50440

Merged
Alan Zimmer (alzimmermsft) merged 5 commits into
mainfrom
MoveNonGlobalSpotbugsExcludesToSdkLevel
Sep 15, 2026
Merged

Alan Zimmer (alzimmermsft) merged 5 commits into
mainfrom
MoveNonGlobalSpotbugsExcludesToSdkLevel

Conversation

@alzimmermsft

Copy link
Copy Markdown
Member

Description

Moves global Spotbugs exclusions to SDK-level exclusions where applicable. Updates Spotbugs exclusion framework to have SDK-level exclusions extends the global exclusions. Updates Spotbugs exclusion definitions to use updated DTD.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 10 pipeline(s).
26 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@vcolin7 vcolin7 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left a few comments, but the PR looks good to me for the most part :)

Comment thread sdk/parents/azure-sdk-parent/pom.xml
Comment thread sdk/identity/azure-identity/spotbugs-exclude.xml
Comment on lines +41 to +43
For a confirmed false positive or an approved exception, add `spotbugs-exclude.xml`
next to the SDK's `pom.xml`. The client SDK parents (including ClientCore and the
legacy data SDK parent) automatically append this optional file to the shared

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rephrasing for less ambiguity if read by an AI agent.

Suggested change
For a confirmed false positive or an approved exception, add `spotbugs-exclude.xml`
next to the SDK's `pom.xml`. The client SDK parents (including ClientCore and the
legacy data SDK parent) automatically append this optional file to the shared
For a confirmed false positive or an approved exception, add a `spotbugs-exclude.xml`
file next to the SDK's `pom.xml` if one does not already exist. Otherwise, you can
add a new entry for said exception to the existing file. The client SDK parents (including
ClientCore and the legacy data SDK parent) automatically append this optional file to the shared

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll do this in a follow-up PR given the number of pipelines this runs

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 10 pipeline(s).
26 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved SpotBugs suppressions and code-generation comparison skips require correction.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Moves global SpotBugs suppressions into SDK-level filters and updates filter inheritance, schemas, tooling, tests, and documentation.

Changes:

  • Migrates SDK-local SpotBugs exclusions and shared filter configuration.
  • Updates Maven parent/tool configuration and suppression-generation tooling.
  • Updates validation tests, code-quality documentation, and spelling configuration.
File summaries
File Reviewed change
sdk/webpubsub/azure-messaging-webpubsub/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/webpubsub/azure-messaging-webpubsub-client/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/vision/azure-ai-vision-imageanalysis/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/translation/azure-ai-translation-text/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/translation/azure-ai-translation-document/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/translation/azure-ai-documenttranslator/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/tools/cspell.yml Spelling configuration update.
sdk/tools/azure-sdk-build-tool/spotbugs-exclude.xml Tool-module SpotBugs filter migration.
sdk/tools/azure-sdk-build-tool/pom.xml Maven SpotBugs configuration update.
sdk/tools/azure-sdk-archetype/pom.xml Maven tooling configuration update.
sdk/tools/azure-openrewrite/pom.xml Maven tooling configuration update.
sdk/textanalytics/azure-ai-textanalytics/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/template/azure-template-perf/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/tables/azure-data-tables/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/synapse/azure-analytics-synapse-spark/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/synapse/azure-analytics-synapse-monitoring/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/synapse/azure-analytics-synapse-managedprivateendpoints/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/synapse/azure-analytics-synapse-artifacts/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/synapse/azure-analytics-synapse-accesscontrol/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/storage/azure-storage-queue/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/storage/azure-storage-perf/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/storage/azure-storage-internal-avro/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/storage/azure-storage-file-share/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/storage/azure-storage-file-datalake/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/storage/azure-storage-common/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/storage/azure-storage-blob/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/storage/azure-storage-blob-nio/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/storage/azure-storage-blob-cryptography/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/storage/azure-storage-blob-changefeed/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/storage/azure-storage-blob-batch/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/spring/spring-cloud-azure-service/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/spring/spring-cloud-azure-core/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/spring/spring-cloud-azure-autoconfigure/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/servicebus/microsoft-azure-servicebus/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/servicebus/microsoft-azure-servicebus/checkstyle-suppressions.xml Checkstyle suppression configuration update.
sdk/servicebus/azure-messaging-servicebus/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/serialization/azure-xml/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/serialization/azure-json/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/search/azure-search-documents/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/schemaregistry/azure-data-schemaregistry/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/schemaregistry/azure-data-schemaregistry-jsonschema/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/schemaregistry/azure-data-schemaregistry-apacheavro/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/resources/azure-resourcemanager-resources/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/quantum/azure-quantum-jobs/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/purview/azure-analytics-purview-workflow/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/purview/azure-analytics-purview-sharing/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/purview/azure-analytics-purview-scanning/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/purview/azure-analytics-purview-datamap/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/purview/azure-analytics-purview-administration/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/parents/clientcore-parent/pom.xml ClientCore SpotBugs filter inheritance update.
sdk/parents/azure-sdk-parent/pom.xml Parent SpotBugs filter inheritance update.
sdk/parents/azure-data-sdk-parent/pom.xml Parent SpotBugs configuration update.
sdk/parents/azure-data-sdk-parent/CHANGELOG.md Parent package changelog update.
sdk/parents/azure-client-sdk-parent/pom.xml Parent SpotBugs configuration update.
sdk/parents/azure-client-sdk-parent-v2/pom.xml Parent SpotBugs configuration update.
sdk/openai/azure-ai-openai/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/openai/azure-ai-openai-assistants/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/monitor/azure-monitor-query/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/monitor/azure-monitor-opentelemetry-exporter/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/monitor/azure-monitor-opentelemetry-autoconfigure/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/monitor/azure-monitor-ingestion/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/modelsrepository/azure-iot-modelsrepository/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/metricsadvisor/azure-ai-metricsadvisor/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/maps/azure-maps-traffic/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/maps/azure-maps-timezone/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/maps/azure-maps-search/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/maps/azure-maps-route/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/maps/azure-maps-render/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/maps/azure-maps-geolocation/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/loadtesting/azure-developer-loadtesting/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/keyvault/azure-security-test-keyvault-jca/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/keyvault/azure-security-keyvault-secrets/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/keyvault/azure-security-keyvault-keys/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/keyvault/azure-security-keyvault-jca/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/keyvault/azure-security-keyvault-certificates/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/keyvault/azure-security-keyvault-administration/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/identity/azure-identity/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/identity/azure-identity-extensions/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/identity/azure-identity-broker/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/identity/azure-identity-broker-samples/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/healthinsights/azure-health-insights-radiologyinsights/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/healthinsights/azure-health-insights-clinicalmatching/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/healthinsights/azure-health-insights-cancerprofiling/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/healthdataaiservices/azure-health-deidentification/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/formrecognizer/azure-ai-formrecognizer/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/face/azure-ai-vision-face/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/eventhubs/microsoft-azure-eventhubs/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/eventhubs/microsoft-azure-eventhubs/checkstyle-suppressions.xml Checkstyle suppression configuration update.
sdk/eventhubs/azure-messaging-eventhubs/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/eventhubs/azure-messaging-eventhubs-track2-perf/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-jedis/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/eventgrid/azure-messaging-eventgrid/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/eventgrid/azure-messaging-eventgrid-namespaces/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/eventgrid/azure-messaging-eventgrid-cloudnative-cloudevents/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/easm/azure-analytics-defender-easm/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/documentintelligence/azure-ai-documentintelligence/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/discovery/azure-ai-discovery/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/digitaltwins/azure-digitaltwins-core/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/deviceupdate/azure-iot-deviceupdate/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/devcenter/azure-developer-devcenter/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/cosmos/azure-cosmos/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/cosmos/azure-cosmos-tests/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/cosmos/azure-cosmos-test/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/cosmos/azure-cosmos-encryption/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/cosmos/azure-cosmos-benchmark/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/core/azure-core/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/core/azure-core-tracing-opentelemetry/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/core/azure-core-test/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/core/azure-core-serializer-json-jackson/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/core/azure-core-serializer-json-gson/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/core/azure-core-serializer-avro-apache/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/core/azure-core-metrics-opentelemetry/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/core/azure-core-management/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/core/azure-core-http-vertx/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/core/azure-core-http-okhttp/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/core/azure-core-http-netty/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/core/azure-core-http-jdk-httpclient/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/core/azure-core-experimental/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/core/azure-core-amqp/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/core-v2/azure-core-test/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/contentsafety/azure-ai-contentsafety/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/containerregistry/azure-containers-containerregistry/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/confidentialledger/azure-security-confidentialledger/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/communication/azure-communication-sms/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/communication/azure-communication-rooms/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/communication/azure-communication-phonenumbers/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/communication/azure-communication-messages/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/communication/azure-communication-jobrouter/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/communication/azure-communication-identity/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/communication/azure-communication-email/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/communication/azure-communication-common/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/communication/azure-communication-chat/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/communication/azure-communication-callingserver/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/communication/azure-communication-callautomation/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/clientcore/optional-dependency-tests/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/clientcore/http-stress/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/clientcore/http-okhttp3/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/clientcore/http-netty4/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/clientcore/core/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/clientcore/annotation-processor/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/batch/microsoft-azure-batch/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/batch/azure-compute-batch/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/attestation/azure-security-attestation/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/appconfiguration/azure-data-appconfiguration/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/anomalydetector/azure-ai-anomalydetector/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
sdk/ai/azure-ai-inference/spotbugs-exclude.xml SDK-local SpotBugs filter migration.
eng/scripts/tests/SpotBugs-Configuration.tests.ps1 SpotBugs configuration tests.
eng/scripts/linting_suppression_generator.py Suppression generation update.
eng/scripts/Compare-CurrentToCodegeneration.ps1 Code-generation comparison update.
eng/lintingconfigs/spotbugs/track2/spotbugs-exclude.xml Shared SpotBugs filter update.
docs/contributor/code-quality.md Code-quality documentation update.
.vscode/cspell.json Editor spelling configuration update.
Review details

Suppressed comments (4)

eng/scripts/Compare-CurrentToCodegeneration.ps1:69

  • This unconditional return removes azure-ai-anomalydetector from the regeneration comparison entirely, so future generated-code drift in that SDK will pass undetected. Please remove the skip or make the temporary exception explicitly tracked and scoped to the known failure.
  if ($LibraryFolder.Contains("azure-ai-anomalydetector")) {
    # Skip azure-ai-anomalydetector for TypeSpec regeneration as it is has errors that need to be fixed.
    Write-Host "Skipping TypeSpec regeneration for azure-ai-anomalydetector: $LibraryFolder"

eng/scripts/Compare-CurrentToCodegeneration.ps1:74

  • This unconditional return removes azure-ai-vision-face from the regeneration comparison entirely, so future generated-code drift in that SDK will pass undetected. Please remove the skip or make the temporary exception explicitly tracked and scoped to the known failure.
  if ($LibraryFolder.Contains("azure-ai-vision-face")) {
    # Skip azure-ai-vision-face for TypeSpec regeneration as it is has errors that need to be fixed.
    Write-Host "Skipping TypeSpec regeneration for azure-ai-vision-face: $LibraryFolder"

eng/scripts/Compare-CurrentToCodegeneration.ps1:73

  • The new explanatory comment contains the grammatical error it is has errors; please correct it so the script's diagnostic remains clear.
    # Skip azure-ai-vision-face for TypeSpec regeneration as it is has errors that need to be fixed.

sdk/spring/spring-cloud-azure-autoconfigure/spotbugs-exclude.xml:12

  • The old global UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR suppression for AzureServiceClientBuilderFactoryPostProcessor is not carried into this SDK-local filter. The class still has a beanFactory field assigned through setBeanFactory rather than its constructor, so this module will fail SpotBugs once the global suppression is removed; please add the class-specific match here.
  • Files reviewed: 153/153 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread sdk/eventhubs/microsoft-azure-eventhubs/spotbugs-exclude.xml
Comment thread eng/scripts/Compare-CurrentToCodegeneration.ps1
Comment thread sdk/tools/cspell.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done
Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants